diff --git a/src/com/dre/dungeonsxl/LanguageReader.java b/src/com/dre/dungeonsxl/LanguageReader.java index 87734e1e..65ebf62c 100644 --- a/src/com/dre/dungeonsxl/LanguageReader.java +++ b/src/com/dre/dungeonsxl/LanguageReader.java @@ -22,8 +22,6 @@ public class LanguageReader { /* Load */ this.file = file; - P.p.log("FilePath:"+file.getPath()); - FileConfiguration configFile = YamlConfiguration.loadConfiguration(file); Set keySet = configFile.getKeys(false); @@ -68,6 +66,7 @@ public class LanguageReader { /* Errors */ defaults.put("Error_Enderchest","&4Du kannst keine Enderchest in einem Dungeon verwenden!"); + defaults.put("Error_Dispenser","&4Du kannst nicht auf diesen Dispenser zugreifen!"); defaults.put("Error_Ready","&4Wähle zuerst eine Klasse aus!"); defaults.put("Error_Cooldown","&4Du kannst den Dungeon nur alle &6&v1&4 Stunden betreten!"); defaults.put("Error_Leftklick","&4Du musst das Schild mit Links-klick berühren!"); diff --git a/src/com/dre/dungeonsxl/listener/PlayerListener.java b/src/com/dre/dungeonsxl/listener/PlayerListener.java index 5893c3d8..fca6e7f8 100644 --- a/src/com/dre/dungeonsxl/listener/PlayerListener.java +++ b/src/com/dre/dungeonsxl/listener/PlayerListener.java @@ -43,13 +43,28 @@ public class PlayerListener implements Listener{ Player player = event.getPlayer(); Block clickedBlock=event.getClickedBlock(); - //Block Enderchests + if(clickedBlock!=null){ + //Block Enderchests if(GameWorld.get(player.getWorld())!=null || EditWorld.get(player.getWorld())!=null){ if(event.getAction()!=Action.LEFT_CLICK_BLOCK){ if(clickedBlock.getType()==Material.ENDER_CHEST){ - p.msg(player, p.language.get("Error_Enderchest")); - event.setCancelled(true); + if(!player.isOp()){ + p.msg(player, p.language.get("Error_Enderchest")); + event.setCancelled(true); + } + } + } + } + + //Block Dispensers + if(GameWorld.get(player.getWorld())!=null){ + if(event.getAction()!=Action.LEFT_CLICK_BLOCK){ + if(clickedBlock.getType()==Material.DISPENSER){ + if(!player.isOp()){ + p.msg(player, p.language.get("Error_Dispenser")); + event.setCancelled(true); + } } } }