mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 16:58:34 +01:00
parent
15a0608055
commit
8ea5a3a330
1 changed files with 8 additions and 6 deletions
|
@ -350,15 +350,21 @@ public final class WorldUtil{
|
||||||
IBlockState state = world.getBlockState(pos);
|
IBlockState state = world.getBlockState(pos);
|
||||||
Block block = state.getBlock();
|
Block block = state.getBlock();
|
||||||
|
|
||||||
|
if(!world.isRemote){
|
||||||
|
world.playEvent(player, 2001, pos, Block.getStateId(state));
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
world.playEvent(2001, pos, Block.getStateId(state));
|
||||||
|
}
|
||||||
|
|
||||||
if(player.capabilities.isCreativeMode){
|
if(player.capabilities.isCreativeMode){
|
||||||
|
|
||||||
block.onBlockHarvested(world, pos, state, player);
|
block.onBlockHarvested(world, pos, state, player);
|
||||||
if(block.removedByPlayer(state, world, pos, player, false)){
|
if(block.removedByPlayer(state, world, pos, player, false)){
|
||||||
block.onBlockDestroyedByPlayer(world, pos, state);
|
block.onBlockDestroyedByPlayer(world, pos, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!world.isRemote){
|
if(!world.isRemote){
|
||||||
world.playEvent(player, 2001, pos, Block.getStateId(state));
|
|
||||||
|
|
||||||
if(player instanceof EntityPlayerMP){
|
if(player instanceof EntityPlayerMP){
|
||||||
((EntityPlayerMP)player).connection.sendPacket(new SPacketBlockChange(world, pos));
|
((EntityPlayerMP)player).connection.sendPacket(new SPacketBlockChange(world, pos));
|
||||||
}
|
}
|
||||||
|
@ -385,7 +391,6 @@ public final class WorldUtil{
|
||||||
block.dropXpOnBlockBreak(world, pos, xp);
|
block.dropXpOnBlockBreak(world, pos, xp);
|
||||||
}
|
}
|
||||||
|
|
||||||
world.playEvent(player, 2001, pos, Block.getStateId(state));
|
|
||||||
playerMp.connection.sendPacket(new SPacketBlockChange(world, pos));
|
playerMp.connection.sendPacket(new SPacketBlockChange(world, pos));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -395,9 +400,6 @@ public final class WorldUtil{
|
||||||
block.onBlockDestroyedByPlayer(world, pos, state);
|
block.onBlockDestroyedByPlayer(world, pos, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
stack.onBlockDestroyed(world, state, pos, player);
|
|
||||||
world.playEvent(2001, pos, Block.getStateId(state));
|
|
||||||
|
|
||||||
if(stack.stackSize <= 0 && stack == player.getHeldItemMainhand()){
|
if(stack.stackSize <= 0 && stack == player.getHeldItemMainhand()){
|
||||||
ForgeEventFactory.onPlayerDestroyItem(player, stack, EnumHand.MAIN_HAND);
|
ForgeEventFactory.onPlayerDestroyItem(player, stack, EnumHand.MAIN_HAND);
|
||||||
player.setHeldItem(EnumHand.MAIN_HAND, null);
|
player.setHeldItem(EnumHand.MAIN_HAND, null);
|
||||||
|
|
Loading…
Reference in a new issue