Fixed TiCon's mess.

They also used the wrong method to play the block breaking particles in the first place by the way.
This commit is contained in:
Ellpeck 2016-07-06 18:42:17 +02:00
parent 5d2ba3734e
commit 5cefc43aca

View file

@ -52,7 +52,6 @@ import net.minecraftforge.fluids.capability.IFluidHandler;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set;
public final class WorldUtil{ public final class WorldUtil{
@ -367,9 +366,14 @@ public final class WorldUtil{
block.onBlockDestroyedByPlayer(world, pos, state); block.onBlockDestroyedByPlayer(world, pos, state);
} }
if(!world.isRemote && player instanceof EntityPlayerMP){ if(!world.isRemote){
((EntityPlayerMP)player).connection.sendPacket(new SPacketBlockChange(world, pos)); world.playEvent(2001, pos, Block.getStateId(state));
if(player instanceof EntityPlayerMP){
((EntityPlayerMP)player).connection.sendPacket(new SPacketBlockChange(world, pos));
}
} }
return true; return true;
} }
@ -391,12 +395,12 @@ public final class WorldUtil{
block.dropXpOnBlockBreak(world, pos, xp); block.dropXpOnBlockBreak(world, pos, xp);
} }
world.playEvent(2001, pos, Block.getStateId(state));
playerMp.connection.sendPacket(new SPacketBlockChange(world, pos)); playerMp.connection.sendPacket(new SPacketBlockChange(world, pos));
return true;
} }
} }
else{ else{
world.playEvent(2001, pos, Block.getStateId(state));
if(block.removedByPlayer(state, world, pos, player, true)){ if(block.removedByPlayer(state, world, pos, player, true)){
block.onBlockDestroyedByPlayer(world, pos, state); block.onBlockDestroyedByPlayer(world, pos, state);
} }
@ -410,7 +414,9 @@ public final class WorldUtil{
Minecraft mc = Minecraft.getMinecraft(); Minecraft mc = Minecraft.getMinecraft();
mc.getConnection().sendPacket(new CPacketPlayerDigging(CPacketPlayerDigging.Action.STOP_DESTROY_BLOCK, pos, mc.objectMouseOver.sideHit)); mc.getConnection().sendPacket(new CPacketPlayerDigging(CPacketPlayerDigging.Action.STOP_DESTROY_BLOCK, pos, mc.objectMouseOver.sideHit));
return true;
} }
return true; return false;
} }
} }