From 7e02e12f44f4b59619d19c8f4c617f41c8d79954 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 9 Jul 2015 13:06:11 +0200 Subject: [PATCH] Added some Comments to weird parts of the Drill code so that I and other people don't get utterly confused --- .../ellpeck/actuallyadditions/items/ItemDrill.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemDrill.java b/src/main/java/ellpeck/actuallyadditions/items/ItemDrill.java index a8e667842..e235410a7 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemDrill.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemDrill.java @@ -203,7 +203,12 @@ public class ItemDrill extends ItemEnergy implements INameableItem{ int zRange = 0; MovingObjectPosition pos = WorldUtil.getNearestBlockWithDefaultReachDistance(world, player); - if(pos == null) return false; + //Always prevent the Block from being broken on the Server, but always drop Breaking Particles + //on the Client (otherwise Tall Grass for example wouldn't drop particles for some reason), + //as this will only happen in very rare cases anyway + if(pos == null){ + return !world.isRemote; + } int side = pos.sideHit; if(side == 0 || side == 1){ @@ -272,6 +277,9 @@ public class ItemDrill extends ItemEnergy implements INameableItem{ block.onBlockDestroyedByPlayer(world, xPos, yPos, zPos, meta); } + //When mining very fast, Client and Server might de-sync causing Ghost Blocks + //This sends a check to the Server and if the broken block results in a Ghost Block, it will reappear + //(Not all of the time, but very often, making Ghost Blocks much rarer than they usually are) Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C07PacketPlayerDigging(2, xPos, yPos, zPos, Minecraft.getMinecraft().objectMouseOver.sideHit)); } }