Skip to content

Commit c1c1449

Browse files
committed
feat サバイバルモードでも壊せないようにするやつ
1 parent 7c3bfb5 commit c1c1449

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/java/com/github/elic0de/thejpspit/listener/BlockPlaceListener.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ public void on(BlockPlaceEvent event) {
3030
if (player.getGameMode() == GameMode.CREATIVE) return;
3131
final BlockState replacedState = event.getBlockReplacedState();
3232

33+
// クリエイティブ以外は壊せないように
34+
event.setCancelled(true);
35+
3336
if (replacedStates.containsKey(replacedState.getLocation())) return;
3437
replacedStates.put(replacedState.getLocation(), replacedState);
3538

0 commit comments

Comments
 (0)