Skip to content

Commit

Permalink
Send dig packets to synchronize states after breaking blocks. (Should…
Browse files Browse the repository at this point in the history
… reduce ghost-block problems with AOE tools)
  • Loading branch information
bonii-xx committed Aug 23, 2014
1 parent 699b0f5 commit 46d8409
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/tconstruct/items/tools/Scythe.java
Expand Up @@ -237,7 +237,14 @@ public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPl
// Workaround for dropping experience
if (!butter)
localBlock.dropXpOnBlockBreak(world, xPos, yPos, zPos, exp);
}

if(world.isRemote) {
INetHandler handler = FMLClientHandler.instance().getClientPlayHandler();
if(handler != null && handler instanceof NetHandlerPlayClient) {
NetHandlerPlayClient handlerClient = (NetHandlerPlayClient) handler;
handlerClient.addToSendQueue(new C07PacketPlayerDigging(0, x, y, z, Minecraft.getMinecraft().objectMouseOver.sideHit));
handlerClient.addToSendQueue(new C07PacketPlayerDigging(2, x, y, z, Minecraft.getMinecraft().objectMouseOver.sideHit));
}
}

Expand Down
8 changes: 8 additions & 0 deletions src/main/java/tconstruct/library/tools/HarvestTool.java
Expand Up @@ -319,6 +319,14 @@ public void mineBlock(World world, int x, int y, int z, int meta, EntityPlayer p
if (!silktouch)
block.dropXpOnBlockBreak(world, x, y, z, exp);

if(world.isRemote) {
INetHandler handler = FMLClientHandler.instance().getClientPlayHandler();
if(handler != null && handler instanceof NetHandlerPlayClient) {
NetHandlerPlayClient handlerClient = (NetHandlerPlayClient) handler;
handlerClient.addToSendQueue(new C07PacketPlayerDigging(0, x, y, z, Minecraft.getMinecraft().objectMouseOver.sideHit));
handlerClient.addToSendQueue(new C07PacketPlayerDigging(2, x, y, z, Minecraft.getMinecraft().objectMouseOver.sideHit));
}
}
}
}
}

0 comments on commit 46d8409

Please sign in to comment.