Added spray can tool

This commit is contained in:
William Burns 2016-01-15 18:52:26 +00:00
parent 1066becd68
commit 733bfadf68

View File

@ -364,6 +364,7 @@ public class Draw extends SoloGame
drawer.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.STONE_SWORD, (byte) 0, 1, "Line Tool"));
drawer.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.GOLD_SWORD, (byte)0, 1, "Square Tool"));
drawer.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.DIAMOND_SWORD, (byte)0, 1, "Circle Tool"));
drawer.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_BLOCK, (byte)0, 1, "Spray Can"));
drawer.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BUCKET, (byte)0, 1, "Paint Bucket"));
drawer.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.TNT, (byte)0, 1, "Clear Canvas"));
@ -562,7 +563,7 @@ public class Draw extends SoloGame
for (Player player : _drawers.GetPlayers(true))
{
if (!UtilGear.isMat(player.getItemInHand(), Material.WOOD_SWORD) && !UtilGear.isMat(player.getItemInHand(), Material.IRON_SWORD))
if (!UtilGear.isMat(player.getItemInHand(), Material.WOOD_SWORD) && !UtilGear.isMat(player.getItemInHand(), Material.IRON_SWORD) && !UtilGear.isMat(player.getItemInHand(), Material.IRON_BLOCK))
continue;
if (!player.isBlocking())
@ -592,6 +593,21 @@ public class Draw extends SoloGame
other.setData(_brushColor);
}
}
//Spray Can
if (UtilGear.isMat(player.getItemInHand(), Material.IRON_BLOCK))
{
for (Block other : UtilBlock.getSurrounding(block, false))
{
if (!_canvas.contains(other))
continue;
if (Math.random() > 0.75)
continue;
other.setData(_brushColor);
}
}
//Join Dots
if (_brushPrevious != null)
@ -618,6 +634,21 @@ public class Draw extends SoloGame
other.setData(_brushColor);
}
}
//Spray Can
if (UtilGear.isMat(player.getItemInHand(), Material.IRON_BLOCK))
{
for (Block other : UtilBlock.getSurrounding(fixBlock, false))
{
if (!_canvas.contains(other))
continue;
if (Math.random() > 0.75)
continue;
other.setData(_brushColor);
}
}
}
}