diff --git a/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestHandlerStem.java b/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestHandlerStem.java index 2e7bb2fd..7a0ef364 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestHandlerStem.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestHandlerStem.java @@ -10,6 +10,7 @@ import net.minecraft.util.NonNullList; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import java.util.Collection; import java.util.List; /** @@ -29,19 +30,21 @@ public class HarvestHandlerStem implements IHarvestHandler { @Override public boolean harvest(World world, BlockPos pos, IBlockState state, List drops) { - EnumFacing cropDir = state.getBlock().getActualState(state, world, pos).getValue(BlockStem.FACING); + EnumFacing cropDir = state.getActualState(world, pos).getValue(BlockStem.FACING); if (cropDir != EnumFacing.UP) { BlockPos cropPos = pos.offset(cropDir); IBlockState probableCrop = world.getBlockState(cropPos); - IBlockState registeredCrop = HarvestRegistry.getStemCrops().get(state); + Collection registeredCrops = HarvestRegistry.getStemCrops().get(state); - if (registeredCrop == probableCrop) { - NonNullList blockDrops = NonNullList.create(); - probableCrop.getBlock().getDrops(blockDrops, world, cropPos, probableCrop, 0); - drops.addAll(blockDrops); - world.destroyBlock(cropPos, false); - return true; + for (IBlockState registeredCrop : registeredCrops) { + if (registeredCrop == probableCrop) { + NonNullList blockDrops = NonNullList.create(); + probableCrop.getBlock().getDrops(blockDrops, world, cropPos, probableCrop, 0); + drops.addAll(blockDrops); + world.destroyBlock(cropPos, false); + return true; + } } } diff --git a/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestRegistry.java b/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestRegistry.java index c5deba16..82c403e6 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestRegistry.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestRegistry.java @@ -14,7 +14,7 @@ public class HarvestRegistry { private static final List HARVEST_HANDLERS = Lists.newArrayList(); private static final Map STANDARD_CROPS = Maps.newHashMap(); private static final Set TALL_CROPS = Sets.newHashSet(); - private static final Map STEM_CROPS = Maps.newHashMap(); + private static final Multimap STEM_CROPS = ArrayListMultimap.create(); private static final Map AMPLIFIERS = Maps.newHashMap(); /** @@ -95,8 +95,8 @@ public class HarvestRegistry { return ImmutableSet.copyOf(TALL_CROPS); } - public static Map getStemCrops() { - return ImmutableMap.copyOf(STEM_CROPS); + public static Multimap getStemCrops() { + return ImmutableMultimap.copyOf(STEM_CROPS); } public static Map getAmplifiers() {