mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-15 12:13:54 -07:00
Added VEHICLE_DESTROY event
This commit is contained in:
committed by
Erik Broes
parent
325f4e0c22
commit
39972530f2
@@ -120,6 +120,17 @@ public class EntityMinecart extends Entity implements IInventory {
|
||||
this.W();
|
||||
this.a += i * 10;
|
||||
if (this.a > 40) {
|
||||
|
||||
// CraftBukkit start
|
||||
VehicleDestroyEvent destroyEvent = new VehicleDestroyEvent(vehicle, passenger);
|
||||
((WorldServer) this.world).getServer().getPluginManager().callEvent(destroyEvent);
|
||||
|
||||
if (destroyEvent.isCancelled()) {
|
||||
this.a = 40; // Maximize damage so this doesn't get triggered again right away
|
||||
return true;
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
this.a(Item.MINECART.id, 1, 0.0F);
|
||||
if (this.d == 1) {
|
||||
this.a(Block.CHEST.id, 1, 0.0F);
|
||||
|
Reference in New Issue
Block a user