mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-25 11:35:18 +01:00
Improve block break/place detection in 1.8->1.9 (#3886)
Servers can send sound packets where the positions have a slight offset. This PR aims to improve the detection to account for that. Closes https://github.com/ViaVersion/ViaFabricPlus/issues/333
This commit is contained in:
parent
3f7d286606
commit
d9446eed07
@ -143,8 +143,13 @@ public class EntityTracker1_9 extends EntityTrackerBase {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean interactedBlockRecently(int x, int y, int z) {
|
||||
return blockInteractions.contains(new BlockPosition(x, y, z));
|
||||
public boolean interactedBlockRecently(final int x, final int y, final int z) {
|
||||
for (final BlockPosition position : blockInteractions) {
|
||||
if (Math.abs(position.x() - x) <= 1 && Math.abs(position.y() - y) <= 1 && Math.abs(position.z() - z) <= 1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void addBlockInteraction(BlockPosition p) {
|
||||
|
Loading…
Reference in New Issue
Block a user