From cf05cccd1b8b96bd48474cbf6c8ddae3365d00d0 Mon Sep 17 00:00:00 2001 From: BlackHole Date: Tue, 21 Mar 2017 23:03:20 +0100 Subject: SPIGOT-3143: Don't decrease item stack size if VehicleCreateEvent is cancelled --- nms-patches/ItemBoat.patch | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'nms-patches/ItemBoat.patch') diff --git a/nms-patches/ItemBoat.patch b/nms-patches/ItemBoat.patch index abcb54aa..e25ef73f 100644 --- a/nms-patches/ItemBoat.patch +++ b/nms-patches/ItemBoat.patch @@ -14,3 +14,12 @@ Block block = world.getType(movingobjectposition.a()).getBlock(); boolean flag1 = block == Blocks.WATER || block == Blocks.FLOWING_WATER; EntityBoat entityboat = new EntityBoat(world, movingobjectposition.pos.x, flag1 ? movingobjectposition.pos.y - 0.12D : movingobjectposition.pos.y, movingobjectposition.pos.z); +@@ -66,7 +73,7 @@ + return new InteractionResultWrapper(EnumInteractionResult.FAIL, itemstack); + } else { + if (!world.isClientSide) { +- world.addEntity(entityboat); ++ if (!world.addEntity(entityboat)) return new InteractionResultWrapper(EnumInteractionResult.PASS, itemstack); // CraftBukkit + } + + if (!entityhuman.abilities.canInstantlyBuild) { -- cgit v1.2.3