(donington) Fixes for compiler warnings & minor .gitignore enhancement, completed the last of the creatureType/entityType renaming (a few imports and functions)
This commit is contained in:
		
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -14,7 +14,7 @@
 | 
				
			|||||||
/build
 | 
					/build
 | 
				
			||||||
/bin
 | 
					/bin
 | 
				
			||||||
/dist
 | 
					/dist
 | 
				
			||||||
/localexport.jardesc
 | 
					/*.jardesc
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Mac filesystem dust
 | 
					# Mac filesystem dust
 | 
				
			||||||
.DS_Store
 | 
					.DS_Store
 | 
				
			||||||
@@ -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
 | 
					 * 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
 | 
					public class EssentialsFeatures
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	private static EssentialsChat essChat;
 | 
						private static EssentialsChat essChat;
 | 
				
			||||||
	private static IEssentials essentials;
 | 
						private static IEssentials essentials;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@SuppressWarnings("deprecation")
 | 
					 | 
				
			||||||
	public static void setup()
 | 
						public static void setup()
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		// integrate main essentials plugin
 | 
							// integrate main essentials plugin
 | 
				
			||||||
@@ -79,7 +80,6 @@ public class EssentialsFeatures
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// return false if feature is disabled or Essentials isn't available
 | 
						// return false if feature is disabled or Essentials isn't available
 | 
				
			||||||
	@SuppressWarnings("deprecation")
 | 
					 | 
				
			||||||
	public static boolean handleTeleport(Player player, Location loc)
 | 
						public static boolean handleTeleport(Player player, Location loc)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		if ( ! Conf.homesTeleportCommandEssentialsIntegration || essentials == null) return false;
 | 
							if ( ! Conf.homesTeleportCommandEssentialsIntegration || essentials == null) return false;
 | 
				
			||||||
@@ -121,6 +121,7 @@ public class EssentialsFeatures
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	private static class LocalChatListener implements Listener
 | 
						private static class LocalChatListener implements Listener
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
 | 
							@SuppressWarnings("unused")
 | 
				
			||||||
		@EventHandler(priority = EventPriority.NORMAL)
 | 
							@EventHandler(priority = EventPriority.NORMAL)
 | 
				
			||||||
		public void onPlayerChat(EssentialsLocalChatEvent event)
 | 
							public void onPlayerChat(EssentialsLocalChatEvent event)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -313,7 +313,7 @@ public class FactionsEntityListener implements Listener
 | 
				
			|||||||
		Faction faction = Board.getFactionAt(floc);
 | 
							Faction faction = Board.getFactionAt(floc);
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		if (faction.getFlag(FFlag.MONSTERS)) return;
 | 
							if (faction.getFlag(FFlag.MONSTERS)) return;
 | 
				
			||||||
		if ( ! Conf.monsters.contains(event.getCreatureType())) return;
 | 
							if ( ! Conf.monsters.contains(event.getEntityType())) return;
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		event.setCancelled(true);
 | 
							event.setCancelled(true);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,12 +5,12 @@ import java.util.HashSet;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import org.bukkit.ChatColor;
 | 
					import org.bukkit.ChatColor;
 | 
				
			||||||
import org.bukkit.entity.Creature;
 | 
					import org.bukkit.entity.Creature;
 | 
				
			||||||
import org.bukkit.entity.CreatureType;
 | 
					import org.bukkit.entity.EntityType;
 | 
				
			||||||
import org.bukkit.entity.Entity;
 | 
					import org.bukkit.entity.Entity;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class MiscUtil
 | 
					public class MiscUtil
 | 
				
			||||||
{	
 | 
					{	
 | 
				
			||||||
	public static CreatureType creatureTypeFromEntity(Entity entity)
 | 
						public static EntityType creatureTypeFromEntity(Entity entity)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		if ( ! (entity instanceof Creature))
 | 
							if ( ! (entity instanceof Creature))
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
@@ -20,7 +20,7 @@ public class MiscUtil
 | 
				
			|||||||
		String name = entity.getClass().getSimpleName();
 | 
							String name = entity.getClass().getSimpleName();
 | 
				
			||||||
		name = name.substring(5); // Remove "Craft"
 | 
							name = name.substring(5); // Remove "Craft"
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		return CreatureType.fromName(name);
 | 
							return EntityType.fromName(name);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	// Inclusive range
 | 
						// Inclusive range
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user