SPIGOT-3258: VehicleBlockCollisionEvent only fires in certain directions

This commit is contained in:
md_5 2017-05-21 10:24:47 +10:00
parent cda27c992d
commit 24147056e0

View File

@ -240,13 +240,13 @@
+ Vehicle vehicle = (Vehicle) this.getBukkitEntity(); + Vehicle vehicle = (Vehicle) this.getBukkitEntity();
+ org.bukkit.block.Block bl = this.world.getWorld().getBlockAt(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)); + org.bukkit.block.Block bl = this.world.getWorld().getBlockAt(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ));
+ +
+ if (d6 > d0) { + if (d7 > d0) {
+ bl = bl.getRelative(BlockFace.EAST); + bl = bl.getRelative(BlockFace.EAST);
+ } else if (d6 < d0) { + } else if (d7 < d0) {
+ bl = bl.getRelative(BlockFace.WEST); + bl = bl.getRelative(BlockFace.WEST);
+ } else if (d8 > d2) { + } else if (d9 > d2) {
+ bl = bl.getRelative(BlockFace.SOUTH); + bl = bl.getRelative(BlockFace.SOUTH);
+ } else if (d8 < d2) { + } else if (d9 < d2) {
+ bl = bl.getRelative(BlockFace.NORTH); + bl = bl.getRelative(BlockFace.NORTH);
+ } + }
+ +