diff --git a/src/main/java/io/github/thebusybiscuit/sensibletoolbox/blocks/machines/InfernalFarm.java b/src/main/java/io/github/thebusybiscuit/sensibletoolbox/blocks/machines/InfernalFarm.java index c2cc62b5..295ddf47 100644 --- a/src/main/java/io/github/thebusybiscuit/sensibletoolbox/blocks/machines/InfernalFarm.java +++ b/src/main/java/io/github/thebusybiscuit/sensibletoolbox/blocks/machines/InfernalFarm.java @@ -4,6 +4,7 @@ import java.util.Set; import org.bukkit.Effect; +import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.data.Ageable; @@ -60,6 +61,20 @@ public Recipe getRecipe() { res.setIngredient('N', Material.NETHER_BRICK); return res; } + + @Override + public void onBlockRegistered(Location location, boolean isPlacing) { + int range = RADIUS / 2; + Block block = location.getBlock(); + + for (int x = -range; x <= range; x++) { + for (int z = -range; z <= range; z++) { + blocks.add(block.getRelative(x, 2, z)); + } + } + + super.onBlockRegistered(location, isPlacing); + } @Override public void onServerTick() { @@ -71,9 +86,9 @@ public void onServerTick() { if (ageable.getAge() >= ageable.getMaximumAge()) { setCharge(getCharge() - getScuPerCycle()); - ageable.setAge(0); crop.getWorld().playEffect(crop.getLocation(), Effect.STEP_SOUND, crop.getType()); + crop.setBlockData(ageable); setJammed(!output(Material.NETHER_WART)); break; }