From 6319b181c4842cbda67dad89d1dede6a55bc471d Mon Sep 17 00:00:00 2001 From: stijnb1234 Date: Thu, 27 Feb 2020 12:30:40 +0100 Subject: [PATCH] Added messages.yml, must be implemented. --- .../SBDeveloper/V10Lift/API/V10LiftAPI.java | 2 +- .../V10Lift/Commands/V10LiftCommand.java | 6 +- .../Listeners/PlayerInteractListener.java | 4 - src/main/resources/config.yml | 2 + src/main/resources/messages.yml | 154 ++++++++++++++++++ 5 files changed, 162 insertions(+), 6 deletions(-) create mode 100644 src/main/resources/messages.yml diff --git a/src/main/lombok/nl/SBDeveloper/V10Lift/API/V10LiftAPI.java b/src/main/lombok/nl/SBDeveloper/V10Lift/API/V10LiftAPI.java index fb32a5c..18ab01f 100644 --- a/src/main/lombok/nl/SBDeveloper/V10Lift/API/V10LiftAPI.java +++ b/src/main/lombok/nl/SBDeveloper/V10Lift/API/V10LiftAPI.java @@ -229,7 +229,7 @@ public class V10LiftAPI { * * @param blocks The blockset * @param block The LiftBlock - * @return 0 if added, -1 if null or doesn't exists, -2 if forbidden, -3 if already added + * @return 0 if added, -2 if forbidden, -3 if already added */ public int addBlockToLift(@Nonnull Set blocks, @Nonnull LiftBlock block) { if (getFBM().isForbidden(block.getMat())) return -2; diff --git a/src/main/lombok/nl/SBDeveloper/V10Lift/Commands/V10LiftCommand.java b/src/main/lombok/nl/SBDeveloper/V10Lift/Commands/V10LiftCommand.java index 3132a95..23bd82e 100644 --- a/src/main/lombok/nl/SBDeveloper/V10Lift/Commands/V10LiftCommand.java +++ b/src/main/lombok/nl/SBDeveloper/V10Lift/Commands/V10LiftCommand.java @@ -365,7 +365,7 @@ public class V10LiftCommand implements CommandExecutor { e.printStackTrace(); } - sender.sendMessage(ChatColor.YELLOW + "Plugin reset successful!"); + sender.sendMessage(ChatColor.YELLOW + "Plugin reloaded successfully!"); return true; } @@ -566,6 +566,10 @@ public class V10LiftCommand implements CommandExecutor { } else { OfflinePlayer wp = Bukkit.getOfflinePlayer(args[2]); wpu = wp.getUniqueId(); + if (!wp.hasPlayedBefore()) { + sender.sendMessage(ChatColor.RED + "Player " + args[2] + " not found!"); + return true; + } } String floor = null; diff --git a/src/main/lombok/nl/SBDeveloper/V10Lift/Listeners/PlayerInteractListener.java b/src/main/lombok/nl/SBDeveloper/V10Lift/Listeners/PlayerInteractListener.java index cbf23ab..587ef17 100644 --- a/src/main/lombok/nl/SBDeveloper/V10Lift/Listeners/PlayerInteractListener.java +++ b/src/main/lombok/nl/SBDeveloper/V10Lift/Listeners/PlayerInteractListener.java @@ -266,10 +266,6 @@ public class PlayerInteractListener implements Listener { if (e.getAction() != Action.RIGHT_CLICK_BLOCK) return; e.setCancelled(true); Block block = e.getClickedBlock(); - if (V10LiftPlugin.getAPI().getFBM().isForbidden(block.getType())) { - p.sendMessage(ChatColor.RED + "The material " + e.getClickedBlock().getType().toString() + " is currently not supported!"); - return; - } String liftName = DataManager.getEditPlayer(p.getUniqueId()); if (!V10LiftPlugin.getAPI().containsRope(liftName, block)) { p.sendMessage(ChatColor.RED + "This block is not part of the rope."); diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 70699ab..f919a69 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -2,6 +2,8 @@ SignText: "[v10lift]" DefectText: "&kDefect!" DisabledText: "&cDisabled" MaintenanceText: "&cMaintenance" +UpText: "&aup" +DownText: "&adown" DefectRate: 0.0 RepairItem: REDSTONE RepairAmount: 5 diff --git a/src/main/resources/messages.yml b/src/main/resources/messages.yml new file mode 100644 index 0000000..6ef810b --- /dev/null +++ b/src/main/resources/messages.yml @@ -0,0 +1,154 @@ +General: + #General + NoPermission: "&cYou don't have the permission to do this." + PlayerOnly: "&cYou have to be a player to do this." + IncorrectUsage: "&cPlease use %Command%" + InternalError: "&cInternal error!" + + #General lift + DoesntExists: "&cA lift with that name doesn't exists." + AlreadyExists: "&cA lift with that name already exists." + SwitchOnEdit: "&cFirst switch on the editor mode!" + DetectionFailed: "&cAutomatic floor detection failed!" + FloorDoesntExists: "&cThe floor %Name% doesn't exists!" + + #Control lift + NoWhitelistPermission: "&cYou can't go to that floor!" + NoFloors: "&cThis elevator has no floors!" + + #Anti break + RemoveLiftFirst: "&cYou can't do this! Remove the lift first." + RemoveRopeFirst: "&cYou can't do this! Remove the rope first." + RemoveDoorFirst: "&cYou can't do this! Remove the door first." + +Create: + AddBlocks: "&aOkay, now add all the blocks from the cab by right-clicking on the blocks.\n&aThen type: /v10lift create " + NoBlocks: "&cAdd blocks first." + Created: "&aThe lift %Name% is successfully created." + +Delete: + NotRemoved: "&cThe lift %Name% couldn't be removed." + Removed: "&aThe lift %Name% is successfully removed." + +Rename: + Renamed: "&aLift successfully renamed!" + +Edit: + StillInEditMode: "&cYou are still in editor mode." + TurnedOn: "&aEditor turned on." + TurnedOff: "&aEditor turned off." + +Floor: + ToHigh: "&cThat floor is too high!" + AlreadyExists: "&cThat floor already exists!" + DoesntExists: "&cThat floor doesn't exists!" + Added: "&aFloor successfully added!" + Removed: "&aFloor successfully removed!" + Renamed: "&aFloor successfully renamed!" + +Input: + StillAdjusting: "&cYou are still adjusting an input!" + NothingToRemove: "&cThere is no input to remove!" + AlreadyAdded: "&cThis block has already been chosen as an input. Choose another block!" + NoInput: "&cThis block is not an input. Choose another block!" + RightClick: "&aNow right click on the input block!" + Created: "&aInput created!" + Removed: "&aInput removed!" + +OfflineInput: + StillAdjusting: "&cYou are still adjusting an offline input!" + NothingToRemove: "&cThere is no offline input to remove!" + AlreadyAdded: "&cThis block has already been chosen as an offline input. Choose another block!" + NoInput: "&cThis block is not an offline input. Choose another block!" + RightClick: "&aNow right click on the offline input block!" + Created: "&aOffline input created!" + Removed: "&aOffline input removed!" + +Build: + Disabled: "&aConstruction mode disabled!" + Enabled: "&aNow right-click on the elevator blocks!\n&aThen do /v10lift build to save it!" + BlockAdded: "&aBlock added to the elevator." + BlockRemoved: "&6Block removed from the elevator." + BlacklistedMaterial: "&cThe material %Name% cannot be used!" + +Rope: + StillAdjusting: "&cYou are still adjusting a rope." + OnlyUp: "&cA rope can only go up!" + OnlyOneMaterial: "&cThe rope must be of the same material!" + AlreadyARope: "&cPart of the rope is already part of another rope!" + NotARope: "&cThis block is not part of the rope." + BlacklistedMaterial: "&cThe rope is build of blacklisted blocks!" + Add: "&aNow right-click on the beginning and the end of the rope." + Delete: "&aNow right-click on the rope." + ClickOnEnd: "&6Now right-click on the end of the rope!" + PartRemoved: "&6Start removed!\n&6Now right-click on the end of the rope!" + Created: "&aRope created." + Removed: "&aRope removed." + +Door: + BlacklistedMaterial: "&cThe material %Name% is currently not supported!" + Disabled: "&aDoor editor mode disabled!" + Enabled: "&aNow right-click on the door blocks! (If it are real doors, click on the bottom block)\n&aThen do /v10lift door to save it." + Created: "&aDoor created." + Removed: "&6Door removed." + +Whitelist: + Group: + VaultNotFound: "&cYou can't add a group when Vault is not found." + NotFound: "&cThe group %Name% is not found." + AlreadyContains: "&cWhitelist already contains this group!" + DoesntContains: "&cWhitelist doesn't contain this group!" + Added: "&aGroup added to whitelist!" + Removed: "&aGroup removed from whitelist!" + Player: + NotFound: "&cThe player %Name% is not found." + AlreadyContains: "Whitelist already contains this user!" + DoesntContains: "&cWhitelist doesn't contain this user!" + Added: "&aUser added to whitelist!" + Removed: "&aUser removed from whitelist!" + +Whois: + NotALift: "&cThis block is not part of a lift." + WithoutName: "&aNow right-click on the block you want to check." + +Speed: + WrongSpeed: "&cThe speed %Speed% is incorrect." + Changed: "&aLift speed changed!" + +Sound: + TurnedOn: "&aSound mode turned on!" + TurnedOff: "&aSound mode turned off!" + +Realistic: + TurnedOn: "&aRealistic mode turned on!" + TurnedOff: "&aRealistic mode turned off!" + +Disable: + AlreadyDefective: "&cThis lift is already defective!" + Disabled: "&aLift disabled!" + +Repair: + NotDefective: "&cThis lift isn't defective!" + ItemsNeeded: "&cYou need %Amount%x %ItemName%!" + Repaired: "&aLift repaired!" + +Abort: + NothingToCancel: "&cOops! You can't cancel anything." + Cancelled: "&6Cancelled." + +Reload: + Reloaded: "&6Plugin reloaded successfully!" + +Start: + NonPlayer: "&cPlease give a name as non-player!" + Started: "&aLift %Name% started." + +Stop: + NonPlayer: "&cPlease give a name as non-player!" + NoMovingTasks: "&cLift %Name% doesn't contain any movingtasks!" + Started: "&aLift %Name% stopped." + +LiftSign: + NoName: "&cNo lift name given!" + Created: "&aLift sign created!" + Removed: "&6Lift sign removed!" \ No newline at end of file