Change mobspawn track list to use entity id

This commit is contained in:
nossr50 2012-02-22 08:29:51 -08:00
parent 95da5a4535
commit 0c8b46acee
4 changed files with 6 additions and 5 deletions

View File

@ -18,6 +18,7 @@ Version 1.3.00-dev
+ Re-added mcMMO reporting damage events + Re-added mcMMO reporting damage events
= Fixed /mcability not respecting permissions = Fixed /mcability not respecting permissions
= Prettied up new config files = 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 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 god mode to turn off if player enters world where he does not have mcgod permission
! Changed Taming to also gain XP from shearing ! Changed Taming to also gain XP from shearing

View File

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

View File

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

View File

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