SPIGOT-3143: Don't decrease item stack size if VehicleCreateEvent is cancelled

By: BlackHole <black-hole@live.com>
This commit is contained in:
CraftBukkit/Spigot
2017-03-21 23:03:20 +01:00
parent b18c5c741b
commit c839929065
3 changed files with 22 additions and 2 deletions

View File

@@ -498,8 +498,9 @@
entityboat.setType(this.c);
entityboat.yaw = enumdirection.l();
world.addEntity(entityboat);
- world.addEntity(entityboat);
- itemstack.subtract(1);
+ if (!world.addEntity(entityboat)) itemstack.add(1); // CraftBukkit
+ // itemstack.subtract(1); // CraftBukkit - handled during event processing
return itemstack;
}