From e682e232e618c48d52b410856e1fdae19696a194 Mon Sep 17 00:00:00 2001 From: Colman Davenport Date: Wed, 9 Sep 2020 12:57:34 -0400 Subject: [PATCH] Allow harvesters to harvest kelp tops --- .../components/actors/HarvesterMovementBehaviour.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterMovementBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterMovementBehaviour.java index 9044e57bb..38d5f55f8 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterMovementBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterMovementBehaviour.java @@ -15,6 +15,7 @@ import net.minecraft.block.Blocks; import net.minecraft.block.CocoaBlock; import net.minecraft.block.CropsBlock; import net.minecraft.block.KelpBlock; +import net.minecraft.block.KelpTopBlock; import net.minecraft.block.SugarCaneBlock; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.item.ItemStack; @@ -109,6 +110,11 @@ public class HarvesterMovementBehaviour extends MovementBehaviour { if (state.getCollisionShape(world, pos) .isEmpty() || state.getBlock() instanceof CocoaBlock) { + if (state.getBlock() instanceof KelpBlock) + return true; + if (state.getBlock() instanceof KelpTopBlock) + return true; + for (IProperty property : state.getProperties()) { if (!(property instanceof IntegerProperty)) continue; @@ -118,8 +124,6 @@ public class HarvesterMovementBehaviour extends MovementBehaviour { return false; } - if (state.getBlock() instanceof KelpBlock) - return true; if (state.getBlock() instanceof IPlantable) return true; } @@ -132,7 +136,7 @@ public class HarvesterMovementBehaviour extends MovementBehaviour { CropsBlock crop = (CropsBlock) state.getBlock(); return crop.withAge(0); } - if (state.getBlock() == Blocks.SUGAR_CANE) { + if (state.getBlock() == Blocks.SUGAR_CANE || state.getBlock() == Blocks.KELP) { if (state.getFluidState() .isEmpty()) return Blocks.AIR.getDefaultState();