From 5cefc43aca9df1171281a09917148492819efe76 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 6 Jul 2016 18:42:17 +0200 Subject: [PATCH] Fixed TiCon's mess. They also used the wrong method to play the block breaking particles in the first place by the way. --- .../actuallyadditions/mod/util/WorldUtil.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java index fd348e1d2..974f81422 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java @@ -52,7 +52,6 @@ import net.minecraftforge.fluids.capability.IFluidHandler; import java.util.ArrayList; import java.util.List; -import java.util.Set; public final class WorldUtil{ @@ -367,9 +366,14 @@ public final class WorldUtil{ block.onBlockDestroyedByPlayer(world, pos, state); } - if(!world.isRemote && player instanceof EntityPlayerMP){ - ((EntityPlayerMP)player).connection.sendPacket(new SPacketBlockChange(world, pos)); + if(!world.isRemote){ + world.playEvent(2001, pos, Block.getStateId(state)); + + if(player instanceof EntityPlayerMP){ + ((EntityPlayerMP)player).connection.sendPacket(new SPacketBlockChange(world, pos)); + } } + return true; } @@ -391,12 +395,12 @@ public final class WorldUtil{ block.dropXpOnBlockBreak(world, pos, xp); } + world.playEvent(2001, pos, Block.getStateId(state)); playerMp.connection.sendPacket(new SPacketBlockChange(world, pos)); + return true; } } else{ - world.playEvent(2001, pos, Block.getStateId(state)); - if(block.removedByPlayer(state, world, pos, player, true)){ block.onBlockDestroyedByPlayer(world, pos, state); } @@ -410,7 +414,9 @@ public final class WorldUtil{ Minecraft mc = Minecraft.getMinecraft(); mc.getConnection().sendPacket(new CPacketPlayerDigging(CPacketPlayerDigging.Action.STOP_DESTROY_BLOCK, pos, mc.objectMouseOver.sideHit)); + + return true; } - return true; + return false; } }