From 9fd16290c050f9d552a777a6d8ce5362dd7f2003 Mon Sep 17 00:00:00 2001 From: Thijs Wiefferink Date: Sun, 22 Feb 2015 23:16:37 +0100 Subject: [PATCH] Fix some unclear and wrong messages in the language file Thanks to qlick for suggesting these language changes. Also fixes a bug with the '/as info player' command, would cause an error if a region has an incorrect UUID as owner or an UUID without name. --- lang/EN.yml | 60 +++++++++---------- src/nl/evolutioncoding/areashop/AreaShop.java | 9 ++- 2 files changed, 37 insertions(+), 32 deletions(-) diff --git a/lang/EN.yml b/lang/EN.yml index 11e5288..efb043a 100644 --- a/lang/EN.yml +++ b/lang/EN.yml @@ -16,7 +16,7 @@ cmd-weOnlyByPlayer: "Using a WorldEdit selection is only possible as a player, s cmd-noSelection: "You don't have a WorldEdit selection." cmd-noRegionsFound: "No regions registered in AreaShop are found in your selection." cmd-noWERegionsFound: "No WorldEdit regions intersecting your selection are found." -cmd-notRegistered: "%0% is not registered in AreaShop." +cmd-notRegistered: "The specified region is not registered: %0%." cmd-noRegionsAtLocation: "No regions found at your location, specify the region as argument." cmd-moreRegionsAtLocation: "More than one region has been found at your location, specify the region as argument." cmd-automaticRegionOnlyByPlayer: "Automatically determining the region is only possible for players, specify the region as argument." @@ -96,8 +96,8 @@ buy-restrictedToRegion: "You need to be inside '%0%' to buy it." unrent-help: "/as unrent [regionname], the region you stand in will be used if not specified." unrent-noPermission: "You don't have permission to unrent a region." unrent-noPermissionOther: "You don't have permission to unrent another region." -unrent-notRegistered: "The region can't be unrent because it is not registered for renting." -unrent-notRented: "The region can't be unrent because it is not rented." +unrent-notRegistered: "The region can't be unrented because it is not registered for renting." +unrent-notRented: "The region can't be unrented because it is not rented." unrent-unrented: "Your region has been unrented." unrent-other: "The region has been unrented for player %0%." unrent-expired: "Your rent of %0% has expired." @@ -154,9 +154,9 @@ info-regionReselPrice: "&2&l►&r Resell price: &7%resellprice% (you can buy it info-regionFriends: "&2&l►&r Added friends: &7%friends%." info-regionMoneyBackBuy: "&2&l►&r Selling payback: &7%moneyback% (%moneybackpercent%% of the price)." info-regionMoneyBackRent: "&2&l►&r Unrenting payback: &7%moneyback% (%moneybackpercent%% of the remaining time)." -info-regionMaxExtends: "&2&l►&r Maximum number of extends: &7%maxextends% time(s)." +info-regionMaxExtends: "&2&l►&r Maximum number of extensions: &7%maxextends% time(s)." info-regionNoExtending: "&2&l►&r Rent cannot be extended." -info-regionExtendsLeft: "&2&l►&r Extending left: &7%extendsleft% time(s) out of %maxextends%." +info-regionExtendsLeft: "&2&l►&r Extensions left: &7%extendsleft% time(s) out of %maxextends%." info-regionMaxRentTime: "&2&l►&r In advance renting: &7%maxrenttime% at maximum." info-regionNoTeleport: "&2&l►&r Teleport location not set%0%." info-regionTeleportHint: " &7(use '/as settp' for a better spot)" @@ -166,10 +166,10 @@ info-regionSignLocation: "&7(%0%, %1%, %2%, %3%)&r" info-regionGroups: "&2&l►&r Assigned groups: &7%0%." info-regionInactiveUnrent: "&2&l►&r Auto unrent after: &7%inactivetime% of inactivity by the player." info-regionInactiveSell: "&2&l►&r Auto sell after: &7%inactivetime% of inactivity by the player." -info-regionRestrictedRegionRent: "&2&l►&r To rent this region you need to be inside it." -info-regionRestrictedWorldRent: "&2&l►&r To rent this region you need to be inside world '%world%'." -info-regionRestrictedRegionBuy: "&2&l►&r To buy this region you need to be inside it." -info-regionRestrictedWorldBuy: "&2&l►&r To buy this region you need to be inside world '%world%'." +info-regionRestrictedRegionRent: "&2&l►&r You must be inside this region to rent it." +info-regionRestrictedWorldRent: "&2&l►&r You need to be inside world '%world%' to rent this region." +info-regionRestrictedRegionBuy: "&2&l►&r You must be inside this region to buy it." +info-regionRestrictedWorldBuy: "&2&l►&r You need to be inside world '%world%' to buy this region." info-regionRestoringRent: "&2&l►&r Restoring is enabled &7(region will reset at unrent)%0%." info-regionRestoringBuy: "&2&l►&r Restoring is enabled &7(region will reset at sell)%0%." info-regionRestoringProfile: " (profile: %0%)" @@ -180,25 +180,25 @@ info-regionRestore: "Restoring enabled: &7%0%." info-regionRestoreProfile: "Restoring profile: &7%0%." info-regionTPLocation: "Teleport location: &7World=%0%, X=%1%, Y=%2%, Z=%3%, Pitch=%4%, Yaw=%5%." info-regionNoTP: "No teleport location set." -info-regionNotExisting: "Region %0% is not registered." +info-regionNotExisting: "The specified region is not registered: %0%." setrestore-help: "/as setrestore [profile]." setrestore-noPermission: "You don't have permission to change the restore settings." -setrestore-notRegistered: "%0% is not registered." +setrestore-notRegistered: "The specified region is not registered: %0%." setrestore-invalidSetting: "'%0%' is not a valid state, should be true, false or general." setrestore-success: "Successfully set the restore setting of %0% to '%1%'." setrestore-successProfile: "Successfully set the restore setting of %0% to '%1%' and the profile to '%2%'." setprice-noPermission: "You don't have permission to change the price of a region." setprice-help: "/as setprice [region], the region you stand in will be used if not specified." -setprice-notRegistered: "%0% is not registered in AreaShop." +setprice-notRegistered: "The specified region is not registered: %0%." setprice-wrongPrice: "'%0%' is not a valid price." setprice-successRent: "Price of region %0% changed to %1% per %2%." setprice-successBuy: "Price of region %0% changed to %1%." setduration-noPermission: "You don't have permission to change the duration of a rent." setduration-help: "/as setduration [region], the region you stand in will be used if not specified." -setduration-notRegistered: "%0% is not registered as a rent." +setduration-notRegistered: "%0% is not registered for renting." setduration-wrongAmount: "'%0%' is not a valid amount, use a whole number." setduration-wrongFormat: "'%0%' is not a proper timeformat, check the documentation on Bukkit." setduration-success: "Duration of region %0% changed to '%1%'." @@ -210,36 +210,36 @@ setup-alreadyBuySign: "The region you specified is already added to AreaShop as setup-noDuration: "You did not specify how long the region can be rented, do this on the third line." setup-wrongDuration: "The time specified is not in the correct format, example: 1 day." setup-noPrice: "You did not specify the price on the fourth line." -setup-wrongPrice: "You did not specify the price correctly, use a number only." +setup-wrongPrice: "You did not specify the price correctly, use numbers only." setup-rentSuccess: "Renting of region %0% is setup correctly." setup-buySuccess: "Buying of region %0% is setup correctly." -setup-noPermissionRent: "You don't have permission for setting up renting of regions." -setup-noPermissionBuy: "You don't have permission for setting up buying of regions." +setup-noPermissionRent: "You don't have permission for setting up rental regions." +setup-noPermissionBuy: "You don't have permission for setting up buy regions." setup-couldNotDetect: "Found multiple regions with the same priority and/or parent/child relation, specify one on the second line (2 of the regions that were found: %0% and %1%)." setup-blacklisted: "%0% is on the blacklist and cannot be added to AreaShop." -destroy-noPermissionRent: "You don't have permission for destroying a sign for renting a region." -destroy-noPermissionBuy: "You don't have permission for destroying a sign for buying a region." -destroy-successRent: "Renting of %0% successfully removed." -destroy-successBuy: "Buying of %0% successfully removed." +destroy-noPermissionRent: "You don't have permission for deregistering a rental region." +destroy-noPermissionBuy: "You don't have permission for deregistering a buy region." +destroy-successRent: "%0% successfully deregistered as rental region." +destroy-successBuy: "%0% successfully deregistered as buy region." teleport-help: "/as tp [sign]." -teleport-noRentOrBuy: "Region '%0%' is not registered as rent or buy." +teleport-noRentOrBuy: "The specified region is not registered: %0%." teleport-noPermission: "You don't have permission to teleport to your region." teleport-noPermissionOther: "You don't have permission to teleport to regions you do not own." teleport-noPermissionSign: "You don't have permission to teleport to the sign of your region." teleport-noPermissionOtherSign: "You don't have permission to teleport to signs of regions you do not own." -teleport-noPermissionFriend: "You don't have permission to teleport to regions you are added as friend." -teleport-noPermissionFriendSign: "You don't have permission to teleport to the sign of region you are added as friend." +teleport-noPermissionFriend: "You don't have permission to teleport to regions you are added to as a friend." +teleport-noPermissionFriendSign: "You don't have permission to teleport to the sign of regions you are added to as a friend." teleport-success: "You teleported to %0%." teleport-successSign: "You teleported to the sign of %0%." teleport-noSafe: "No safe position found in region %0%, no spots in region left or maximum tries exceeded (%1%/%2%)." -teleport-blocked: "You can't teleport because the position is outside the region and you are forced to teleport inside." +teleport-blocked: "You can't teleport because the position is outside the region, and you are forced to teleport inside." setteleport-help: "/as settp [region] [reset], the region you stand in will be used if not specified." setteleport-noPermission: "You don't have permission to set the teleport location." setteleport-noPermissionOther: "You don't have permission to set the teleport location for a region you do not own." -setteleport-noRentOrBuy: "Region '%0%' is not registered as rent or buy." +setteleport-noRentOrBuy: "The specified region is not registered: %0%." setteleport-success: "Teleport location of %0% set." setteleport-notInside: "The location has to be inside the region." setteleport-reset: "Teleport location of %0% has been reset." @@ -295,7 +295,7 @@ add-specifyWorld: "Specify the world of the region when using from console." add-incorrectWorld: "World '%0%' not found, try again (case-sensitive)." add-noRegion: "Region '%0%' does not exist in this world." -del-noRegion: "Region '%0%' is not registered in AreaShop." +del-noRegion: "The specified region is not registered: %0%." del-noPermission: "You don't have permission to remove regions." del-success: "Removed regions: &7%0%." del-failed: "No permission to remove or not registered: &7%0%." @@ -325,8 +325,8 @@ me-rentRegions: "You have rented the following regions:" me-buyRegions: "You have bought the following regions:" me-rentLine: "&2&l►&r %region% until %until% &7(%timeleft% left)." me-buyLine: "&2&l►&r %region%." -me-noFriendRegions: "You have not been added to regions as friend." -me-friendRegions: "You are added as friend to the following regions:" +me-noFriendRegions: "You have not been added to any regions as friend." +me-friendRegions: "You are added as a friend to the following regions:" me-friendLine: "&2&l►&r %region% &7(owner: %player%)." setowner-help: "/as setowner [region], the region you stand in will be used if not specified." @@ -341,7 +341,7 @@ setowner-succesBuy: "Owner of %region% successfully changed to %player%." resell-help: "/as resell [region], the region you stand in will be used if not specified." resell-wrongPrice: "'%0%' is not a valid price." -resell-notRegistered: "%0% is not registered in AreaShop." +resell-notRegistered: "The specified region is not registered: %0%." resell-noRegionFound: "No AreaShop region could be found at your location, try specifying the region as argument." resell-notBought: "You can't resell %region% because it is not sold yet." resell-success: "%region% is successfully put into reselling mode for %resellprice%." @@ -349,7 +349,7 @@ resell-noPermission: "You don't have permission to set your region in reselling resell-noPermissionOther: "You don't have permission to set regions in reselling mode." stopresell-help: "/as stopresell [region], the region you stand in will be used if not specified." -stopresell-notRegistered: "%0% is not registered in AreaShop." +stopresell-notRegistered: "The specified region is not registered: %0%." stopresell-noRegionFound: "No AreaShop region could be found at your location, try specifying the region as argument." stopresell-notResell: "You can't stop reselling %region% because it is not in resell mode." stopresell-success: "%region% is successfully put back into sold mode." diff --git a/src/nl/evolutioncoding/areashop/AreaShop.java b/src/nl/evolutioncoding/areashop/AreaShop.java index 959421a..c015bd3 100644 --- a/src/nl/evolutioncoding/areashop/AreaShop.java +++ b/src/nl/evolutioncoding/areashop/AreaShop.java @@ -558,9 +558,14 @@ public final class AreaShop extends JavaPlugin { */ public String toName(UUID uuid) { if(uuid == null) { - return null; + return ""; } else { - return Bukkit.getOfflinePlayer(uuid).getName(); + String name = Bukkit.getOfflinePlayer(uuid).getName(); + if(name != null) { + return name; + } else { + return uuid.toString(); + } } }