Skip to content

Commit

Permalink
Fix BlockCanBuildEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
Mgazul committed Oct 30, 2024
1 parent 730da1b commit f3862c2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected BlockState getPlacementState(BlockPlaceContext context) {
if (blockState2 != null) {
boolean defaultReturn = levelReader.isUnobstructed(blockState2, blockPos, CollisionContext.empty());
org.bukkit.entity.Player player = (context.getPlayer() instanceof ServerPlayer) ? (org.bukkit.entity.Player) context.getPlayer().getBukkitEntity() : null;
BlockCanBuildEvent event = new BlockCanBuildEvent(CraftBlock.at(context.getLevel(), blockPos), player, CraftBlockData.fromData(blockState), defaultReturn);
BlockCanBuildEvent event = new BlockCanBuildEvent(CraftBlock.at(context.getLevel(), blockPos), player, CraftBlockData.fromData(blockState2), defaultReturn);
context.getLevel().getCraftServer().getPluginManager().callEvent(event);
return (event.isBuildable()) ? blockState2 : null;
} else {
Expand Down

0 comments on commit f3862c2

Please sign in to comment.