Fixed RS blocks requiring a pickaxe to be broken, fixes #1473

This commit is contained in:
raoulvdberge
2017-10-01 13:33:23 +02:00
parent 74fda65889
commit 0c901a3932
2 changed files with 9 additions and 0 deletions

View File

@@ -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)

View File

@@ -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);