Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-23 23:00:08 +01:00
Don't call duplicate interact air events. Fixes BUKKIT-5359
Previously we attempted to call interact events in cases that were missing by modifying the arm swing logic. This, however, was too broad and started triggering events in cases we already covered leading to duplicates. Since the only case we can handle cleanly and the primary point of the previous fix was fluids we now instead simply treat fluids as air for this check. This also ensures we do not get duplicate events when the player is in a fluid and hits a normal block, unlike the previous change. This reverts commit 68b702f7 and replaces it with a better fix.
Dieser Commit ist enthalten in:
Ursprung
9907271071
Commit
842962530a
@ -962,19 +962,9 @@ public class PlayerConnection implements PacketPlayInListener {
|
|||||||
float f8 = f3 * f5;
|
float f8 = f3 * f5;
|
||||||
double d3 = 5.0D;
|
double d3 = 5.0D;
|
||||||
Vec3D vec3d1 = vec3d.add((double) f7 * d3, (double) f6 * d3, (double) f8 * d3);
|
Vec3D vec3d1 = vec3d.add((double) f7 * d3, (double) f6 * d3, (double) f8 * d3);
|
||||||
MovingObjectPosition movingobjectposition = this.player.world.rayTrace(vec3d, vec3d1, true);
|
MovingObjectPosition movingobjectposition = this.player.world.rayTrace(vec3d, vec3d1, false);
|
||||||
|
|
||||||
boolean valid = false;
|
|
||||||
if (movingobjectposition == null || movingobjectposition.type != EnumMovingObjectType.BLOCK) {
|
if (movingobjectposition == null || movingobjectposition.type != EnumMovingObjectType.BLOCK) {
|
||||||
valid = true;
|
|
||||||
} else {
|
|
||||||
Block block = this.player.world.getType(movingobjectposition.b, movingobjectposition.c, movingobjectposition.d);
|
|
||||||
if (!block.c()) { // Should be isBreakable?
|
|
||||||
valid = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (valid) {
|
|
||||||
CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_AIR, this.player.inventory.getItemInHand());
|
CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_AIR, this.player.inventory.getItemInHand());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren