1
0
Fork 0

remove block break progress sending

This commit is contained in:
Sen 2025-08-29 09:45:25 +02:00
parent 01ceef058c
commit 9b0bc17a95
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
12 changed files with 46 additions and 354 deletions

View file

@ -84,7 +84,6 @@ import common.packet.SPacketSignEditorOpen;
import common.packet.SPacketPlayerAbilities;
import common.packet.SPacketTabComplete;
import common.packet.SPacketAnimation;
import common.packet.SPacketBlockBreakAnim;
import common.packet.SPacketBlockChange;
import common.packet.SPacketCamera;
import common.packet.SPacketCharacterList;
@ -956,26 +955,6 @@ public class Player extends User implements Executor, IPlayer
return new SPacketMapChunkBulk(xPositions, zPositions, chunksData);
}
private void sendBlockBreakProgress(BlockPos pos, int progress)
{
for (Player conn : this.server.getPlayers())
{
EntityNPC player = conn.getPresentEntity();
if (player != null && player.worldObj == this.entity.worldObj && player != this.entity)
{
double d0 = (double)pos.getX() - player.posX;
double d1 = (double)pos.getY() - player.posY;
double d2 = (double)pos.getZ() - player.posZ;
if (d0 * d0 + d1 * d1 + d2 * d2 < 1024.0D)
{
conn.sendPacket(new SPacketBlockBreakAnim(this.entity.getId(), pos, progress));
}
}
}
}
public void updateEntity()
{
if (this.entity.hurtResistance > 0)
@ -1093,7 +1072,6 @@ public class Player extends User implements Executor, IPlayer
if (j != this.durabilityRemainingOnBlock)
{
this.sendBlockBreakProgress(this.removingPos, j);
this.durabilityRemainingOnBlock = j;
}
@ -1110,7 +1088,6 @@ public class Player extends User implements Executor, IPlayer
if (block1 == Blocks.air)
{
this.sendBlockBreakProgress(this.startPos, -1);
this.durabilityRemainingOnBlock = -1;
this.isDestroyingBlock = false;
}
@ -1122,7 +1099,6 @@ public class Player extends User implements Executor, IPlayer
if (l != this.durabilityRemainingOnBlock)
{
this.sendBlockBreakProgress(this.startPos, l);
this.durabilityRemainingOnBlock = l;
}
}
@ -1169,7 +1145,6 @@ public class Player extends User implements Executor, IPlayer
this.isDestroyingBlock = true;
this.startPos = pos;
int i = (int)(f * 10.0F);
this.sendBlockBreakProgress(pos, i);
this.durabilityRemainingOnBlock = i;
}
// }
@ -1189,7 +1164,6 @@ public class Player extends User implements Executor, IPlayer
if (f >= 0.7F)
{
this.isDestroyingBlock = false;
this.sendBlockBreakProgress(pos, -1);
this.tryHarvestBlock(pos);
}
else if (!this.receivedFinishDiggingPacket)
@ -1206,7 +1180,6 @@ public class Player extends User implements Executor, IPlayer
public void cancelDestroyingBlock()
{
this.isDestroyingBlock = false;
this.sendBlockBreakProgress(this.startPos, -1);
}
private boolean removeBlock(BlockPos pos)