From 863e7742664058fae9bf8439d7b8a9e3ff492322 Mon Sep 17 00:00:00 2001 From: Daniel Saukel Date: Wed, 22 Jun 2016 14:29:41 +0200 Subject: [PATCH] Accept right clicks on signs --- .../java/io/github/dre2n/dungeonsxl/config/DMessages.java | 1 - .../github/dre2n/dungeonsxl/listener/PlayerListener.java | 8 ++------ src/main/resources/plugin.yml | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/java/io/github/dre2n/dungeonsxl/config/DMessages.java b/src/main/java/io/github/dre2n/dungeonsxl/config/DMessages.java index db8006dc..3d3ddf4c 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/config/DMessages.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/config/DMessages.java @@ -63,7 +63,6 @@ public enum DMessages implements Messages { ERROR_LEAVE_DUNGEON("Error_LeaveDungeon", "&4You have to leave your current dungeon first!"), ERROR_LEAVE_GAME("Error_LeaveGame", "&4You have to leave your current game first!"), ERROR_LEAVE_GROUP("Error_LeaveGroup", "&4You have to leave your group first!"), - ERROR_LEFT_CLICK("Error_Leftklick", "&4You have to use Left-Click on this sign!"), ERROR_MSG_ID_NOT_EXIST("Error_MsgIdNotExist", "&4Messages with Id &6&v1&4 does not exist!"), ERROR_MSG_FORMAT("Error_MsgFormat", "&4The Messages has to be between \"!"), ERROR_MSG_NO_INT("Error_MsgNoInt", "&4The argument [id] has to include a number!"), diff --git a/src/main/java/io/github/dre2n/dungeonsxl/listener/PlayerListener.java b/src/main/java/io/github/dre2n/dungeonsxl/listener/PlayerListener.java index 79b554b8..4ad92df4 100644 --- a/src/main/java/io/github/dre2n/dungeonsxl/listener/PlayerListener.java +++ b/src/main/java/io/github/dre2n/dungeonsxl/listener/PlayerListener.java @@ -279,10 +279,8 @@ public class PlayerListener implements Listener { // Trigger InteractTrigger InteractTrigger trigger = InteractTrigger.getByBlock(clickedBlock, gameWorld); if (trigger != null) { - if (event.getAction() == Action.LEFT_CLICK_BLOCK) { + if (event.getAction() == Action.LEFT_CLICK_BLOCK || event.getAction() == Action.RIGHT_CLICK_BLOCK) { trigger.onTrigger(player); - } else { - MessageUtil.sendMessage(player, DMessages.ERROR_LEFT_CLICK.getMessage()); } } @@ -290,10 +288,8 @@ public class PlayerListener implements Listener { for (Sign classSign : gameWorld.getSignClass()) { if (classSign != null) { if (classSign.getLocation().distance(clickedBlock.getLocation()) < 1) { - if (event.getAction() == Action.LEFT_CLICK_BLOCK) { + if (event.getAction() == Action.LEFT_CLICK_BLOCK || event.getAction() == Action.RIGHT_CLICK_BLOCK) { dPlayer.setDClass(ChatColor.stripColor(classSign.getLine(1))); - } else { - MessageUtil.sendMessage(player, DMessages.ERROR_LEFT_CLICK.getMessage()); } return; } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 83bb3d74..36c167d2 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -4,7 +4,7 @@ version: ${project.version} authors: [Frank Baumann, Milan Albrecht, Tobias Schmitz, Daniel Saukel] description: ${project.description} website: ${project.url} -softdepend: [BlueRoseCommons, CommandsXL, ItemsXL, Vault, CustomMobs, InsaneMobs, MythicMobs] +softdepend: [BlueRoseCommons, CommandsXL, ItemsXL, Vault, CustomMobs, InsaneMobs, MythicMobs, HolographicDisplays] commands: dungeonsxl: description: Reference command for DungeonsXL.