Added Gamemode-check

master
Ruakij 4 years ago
parent 800032f530
commit a296a190c6

@ -4,6 +4,7 @@ import eu.ruekov.ruakij.LinkedBeaconTeleporters.Main;
import eu.ruekov.ruakij.LinkedBeaconTeleporters.linkedBeaconTeleporter.LinkedBeaconTeleporterBlock; import eu.ruekov.ruakij.LinkedBeaconTeleporters.linkedBeaconTeleporter.LinkedBeaconTeleporterBlock;
import eu.ruekov.ruakij.LinkedBeaconTeleporters.linkedBeaconTeleporter.LinkedBeaconTeleporterItem; import eu.ruekov.ruakij.LinkedBeaconTeleporters.linkedBeaconTeleporter.LinkedBeaconTeleporterItem;
import eu.ruekov.ruakij.LinkedBeaconTeleporters.linkedBeaconTeleporter.LinkedBeaconTeleporterManager; import eu.ruekov.ruakij.LinkedBeaconTeleporters.linkedBeaconTeleporter.LinkedBeaconTeleporterManager;
import org.bukkit.GameMode;
import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockBreakEvent;
public class OnBlockBreak { public class OnBlockBreak {
@ -16,6 +17,7 @@ public class OnBlockBreak {
e.setExpToDrop(0); e.setExpToDrop(0);
// Drop custom-item // Drop custom-item
if(e.getPlayer().getGameMode() != GameMode.CREATIVE)
lbtBlock.block().getLocation().getWorld().dropItemNaturally( lbtBlock.block().getLocation().getWorld().dropItemNaturally(
lbtBlock.block().getLocation(), lbtBlock.block().getLocation(),
lbtItem.item() lbtItem.item()

Loading…
Cancel
Save