فهرست منبع

Change mobspawn track list to use entity id

nossr50 13 سال پیش
والد
کامیت
0c8b46acee

+ 1 - 0
Changelog.txt

@@ -18,6 +18,7 @@ Version 1.3.00-dev
  + Re-added mcMMO reporting damage events
  = Fixed /mcability not respecting permissions
  = Prettied up new config files
+ ! Changed mob spawn tracking to use Unique Entity ID instead of Entity Object
  ! Changed stats command name to mcstats for better plugin compatibility
  ! Changed god mode to turn off if player enters world where he does not have mcgod permission
  ! Changed Taming to also gain XP from shearing

+ 3 - 3
src/main/java/com/gmail/nossr50/Combat.java

@@ -131,7 +131,7 @@ public class Combat
 			    		}
 		      		}
 		      		
-		      		if(!pluginx.misc.mobSpawnerList.contains(event.getEntity()))
+		      		if(!pluginx.misc.mobSpawnerList.contains(event.getEntity().getEntityId()))
 		      		{
 		      			int xp = getXp(event.getEntity(), event);
 
@@ -221,7 +221,7 @@ public class Combat
 						
 						master.sendMessage(mcLocale.getString("Combat.Gore")); //$NON-NLS-1$
 					}
-					if(!event.getEntity().isDead() && !pluginx.misc.mobSpawnerList.contains(event.getEntity()))
+					if(!event.getEntity().isDead() && !pluginx.misc.mobSpawnerList.contains(event.getEntity().getEntityId()))
 					{
 						int xp = getXp(event.getEntity(), event);
 						Users.getProfile(master).addXP(SkillType.TAMING, xp*10, master);
@@ -336,7 +336,7 @@ public class Combat
     		/*
     		 * Defender is Monster
     		 */
-    		if(!pluginx.misc.mobSpawnerList.contains(x))
+    		if(!pluginx.misc.mobSpawnerList.contains(x.getEntityId()))
     		{
     			int xp = getXp(event.getEntity(), event);
 				PPa.addXP(SkillType.ARCHERY, xp*10, attacker);

+ 1 - 1
src/main/java/com/gmail/nossr50/config/Misc.java

@@ -31,7 +31,7 @@ public class Misc
     
     protected static final Logger log = Logger.getLogger("Minecraft");
     
-    public ArrayList<Entity> mobSpawnerList = new ArrayList<Entity>();
+    public ArrayList<Integer> mobSpawnerList = new ArrayList<Integer>();
     public HashSet<Block> blockWatchList = new HashSet<Block>();
     public HashMap<Entity, Integer> arrowTracker = new HashMap<Entity, Integer>();
     public ArrayList<LivingEntity> bleedTracker = new ArrayList<LivingEntity>();

+ 1 - 1
src/main/java/com/gmail/nossr50/listeners/mcEntityListener.java

@@ -207,7 +207,7 @@ public class mcEntityListener implements Listener
     	
     	if(reason == SpawnReason.SPAWNER && !LoadProperties.xpGainsMobSpawners)
     	{
-    		plugin.misc.mobSpawnerList.add(event.getEntity());
+    		plugin.misc.mobSpawnerList.add(event.getEntity().getEntityId());
     	}
     }