From a296a190c6d4e8cbdce4a61e2e9e4d1d8c268fef Mon Sep 17 00:00:00 2001 From: Ruakij Date: Mon, 10 May 2021 10:21:16 +0200 Subject: [PATCH] Added Gamemode-check --- .../linkedBeaconTeleporter/listener/OnBlockBreak.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/listener/OnBlockBreak.java b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/listener/OnBlockBreak.java index 97d9e7b..a9e5477 100644 --- a/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/listener/OnBlockBreak.java +++ b/src/main/java/eu/ruekov/ruakij/LinkedBeaconTeleporters/linkedBeaconTeleporter/listener/OnBlockBreak.java @@ -4,6 +4,7 @@ import eu.ruekov.ruakij.LinkedBeaconTeleporters.Main; import eu.ruekov.ruakij.LinkedBeaconTeleporters.linkedBeaconTeleporter.LinkedBeaconTeleporterBlock; import eu.ruekov.ruakij.LinkedBeaconTeleporters.linkedBeaconTeleporter.LinkedBeaconTeleporterItem; import eu.ruekov.ruakij.LinkedBeaconTeleporters.linkedBeaconTeleporter.LinkedBeaconTeleporterManager; +import org.bukkit.GameMode; import org.bukkit.event.block.BlockBreakEvent; public class OnBlockBreak { @@ -16,9 +17,10 @@ public class OnBlockBreak { e.setExpToDrop(0); // Drop custom-item - lbtBlock.block().getLocation().getWorld().dropItemNaturally( + if(e.getPlayer().getGameMode() != GameMode.CREATIVE) + lbtBlock.block().getLocation().getWorld().dropItemNaturally( lbtBlock.block().getLocation(), lbtItem.item() - ); + ); } }