- Assorted bugfixes
This commit is contained in:
parent
cddc6674a5
commit
5a5dbcfe67
@ -483,7 +483,8 @@ public class CaptureTheFlag extends TeamGame
|
||||
return 1;
|
||||
}
|
||||
|
||||
public String getMode()
|
||||
@Override
|
||||
public String GetMode()
|
||||
{
|
||||
return "Capture the Flag";
|
||||
}
|
||||
|
@ -36,6 +36,9 @@ public class Flag
|
||||
|
||||
private Block[] _flagBlocks;
|
||||
|
||||
private Material[] _priorBlocks;
|
||||
private Byte[] _priorData;
|
||||
|
||||
private GameTeam _team;
|
||||
|
||||
private ItemStack _representation;
|
||||
@ -210,8 +213,21 @@ public class Flag
|
||||
return ChatColor.RED;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public void spawnFlag(Location loc, boolean red)
|
||||
{
|
||||
_priorBlocks = new Material[]
|
||||
{
|
||||
loc.getBlock().getType(),
|
||||
loc.clone().add(0, 1, 0).getBlock().getType()
|
||||
};
|
||||
|
||||
_priorData = new Byte[]
|
||||
{
|
||||
loc.getBlock().getData(),
|
||||
loc.clone().add(0, 1, 0).getBlock().getData()
|
||||
};
|
||||
|
||||
_flagBlocks = new Block[]
|
||||
{
|
||||
loc.getBlock(),
|
||||
@ -240,12 +256,16 @@ public class Flag
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void deleteFlag()
|
||||
{
|
||||
for (Block flagBlock : _flagBlocks)
|
||||
for (int i = 0; i < _flagBlocks.length; i++)
|
||||
{
|
||||
flagBlock.setType(Material.AIR);
|
||||
Block flagBlock = _flagBlocks[i];
|
||||
flagBlock.setType(_priorBlocks[i]);
|
||||
flagBlock.setData(_priorData[i]);
|
||||
}
|
||||
|
||||
_name.stop();
|
||||
_time.stop();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user