a couple of TODOs, fixed "keep-exp: false" not removing exp

This commit is contained in:
Brian 2012-05-21 22:15:11 -04:00
parent 10147532a5
commit e2901086f0
4 changed files with 17 additions and 21 deletions

View File

@ -172,7 +172,7 @@ public class ArenaImpl implements Arena
Time time = Enums.getEnumFromString(Time.class, timeString);
this.timeStrategy = (time != null ? new TimeStrategyLocked(time) : new TimeStrategyNull());
if(isLogging()) {
if (logging) {
this.dir = new File(plugin.getDataFolder() + File.separator + "arenas" + File.separator + name);
this.sessionBuilder = new YMLSessionBuilder(new File(dir, "log_session.yml"));
this.totalsBuilder = new YMLTotalsBuilder(new File(dir, "log_totals.yml"));
@ -452,7 +452,7 @@ public class ArenaImpl implements Arena
// Start logging
rewardManager.reset();
if(isLogging())
if(logging)
log.start();
// Initialize leaderboards and start displaying info.
@ -488,7 +488,7 @@ public class ArenaImpl implements Arena
leaderboard.update();
// Finish logging
if(isLogging())
if(logging)
log.end();
// Stop spawning.
@ -598,19 +598,15 @@ public class ArenaImpl implements Arena
removePotionEffects(p);
ArenaPlayer ap = arenaPlayerMap.get(p);
if (ap != null && running) log.playerDeath(ap);
if (logging)
if (ap != null && running)
log.playerDeath(ap);
if (inLobby(p) || inArena(p)) {
inventoryManager.clearInventory(p);
inventoryManager.restoreInventory(p);
rewardManager.grantRewards(p);
arenaPlayers.remove(p);
restoreInvAndExp(p);
if(inLobby(p) || inArena(p))
refund(p);
//p.updateInventory();
}
else if (inSpec(p)) {
inventoryManager.restoreInventory(p);
//p.updateInventory();
}
movePlayerToEntry(p);
discardPlayer(p);
@ -627,7 +623,9 @@ public class ArenaImpl implements Arena
plugin.getServer().getPluginManager().callEvent(event);
ArenaPlayer ap = arenaPlayerMap.get(p);
if (ap != null) log.playerDeath(ap);
if (logging)
if (ap != null)
log.playerDeath(ap);
arenaPlayers.remove(p);
@ -661,6 +659,7 @@ public class ArenaImpl implements Arena
if (settings.getBoolean("spectate-on-death", true)) {
movePlayerToSpec(p);
//TODO remove this line below, and require "/ma leave" to get inv and rewards back? perhaps a msg should be displayed?
restoreInvAndExp(p);
} else {
restoreInvAndExp(p);

View File

@ -137,13 +137,11 @@ public class ArenaListener
public void onBlockBreak(BlockBreakEvent event) {
if (!arena.getRegion().contains(event.getBlock().getLocation()))
return;
// Below this, the block break is in the arena's region - ACStache
if (!arena.inArena(event.getPlayer())) {
if (arena.inEditMode())
return;
else
// Players not partaking in the arena while edit mode is off - ACStache
event.setCancelled(true);
}
@ -163,11 +161,9 @@ public class ArenaListener
private boolean onBlockDestroy(BlockEvent event) {
if (arena.inEditMode())
return true;
// Below this, arena is not in edit mode - ACStache
if (!arena.isRunning())
return false;
// Below this, arena is running - ACStache
Block b = event.getBlock();
if (arena.removeBlock(b) || b.getType() == Material.TNT)
@ -600,6 +596,7 @@ public class ArenaListener
return;
}
//TODO watch for arena's pvp setting, then remove all players
// If a potion has harmful effects, remove all players.
for (PotionEffect effect : potion.getEffects()) {
PotionEffectType type = effect.getType();

View File

@ -57,7 +57,7 @@ public class RewardManager
}
if (stack.getTypeId() == MobArena.ECONOMY_MONEY_ID) {
plugin.giveMoney(p, stack.getAmount());
plugin.giveMoney(p, stack.getAmount()); //TODO bug JustMe in IRC to find out what he changed to fix Economy Money Dupe
continue;
}

View File

@ -40,7 +40,7 @@ public class MAGlobalListener implements Listener
// //
///////////////////////////////////////////////////////////////////////////
//TODO watch block physics, piston extend, and piston retract events
@EventHandler(priority = EventPriority.HIGHEST)
public void blockBreak(BlockBreakEvent event) {
for (Arena arena : am.getArenas())