diff options
4 files changed, 12 insertions, 11 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commanditemdb.java b/Essentials/src/com/earth2me/essentials/commands/Commanditemdb.java index 27f51f0b6..fe1177fa2 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commanditemdb.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commanditemdb.java @@ -30,10 +30,11 @@ public class Commanditemdb extends EssentialsCommand } sender.sendMessage(itemStack.getType().toString() + "- " + itemStack.getTypeId() + ":" + Integer.toString(itemStack.getData().getData())); - int maxuses = itemStack.getType().getMaxDurability(); - int durability = ((itemStack.getType().getMaxDurability() + 1) - itemStack.getDurability()); + if (itemStack.getType() != Material.AIR) { + int maxuses = itemStack.getType().getMaxDurability(); + int durability = ((maxuses + 1) - itemStack.getDurability()); if (maxuses != 0) { sender.sendMessage(_("durability", Integer.toString(durability))); diff --git a/Essentials/src/com/earth2me/essentials/listener/EssentialsBlockListener.java b/Essentials/src/com/earth2me/essentials/listener/EssentialsBlockListener.java index 3f2f78477..3d09d39ff 100644 --- a/Essentials/src/com/earth2me/essentials/listener/EssentialsBlockListener.java +++ b/Essentials/src/com/earth2me/essentials/listener/EssentialsBlockListener.java @@ -21,7 +21,7 @@ public class EssentialsBlockListener implements Listener this.ess = ess; } - @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) + @EventHandler(priority = EventPriority.Low, ignoreCancelled = true) public void onBlockPlace(final BlockPlaceEvent event) { // Do not rely on getItemInHand(); diff --git a/Essentials/src/com/earth2me/essentials/listener/EssentialsEntityListener.java b/Essentials/src/com/earth2me/essentials/listener/EssentialsEntityListener.java index 675d861f5..465c0fbed 100644 --- a/Essentials/src/com/earth2me/essentials/listener/EssentialsEntityListener.java +++ b/Essentials/src/com/earth2me/essentials/listener/EssentialsEntityListener.java @@ -30,7 +30,7 @@ public class EssentialsEntityListener implements Listener this.ess = ess; } - @EventHandler(priority = EventPriority.LOWEST) + @EventHandler(priority = EventPriority.LOW) public void onEntityDamage(final EntityDamageByEntityEvent event) { final Entity eAttack = event.getDamager(); @@ -96,7 +96,7 @@ public class EssentialsEntityListener implements Listener } } - @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) + @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onEntityDamage(final EntityDamageEvent event) { if (event.getEntity() instanceof Player && ess.getUser((Player)event.getEntity()).isGodModeEnabled()) @@ -108,7 +108,7 @@ public class EssentialsEntityListener implements Listener } } - @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) + @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onEntityCombust(final EntityCombustEvent event) { if (event.getEntity() instanceof Player && ess.getUser((Player)event.getEntity()).isGodModeEnabled()) @@ -135,7 +135,7 @@ public class EssentialsEntityListener implements Listener } } - @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) + @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onFoodLevelChange(final FoodLevelChangeEvent event) { if (event.getEntity() instanceof Player && ess.getUser((Player)event.getEntity()).isGodModeEnabled()) @@ -144,7 +144,7 @@ public class EssentialsEntityListener implements Listener } } - @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) + @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onEntityRegainHealth(final EntityRegainHealthEvent event) { diff --git a/Essentials/src/com/earth2me/essentials/listener/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/listener/EssentialsPlayerListener.java index b2071d6d4..6ff80e568 100644 --- a/Essentials/src/com/earth2me/essentials/listener/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/listener/EssentialsPlayerListener.java @@ -5,12 +5,12 @@ import com.earth2me.essentials.api.IEssentials; import com.earth2me.essentials.api.ISettings; import com.earth2me.essentials.api.IUser; import com.earth2me.essentials.permissions.Permissions; +import com.earth2me.essentials.user.UserData.TimestampType; +import com.earth2me.essentials.utils.LocationUtil; import com.earth2me.essentials.utils.textreader.IText; import com.earth2me.essentials.utils.textreader.KeywordReplacer; import com.earth2me.essentials.utils.textreader.TextInput; import com.earth2me.essentials.utils.textreader.TextPager; -import com.earth2me.essentials.user.UserData.TimestampType; -import com.earth2me.essentials.utils.LocationUtil; import java.io.IOException; import java.util.Arrays; import java.util.Iterator; @@ -30,8 +30,8 @@ import org.bukkit.event.Listener; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryCloseEvent; import org.bukkit.event.inventory.InventoryType; -import org.bukkit.event.player.PlayerLoginEvent.Result; import org.bukkit.event.player.*; +import org.bukkit.event.player.PlayerLoginEvent.Result; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; import org.bukkit.inventory.InventoryHolder; import org.bukkit.inventory.ItemStack; |