From 632762768eefa612df8b019ee83ff927c5ab05e6 Mon Sep 17 00:00:00 2001 From: SquidDev Date: Sat, 30 Dec 2017 19:03:32 +0000 Subject: [PATCH] Add workaround for incorrect overload of getDrops being overridden Closes #2 --- .../computercraft/shared/turtle/upgrades/TurtleTool.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleTool.java b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleTool.java index 4f8738f54..86f90af8f 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleTool.java +++ b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleTool.java @@ -302,12 +302,13 @@ public class TurtleTool implements ITurtleUpgrade return TurtleCommandResult.failure( "Nothing to dig here" ); } + @SuppressWarnings("deprecation") private List getBlockDropped( World world, BlockPos pos, EntityPlayer player ) { IBlockState state = world.getBlockState( pos ); Block block = state.getBlock(); - NonNullList drops = NonNullList.create(); - block.getDrops( drops, world, pos, world.getBlockState( pos ), 0 ); + // Note, we use the deprecated version as some mods override that instead. Those mods are wrong (TM). + List drops = block.getDrops( world, pos, world.getBlockState( pos ), 0 ); double chance = ForgeEventFactory.fireBlockHarvesting( drops, world, pos, state, 0, 1, false, player ); for( int i = drops.size() - 1; i >= 0; i-- )