From 0c901a3932c3d4f538caf5b1c734973624845dd2 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sun, 1 Oct 2017 13:33:23 +0200 Subject: [PATCH] Fixed RS blocks requiring a pickaxe to be broken, fixes #1473 --- CHANGELOG.md | 1 + .../raoulvdberge/refinedstorage/proxy/ProxyCommon.java | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a46a08ed1..4b8264428 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### 1.5.19 - Updated Forge to 2493 (MC 1.12.2) (raoulvdberge) +- Fixed RS blocks requiring a pickaxe to be broken (raoulvdberge) ### 1.5.18 - Added Project E integration for the External Storage on the Transmutation Table (raoulvdberge) diff --git a/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyCommon.java b/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyCommon.java index 821f396f3..98e569692 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyCommon.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyCommon.java @@ -53,6 +53,7 @@ import net.minecraftforge.common.crafting.CraftingHelper; import net.minecraftforge.common.crafting.IIngredientFactory; import net.minecraftforge.common.crafting.JsonContext; import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.event.entity.player.PlayerEvent; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; @@ -295,6 +296,13 @@ public class ProxyCommon { } } + @SubscribeEvent + public void onHarvestCheck(PlayerEvent.HarvestCheck e) { + if (e.getTargetBlock().getBlock() instanceof BlockBase) { + e.setCanHarvest(true); // Allow break without tool + } + } + private void registerBlock(BlockBase block) { blocksToRegister.add(block);