Fixed CME

Gadget cost fix
MapParser fix
This commit is contained in:
Chiss 2014-06-15 15:10:19 +10:00
parent 1bfa24cc45
commit 9a79d0ede7
3 changed files with 25 additions and 6 deletions

View File

@ -119,13 +119,13 @@ public abstract class ItemGadget extends Gadget
} }
//Recharge //Recharge
if (!Recharge.Instance.use(player, GetName(), _recharge, true, false)) if (!Recharge.Instance.use(player, GetName(), _recharge, _recharge > 1000, false))
return; return;
//Use Gems //Use Gems
if (_gemsPerUse > 0) if (_gemsPerUse > 0)
{ {
if (Manager.Manager.GetDonation().Get(player.getName()).GetGems() > _gemsPerUse) if (Manager.Manager.GetDonation().Get(player.getName()).GetGems() >= _gemsPerUse)
{ {
Manager.Manager.GetDonation().RewardGemsLater(GetName(), player.getName(), -_gemsPerUse); Manager.Manager.GetDonation().RewardGemsLater(GetName(), player.getName(), -_gemsPerUse);
} }

View File

@ -1,3 +1,3 @@
name: MapParser name: MapParser
main: Mineplex.MapParser main: mineplex.mapparser.MapParser
version: 1 version: 1

View File

@ -2,6 +2,7 @@ package nautilus.game.arcade.game.games.castlesiege;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
@ -70,7 +71,9 @@ public class CastleSiege extends TeamGame
private long _tntSpawn = 0; private long _tntSpawn = 0;
private ArrayList<Location> _tntSpawns = new ArrayList<Location>(); private ArrayList<Location> _tntSpawns = new ArrayList<Location>();
private ArrayList<Location> _tntWeakness = new ArrayList<Location>(); private ArrayList<Location> _tntWeakness = new ArrayList<Location>();
private HashMap<Player, FallingBlock> _tntCarry = new HashMap<Player, FallingBlock>(); private HashMap<Player, FallingBlock> _tntCarry = new HashMap<Player, FallingBlock>();
private HashSet<Player> _tntCarryEnd = new HashSet<Player>();
private ArrayList<Location> _kingLocs; private ArrayList<Location> _kingLocs;
private Creature _king; private Creature _king;
@ -593,7 +596,12 @@ public class CastleSiege extends TeamGame
if (!_tntCarry.containsKey(player)) if (!_tntCarry.containsKey(player))
return; return;
_tntCarry.remove(player).remove(); //Remove the TNT
_tntCarry.get(player).remove();
//Flag for Removal
_tntCarryEnd.add(player);
TNTPrimed tnt = player.getWorld().spawn(player.getEyeLocation(), TNTPrimed.class); TNTPrimed tnt = player.getWorld().spawn(player.getEyeLocation(), TNTPrimed.class);
tnt.setFuseTicks(0); tnt.setFuseTicks(0);
@ -603,8 +611,12 @@ public class CastleSiege extends TeamGame
@EventHandler(priority = EventPriority.LOWEST) @EventHandler(priority = EventPriority.LOWEST)
public void TNTDamageDivert(ProjectileHitEvent event) public void TNTDamageDivert(ProjectileHitEvent event)
{ {
for (Player player : _tntCarry.keySet()) Iterator<Player> playerIterator = _tntCarry.keySet().iterator();
while (playerIterator.hasNext())
{ {
Player player = playerIterator.next();
if (player.getPassenger() == null) if (player.getPassenger() == null)
continue; continue;
@ -621,9 +633,16 @@ public class CastleSiege extends TeamGame
event.getEntity().remove(); event.getEntity().remove();
} }
if (_tntCarryEnd.contains(player))
{
playerIterator.remove();
} }
} }
_tntCarryEnd.clear();
}
@EventHandler @EventHandler
public void TNTExpire(UpdateEvent event) public void TNTExpire(UpdateEvent event)