diff --git a/TwosideKeeper.jar b/TwosideKeeper.jar index 2d60e97..788e51f 100644 Binary files a/TwosideKeeper.jar and b/TwosideKeeper.jar differ diff --git a/src/sig/plugin/TwosideKeeper/EliteMonster.java b/src/sig/plugin/TwosideKeeper/EliteMonster.java index 22b52bc..fdf7a19 100644 --- a/src/sig/plugin/TwosideKeeper/EliteMonster.java +++ b/src/sig/plugin/TwosideKeeper/EliteMonster.java @@ -149,20 +149,18 @@ public class EliteMonster { } private void retargetInAir() { - Player p = ChooseRandomTarget(); - if (p!=null) { - if (Math.random()<=0.2 && !p.isOnGround()) { - //p.addPotionEffect(new PotionEffect(PotionEffectType.LEVITATION,20*5,-31)); - p.addPotionEffect(new PotionEffect(PotionEffectType.JUMP,20*5,-1)); - p.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS,10*1,7)); - m.setTarget(p); - p.setFlying(false); - p.setVelocity(new Vector(0,-1,0)); - p.removePotionEffect(PotionEffectType.LEVITATION); - p.addPotionEffect(new PotionEffect(PotionEffectType.CONFUSION,(int)(20*2.25),0)); - p.playSound(p.getLocation(), Sound.BLOCK_ANVIL_FALL, 0.4f, 0.8f); - p.playSound(p.getLocation(), Sound.ENTITY_MAGMACUBE_SQUISH, 1.0f, 1.0f); - } + if (Math.random()<=0.2) { + Player p = ChooseRandomTarget(); + //p.addPotionEffect(new PotionEffect(PotionEffectType.LEVITATION,20*5,-31)); + p.addPotionEffect(new PotionEffect(PotionEffectType.JUMP,20*5,-1)); + p.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS,10*1,7)); + m.setTarget(p); + p.setFlying(false); + p.setVelocity(new Vector(0,-1,0)); + p.removePotionEffect(PotionEffectType.LEVITATION); + p.addPotionEffect(new PotionEffect(PotionEffectType.CONFUSION,(int)(20*2.25),0)); + p.playSound(p.getLocation(), Sound.BLOCK_ANVIL_FALL, 0.4f, 0.8f); + p.playSound(p.getLocation(), Sound.ENTITY_MAGMACUBE_SQUISH, 1.0f, 1.0f); } } diff --git a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java index e280a5b..5778a32 100644 --- a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java +++ b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java @@ -128,6 +128,7 @@ import org.bukkit.event.player.PlayerItemBreakEvent; import org.bukkit.event.player.PlayerItemConsumeEvent; import org.bukkit.event.player.PlayerItemHeldEvent; import org.bukkit.event.player.PlayerJoinEvent; +import org.bukkit.event.player.PlayerKickEvent; import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.event.player.PlayerPickupArrowEvent; import org.bukkit.event.player.PlayerPickupItemEvent; @@ -3303,6 +3304,13 @@ public class TwosideKeeper extends JavaPlugin implements Listener { }*/ } } + + @EventHandler(priority=EventPriority.LOW,ignoreCancelled = true) + public void onPlayerKick(PlayerKickEvent ev) { + if (DeathManager.deathStructureExists(ev.getPlayer())) { + DeathManager.removeDeathStructure(ev.getPlayer()); + } + } @EventHandler(priority=EventPriority.LOW,ignoreCancelled = true) public void onInventoryClick(InventoryClickEvent ev) { @@ -3324,7 +3332,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener { //player.getInventory().addItem(ev.getCurrentItem()); if (ev.getCurrentItem()!=null && ev.getCurrentItem().getType()!=Material.AIR) { - player.getLocation().getWorld().dropItemNaturally(player.getLocation(), ev.getCurrentItem()).setPickupDelay(0); + //player.getLocation().getWorld().dropItemNaturally(player.getLocation(), ev.getCurrentItem()).setPickupDelay(0); + GenericFunctions.giveItem(player, ev.getCurrentItem()); ev.setCurrentItem(new ItemStack(Material.AIR)); final DecimalFormat df = new DecimalFormat("0.00");