Permalink
Browse files

Added Beetroot support to Planter.

  • Loading branch information...
me4502 committed Jan 29, 2017
1 parent 662f042 commit b78dc456f9983d3641e1bf35b5ef02a554b1e238
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/main/java/com/sk89q/craftbook/mechanics/ic/gates/world/blocks/Planter.java
@@ -158,6 +158,7 @@ protected boolean plantableItem(ItemStack item) {
case RED_MUSHROOM:
case BROWN_MUSHROOM:
case WATER_LILY:
+ case BEETROOT_SEEDS:
return true;
case INK_SACK:
return ((Dye)item.getData()).getColor() == DyeColor.BROWN;
@@ -178,6 +179,7 @@ protected boolean itemPlantableAtBlock(ItemStack item, Block block) {
case PUMPKIN_SEEDS:
case POTATO_ITEM:
case CARROT_ITEM:
+ case BEETROOT_SEEDS:
return block.getRelative(0, -1, 0).getType() == Material.SOIL;
case NETHER_STALK:
return block.getRelative(0, -1, 0).getType() == Material.SOUL_SAND;
@@ -232,6 +234,9 @@ protected boolean plantBlockAt(ItemStack item, Block block) {
case CARROT_ITEM:
block.setTypeIdAndData(Material.CARROT.getId(), (byte) 0, true);
return true;
+ case BEETROOT_SEEDS:
+ block.setTypeIdAndData(Material.BEETROOT_BLOCK.getId(), (byte) 0, true);
+ return true;
case INK_SACK:
if(((Dye)item.getData()).getColor() != DyeColor.BROWN) return false;
List<BlockFace> faces = new ArrayList<BlockFace>(Arrays.asList(new BlockFace[]{BlockFace.EAST, BlockFace.WEST, BlockFace.NORTH, BlockFace.SOUTH}));

0 comments on commit b78dc45

Please sign in to comment.