fixed double economy rewards, spectators dont get rewards until after they leave the spec area
This commit is contained in:
@@ -452,7 +452,7 @@ public class ArenaImpl implements Arena
|
|||||||
|
|
||||||
// Start logging
|
// Start logging
|
||||||
rewardManager.reset();
|
rewardManager.reset();
|
||||||
if(logging)
|
if (logging)
|
||||||
log.start();
|
log.start();
|
||||||
|
|
||||||
// Initialize leaderboards and start displaying info.
|
// Initialize leaderboards and start displaying info.
|
||||||
@@ -488,7 +488,7 @@ public class ArenaImpl implements Arena
|
|||||||
leaderboard.update();
|
leaderboard.update();
|
||||||
|
|
||||||
// Finish logging
|
// Finish logging
|
||||||
if(logging)
|
if (logging)
|
||||||
log.end();
|
log.end();
|
||||||
|
|
||||||
// Stop spawning.
|
// Stop spawning.
|
||||||
@@ -659,8 +659,9 @@ public class ArenaImpl implements Arena
|
|||||||
|
|
||||||
if (settings.getBoolean("spectate-on-death", true)) {
|
if (settings.getBoolean("spectate-on-death", true)) {
|
||||||
movePlayerToSpec(p);
|
movePlayerToSpec(p);
|
||||||
//TODO remove this line below, and require "/ma leave" to get inv and rewards back? perhaps a msg should be displayed?
|
//TODO revert if people throw a fit. Should help deter removing valuables from the arena
|
||||||
restoreInvAndExp(p);
|
Messenger.tellPlayer(p, Msg.SPEC_FROM_ARENA);
|
||||||
|
//restoreInvAndExp(p);
|
||||||
} else {
|
} else {
|
||||||
restoreInvAndExp(p);
|
restoreInvAndExp(p);
|
||||||
movePlayerToEntry(p);
|
movePlayerToEntry(p);
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ public class ArenaListener
|
|||||||
pvpEnabled,
|
pvpEnabled,
|
||||||
foodRegen,
|
foodRegen,
|
||||||
lockFoodLevel;
|
lockFoodLevel;
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private boolean allowTeleport,
|
private boolean allowTeleport,
|
||||||
canShare,
|
canShare,
|
||||||
allowMonsters,
|
allowMonsters,
|
||||||
@@ -596,7 +597,6 @@ public class ArenaListener
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO watch for arena's pvp setting, then remove all players
|
|
||||||
// If a potion has harmful effects, remove all players.
|
// If a potion has harmful effects, remove all players.
|
||||||
for (PotionEffect effect : potion.getEffects()) {
|
for (PotionEffect effect : potion.getEffects()) {
|
||||||
PotionEffectType type = effect.getType();
|
PotionEffectType type = effect.getType();
|
||||||
|
|||||||
@@ -299,7 +299,7 @@ public class MASpawnThread implements Runnable
|
|||||||
Messenger.warning("Could not add null reward. Please check the config-file!");
|
Messenger.warning("Could not add null reward. Please check the config-file!");
|
||||||
}
|
}
|
||||||
else if (reward.getTypeId() == MobArena.ECONOMY_MONEY_ID) {
|
else if (reward.getTypeId() == MobArena.ECONOMY_MONEY_ID) {
|
||||||
if (plugin.giveMoney(p, reward.getAmount())) {
|
if (plugin.giveMoney(p, reward.getAmount())) { // Money already awarded here, not needed at end of match as well
|
||||||
Messenger.tellPlayer(p, Msg.WAVE_REWARD, plugin.economyFormat(reward.getAmount()));
|
Messenger.tellPlayer(p, Msg.WAVE_REWARD, plugin.economyFormat(reward.getAmount()));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ public enum Msg
|
|||||||
LEAVE_PLAYER_LEFT("You left the arena. Thanks for playing!", "Left arena.", Material.WOOD_DOOR),
|
LEAVE_PLAYER_LEFT("You left the arena. Thanks for playing!", "Left arena.", Material.WOOD_DOOR),
|
||||||
PLAYER_DIED("% died!", "% died!", Material.BONE),
|
PLAYER_DIED("% died!", "% died!", Material.BONE),
|
||||||
SPEC_PLAYER_SPECTATE("Enjoy the show!", "Enjoy the show!"),
|
SPEC_PLAYER_SPECTATE("Enjoy the show!", "Enjoy the show!"),
|
||||||
|
SPEC_FROM_ARENA("Enjoy the rest of the show! Make sure to '/ma leave' when you're finished watching!", "Enjoy the show!"),
|
||||||
SPEC_NOT_RUNNING("This arena isn't running.", "Arena not running.", Material.REDSTONE_TORCH_OFF),
|
SPEC_NOT_RUNNING("This arena isn't running.", "Arena not running.", Material.REDSTONE_TORCH_OFF),
|
||||||
SPEC_EMPTY_INV("Empty your inventory first!", "Empty your inventory.", Material.CHEST),
|
SPEC_EMPTY_INV("Empty your inventory first!", "Empty your inventory.", Material.CHEST),
|
||||||
SPEC_ALREADY_PLAYING("Can't spectate when in the arena!", "Already playing!"),
|
SPEC_ALREADY_PLAYING("Can't spectate when in the arena!", "Already playing!"),
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import com.garbagemule.MobArena.framework.Arena;
|
|||||||
|
|
||||||
public class RewardManager
|
public class RewardManager
|
||||||
{
|
{
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private MobArena plugin;
|
private MobArena plugin;
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private Arena arena;
|
private Arena arena;
|
||||||
@@ -57,13 +58,12 @@ public class RewardManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (stack.getTypeId() == MobArena.ECONOMY_MONEY_ID) {
|
if (stack.getTypeId() == MobArena.ECONOMY_MONEY_ID) {
|
||||||
plugin.giveMoney(p, stack.getAmount()); //TODO bug JustMe in IRC to find out what he changed to fix Economy Money Dupe
|
// plugin.giveMoney(p, stack.getAmount()); - removed to fix double money rewards
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
p.getInventory().addItem(stack);
|
p.getInventory().addItem(stack);
|
||||||
}
|
}
|
||||||
|
|
||||||
rewarded.add(p);
|
rewarded.add(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Chunk;
|
import org.bukkit.Chunk;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
|
|||||||
Reference in New Issue
Block a user