mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-25 03:55:14 +01:00
Fixed redstone current being sent even if a BlockPlace was cancelled.
This commit is contained in:
parent
053e05dd37
commit
0c24f86a09
@ -49,8 +49,6 @@ public class ItemRedstone extends Item {
|
|||||||
if (Block.REDSTONE_WIRE.canPlace(world, i, j, k)) {
|
if (Block.REDSTONE_WIRE.canPlace(world, i, j, k)) {
|
||||||
BlockState blockState = CraftBlockState.getBlockState(world, i, j, k); // CraftBukkit
|
BlockState blockState = CraftBlockState.getBlockState(world, i, j, k); // CraftBukkit
|
||||||
|
|
||||||
world.setTypeId(i, j, k, Block.REDSTONE_WIRE.id);
|
|
||||||
|
|
||||||
// CraftBukkit start - redstone
|
// CraftBukkit start - redstone
|
||||||
BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, clickedX, clickedY, clickedZ, Block.REDSTONE_WIRE);
|
BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, clickedX, clickedY, clickedZ, Block.REDSTONE_WIRE);
|
||||||
|
|
||||||
@ -58,6 +56,8 @@ public class ItemRedstone extends Item {
|
|||||||
event.getBlockPlaced().setTypeIdAndData(blockState.getTypeId(), blockState.getRawData(), false);
|
event.getBlockPlaced().setTypeIdAndData(blockState.getTypeId(), blockState.getRawData(), false);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
world.setTypeId(i, j, k, Block.REDSTONE_WIRE.id); // CraftBukkit - Must take place after BlockPlaceEvent
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
--itemstack.count; // CraftBukkit - ORDER MATTERS
|
--itemstack.count; // CraftBukkit - ORDER MATTERS
|
||||||
|
Loading…
Reference in New Issue
Block a user