Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-27 00:22:51 +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
Dieser Commit ist enthalten in:
Ursprung
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) {
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren