- Assorted bugfixes

This commit is contained in:
AlexTheCoder 2015-09-27 23:36:51 -04:00
parent cddc6674a5
commit 5a5dbcfe67
2 changed files with 24 additions and 3 deletions

View File

@ -483,7 +483,8 @@ public class CaptureTheFlag extends TeamGame
return 1;
}
public String getMode()
@Override
public String GetMode()
{
return "Capture the Flag";
}

View File

@ -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();
}