From fd8ca30af6ceb13de28970120e5c7039a47cf010 Mon Sep 17 00:00:00 2001 From: Brettflan Date: Tue, 13 Mar 2012 08:43:45 -0500 Subject: [PATCH] (donington) Fixes for compiler warnings & minor .gitignore enhancement, completed the last of the creatureType/entityType renaming (a few imports and functions) --- .gitignore | 2 +- .../factions/integration/EssentialsFeatures.java | 5 +++-- .../factions/listeners/FactionsEntityListener.java | 2 +- src/com/massivecraft/factions/util/MiscUtil.java | 6 +++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index c432b8be..99412a2a 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,7 @@ /build /bin /dist -/localexport.jardesc +/*.jardesc # Mac filesystem dust .DS_Store \ No newline at end of file diff --git a/src/com/massivecraft/factions/integration/EssentialsFeatures.java b/src/com/massivecraft/factions/integration/EssentialsFeatures.java index 6a7d7d54..2b4b8af1 100644 --- a/src/com/massivecraft/factions/integration/EssentialsFeatures.java +++ b/src/com/massivecraft/factions/integration/EssentialsFeatures.java @@ -24,12 +24,13 @@ import com.earth2me.essentials.chat.EssentialsLocalChatEvent; * If an older version is detected in the setup() method below, handling is passed off to EssentialsOldVersionFeatures */ +// silence deprecation warnings with this old interface +@SuppressWarnings("deprecation") public class EssentialsFeatures { private static EssentialsChat essChat; private static IEssentials essentials; - @SuppressWarnings("deprecation") public static void setup() { // integrate main essentials plugin @@ -79,7 +80,6 @@ public class EssentialsFeatures // return false if feature is disabled or Essentials isn't available - @SuppressWarnings("deprecation") public static boolean handleTeleport(Player player, Location loc) { if ( ! Conf.homesTeleportCommandEssentialsIntegration || essentials == null) return false; @@ -121,6 +121,7 @@ public class EssentialsFeatures private static class LocalChatListener implements Listener { + @SuppressWarnings("unused") @EventHandler(priority = EventPriority.NORMAL) public void onPlayerChat(EssentialsLocalChatEvent event) { diff --git a/src/com/massivecraft/factions/listeners/FactionsEntityListener.java b/src/com/massivecraft/factions/listeners/FactionsEntityListener.java index bb4cd5e5..4bab89fd 100644 --- a/src/com/massivecraft/factions/listeners/FactionsEntityListener.java +++ b/src/com/massivecraft/factions/listeners/FactionsEntityListener.java @@ -313,7 +313,7 @@ public class FactionsEntityListener implements Listener Faction faction = Board.getFactionAt(floc); if (faction.getFlag(FFlag.MONSTERS)) return; - if ( ! Conf.monsters.contains(event.getCreatureType())) return; + if ( ! Conf.monsters.contains(event.getEntityType())) return; event.setCancelled(true); } diff --git a/src/com/massivecraft/factions/util/MiscUtil.java b/src/com/massivecraft/factions/util/MiscUtil.java index cb1878fe..32067ae8 100644 --- a/src/com/massivecraft/factions/util/MiscUtil.java +++ b/src/com/massivecraft/factions/util/MiscUtil.java @@ -5,12 +5,12 @@ import java.util.HashSet; import org.bukkit.ChatColor; import org.bukkit.entity.Creature; -import org.bukkit.entity.CreatureType; +import org.bukkit.entity.EntityType; import org.bukkit.entity.Entity; public class MiscUtil { - public static CreatureType creatureTypeFromEntity(Entity entity) + public static EntityType creatureTypeFromEntity(Entity entity) { if ( ! (entity instanceof Creature)) { @@ -20,7 +20,7 @@ public class MiscUtil String name = entity.getClass().getSimpleName(); name = name.substring(5); // Remove "Craft" - return CreatureType.fromName(name); + return EntityType.fromName(name); } // Inclusive range