Call EntityChangeBlockEvent when boats destroy blocks. Fixes BUKKIT-3871
Dieser Commit ist enthalten in:
Ursprung
18d7bc7ca3
Commit
02a5d09ddf
@ -4,6 +4,7 @@ import java.util.List;
|
|||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||||
import org.bukkit.entity.Vehicle;
|
import org.bukkit.entity.Vehicle;
|
||||||
import org.bukkit.event.vehicle.VehicleDamageEvent;
|
import org.bukkit.event.vehicle.VehicleDamageEvent;
|
||||||
import org.bukkit.event.vehicle.VehicleDestroyEvent;
|
import org.bukkit.event.vehicle.VehicleDestroyEvent;
|
||||||
@ -379,8 +380,20 @@ public class EntityBoat extends Entity {
|
|||||||
int i2 = this.world.getTypeId(i1, l1, j1);
|
int i2 = this.world.getTypeId(i1, l1, j1);
|
||||||
|
|
||||||
if (i2 == Block.SNOW.id) {
|
if (i2 == Block.SNOW.id) {
|
||||||
|
// CraftBukkit start
|
||||||
|
if (CraftEventFactory.callEntityChangeBlockEvent(this, i1, l1, j1, 0, 0).isCancelled()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
|
|
||||||
this.world.setAir(i1, l1, j1);
|
this.world.setAir(i1, l1, j1);
|
||||||
} else if (i2 == Block.WATER_LILY.id) {
|
} else if (i2 == Block.WATER_LILY.id) {
|
||||||
|
// CraftBukkit start
|
||||||
|
if (CraftEventFactory.callEntityChangeBlockEvent(this, i1, l1, j1, 0, 0).isCancelled()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
|
|
||||||
this.world.setAir(i1, l1, j1, true);
|
this.world.setAir(i1, l1, j1, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren