Accept right clicks on signs

This commit is contained in:
Daniel Saukel 2016-06-22 14:29:41 +02:00
parent 3e118f688e
commit 863e774266
3 changed files with 3 additions and 8 deletions

View File

@ -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!"),

View File

@ -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;
}

View File

@ -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.