From 52f9c7fa3a8b701e210a2b802b9fc03351a94031 Mon Sep 17 00:00:00 2001 From: Otter Date: Mon, 12 Aug 2024 19:38:10 +0200 Subject: [PATCH] fixed witchery seeds --- .../Modules/Addons/Plants/ModuleModCrops.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/main/java/vswe/stevescarts/Modules/Addons/Plants/ModuleModCrops.java b/src/main/java/vswe/stevescarts/Modules/Addons/Plants/ModuleModCrops.java index db64a740..332275fe 100644 --- a/src/main/java/vswe/stevescarts/Modules/Addons/Plants/ModuleModCrops.java +++ b/src/main/java/vswe/stevescarts/Modules/Addons/Plants/ModuleModCrops.java @@ -1,7 +1,7 @@ package vswe.stevescarts.Modules.Addons.Plants; import net.minecraft.block.Block; -import net.minecraft.block.BlockCrops; +import net.minecraft.block.IGrowable; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.common.IPlantable; @@ -51,13 +51,21 @@ public boolean isReadyToHarvest(int x, int y, int z) { int m = getCart().worldObj.getBlockMetadata(x, y, z); UniqueIdentifier uniqueIdentifier = GameRegistry.findUniqueIdentifierFor(block); + if (!(block instanceof IGrowable)) { + return false; + } + // witchery compatibility - if (uniqueIdentifier.modId.equals("witchery") && m == 4) { - return true; + if (uniqueIdentifier.modId.equals("witchery")) { + if (uniqueIdentifier.name.equals("garlicplant") && m == 5) { + return true; + } else if (m == 4) { + return true; + } } - // default behaviour - if (block instanceof BlockCrops && m == 7) { + // default for crops + if (m == 7) { return true; }