diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/animation/AnimationPoint.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/animation/AnimationPoint.java index a02e78796..316e23b87 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/animation/AnimationPoint.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/animation/AnimationPoint.java @@ -54,5 +54,4 @@ public class AnimationPoint { return Objects.hash(_tick, _move); } - -} +} \ No newline at end of file diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/lang/IntlString.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/lang/IntlString.java index fada15f15..ff4de1345 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/lang/IntlString.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/lang/IntlString.java @@ -6,6 +6,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Locale; +import java.util.Objects; import org.bukkit.ChatColor; import org.bukkit.entity.Entity; @@ -154,7 +155,7 @@ public class IntlString @Override public int hashCode() { - return toString().hashCode(); + return Objects.hash(getKey(), getArguments()); } @Override @@ -220,7 +221,7 @@ public class IntlString @Override public int hashCode() { - return toString().hashCode(); + return Objects.hash(getArgument(), getStyle()); } @Override diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/PlayerMap.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/PlayerMap.java index 5cb6e7758..bd110173c 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/PlayerMap.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/PlayerMap.java @@ -1,15 +1,7 @@ package mineplex.core.common.util; -import com.google.common.collect.Sets; -import org.apache.commons.lang3.Validate; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerQuitEvent; - -import javax.annotation.Nonnull; import java.util.Collection; +import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Set; @@ -17,12 +9,21 @@ import java.util.UUID; import java.util.WeakHashMap; import java.util.concurrent.ConcurrentHashMap; +import javax.annotation.Nonnull; + +import org.apache.commons.lang3.Validate; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerQuitEvent; + public class PlayerMap implements Map { private static final Object LOCK = new Object(); private static final RemovalListener REMOVAL_LISTENER = new RemovalListener(); - private static final Set> ALL_PLAYER_MAPS = Sets.newSetFromMap(new WeakHashMap<>()); + private static final Set> ALL_PLAYER_MAPS = Collections.newSetFromMap(new WeakHashMap<>()); static { @@ -231,4 +232,4 @@ public class PlayerMap implements Map } } } -} +} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFleshHook.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFleshHook.java index 82004ff2b..e15b66832 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFleshHook.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFleshHook.java @@ -99,4 +99,10 @@ public class ItemFleshHook extends ItemGadget implements IThrown { data.getThrown().remove(); } -} + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFreezeCannon.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFreezeCannon.java index ce3e899d1..68a45639d 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFreezeCannon.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemFreezeCannon.java @@ -182,6 +182,12 @@ public class ItemFreezeCannon extends ItemGadget implements IThrown smash(data.getThrown()); } + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } + public void smash(Entity ent) { //Effect @@ -190,5 +196,4 @@ public class ItemFreezeCannon extends ItemGadget implements IThrown //Remove ent.remove(); } - -} +} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemMelonLauncher.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemMelonLauncher.java index 30c732740..6418d54bc 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemMelonLauncher.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemMelonLauncher.java @@ -101,6 +101,12 @@ public class ItemMelonLauncher extends ItemGadget implements IThrown smash(data.getThrown()); } + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } + public void smash(Entity ent) { //Effect @@ -160,4 +166,4 @@ public class ItemMelonLauncher extends ItemGadget implements IThrown item.remove(); } } -} +} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPartyPopper.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPartyPopper.java index 0554acfe2..a4702fea0 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPartyPopper.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/item/ItemPartyPopper.java @@ -108,6 +108,12 @@ public class ItemPartyPopper extends ItemGadget implements IThrown Explode(data); } + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } + @EventHandler public void particleTrail(UpdateEvent event) { @@ -140,4 +146,4 @@ public class ItemPartyPopper extends ItemGadget implements IThrown data.getThrown().remove(); */ } -} +} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBat.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBat.java index 4225b2c6b..c2b3300e0 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBat.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphBat.java @@ -152,6 +152,12 @@ public class MorphBat extends MorphGadget implements IThrown { data.getThrown().remove(); } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } @EventHandler public void Flap(PlayerToggleFlightEvent event) @@ -201,4 +207,4 @@ public class MorphBat extends MorphGadget implements IThrown } } } -} +} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSquid.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSquid.java index 34bd79a73..1cb807f6e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSquid.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphSquid.java @@ -155,5 +155,10 @@ public class MorphSquid extends MorphGadget implements IThrown { data.getThrown().remove(); } - -} + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphVillager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphVillager.java index f4cf0f975..e5406a120 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphVillager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphVillager.java @@ -141,6 +141,12 @@ public class MorphVillager extends MorphGadget implements IThrown { } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } @EventHandler public void Pickup(PlayerPickupItemEvent event) @@ -175,4 +181,4 @@ public class MorphVillager extends MorphGadget implements IThrown } } } -} +} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCandyCane.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCandyCane.java index e9e572f19..ed29b8663 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCandyCane.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleCandyCane.java @@ -81,7 +81,6 @@ public class ParticleCandyCane extends ParticleGadget { Double y = _map.get(p.getUniqueId()); if (y == null) return 3; - return y.doubleValue(); + return y; } - -} +} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/inventory/command/GiveItemCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/inventory/command/GiveItemCommand.java index 3cc4042d7..4638a9a97 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/inventory/command/GiveItemCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/inventory/command/GiveItemCommand.java @@ -71,7 +71,7 @@ public class GiveItemCommand extends CommandBase { Plugin.addItemToInventoryForOffline(success -> { - if (success.booleanValue()) + if (success) { UtilPlayer.message(caller, F.main("Item", "You gave " + F.elem(amount + " " + itemName) + " to offline player " + F.name(playerName))); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/loot/RandomItem.java b/Plugins/Mineplex.Core/src/mineplex/core/loot/RandomItem.java index 7e7eef062..7402b32f8 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/loot/RandomItem.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/loot/RandomItem.java @@ -59,4 +59,10 @@ public class RandomItem return _item.getType() == item.getItemStack().getType(); } + + @Override + public int hashCode() + { + return _item.getType().hashCode(); + } } \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/poll/Poll.java b/Plugins/Mineplex.Core/src/mineplex/core/poll/Poll.java index 191113142..ae600ee98 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/poll/Poll.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/poll/Poll.java @@ -70,4 +70,10 @@ public class Poll } return false; } + + @Override + public int hashCode() + { + return Integer.hashCode(getId()); + } } \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/portal/commands/SendCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/portal/commands/SendCommand.java index 294e793f6..e7a4f9a4e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/portal/commands/SendCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/portal/commands/SendCommand.java @@ -38,7 +38,7 @@ public class SendCommand extends CommandBase Plugin.doesServerExist(serverTarget, serverExists -> { - if (!serverExists.booleanValue()) + if (!serverExists) { UtilPlayer.message(player, F.main(Plugin.getName(), C.cGray + "Server " + C.cGold + serverTarget + C.cGray + " does not exist!")); return; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/portal/commands/ServerCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/portal/commands/ServerCommand.java index fd97de43c..16b5aaf65 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/portal/commands/ServerCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/portal/commands/ServerCommand.java @@ -39,7 +39,7 @@ public class ServerCommand extends CommandBase { Plugin.doesServerExist(args[0], serverExists -> { - if (!serverExists.booleanValue()) + if (!serverExists) { UtilPlayer.message( player, diff --git a/Plugins/Mineplex.Core/src/mineplex/core/projectile/IThrown.java b/Plugins/Mineplex.Core/src/mineplex/core/projectile/IThrown.java index 92bb0ddd0..845a372d0 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/projectile/IThrown.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/projectile/IThrown.java @@ -9,4 +9,5 @@ public interface IThrown public void Collide(LivingEntity target, Block block, ProjectileUser data); public void Idle(ProjectileUser data); public void Expire(ProjectileUser data); + public void ChunkUnload(ProjectileUser data); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileManager.java b/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileManager.java index 50ec01904..23057f873 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileManager.java @@ -5,11 +5,6 @@ import java.util.List; import java.util.Map.Entry; import java.util.WeakHashMap; -import mineplex.core.MiniPlugin; -import mineplex.core.common.util.UtilParticle.ParticleType; -import mineplex.core.updater.UpdateType; -import mineplex.core.updater.event.UpdateEvent; - import org.bukkit.Effect; import org.bukkit.Sound; import org.bukkit.entity.Entity; @@ -19,8 +14,14 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.inventory.InventoryPickupItemEvent; import org.bukkit.event.player.PlayerPickupItemEvent; +import org.bukkit.event.world.ChunkUnloadEvent; import org.bukkit.plugin.java.JavaPlugin; +import mineplex.core.MiniPlugin; +import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; + public class ProjectileManager extends MiniPlugin { private WeakHashMap _thrown = new WeakHashMap(); @@ -212,4 +213,16 @@ public class ProjectileManager extends MiniPlugin if (_thrown.containsKey(event.getItem())) event.setCancelled(true); } -} + + @EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR) + public void chunkUnload(ChunkUnloadEvent event) + { + for (Entity e : event.getChunk().getEntities()) + { + if (_thrown.containsKey(e)) + { + _thrown.get(e).chunkUnload(); + } + } + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileUser.java b/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileUser.java index 16213685f..1800fd3d5 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileUser.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/projectile/ProjectileUser.java @@ -2,6 +2,18 @@ package mineplex.core.projectile; import java.util.List; +import org.bukkit.Effect; +import org.bukkit.GameMode; +import org.bukkit.Sound; +import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; +import org.bukkit.craftbukkit.v1_8_R3.CraftWorld; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; +import org.bukkit.craftbukkit.v1_8_R3.entity.CraftLivingEntity; +import org.bukkit.entity.Entity; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; + import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilParticle.ParticleType; @@ -16,19 +28,6 @@ import net.minecraft.server.v1_8_R3.MathHelper; import net.minecraft.server.v1_8_R3.MovingObjectPosition; import net.minecraft.server.v1_8_R3.Vec3D; -import org.bukkit.Bukkit; -import org.bukkit.Effect; -import org.bukkit.GameMode; -import org.bukkit.Sound; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; -import org.bukkit.craftbukkit.v1_8_R3.CraftWorld; -import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; -import org.bukkit.craftbukkit.v1_8_R3.entity.CraftLivingEntity; -import org.bukkit.entity.Entity; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; - public class ProjectileUser { public ProjectileManager Throw; @@ -186,6 +185,10 @@ public class ProjectileUser _canHit = canHit; } + public void chunkUnload() + { + _callback.ChunkUnload(this); + } public void effect(UpdateEvent event) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/ChestReward.java b/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/ChestReward.java index 21b038228..f39f034b8 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/ChestReward.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/ChestReward.java @@ -77,4 +77,10 @@ public class ChestReward extends Reward } return false; } + + @Override + public int hashCode() + { + return _type.getName().hashCode(); + } } \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/GameAmplifierReward.java b/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/GameAmplifierReward.java index cabff6482..9673ab1bc 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/GameAmplifierReward.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/GameAmplifierReward.java @@ -75,4 +75,10 @@ public class GameAmplifierReward extends Reward } return false; } + + @Override + public int hashCode() + { + return getClass().hashCode(); + } } \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/GemReward.java b/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/GemReward.java index 626e69890..d4f062609 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/GemReward.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/GemReward.java @@ -7,7 +7,6 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import mineplex.core.common.currency.GlobalCurrency; -import mineplex.core.common.util.Callback; import mineplex.core.donation.DonationManager; import mineplex.core.reward.Reward; import mineplex.core.reward.RewardData; @@ -66,4 +65,10 @@ public class GemReward extends Reward return false; } -} + + @Override + public int hashCode() + { + return getClass().hashCode(); + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/InventoryReward.java b/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/InventoryReward.java index 6cff231dd..00e796776 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/InventoryReward.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/InventoryReward.java @@ -11,9 +11,6 @@ import mineplex.core.reward.RewardData; import mineplex.core.reward.RewardRarity; import mineplex.core.reward.RewardType; -/** - * Created by shaun on 14-09-12. - */ public class InventoryReward extends Reward { private Random _random; @@ -88,4 +85,10 @@ public class InventoryReward extends Reward } return false; } -} + + @Override + public int hashCode() + { + return _packageName.hashCode(); + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/PowerPlayReward.java b/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/PowerPlayReward.java index ac86ed21f..280503902 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/PowerPlayReward.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/PowerPlayReward.java @@ -65,4 +65,10 @@ public class PowerPlayReward extends Reward } return false; } + + @Override + public int hashCode() + { + return getClass().hashCode(); + } } \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/RankReward.java b/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/RankReward.java index 1f30a79ea..55e20e436 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/RankReward.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/RankReward.java @@ -110,4 +110,10 @@ public class RankReward extends Reward return false; } + + @Override + public int hashCode() + { + return getClass().hashCode(); + } } \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/RuneAmplifierReward.java b/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/RuneAmplifierReward.java index 97d86faa8..f632be193 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/RuneAmplifierReward.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/RuneAmplifierReward.java @@ -75,4 +75,10 @@ public class RuneAmplifierReward extends Reward } return false; } + + @Override + public int hashCode() + { + return Integer.hashCode(_minutes); + } } \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/SpinTicketReward.java b/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/SpinTicketReward.java index eefa2085a..505af62dd 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/SpinTicketReward.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/SpinTicketReward.java @@ -119,4 +119,10 @@ public class SpinTicketReward extends Reward } return false; } + + @Override + public int hashCode() + { + return getClass().hashCode(); + } } \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/TreasureShardReward.java b/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/TreasureShardReward.java index d3535ae40..92422be6a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/TreasureShardReward.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/TreasureShardReward.java @@ -1,16 +1,14 @@ package mineplex.core.reward.rewards; -import mineplex.core.account.CoreClient; -import mineplex.core.account.CoreClientManager; -import mineplex.core.common.currency.GlobalCurrency; -import mineplex.core.common.util.UtilMath; - import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -import mineplex.core.common.util.Callback; +import mineplex.core.account.CoreClient; +import mineplex.core.account.CoreClientManager; +import mineplex.core.common.currency.GlobalCurrency; +import mineplex.core.common.util.UtilMath; import mineplex.core.donation.DonationManager; import mineplex.core.reward.Reward; import mineplex.core.reward.RewardData; @@ -99,5 +97,10 @@ public class TreasureShardReward extends Reward return false; } -} - + + @Override + public int hashCode() + { + return getClass().hashCode(); + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/UnknownPackageReward.java b/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/UnknownPackageReward.java index c14cbe35d..3a499e89e 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/UnknownPackageReward.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/reward/rewards/UnknownPackageReward.java @@ -115,9 +115,15 @@ public class UnknownPackageReward extends Reward } return false; } + + @Override + public int hashCode() + { + return _packageName.hashCode(); + } public String getHeader() { return _header; } -} +} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/shop/item/ShopItem.java b/Plugins/Mineplex.Core/src/mineplex/core/shop/item/ShopItem.java index d05f7734c..bea7b3638 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/shop/item/ShopItem.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/shop/item/ShopItem.java @@ -129,12 +129,6 @@ public class ShopItem extends ItemStack return new ShopItem(super.clone(), _name, _deliveryName, _deliveryAmount, _locked, _displayItem); } - @Override - public boolean equals(Object obj) - { - return super.equals(obj); - } - protected void UpdateVisual(boolean clone) { ItemMeta meta = getItemMeta(); @@ -220,4 +214,4 @@ public class ShopItem extends ItemStack return this; } -} +} \ No newline at end of file diff --git a/Plugins/Mineplex.Game.Clans.Core/src/mineplex/game/clans/core/ClaimLocation.java b/Plugins/Mineplex.Game.Clans.Core/src/mineplex/game/clans/core/ClaimLocation.java index adfdfe9d3..ec3fb85e4 100644 --- a/Plugins/Mineplex.Game.Clans.Core/src/mineplex/game/clans/core/ClaimLocation.java +++ b/Plugins/Mineplex.Game.Clans.Core/src/mineplex/game/clans/core/ClaimLocation.java @@ -62,4 +62,4 @@ public class ClaimLocation ClaimLocation that = (ClaimLocation) other; return Objects.equals(_worldName, that._worldName) && Objects.equals(_chunkX, that._chunkX) && Objects.equals(_chunkZ, that._chunkZ); } -} +} \ No newline at end of file diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClanEnergyTracker.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClanEnergyTracker.java index e7a2a998a..3541d8129 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClanEnergyTracker.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClanEnergyTracker.java @@ -9,7 +9,6 @@ import org.bukkit.plugin.java.JavaPlugin; import mineplex.core.MiniPlugin; import mineplex.core.common.util.C; -import mineplex.core.common.util.F; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.game.clans.clans.ClanTips.TipType; @@ -61,7 +60,7 @@ public class ClanEnergyTracker extends MiniPlugin Triple energyBounds = _updateMap.get(type); - if (energyBounds != null && energyRemaining > energyBounds.getLeft().longValue() && energyRemaining < energyBounds.getMiddle().longValue()) + if (energyBounds != null && energyRemaining > energyBounds.getLeft() && energyRemaining < energyBounds.getMiddle()) { _clans.middleTextClan(clan, energyBounds.getRight()[0], energyBounds.getRight()[1], 20, 200, 80); _clans.sendTipToClan(clan, TipType.ENERGY); diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansDataAccessLayer.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansDataAccessLayer.java index 81e0244f6..2bf5d9015 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansDataAccessLayer.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansDataAccessLayer.java @@ -751,7 +751,7 @@ public class ClansDataAccessLayer { if (callback != null) { - callback.run(Boolean.valueOf(ran)); + callback.run(ran); } else { diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansUtility.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansUtility.java index 2a991759a..58bc244d1 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansUtility.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/ClansUtility.java @@ -879,9 +879,9 @@ public class ClansUtility // Claim Timer if (_clansManager.getUnclaimMap().containsKey(chunk)) { - if (!UtilTime.elapsed(_clansManager.getUnclaimMap().get(chunk).longValue(), _clansManager.getReclaimTime())) + if (!UtilTime.elapsed(_clansManager.getUnclaimMap().get(chunk), _clansManager.getReclaimTime())) { - UtilPlayer.message(caller, F.main("Clans", "This Territory cannot be claimed for " + F.time(UtilTime.convertString(_clansManager.getReclaimTime() - (System.currentTimeMillis() - _clansManager.getUnclaimMap().get(chunk).longValue()), 1, UtilTime.TimeUnit.FIT)) + ".")); + UtilPlayer.message(caller, F.main("Clans", "This Territory cannot be claimed for " + F.time(UtilTime.convertString(_clansManager.getReclaimTime() - (System.currentTimeMillis() - _clansManager.getUnclaimMap().get(chunk)), 1, UtilTime.TimeUnit.FIT)) + ".")); return false; } diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/mounts/MountManager.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/mounts/MountManager.java index 8cadb416e..03946bf39 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/mounts/MountManager.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/mounts/MountManager.java @@ -332,7 +332,7 @@ public class MountManager extends MiniDbClientPlugin if (UtilEnt.GetMetadata(entry.getKey(), "DISMOUNT_TIME") != null) { Long dismount = UtilEnt.GetMetadata(entry.getKey(), "DISMOUNT_TIME"); - if (UtilTime.elapsed(dismount.longValue(), MAX_TIME_DISMOUNTED)) + if (UtilTime.elapsed(dismount, MAX_TIME_DISMOUNTED)) { mountIterator.remove(); entry.getValue().despawn(false); diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/potato/PotatoManager.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/potato/PotatoManager.java index bc9be3fff..c977fc414 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/potato/PotatoManager.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/potato/PotatoManager.java @@ -135,4 +135,10 @@ public class PotatoManager extends MiniPlugin implements IThrown { } -} + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/siege/repository/OutpostRepository.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/siege/repository/OutpostRepository.java index e6b53a15d..6fe2d021e 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/siege/repository/OutpostRepository.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/siege/repository/OutpostRepository.java @@ -119,7 +119,7 @@ public class OutpostRepository extends RepositoryBase public void updateOutpost(OutpostToken token) { executeUpdate(UPDATE_OUTPOST, - new ColumnByte("outpostState", Byte.valueOf(token.OutpostState.getId())), + new ColumnByte("outpostState", token.OutpostState.getId()), new ColumnInt("uniqueId", token.UniqueId)); } @@ -132,6 +132,6 @@ public class OutpostRepository extends RepositoryBase new ColumnInt("outpostType", token.Type.getId()), new ColumnInt("ownerClan", token.OwnerClan.getId()), new ColumnTimestamp("timeSpawned", new Timestamp(token.TimeSpawned)), - new ColumnByte("outpostState", Byte.valueOf(token.OutpostState.getId()))); + new ColumnByte("outpostState", token.OutpostState.getId())); } -} +} \ No newline at end of file diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/worldevent/boss/ironwizard/abilities/IronHook.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/worldevent/boss/ironwizard/abilities/IronHook.java index 73ddfce16..94785a425 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/worldevent/boss/ironwizard/abilities/IronHook.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/worldevent/boss/ironwizard/abilities/IronHook.java @@ -51,4 +51,10 @@ public class IronHook implements IThrown { data.getThrown().remove(); } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } } \ No newline at end of file diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/worldevent/raid/RaidWorldEvent.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/worldevent/raid/RaidWorldEvent.java index 6903d35ab..6ab101de2 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/worldevent/raid/RaidWorldEvent.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/clans/worldevent/raid/RaidWorldEvent.java @@ -313,4 +313,10 @@ public abstract class RaidWorldEvent extends WorldEvent return ((RaidWorldEvent)object).getId() == getId(); } + + @Override + public int hashCode() + { + return Integer.hashCode(getId()); + } } \ No newline at end of file diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/ui/GearPage.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/ui/GearPage.java index 88c1fc945..960e312be 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/ui/GearPage.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/ui/GearPage.java @@ -289,7 +289,7 @@ public class GearPage extends ShopPageBase if (_factory == null || _factory.getItemType() == null) { performBack(); - return Triple.of(Boolean.valueOf(true), stageTitle, stageMaterial); + return Triple.of(true, stageTitle, stageMaterial); } if (_factory.getItemType().equals(ItemType.RARE)) @@ -429,7 +429,7 @@ public class GearPage extends ShopPageBase } } } - return Triple.of(Boolean.valueOf($return), stageTitle, stageMaterial); + return Triple.of($return, stageTitle, stageMaterial); } private Triple doStageThree() throws InstantiationException, IllegalAccessException @@ -439,7 +439,7 @@ public class GearPage extends ShopPageBase if (_factory.getMaterial() == null) { performBack(); - return Triple.of(Boolean.valueOf(true), null, null); + return Triple.of(true, null, null); } Material stageMaterial = _factory.getMaterial(); @@ -535,7 +535,7 @@ public class GearPage extends ShopPageBase } } - return Triple.of(Boolean.valueOf(false), stageTitle, stageMaterial); + return Triple.of(false, stageTitle, stageMaterial); } private Pair doStageFour() throws InstantiationException, IllegalAccessException diff --git a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/BlowUpWallGoal.java b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/BlowUpWallGoal.java index b4010c28a..756c26a42 100644 --- a/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/BlowUpWallGoal.java +++ b/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/tutorial/tutorials/clans/objective/goals/attackenemy/BlowUpWallGoal.java @@ -1,6 +1,7 @@ package mineplex.game.clans.tutorial.tutorials.clans.objective.goals.attackenemy; import java.util.HashMap; +import java.util.Map; import org.bukkit.DyeColor; import org.bukkit.Location; @@ -11,7 +12,6 @@ import org.bukkit.entity.Zombie; import org.bukkit.event.EventHandler; import mineplex.core.common.util.F; -import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; import mineplex.core.fallingblock.FallingBlocks; @@ -64,7 +64,7 @@ public class BlowUpWallGoal extends ObjectiveGoal double radius = 5.2; - HashMap blockList = new HashMap(); + Map blockList = new HashMap<>(); int iR = (int) radius + 1; for (int x = -iR; x <= iR; x++) @@ -91,7 +91,7 @@ public class BlowUpWallGoal extends ObjectiveGoal || block.getType() == Material.SMOOTH_STAIRS || block.getType() == Material.IRON_DOOR_BLOCK) - if (Math.random() < 0.2 + (dist.doubleValue() / 2.55) || dist.doubleValue() < 1.75) + if (Math.random() < 0.2 + (dist / 2.55) || dist < 1.75) { block.setType(Material.AIR, false); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsAddCommand.java b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsAddCommand.java index a5ea32266..f43da9005 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsAddCommand.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsAddCommand.java @@ -48,7 +48,7 @@ public class NewsAddCommand extends CommandBase newsMang.AddNewsEntry(entry, success -> { - if (success.booleanValue()) + if (success) { UtilPlayer.message(caller, F.main(Plugin.getName(), C.cGray + "The news entry: " + C.cGold + entry + C.cGray + " has been added to the database!")); } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsDeleteCommand.java b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsDeleteCommand.java index 1e7084b77..7b27eae45 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsDeleteCommand.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsDeleteCommand.java @@ -39,7 +39,7 @@ public class NewsDeleteCommand extends CommandBase } newsMang.DeleteNewsEntry(newsPosition, success -> { - if (success.booleanValue()) + if (success) { UtilPlayer.message(caller, F.main(Plugin.getName(), C.cGray + "The news entry at position " + C.cGold + newsPosition + C.cGray + " has been deleted!")); } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsListCommand.java b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsListCommand.java index 29b50af26..d281de462 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsListCommand.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsListCommand.java @@ -33,7 +33,7 @@ public class NewsListCommand extends CommandBase // Order newsEntries set or its output by newsPosition, not hash order... newsMang.RetrieveMaxNewsPosition(maxPosition -> { - String[] newsStrings = new String[maxPosition.intValue()]; + String[] newsStrings = new String[maxPosition]; for (Iterator iterator = entries.keySet().iterator(); iterator.hasNext();) { String newsPosition = iterator.next(); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsSetCommand.java b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsSetCommand.java index baa3e441e..5d001709c 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsSetCommand.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/commands/NewsSetCommand.java @@ -58,7 +58,7 @@ public class NewsSetCommand extends CommandBase newsMang.SetNewsEntry(entry, newsPosition, success -> { - if (success.booleanValue()) + if (success) { UtilPlayer.message(caller, F.main(Plugin.getName(), C.cGray + "The news entry at position " + C.cGold + newsPosition + C.cGray + " has been updated to: " + C.cGold + entry + C.cGray + "!")); } diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/BlockToss.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/BlockToss.java index 931426de1..10ef5490a 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/BlockToss.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/BlockToss.java @@ -449,6 +449,12 @@ public class BlockToss extends SkillCharge implements IThrown } } } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } @Override public void Reset(Player player) diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/FleshHook.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/FleshHook.java index 588571fdc..294d6fe22 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/FleshHook.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Brute/FleshHook.java @@ -180,4 +180,10 @@ public class FleshHook extends SkillActiveCharge implements IThrown //Remove data.getThrown().remove(); } -} + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/AxeThrow.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/AxeThrow.java index 14ae0fcf1..f4afb8a81 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/AxeThrow.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Knight/AxeThrow.java @@ -226,4 +226,10 @@ public class AxeThrow extends SkillActive implements IThrown } } } -} + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/FreezingBlast.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/FreezingBlast.java index ba21f4252..f0147e14f 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/FreezingBlast.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/FreezingBlast.java @@ -147,4 +147,10 @@ public class FreezingBlast extends SkillActive implements IThrown { } -} + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/GlacialBlade.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/GlacialBlade.java index 7f9f0b6a7..eb975e62a 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/GlacialBlade.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/GlacialBlade.java @@ -119,4 +119,10 @@ public class GlacialBlade extends SkillActive implements IThrown { } -} + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/IcePrison.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/IcePrison.java index a04b31ebc..eb40b9ac9 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/IcePrison.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/IcePrison.java @@ -193,4 +193,10 @@ public class IcePrison extends SkillActive implements IThrown { } -} + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/LightningOrb.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/LightningOrb.java index 79cbdc825..8772aed09 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/LightningOrb.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Mage/LightningOrb.java @@ -199,4 +199,10 @@ public class LightningOrb extends SkillActive implements IThrown { } -} + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/VitalitySpores.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/VitalitySpores.java index 310146f5a..41a752f2d 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/VitalitySpores.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Ranger/VitalitySpores.java @@ -9,7 +9,6 @@ import org.bukkit.event.EventHandler; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; -import mineplex.core.common.util.F; import mineplex.core.common.util.UtilTime; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; @@ -45,7 +44,7 @@ public class VitalitySpores extends Skill } else { - _lastDamage.put(event.GetDamageePlayer(), Long.valueOf(System.currentTimeMillis())); + _lastDamage.put(event.GetDamageePlayer(), System.currentTimeMillis()); } } } @@ -63,7 +62,7 @@ public class VitalitySpores extends Skill { Entry entry = iterator.next(); - if (UtilTime.elapsed(entry.getValue().longValue(), 10000)) + if (UtilTime.elapsed(entry.getValue(), 10000)) { iterator.remove(); entry.getKey().addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, (20 * (5 + getLevel(entry.getKey()))), 1)); diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Consume/Apple.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Consume/Apple.java index 08d800a16..2e9d1d5f6 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Consume/Apple.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Consume/Apple.java @@ -81,4 +81,10 @@ public class Apple extends ItemUsable { } -} + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Consume/Soup.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Consume/Soup.java index e24518afe..bccbaefdb 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Consume/Soup.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Consume/Soup.java @@ -68,4 +68,10 @@ public class Soup extends ItemUsable { } -} + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/Pistol.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/Pistol.java index adead9093..4700994fb 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/Pistol.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/Pistol.java @@ -188,4 +188,10 @@ public class Pistol extends ItemUsable { } -} + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/PoisonBall.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/PoisonBall.java index 08293d5a7..4da131381 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/PoisonBall.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/PoisonBall.java @@ -72,4 +72,10 @@ public class PoisonBall extends ItemUsable if (ent instanceof Item) ((Item)ent).setPickupDelay(5); } -} + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/ProximityExplosive.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/ProximityExplosive.java index 017f6c5fe..5c3835253 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/ProximityExplosive.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/ProximityExplosive.java @@ -2,6 +2,7 @@ package mineplex.minecraft.game.classcombat.item.Throwable; import java.util.HashMap; import java.util.Iterator; +import java.util.Map; import org.bukkit.Bukkit; import org.bukkit.Effect; @@ -18,27 +19,28 @@ import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.inventory.InventoryPickupItemEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerPickupItemEvent; +import org.bukkit.event.world.ChunkUnloadEvent; -import mineplex.core.projectile.ProjectileUser; -import mineplex.core.updater.event.UpdateEvent; -import mineplex.core.updater.UpdateType; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilEnt; -import mineplex.core.common.util.UtilParticle; -import mineplex.core.common.util.UtilPlayer; -import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilEvent.ActionType; +import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilServer; +import mineplex.core.projectile.ProjectileUser; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.classcombat.item.ItemFactory; import mineplex.minecraft.game.classcombat.item.ItemUsable; import mineplex.minecraft.game.classcombat.item.event.ProximityUseEvent; public class ProximityExplosive extends ItemUsable { - private HashMap _armed = new HashMap(); + private Map _armed = new HashMap<>(); public ProximityExplosive(ItemFactory factory, Material type, int amount, boolean canDamage, int gemCost, int tokenCost, @@ -185,5 +187,22 @@ public class ProximityExplosive extends ItemUsable } } } -} - + + @EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR) + public void chunkUnload(ChunkUnloadEvent event) + { + for (Entity e : event.getChunk().getEntities()) + { + if (_armed.remove(e) != null) + { + e.remove(); + } + } + } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/ProximityManager.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/ProximityManager.java index 9e70eba21..f53033c73 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/ProximityManager.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/ProximityManager.java @@ -4,15 +4,10 @@ import java.util.AbstractMap; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; +import java.util.List; +import java.util.Map; import java.util.Map.Entry; -import mineplex.core.common.util.F; -import mineplex.core.common.util.UtilMath; -import mineplex.core.common.util.UtilPlayer; -import mineplex.core.updater.UpdateType; -import mineplex.core.updater.event.UpdateEvent; -import mineplex.minecraft.game.classcombat.item.event.ProximityUseEvent; - import org.bukkit.Location; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; @@ -20,11 +15,18 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilPlayer; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; +import mineplex.minecraft.game.classcombat.item.event.ProximityUseEvent; + public class ProximityManager implements Listener { private int _proxyLimit = 6; - private HashMap>> _proxyMap = new HashMap>>(); + private Map>> _proxyMap = new HashMap<>(); public void setProxyLimit(int limit) { @@ -41,7 +43,7 @@ public class ProximityManager implements Listener if (!_proxyMap.containsKey(event.getPlayer())) _proxyMap.put(event.getPlayer(), new ArrayList>()); - ArrayList> proxies = _proxyMap.get(event.getPlayer()); + List> proxies = _proxyMap.get(event.getPlayer()); //Store New proxies.add(new AbstractMap.SimpleEntry(event.getItemType().GetName(), event.getEntity())); @@ -79,7 +81,7 @@ public class ProximityManager implements Listener continue; } - ArrayList> proxies = _proxyMap.get(player); + List> proxies = _proxyMap.get(player); Iterator> proxyIter = proxies.iterator(); @@ -101,4 +103,4 @@ public class ProximityManager implements Listener playerIter.remove(); } } -} +} \ No newline at end of file diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/ProximityZapper.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/ProximityZapper.java index 3076b403b..b47364428 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/ProximityZapper.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/ProximityZapper.java @@ -2,6 +2,7 @@ package mineplex.minecraft.game.classcombat.item.Throwable; import java.util.HashMap; import java.util.Iterator; +import java.util.Map; import org.bukkit.Bukkit; import org.bukkit.Effect; @@ -17,25 +18,26 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.inventory.InventoryPickupItemEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerPickupItemEvent; +import org.bukkit.event.world.ChunkUnloadEvent; -import mineplex.core.projectile.ProjectileUser; -import mineplex.core.updater.event.UpdateEvent; -import mineplex.core.updater.UpdateType; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.common.util.UtilParticle; -import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilParticle.ParticleType; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.common.util.UtilPlayer; -import mineplex.core.common.util.UtilEvent.ActionType; +import mineplex.core.common.util.UtilServer; +import mineplex.core.projectile.ProjectileUser; +import mineplex.core.updater.UpdateType; +import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.classcombat.item.ItemFactory; import mineplex.minecraft.game.classcombat.item.ItemUsable; import mineplex.minecraft.game.classcombat.item.event.ProximityUseEvent; public class ProximityZapper extends ItemUsable { - private HashMap _armed = new HashMap(); + private Map _armed = new HashMap<>(); public ProximityZapper(ItemFactory factory, Material type, int amount, boolean canDamage, int gemCost, int tokenCost, @@ -178,5 +180,22 @@ public class ProximityZapper extends ItemUsable } } } -} - + + @EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR) + public void chunkUnload(ChunkUnloadEvent event) + { + for (Entity e : event.getChunk().getEntities()) + { + if (_armed.remove(e) != null) + { + e.remove(); + } + } + } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/WaterBottle.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/WaterBottle.java index 99361e426..bc711045b 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/WaterBottle.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/WaterBottle.java @@ -76,6 +76,12 @@ public class WaterBottle extends ItemUsable { Break(data); } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } public void Break(ProjectileUser data) { @@ -96,4 +102,4 @@ public class WaterBottle extends ItemUsable player.setFireTicks(-20); } } -} +} \ No newline at end of file diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/Web.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/Web.java index 55e9929bb..294e8234f 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/Web.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/item/Throwable/Web.java @@ -69,6 +69,12 @@ public class Web extends ItemUsable CreateWeb(data.getThrown()); } + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } + public void CreateWeb(Entity ent) { LivingEntity thrower = Factory.Throw().getThrower(ent); diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/broodmother/attacks/SpiderPoison.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/broodmother/attacks/SpiderPoison.java index b1bc6cc24..ad330117a 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/broodmother/attacks/SpiderPoison.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/broodmother/attacks/SpiderPoison.java @@ -62,5 +62,10 @@ public class SpiderPoison implements IThrown { burst(data); } - -} + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/ironwizard/abilities/IronHook.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/ironwizard/abilities/IronHook.java index 9c402dab6..e565aa38f 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/ironwizard/abilities/IronHook.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/ironwizard/abilities/IronHook.java @@ -51,4 +51,10 @@ public class IronHook implements IThrown { data.getThrown().remove(); } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } } \ No newline at end of file diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/slimeking/ability/RocketAbility.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/slimeking/ability/RocketAbility.java index d77b039ef..88421942c 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/slimeking/ability/RocketAbility.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/slimeking/ability/RocketAbility.java @@ -132,6 +132,12 @@ public class RocketAbility extends SlimeAbility implements IThrown data.getThrown().remove(); _rocketsHit++; } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } private static class ShotData { @@ -154,4 +160,4 @@ public class RocketAbility extends SlimeAbility implements IThrown return _target; } } -} +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java index c1d4dce53..693478437 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java @@ -1259,7 +1259,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation UtilPlayer.setGliding(player, false); UtilPlayer.setAutoDeployDistance(player, 1.15F); - ((CraftEntity) player).getHandle().getDataWatcher().watch(0, Byte.valueOf((byte) 0), EntityLiving.META_ENTITYDATA, (byte) 0); + ((CraftEntity) player).getHandle().getDataWatcher().watch(0, (byte) 0, EntityLiving.META_ENTITYDATA, (byte) 0); player.setCustomName(""); player.setCustomNameVisible(false); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkBlockTossEVO.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkBlockTossEVO.java index 2d91ec76d..2de8ee36c 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkBlockTossEVO.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkBlockTossEVO.java @@ -204,7 +204,12 @@ public class PerkBlockTossEVO extends Perk implements IThrown { } - + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } @SuppressWarnings("deprecation") @EventHandler diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkSulphurBombEVO.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkSulphurBombEVO.java index 4baac10db..f37eec459 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkSulphurBombEVO.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkSulphurBombEVO.java @@ -119,6 +119,12 @@ public class PerkSulphurBombEVO extends Perk implements IThrown { Explode(data); } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } public void Explode(ProjectileUser data) { @@ -135,6 +141,5 @@ public class PerkSulphurBombEVO extends Perk implements IThrown return; event.AddKnockback(GetName(), 1.5); - } - -} + } +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkWebEVO.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkWebEVO.java index a23144570..ea608e1fd 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkWebEVO.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/evolution/mobs/perks/PerkWebEVO.java @@ -110,6 +110,12 @@ public class PerkWebEVO extends Perk implements IThrown Web(data); } + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } + public void Web(ProjectileUser data) { Location loc = data.getThrown().getLocation(); @@ -121,4 +127,4 @@ public class PerkWebEVO extends Perk implements IThrown Manager.GetBlockRestore().add(loc.getBlock(), 30, (byte)0, 4000); } -} +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/forms/BlockForm.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/forms/BlockForm.java index a3c515081..f0cee8975 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/forms/BlockForm.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/forms/BlockForm.java @@ -82,7 +82,7 @@ public class BlockForm extends Form } EntityPlayer player = ((CraftPlayer) Player).getHandle(); - player.getDataWatcher().watch(0, Byte.valueOf((byte) 32), Entity.META_ENTITYDATA, (byte) 32); + player.getDataWatcher().watch(0, (byte) 32, Entity.META_ENTITYDATA, (byte) 32); // Player > Chicken DisguiseChicken disguise = new DisguiseChicken(Player); @@ -209,7 +209,7 @@ public class BlockForm extends Form public void SolidifyUpdate() { if (!Player.isSprinting()) - ((CraftEntity) Player).getHandle().getDataWatcher().watch(0, Byte.valueOf((byte) 32), Entity.META_ENTITYDATA, + ((CraftEntity) Player).getHandle().getDataWatcher().watch(0, (byte) 32, Entity.META_ENTITYDATA, (byte) 32); // Not a Block diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/forms/CreatureForm.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/forms/CreatureForm.java index 22db07638..1b49d903a 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/forms/CreatureForm.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/forms/CreatureForm.java @@ -44,7 +44,7 @@ public class CreatureForm extends Form _disguise.setSoundDisguise(new DisguiseCat(Player)); Host.Manager.GetDisguise().disguise(_disguise); - ((CraftEntity)Player).getHandle().getDataWatcher().watch(0, Byte.valueOf((byte) 0), Entity.META_ENTITYDATA, (byte) 0); + ((CraftEntity)Player).getHandle().getDataWatcher().watch(0, (byte) 0, Entity.META_ENTITYDATA, (byte) 0); //Inform UtilPlayer.message(Player, F.main("Game", C.cWhite + "You are now a " + F.elem(UtilEnt.getName(_type)) + "!")); @@ -62,6 +62,6 @@ public class CreatureForm extends Form { Host.Manager.GetDisguise().undisguise(Player); - ((CraftEntity)Player).getHandle().getDataWatcher().watch(0, Byte.valueOf((byte) 0), Entity.META_ENTITYDATA, (byte) 0); + ((CraftEntity)Player).getHandle().getDataWatcher().watch(0, (byte) 0, Entity.META_ENTITYDATA, (byte) 0); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/lobbers/BombLobbers.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/lobbers/BombLobbers.java index 4b4aa2c13..542598980 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/lobbers/BombLobbers.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/lobbers/BombLobbers.java @@ -610,6 +610,12 @@ public class BombLobbers extends TeamGame implements IThrown } + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } + public void knockbackIncrease(CustomDamageEvent event) { if (event.GetCause() != DamageCause.ENTITY_EXPLOSION && event.GetCause() != DamageCause.BLOCK_EXPLOSION) @@ -617,4 +623,4 @@ public class BombLobbers extends TeamGame implements IThrown event.AddKnockback("Explosion", 1.7D); } -} +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/BawkBawkBattles.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/BawkBawkBattles.java index 2a6636c1b..ec49f6a5f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/BawkBawkBattles.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/mineware/BawkBawkBattles.java @@ -1633,6 +1633,12 @@ public class BawkBawkBattles extends TeamGame implements IThrown } } } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } @Override public void Idle(ProjectileUser data) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/moba/kit/anath/SkillMeteor.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/moba/kit/anath/SkillMeteor.java index dc255d790..9583fdeae 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/moba/kit/anath/SkillMeteor.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/moba/kit/anath/SkillMeteor.java @@ -178,11 +178,16 @@ public class SkillMeteor extends HeroSkill implements IThrown startShower(data); data.getThrown().remove(); } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } private void startShower(ProjectileUser data) { Manager.GetBlockRestore().add(data.getThrown().getLocation().getBlock(), Material.NETHERRACK.getId(), (byte) 0, 6000); _data.add(new MeteorShowerData((Player) data.getThrower(), data.getThrown().getLocation(), 6000)); } -} - +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/moba/kit/bob/SkillBuildPainting.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/moba/kit/bob/SkillBuildPainting.java index 862caa9f5..4ee0ae68d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/moba/kit/bob/SkillBuildPainting.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/moba/kit/bob/SkillBuildPainting.java @@ -187,6 +187,12 @@ public class SkillBuildPainting extends HeroSkill implements IThrown { damage(data); } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } private void damage(ProjectileUser data) { @@ -205,5 +211,4 @@ public class SkillBuildPainting extends HeroSkill implements IThrown { return AXIS[Math.round(yaw / 90F) & 0x3]; } - -} +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/moba/kit/bob/SkillPaint.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/moba/kit/bob/SkillPaint.java index b5f8386bf..c2eb42fc8 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/moba/kit/bob/SkillPaint.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/moba/kit/bob/SkillPaint.java @@ -100,4 +100,10 @@ public class SkillPaint extends HeroSkill implements IThrown { } -} + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/moba/kit/hattori/SkillSnowball.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/moba/kit/hattori/SkillSnowball.java index 094700d99..db3a1bb91 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/moba/kit/hattori/SkillSnowball.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/moba/kit/hattori/SkillSnowball.java @@ -91,5 +91,10 @@ public class SkillSnowball extends HeroSkill implements IThrown public void Expire(ProjectileUser data) { } -} - + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/moba/kit/larissa/SkillAOEHeal.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/moba/kit/larissa/SkillAOEHeal.java index 64441aa11..10a51f0b6 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/moba/kit/larissa/SkillAOEHeal.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/moba/kit/larissa/SkillAOEHeal.java @@ -104,6 +104,12 @@ public class SkillAOEHeal extends HeroSkill implements IThrown { deployAoe((Player) data.getThrower(), data.getThrown(), data.getThrown().getLocation()); } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } @EventHandler public void updateAOE(UpdateEvent event) @@ -198,4 +204,4 @@ public class SkillAOEHeal extends HeroSkill implements IThrown LastHeal = Start; } } -} +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/runner/Runner.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/runner/Runner.java index 53d86ee3d..5d7072534 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/runner/Runner.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/runner/Runner.java @@ -366,4 +366,10 @@ public class Runner extends SoloGame implements IThrown { } -} + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/creeper/PerkCreeperSulphurBomb.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/creeper/PerkCreeperSulphurBomb.java index df921ff65..518cd14bb 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/creeper/PerkCreeperSulphurBomb.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/creeper/PerkCreeperSulphurBomb.java @@ -64,6 +64,12 @@ public class PerkCreeperSulphurBomb extends SmashPerk { Explode(data); } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } private void Explode(ProjectileUser data) { @@ -99,6 +105,12 @@ public class PerkCreeperSulphurBomb extends SmashPerk { Explode(data); } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } private void Explode(ProjectileUser data) { @@ -216,4 +228,4 @@ public class PerkCreeperSulphurBomb extends SmashPerk event.AddKnockback(GetName(), _knockbackMagnitude); } -} +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/enderman/PerkBlockToss.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/enderman/PerkBlockToss.java index 3e48a23da..14fa007f9 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/enderman/PerkBlockToss.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/enderman/PerkBlockToss.java @@ -244,6 +244,12 @@ public class PerkBlockToss extends SmashPerk implements IThrown public void Expire(ProjectileUser data) { } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } @EventHandler public void BlockForm(EntityChangeBlockEvent event) @@ -273,4 +279,4 @@ public class PerkBlockToss extends SmashPerk implements IThrown event.AddKnockback(GetName(), _knockbackMagnitude); } -} +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/golem/PerkIronHook.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/golem/PerkIronHook.java index 93ca69da5..bb6d0b45d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/golem/PerkIronHook.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/golem/PerkIronHook.java @@ -128,5 +128,10 @@ public class PerkIronHook extends Perk implements IThrown { data.getThrown().remove(); } - -} + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/guardian/PerkWhirlpoolBlade.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/guardian/PerkWhirlpoolBlade.java index 337655ec7..deaeed797 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/guardian/PerkWhirlpoolBlade.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/guardian/PerkWhirlpoolBlade.java @@ -160,4 +160,10 @@ public class PerkWhirlpoolBlade extends Perk implements IThrown { data.getThrown().remove(); } -} + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/pig/PerkPigBaconBounce.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/pig/PerkPigBaconBounce.java index 720dc9145..43371b217 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/pig/PerkPigBaconBounce.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/pig/PerkPigBaconBounce.java @@ -159,6 +159,12 @@ public class PerkPigBaconBounce extends SmashPerk implements IThrown { Rebound(data.getThrower(), data.getThrown()); } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } public void Rebound(LivingEntity player, Entity ent) { @@ -205,4 +211,4 @@ public class PerkPigBaconBounce extends SmashPerk implements IThrown UtilParticle.PlayParticle(ParticleType.HEART, event.getPlayer().getLocation().add(0, 0.5, 0), 0.2f, 0.2f, 0.2f, 0, 4, ViewDist.LONG, UtilServer.getPlayers()); } } -} +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/skeletalhorse/PerkBoneRush.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/skeletalhorse/PerkBoneRush.java index 1f09e42d9..0878a36dd 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/skeletalhorse/PerkBoneRush.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/skeletalhorse/PerkBoneRush.java @@ -250,4 +250,10 @@ public class PerkBoneRush extends SmashPerk implements IThrown { _active.remove(event.getEntity().getUniqueId()); } -} + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/slime/PerkSlimeRocket.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/slime/PerkSlimeRocket.java index c8659cd43..ab02a5e92 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/slime/PerkSlimeRocket.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/slime/PerkSlimeRocket.java @@ -334,6 +334,12 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown { } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } @EventHandler public void SlimeDamage(CustomDamageEvent event) @@ -433,4 +439,4 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown } } } -} +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/spider/PerkWebShot.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/spider/PerkWebShot.java index ec2bb90fa..49556ba4b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/spider/PerkWebShot.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/spider/PerkWebShot.java @@ -137,6 +137,12 @@ public class PerkWebShot extends SmashPerk implements IThrown { Web(data); } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } public void Web(ProjectileUser data) { @@ -148,4 +154,4 @@ public class PerkWebShot extends SmashPerk implements IThrown Manager.GetBlockRestore().add(loc.getBlock(), 30, (byte) 0, 2000); } } -} +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/squid/PerkFishFlurry.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/squid/PerkFishFlurry.java index 276650c3e..b070f0a57 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/squid/PerkFishFlurry.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/squid/PerkFishFlurry.java @@ -207,6 +207,12 @@ public class PerkFishFlurry extends SmashPerk implements IThrown { data.getThrown().remove(); } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } @EventHandler public void Knockback(CustomDamageEvent event) @@ -219,4 +225,4 @@ public class PerkFishFlurry extends SmashPerk implements IThrown event.AddKnockback(GetName(), _knockbackMagnitude); event.setKnockbackOrigin(event.GetDamageeEntity().getLocation().add(Math.random() - 0.5, -0.1, Math.random() - 0.5)); } -} +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/squid/PerkInkBlast.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/squid/PerkInkBlast.java index b2e1a00fc..0b2bd8b82 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/squid/PerkInkBlast.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/squid/PerkInkBlast.java @@ -174,4 +174,10 @@ public class PerkInkBlast extends SmashPerk implements IThrown event.AddKnockback(GetName(), _knockbackMagnitude); } -} + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/witch/PerkWitchPotion.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/witch/PerkWitchPotion.java index 217f01b77..e828c0561 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/witch/PerkWitchPotion.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/witch/PerkWitchPotion.java @@ -191,4 +191,10 @@ public class PerkWitchPotion extends SmashPerk implements IThrown { Collide(null, null, data); } -} + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/zombie/PerkZombieBile.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/zombie/PerkZombieBile.java index 7fb954e14..7e4372195 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/zombie/PerkZombieBile.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/perks/zombie/PerkZombieBile.java @@ -189,6 +189,12 @@ public class PerkZombieBile extends SmashPerk implements IThrown { data.getThrown().remove(); } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } @EventHandler public void Knockback(CustomDamageEvent event) @@ -200,4 +206,4 @@ public class PerkZombieBile extends SmashPerk implements IThrown event.AddKnockback(GetName(), _knockbackMagnitude); } -} +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/stacker/Stacker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/stacker/Stacker.java index 7198628f8..fc7acb8fe 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/stacker/Stacker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/stacker/Stacker.java @@ -216,4 +216,10 @@ public class Stacker extends SoloGame implements IThrown { } -} + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellIcePrison.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellIcePrison.java index 8fdab34d3..19f1aa037 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellIcePrison.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellIcePrison.java @@ -106,6 +106,12 @@ public class SpellIcePrison extends Spell implements SpellClick, IThrown { IcePrison(data); } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } @EventHandler public void onUpdate(UpdateEvent event) @@ -146,4 +152,4 @@ public class SpellIcePrison extends Spell implements SpellClick, IThrown player.getWorld().playSound(player.getLocation(), Sound.CREEPER_HISS, 1.2F, 0.8F); } } -} +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellIceShards.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellIceShards.java index aad833881..3e35119bf 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellIceShards.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellIceShards.java @@ -152,5 +152,10 @@ public class SpellIceShards extends Spell implements SpellClick, IThrown { handleShard(data); } - -} + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellWebShot.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellWebShot.java index 567078d29..2de1041ab 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellWebShot.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellWebShot.java @@ -156,6 +156,12 @@ public class SpellWebShot extends Spell implements SpellClick, IThrown { Web(data, data.getThrown().getLocation()); } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } public void Web(ProjectileUser data, Location loc) { @@ -166,4 +172,4 @@ public class SpellWebShot extends Spell implements SpellClick, IThrown if (UtilBlock.airFoliage(block)) block.setType(Material.WEB); } -} +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkApple.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkApple.java index 18d24b75b..ad3125e95 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkApple.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkApple.java @@ -23,7 +23,6 @@ import mineplex.core.projectile.ProjectileUser; import mineplex.core.recharge.Recharge; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; - import nautilus.game.arcade.kit.Perk; public class PerkApple extends Perk implements IThrown @@ -141,6 +140,12 @@ public class PerkApple extends Perk implements IThrown { } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } @EventHandler public void playerDeath(PlayerDeathEvent event) @@ -158,4 +163,4 @@ public class PerkApple extends Perk implements IThrown } } } -} +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkAxeThrower.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkAxeThrower.java index 5f4aab77b..e9272e6eb 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkAxeThrower.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkAxeThrower.java @@ -20,7 +20,6 @@ import mineplex.core.common.util.UtilInv; import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.projectile.IThrown; import mineplex.core.projectile.ProjectileUser; -import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.kit.Perk; public class PerkAxeThrower extends Perk implements IThrown @@ -107,4 +106,10 @@ public class PerkAxeThrower extends Perk implements IThrown { } -} + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBaconBlast.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBaconBlast.java index a24bec73d..c2d2b1dfe 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBaconBlast.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBaconBlast.java @@ -105,6 +105,12 @@ public class PerkBaconBlast extends Perk implements IThrown { Explode(data); } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } public void Explode(ProjectileUser data) { @@ -113,4 +119,4 @@ public class PerkBaconBlast extends Perk implements IThrown data.getThrown().getWorld().createExplosion(loc.getX(), loc.getY(), loc.getZ(), 0.5f, false, false); data.getThrown().remove(); } -} +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBlockRestorer.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBlockRestorer.java index c4c754d8f..21f79c731 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBlockRestorer.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBlockRestorer.java @@ -92,4 +92,10 @@ public class PerkBlockRestorer extends Perk implements IThrown UtilFirework.playFirework(entity.getLocation(), Type.BALL_LARGE, Color.WHITE, false, true); } -} + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCowBomb.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCowBomb.java index 535dc0ca5..a8c1fda22 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCowBomb.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCowBomb.java @@ -122,6 +122,12 @@ public class PerkCowBomb extends Perk implements IThrown data.getThrown().getWorld().createExplosion(data.getThrown().getLocation(), 0.5f); data.getThrown().remove(); } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } @EventHandler public void Knockback(CustomDamageEvent event) @@ -131,4 +137,4 @@ public class PerkCowBomb extends Perk implements IThrown event.AddKnockback(GetName(), 5); } -} +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkDirtCannon.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkDirtCannon.java index 243d29eea..ffb4cbb54 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkDirtCannon.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkDirtCannon.java @@ -217,5 +217,10 @@ public class PerkDirtCannon extends Perk implements IThrown { } - -} + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHammerThrow.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHammerThrow.java index f8ebc7caa..7edb9d0a2 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHammerThrow.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkHammerThrow.java @@ -3,6 +3,21 @@ package nautilus.game.arcade.kit.perks; import java.util.HashMap; import java.util.Iterator; +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.block.Block; +import org.bukkit.entity.Entity; +import org.bukkit.entity.Giant; +import org.bukkit.entity.Item; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.entity.EntityDamageEvent.DamageCause; +import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.event.player.PlayerPickupItemEvent; +import org.bukkit.inventory.ItemStack; +import org.bukkit.util.Vector; + import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilAction; @@ -21,21 +36,6 @@ import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent; import nautilus.game.arcade.kit.Perk; -import org.bukkit.Material; -import org.bukkit.Sound; -import org.bukkit.block.Block; -import org.bukkit.entity.Entity; -import org.bukkit.entity.Giant; -import org.bukkit.entity.Item; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.entity.EntityDamageEvent.DamageCause; -import org.bukkit.event.player.PlayerInteractEvent; -import org.bukkit.event.player.PlayerPickupItemEvent; -import org.bukkit.inventory.ItemStack; -import org.bukkit.util.Vector; - public class PerkHammerThrow extends Perk implements IThrown { private HashMap _thrown = new HashMap(); @@ -156,6 +156,12 @@ public class PerkHammerThrow extends Perk implements IThrown { Rebound(data.getThrower(), data.getThrown()); } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } public void Rebound(LivingEntity player, Entity ent) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkIronHook.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkIronHook.java index 1b86acc73..97a481d91 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkIronHook.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkIronHook.java @@ -142,5 +142,10 @@ public class PerkIronHook extends Perk implements IThrown { data.getThrown().remove(); } - -} + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkMadScientist.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkMadScientist.java index cc9ddc0f3..8e004186c 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkMadScientist.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkMadScientist.java @@ -257,5 +257,10 @@ public class PerkMadScientist extends Perk implements IThrown Manager.GetGame().CreatureAllowOverride = false; } - -} + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkRevealer.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkRevealer.java index 37dabb0f8..3ec71307e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkRevealer.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkRevealer.java @@ -142,6 +142,12 @@ public class PerkRevealer extends Perk implements IThrown { explode(data); } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } private void explode(ProjectileUser data) { @@ -182,4 +188,4 @@ public class PerkRevealer extends Perk implements IThrown { return _revealedPlayers; } -} +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSquidRifle.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSquidRifle.java index 0157bf271..d1d7a5837 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSquidRifle.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSquidRifle.java @@ -152,6 +152,12 @@ public class PerkSquidRifle extends Perk implements IThrown { Explode(data); } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } public void Explode(ProjectileUser data) { @@ -172,4 +178,4 @@ public class PerkSquidRifle extends Perk implements IThrown e.printStackTrace(); } } -} +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSquidShotgun.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSquidShotgun.java index 797468967..26299d6eb 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSquidShotgun.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSquidShotgun.java @@ -169,6 +169,12 @@ public class PerkSquidShotgun extends Perk implements IThrown { Explode(data); } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } public void Explode(ProjectileUser data) { @@ -189,4 +195,4 @@ public class PerkSquidShotgun extends Perk implements IThrown e.printStackTrace(); } } -} +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSquidSniper.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSquidSniper.java index 96b38e418..d11253b89 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSquidSniper.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSquidSniper.java @@ -160,6 +160,12 @@ public class PerkSquidSniper extends Perk implements IThrown { Explode(data); } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } public void Explode(ProjectileUser data) { @@ -180,4 +186,4 @@ public class PerkSquidSniper extends Perk implements IThrown e.printStackTrace(); } } -} +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkThrower.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkThrower.java index 839267354..73b51e75a 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkThrower.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkThrower.java @@ -19,7 +19,6 @@ import mineplex.core.common.util.UtilPlayer; import mineplex.core.projectile.IThrown; import mineplex.core.projectile.ProjectileUser; import mineplex.core.recharge.Recharge; -import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.kit.Perk; public class PerkThrower extends Perk implements IThrown @@ -125,4 +124,10 @@ public class PerkThrower extends Perk implements IThrown { } -} + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWeb.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWeb.java index dcaa8df8d..5aeba25f5 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWeb.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWeb.java @@ -129,6 +129,12 @@ public class PerkWeb extends Perk implements IThrown Web(data); } + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } + public void Web(ProjectileUser data) { Location loc = data.getThrown().getLocation(); @@ -136,4 +142,4 @@ public class PerkWeb extends Perk implements IThrown Manager.GetBlockRestore().add(loc.getBlock(), 30, (byte) 0, 4000); } -} +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherWeb.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherWeb.java index d643727a3..0f9ad5992 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherWeb.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherWeb.java @@ -95,6 +95,12 @@ public class PerkWitherWeb extends Perk implements IThrown { Web(data); } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } public void Web(ProjectileUser data) { @@ -104,4 +110,4 @@ public class PerkWitherWeb extends Perk implements IThrown if (data.getThrown().getTicksLived() > 3) Manager.GetBlockRestore().add(loc.getBlock(), 30, (byte) 0, 3000); } -} +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWoolBomb.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWoolBomb.java index 073500018..31e51e04e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWoolBomb.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWoolBomb.java @@ -349,6 +349,12 @@ public class PerkWoolBomb extends Perk implements IThrown { solidify(data.getThrower(), false); } + + @Override + public void ChunkUnload(ProjectileUser data) + { + data.getThrown().remove(); + } @EventHandler public void colorExpireUpdate(UpdateEvent event) @@ -410,4 +416,4 @@ public class PerkWoolBomb extends Perk implements IThrown event.AddKnockback(GetName(), _knockbackMagnitude); } -} +} \ No newline at end of file diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java index 913432715..8da55ff06 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java @@ -72,7 +72,6 @@ import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.condition.Condition.ConditionType; import mineplex.minecraft.game.core.damage.CustomDamageEvent; - import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.GameType; import nautilus.game.arcade.events.GameStateChangeEvent; @@ -824,7 +823,7 @@ public class GameFlagManager implements Listener Manager.getPlugin().getServer().getScheduler().scheduleSyncDelayedTask(Manager.getPlugin(), () -> { Long t = Double.valueOf(timeF).longValue(); - _respawnTimers.put(player, Long.valueOf(System.currentTimeMillis() + UtilTime.convert(t, TimeUnit.SECONDS, TimeUnit.MILLISECONDS))); + _respawnTimers.put(player, System.currentTimeMillis() + UtilTime.convert(t, TimeUnit.SECONDS, TimeUnit.MILLISECONDS)); }, 6); int run = Manager.getPlugin().getServer().getScheduler().scheduleSyncDelayedTask(Manager.getPlugin(), () -> { @@ -843,7 +842,7 @@ public class GameFlagManager implements Listener _respawnRunnables.remove(player); }, (int)(time * 20d)); - _respawnRunnables.put(player, Integer.valueOf(run)); + _respawnRunnables.put(player, run); } } @@ -1292,7 +1291,7 @@ public class GameFlagManager implements Listener _respawnTimers.clear(); for (Integer r : _respawnRunnables.values()) { - Bukkit.getScheduler().cancelTask(r.intValue()); + Bukkit.getScheduler().cancelTask(r); } _respawnRunnables.clear(); return; @@ -1302,7 +1301,7 @@ public class GameFlagManager implements Listener _respawnTimers.clear(); for (Integer r : _respawnRunnables.values()) { - Bukkit.getScheduler().cancelTask(r.intValue()); + Bukkit.getScheduler().cancelTask(r); } _respawnRunnables.clear(); return; @@ -1317,12 +1316,12 @@ public class GameFlagManager implements Listener respawnIterator.remove(); continue; } - if (System.currentTimeMillis() >= next.getValue().longValue()) + if (System.currentTimeMillis() >= next.getValue()) { respawnIterator.remove(); continue; } - long sec = UtilTime.convert(next.getValue().longValue() - System.currentTimeMillis(), TimeUnit.MILLISECONDS, TimeUnit.SECONDS); + long sec = UtilTime.convert(next.getValue() - System.currentTimeMillis(), TimeUnit.MILLISECONDS, TimeUnit.SECONDS); ChatColor color = ChatColor.RED; if (sec < 8) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java index 25637ed98..33d6280be 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameManager.java @@ -38,10 +38,9 @@ import mineplex.core.gadget.types.GadgetType; import mineplex.core.portal.GenericServer; import mineplex.core.portal.Intent; import mineplex.core.updater.UpdateType; -import mineplex.core.updater.event.RestartServerEvent; +import mineplex.core.updater.event.RestartTriggerEvent; import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.condition.Condition.ConditionType; - import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.events.GamePrepareCountdownCommence; import nautilus.game.arcade.events.GameStateChangeEvent; @@ -439,9 +438,9 @@ public class GameManager implements Listener } @EventHandler - public void restartServerCheck(RestartServerEvent event) + public void restartServerCheck(RestartTriggerEvent event) { - if (Manager.GetGame() != null && Manager.GetGame().GetState() != GameState.Recruit) + if (Manager.GetGame() != null && Manager.GetGame().GetState() != GameState.Recruit && event.getReason() == RestartTriggerEvent.RestartReason.UPDATE) event.setCancelled(true); }