Miner cleanup (#5456)

* Cleanup readability of firing events

* Minor cleanup of MinerUtils

* Cleanup fallback system for MinerUtils and inline fallbackGetSilkTouch

* restore block drops backwards compatibility

* handle shulker boxes in digital miner

* use fake player in a few more event spots & add helper for getting a block's state for placement

* Change default placement so that logs face upwards
This commit is contained in:
Richard Freimer authored and GitHub committed 2019-05-04 15:17:12 -04:00
1 parent 4c4e88dca5
commit e3161cf2db
6 files changed
+120 -51

No files matched your search

@@ -38,6 +38,7 @@ import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.world.World;
import net.minecraftforge.common.util.Constants.WorldEvents;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -157,7 +158,7 @@ public class ItemAtomicDisassembler extends ItemEnergized {
Block block2 = coord.getBlock(player.world);
block2.onBlockHarvested(player.world, coord.getPos(), state, player);
player.world.playEvent(null, 2001, coord.getPos(), Block.getStateId(state));
player.world.playEvent(WorldEvents.BREAK_BLOCK_EFFECTS, coord.getPos(), Block.getStateId(state));
player.world.setBlockToAir(coord.getPos());
block2.breakBlock(player.world, coord.getPos(), state);
block2.dropBlockAsItem(player.world, coord.getPos(), state, 0);