Monsters no longer target pet wolves in the arena.

This commit is contained in:
Garbage Mule 2011-08-21 12:41:46 +02:00
parent c298607b56
commit 6c0af886b1
5 changed files with 17 additions and 26 deletions

Binary file not shown.

View File

@ -15,9 +15,9 @@ import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.util.config.Configuration; import org.bukkit.util.config.Configuration;
import com.garbagemule.ArenaPlugin.Master; //import com.garbagemule.ArenaPlugin.Master;
public class ArenaMaster implements Master public class ArenaMaster //implements Master
{ {
private MobArena plugin; private MobArena plugin;
private Configuration config; private Configuration config;
@ -392,9 +392,4 @@ public class ArenaMaster implements Master
public void updateClasses() { update(false, true, false); } public void updateClasses() { update(false, true, false); }
public void updateArenas() { update(false, false, true); } public void updateArenas() { update(false, false, true); }
public void updateAll() { update(true, true, true); } public void updateAll() { update(true, true, true); }
public Map<Player, com.garbagemule.ArenaPlugin.Arena> getArenaMap()
{
return null;//arenaMap;
}
} }

View File

@ -396,27 +396,23 @@ public class MAListener implements ArenaListener
// If the target is a player, cancel. // If the target is a player, cancel.
event.setCancelled(true); event.setCancelled(true);
return;
} }
if (arena.monsters.contains(event.getEntity())) else if (arena.monsters.contains(event.getEntity()))
{ {
if (event.getReason() == TargetReason.FORGOT_TARGET) if (event.getReason() == TargetReason.FORGOT_TARGET)
{
event.setTarget(MAUtils.getClosestPlayer(event.getEntity(), arena)); event.setTarget(MAUtils.getClosestPlayer(event.getEntity(), arena));
return;
}
if (event.getReason() == TargetReason.TARGET_DIED) else if (event.getReason() == TargetReason.TARGET_DIED)
{
event.setTarget(MAUtils.getClosestPlayer(event.getEntity(), arena)); event.setTarget(MAUtils.getClosestPlayer(event.getEntity(), arena));
return;
}
if (event.getReason() == TargetReason.CLOSEST_PLAYER) else if (event.getReason() == TargetReason.TARGET_ATTACKED_ENTITY)
if (arena.pets.contains(event.getTarget()))
event.setCancelled(true);
else if (event.getReason() == TargetReason.CLOSEST_PLAYER)
if (!arena.arenaPlayers.contains(event.getTarget())) if (!arena.arenaPlayers.contains(event.getTarget()))
event.setCancelled(true); event.setCancelled(true);
return;
} }
} }

View File

@ -86,8 +86,13 @@ public class MASpawnThread implements Runnable
{ {
List<Entity> tmp = new LinkedList<Entity>(arena.monsters); List<Entity> tmp = new LinkedList<Entity>(arena.monsters);
for (Entity e : tmp) for (Entity e : tmp)
{
if (e.isDead() || !arena.inRegion(e.getLocation())) if (e.isDead() || !arena.inRegion(e.getLocation()))
{
arena.monsters.remove(e); arena.monsters.remove(e);
e.remove();
}
}
} }
private void grantRewards(int wave) private void grantRewards(int wave)

View File

@ -21,14 +21,14 @@ import com.nijikokun.bukkit.Permissions.Permissions;
import com.garbagemule.MobArena.util.FileUtils; import com.garbagemule.MobArena.util.FileUtils;
import com.garbagemule.register.payment.Method; import com.garbagemule.register.payment.Method;
import com.garbagemule.register.payment.Methods; import com.garbagemule.register.payment.Methods;
import com.garbagemule.ArenaPlugin.ArenaPlugin; //import com.garbagemule.ArenaPlugin.ArenaPlugin;
import com.garbagemule.ArenaPlugin.Master; //import com.garbagemule.ArenaPlugin.Master;
/** /**
* MobArena * MobArena
* @author garbagemule * @author garbagemule
*/ */
public class MobArena extends JavaPlugin implements ArenaPlugin public class MobArena extends JavaPlugin// implements ArenaPlugin
{ {
private Configuration config; private Configuration config;
private ArenaMaster am; private ArenaMaster am;
@ -181,11 +181,6 @@ public class MobArena extends JavaPlugin implements ArenaPlugin
public ArenaMaster getAM() { return am; } // More convenient. public ArenaMaster getAM() { return am; } // More convenient.
public ArenaMaster getArenaMaster() { return am; } public ArenaMaster getArenaMaster() { return am; }
public Master getMaster()
{
return am;
}
private String getHeader() private String getHeader()
{ {
String sep = System.getProperty("line.separator"); String sep = System.getProperty("line.separator");