mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-14 03:35:51 -07:00
SPIGOT-1607: Fix BlockPlaceEvent and BlockMultiPlaceEvent sometimes showing the wrong item used
By: Thinkofdeath <thinkofdeath@spigotmc.org>
This commit is contained in:
@@ -97,9 +97,9 @@
|
||||
+ List<BlockState> blocks = (List<BlockState>) world.capturedBlockStates.clone();
|
||||
+ world.capturedBlockStates.clear();
|
||||
+ if (blocks.size() > 1) {
|
||||
+ placeEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockMultiPlaceEvent(world, entityhuman, blocks, blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
||||
+ placeEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockMultiPlaceEvent(world, entityhuman, enumhand, blocks, blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
||||
+ } else if (blocks.size() == 1) {
|
||||
+ placeEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blocks.get(0), blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
||||
+ placeEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, enumhand, blocks.get(0), blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
||||
+ }
|
||||
+
|
||||
+ if (placeEvent != null && (placeEvent.isCancelled() || !placeEvent.canBuild())) {
|
||||
|
Reference in New Issue
Block a user