Skip to content

Commit

Permalink
Update BlockListener.java
Browse files Browse the repository at this point in the history
  • Loading branch information
mcchampions committed Jan 14, 2025
2 parents 7d0c090 + 5f7d0b2 commit 70f8b63
Showing 1 changed file with 0 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,6 @@ public void onBlockPlace(BlockPlaceEvent e) {
SlimefunItem sfItem = SlimefunItem.getByItem(item);

if (sfItem != null && !(sfItem instanceof NotPlaceable)) {
/*
如果这个物品是工具类物品,我们需要检查它是否修改了一个方块 (铲子右键、打火石点火)
并不要为替换的方块创建一个对应工具 ID 的数据
这应该适用于大部分情况,但建议附属开发者们还是显式声明对应物品是不可放置的最好
*/
if (!e.getBlockReplacedState().getType().isAir()) {
return;
}

if (!sfItem.canUse(e.getPlayer(), true)) {
e.setCancelled(true);
} else {
Expand Down

0 comments on commit 70f8b63

Please sign in to comment.