mirror of
https://github.com/md5sha256/AreaShop.git
synced 2026-11-06 17:32:43 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
064b129205 | ||
|
|
8111387f32 | ||
|
|
a4b23bebba | ||
|
|
7421e685fa | ||
|
|
374b68d8fa | ||
|
|
ca7a9664f3 | ||
|
|
e957b4fc73 | ||
|
|
6493bc4f78 | ||
|
|
2db1b6a243 | ||
|
|
864662a3c4 | ||
|
|
59b960b87c | ||
|
|
2de653d73f | ||
|
|
4feee59834 | ||
|
|
816d136a62 | ||
|
|
121de7dc7e | ||
|
|
f7c86881cc | ||
|
|
351d51b664 | ||
|
|
5a28476cf0 | ||
|
|
8143bdae27 | ||
|
|
b62744fe10 | ||
|
|
fe0b63c760 | ||
|
|
def774c7a1 | ||
|
|
7c5cb5f5aa | ||
|
|
8af6e1d6f1 | ||
|
|
e0e6c39dae | ||
|
|
dabe46bd47 | ||
|
|
ec478a05d1 | ||
|
|
e21c0aafde | ||
|
|
52bf88f4a5 | ||
|
|
e4de560a65 | ||
|
|
6481da29e4 | ||
|
|
f287cc91a6 | ||
|
|
95b7b50346 | ||
|
|
21db2ff440 | ||
|
|
36dd978a92 | ||
|
|
6cc3f2a52f | ||
|
|
852731b1ad | ||
|
|
30faa77da9 | ||
|
|
ec57b922b8 | ||
|
|
c2bcc6008b | ||
|
|
72a05bedce | ||
|
|
bc73a8b20d | ||
|
|
832e8218b6 | ||
|
|
6fcb629133 | ||
|
|
7d6a1f35c1 | ||
|
|
60257d45c2 | ||
|
|
2300227d87 | ||
|
|
b1852b10bb | ||
|
|
88fdb0c3fc | ||
|
|
491e55fc77 | ||
|
|
c7b0a2c663 | ||
|
|
868f4d6b58 | ||
|
|
0d4b034181 | ||
|
|
5f20689ba3 | ||
|
|
38b658fccf | ||
|
|
28ed20c0b5 | ||
|
|
aaff36b2eb | ||
|
|
49b536cab0 | ||
|
|
9a9969dea3 | ||
|
|
84e4b49bfd | ||
|
|
6daaf6997d | ||
|
|
c445a62334 | ||
|
|
0d205b0d9e | ||
|
|
8c33826c2c | ||
|
|
51e1dbafb7 | ||
|
|
6edad3faff | ||
|
|
f89e0f861b | ||
|
|
770b1d98df | ||
|
|
8e5baa47af | ||
|
|
367466735e | ||
|
|
ade6bc3971 | ||
|
|
05fd8c0156 | ||
|
|
5403472476 | ||
|
|
c4ee7bc7aa | ||
|
|
940f1969b6 | ||
|
|
07eb5477b8 | ||
|
|
a4112092b5 | ||
|
|
872d81b0a9 | ||
|
|
b04871c553 | ||
|
|
fd1b8fba4c | ||
|
|
991e7b1961 | ||
|
|
aac963325a | ||
|
|
3e7c7ce76b | ||
|
|
c858d30481 | ||
|
|
b090fd5577 | ||
|
|
8d132c66c4 | ||
|
|
50e3e59543 | ||
|
|
eb21b9567e | ||
|
|
4dba305f6d | ||
|
|
7481d8287f | ||
|
|
4d41decbe5 | ||
|
|
7fc5a5af81 | ||
|
|
d26fa99b95 | ||
|
|
39d755d2db | ||
|
|
48ab46ecf7 | ||
|
|
b3fa31e1cc | ||
|
|
783085fbf7 | ||
|
|
aa093b0c8a | ||
|
|
9c357fe929 | ||
|
|
4d70571a23 | ||
|
|
29a4105ece | ||
|
|
edc7136063 | ||
|
|
6fabc75be4 | ||
|
|
085507bf8b | ||
|
|
73ed3366ae | ||
|
|
9ca029176d | ||
|
|
bf181d69d7 | ||
|
|
68c57515da | ||
|
|
903d6c309f | ||
|
|
0a02eb3254 | ||
|
|
bf04589fab | ||
|
|
14dd094803 | ||
|
|
02df35304c | ||
|
|
4321667ec5 | ||
|
|
5cf5df78c8 | ||
|
|
8608d6ce1d | ||
|
|
614336862e | ||
|
|
a4ea175f1b | ||
|
|
c96043aa38 | ||
|
|
d5a29f6c32 | ||
|
|
5176a1c2c5 | ||
|
|
89569ea182 | ||
|
|
f349657a59 | ||
|
|
40d3d4d8af | ||
|
|
0d5db8fa4e | ||
|
|
25c56e8ecb | ||
|
|
9f436a7eb4 | ||
|
|
f76c1b8a9f | ||
|
|
d466658f36 | ||
|
|
04e02c4ce4 | ||
|
|
3bf493109c | ||
|
|
2f9b6d3987 | ||
|
|
93d5612513 | ||
|
|
937db4620d | ||
|
|
a0239b8837 | ||
|
|
401f52e687 | ||
|
|
2f6874a16e | ||
|
|
c95f4e1c6c | ||
|
|
1a2d755727 | ||
|
|
c489e6eba4 | ||
|
|
b1a56b5230 | ||
|
|
dfbc7805b5 | ||
|
|
8f2c95f5c4 | ||
|
|
0b9bffe68f | ||
|
|
7ac6e34c89 | ||
|
|
5231f6e86e | ||
|
|
791b696aff | ||
|
|
c92bc716dc | ||
|
|
463b34e952 | ||
|
|
ff6e69196d | ||
|
|
76ad952bb6 | ||
|
|
0cdff5e143 | ||
|
|
9dc3013215 | ||
|
|
796b95c9f9 | ||
|
|
2785a72457 | ||
|
|
c2df0cd912 | ||
|
|
4cd32a0792 | ||
|
|
354e70af57 | ||
|
|
fde60e2a27 | ||
|
|
d1a3027e0b | ||
|
|
4e57f03fc0 | ||
|
|
83d4efc3a8 | ||
|
|
1395afffe9 | ||
|
|
5094d39a96 | ||
|
|
e664c1efd9 | ||
|
|
871eeed29c | ||
|
|
0d56762bfc | ||
|
|
c08763883f | ||
|
|
efb534f131 | ||
|
|
d9405a9f49 | ||
|
|
684add89cd | ||
|
|
d1848c0728 | ||
|
|
9fd16290c0 | ||
|
|
3bbca11cc9 | ||
|
|
b1be87014f | ||
|
|
badcd77cfe | ||
|
|
779d340bbb | ||
|
|
4e5061ba54 | ||
|
|
b0f3bdc560 | ||
|
|
5c9fdb6cc9 | ||
|
|
23ea679cd9 | ||
|
|
58680c8cc4 | ||
|
|
75b752a235 | ||
|
|
fb51da84ae | ||
|
|
22d214e59d | ||
|
|
175b531eb5 | ||
|
|
52591d3b6e | ||
|
|
825074479c | ||
|
|
cc8cf1e560 | ||
|
|
a4169d127e | ||
|
|
21340af89f | ||
|
|
db06eae6c9 | ||
|
|
5bae5ecf67 | ||
|
|
679ffe2145 | ||
|
|
e6c5653073 | ||
|
|
ea31dfdd65 | ||
|
|
9da31fed1f | ||
|
|
9baf0b7eec | ||
|
|
a14dc4e541 | ||
|
|
00d3256716 | ||
|
|
40338b66df | ||
|
|
715bbfd9e3 | ||
|
|
b679c49405 | ||
|
|
dd0930bcea | ||
|
|
5b961564e1 | ||
|
|
c12314fa98 | ||
|
|
e23ad74744 | ||
|
|
9957e02e65 | ||
|
|
07ea919aba | ||
|
|
2c1771cc52 | ||
|
|
83778ff803 | ||
|
|
0c79525144 | ||
|
|
e719930364 | ||
|
|
5568ee240b | ||
|
|
46abc8f83d | ||
|
|
cf3139f373 | ||
|
|
59627e1b97 | ||
|
|
a25b5a5752 | ||
|
|
aceb6945fd | ||
|
|
cbeffe9316 | ||
|
|
9ea97fdb5d | ||
|
|
ed1f73fdd7 | ||
|
|
09af826f88 | ||
|
|
1fd24d864d | ||
|
|
4125364a96 | ||
|
|
a6f5a2eb5e | ||
|
|
5eae75fef1 | ||
|
|
7982531e63 | ||
|
|
6ce15b27b7 | ||
|
|
b1809fb265 | ||
|
|
0344391588 |
No files matched your search
+33
@@ -0,0 +1,33 @@
|
||||
# Maven stuff
|
||||
/target
|
||||
|
||||
*.pydevproject
|
||||
.project
|
||||
.metadata
|
||||
bin/
|
||||
tmp/
|
||||
*.tmp
|
||||
*.bak
|
||||
*.swp
|
||||
*~.nib
|
||||
local.properties
|
||||
.classpath
|
||||
.settings/
|
||||
.loadpath
|
||||
|
||||
# External tool builders
|
||||
.externalToolBuilders/
|
||||
|
||||
# Locally stored "Eclipse launch configurations"
|
||||
*.launch
|
||||
|
||||
# CDT-specific
|
||||
.cproject
|
||||
|
||||
# PDT-specific
|
||||
.buildpath
|
||||
|
||||
# IntelliJ IDEA
|
||||
*.iml
|
||||
.idea
|
||||
dependency-reduced-pom.xml
|
||||
@@ -0,0 +1 @@
|
||||
/target
|
||||
@@ -1,194 +0,0 @@
|
||||
##############################################
|
||||
# config.yml of the AreaShop plugin #
|
||||
# This plugin has been created by NLThijs48 #
|
||||
# Check the server minecraft.go-craft.com #
|
||||
# and then the Survival server for a demo #
|
||||
##############################################
|
||||
|
||||
########## GENERAL ##########
|
||||
## Chatprefix used for all messages in the chat. Also check the 'greeting' lines in the 'flagProfiles' section,
|
||||
## these also contain the prefix and you may want to change those to
|
||||
chatPrefix: '&2[AreaShop]&r '
|
||||
## The characters used for the prices of regions, will appear before the number, for the euro character use '%euro%'
|
||||
moneyCharacter: '$'
|
||||
## The characters used after a currency number, '%euro%' will become the euro character
|
||||
moneyCharacterAfter: ''
|
||||
## Enables / disables debug messages in the console, no need to change
|
||||
debug: false
|
||||
## The .yml language file that should be used, provided by this plugin: EN, NL
|
||||
language: EN
|
||||
## Enable Schematic saving and restoring in general
|
||||
enableSchematics: true
|
||||
## Maximum number of blocks to save to or restore from a .schemetic
|
||||
maximumBlocks: 1000000
|
||||
## Maximum number of locations the teleport function should check to find a safe spot
|
||||
maximumTries: 50000
|
||||
## Enable sending stats to http://mcstats.org/ (Metrics plugin)
|
||||
sendStats: true
|
||||
## Use colors when sending messages to console and log files
|
||||
useColorsInConsole: false
|
||||
## Post error messages in the console when a command run from the config fails (from the 'runCommands' section for example)
|
||||
postCommandErrors: true
|
||||
## Version of the config, do not change!
|
||||
version: 2.0.0
|
||||
## The different tags you can write on the sign to trigger the plugin
|
||||
signTags:
|
||||
## Tag for adding a rent region
|
||||
rent: '[rent]'
|
||||
## Tag for adding a buy region
|
||||
buy: '[buy]'
|
||||
## Tag for adding a sign to an existing region
|
||||
add: '[as]'
|
||||
## Configure the max total regions, max rent regions and max buy regions with different groups (-1 is unlimited)
|
||||
## Assign a group to players by giving them the permission 'areashop.limits.<group>'
|
||||
## Every player already has the group 'default' and ops have the unlimited group
|
||||
## If a player has multiple groups the highest numbers are used
|
||||
limitGroups:
|
||||
default:
|
||||
total: 1
|
||||
rents: 1
|
||||
buys: 1
|
||||
unlimited:
|
||||
total: -1
|
||||
rents: -1
|
||||
buys: -1
|
||||
## Below are profiles for the signs, you can assign profiles to regions
|
||||
## by setting 'general.signProfile' in default.yml, groups or individual regions
|
||||
signProfiles:
|
||||
default:
|
||||
## Below is the format for each sign state, the following tags can be used for signs and commands:
|
||||
## %region%, %player%, %uuid%, %price%, %duration%, %world%, %type%, %until%, %untilshort%
|
||||
## The following sections can be added for performing certain commands when the sign is clicked:
|
||||
## rightClickPlayer, rightClickConsole, shiftRightClickPlayer, shiftRightClickConsole,
|
||||
## leftClickPlayer, leftClickConsole, shiftLeftClickPlayer, shiftLeftClickConsole
|
||||
## Sections with 'Player' at the end will be run by the clicking player and 'Console' ones from the console
|
||||
forrent:
|
||||
line1: '&2&l[For Rent]'
|
||||
line2: '%region%'
|
||||
line3: '%duration%'
|
||||
line4: '%price%'
|
||||
rightClickPlayer:
|
||||
- 'as rent %region%'
|
||||
leftClickPlayer:
|
||||
- 'as info region %region%'
|
||||
rented:
|
||||
line1: '&4&l[Rented]'
|
||||
line2: '%region%'
|
||||
line3: '%player%'
|
||||
line4: '%untilshort%'
|
||||
rightClickPlayer:
|
||||
- 'as rent %region%'
|
||||
leftClickPlayer:
|
||||
- 'as info region %region%'
|
||||
shiftRightClickPlayer:
|
||||
- 'as unrent %region%'
|
||||
forsale:
|
||||
line1: '&2&l[For Sale]'
|
||||
line2: '%region%'
|
||||
line3: '%price%'
|
||||
line4:
|
||||
rightClickPlayer:
|
||||
- 'as buy %region%'
|
||||
leftClickPlayer:
|
||||
- 'as info region %region%'
|
||||
sold:
|
||||
line1: '&4&l[Sold]'
|
||||
line2: '%region%'
|
||||
line3: '%player%'
|
||||
line4:
|
||||
rightClickPlayer:
|
||||
- 'as buy %region%'
|
||||
leftClickPlayer:
|
||||
- 'as info region %region%'
|
||||
shiftRightClickPlayer:
|
||||
- 'as sell %region%'
|
||||
## Option to run certain commands when one of these events happen
|
||||
## Commands at a 'before' section will execute before the region details are changed in the AreaShop system
|
||||
## and before any other actions occurred (changing signs, saving/loading schematics, etc.),
|
||||
## the 'after' commands will be run when all changes are done.
|
||||
## After 'before' or 'after' you can create a list of commands (see example at the created event)
|
||||
eventCommandProfiles:
|
||||
default:
|
||||
created:
|
||||
before:
|
||||
after:
|
||||
## - "say An AreaShop region has been created: %region%"
|
||||
deleted:
|
||||
before:
|
||||
after:
|
||||
rented:
|
||||
before:
|
||||
after:
|
||||
extended:
|
||||
before:
|
||||
after:
|
||||
unrented:
|
||||
before:
|
||||
after:
|
||||
bought:
|
||||
before:
|
||||
after:
|
||||
sold:
|
||||
before:
|
||||
after:
|
||||
## For the following events you can specify if you want to restore or save the region to a schematic
|
||||
## After 'save:' or 'restore:' you enter the name of the file, %region% will be replaced by the region name (.schematic will be added automatically)
|
||||
## %type% represents the type of the region, could be 'rent' or 'buy'
|
||||
## If your regions are all the same size you could use just 1 file as the restore file, just enter a name without %region%
|
||||
## Be carefull with these options, it could crash your server or destroy (parts of) your world if used wrong!
|
||||
schematicProfiles:
|
||||
default:
|
||||
created:
|
||||
save: '%type%-%region%'
|
||||
restore: ''
|
||||
deleted:
|
||||
save: ''
|
||||
restore: '%type%-%region%'
|
||||
rented:
|
||||
save: ''
|
||||
restore: ''
|
||||
unrented:
|
||||
save: ''
|
||||
restore: '%type%-%region%'
|
||||
bought:
|
||||
save: ''
|
||||
restore: ''
|
||||
sold:
|
||||
save: ''
|
||||
restore: '%type%-%region%'
|
||||
## Flag profiles to specify what flags should be set on the WorldGuard regions
|
||||
## All region flags can be used + members, owners, priority and parent.
|
||||
flagProfiles:
|
||||
default:
|
||||
forrent:
|
||||
members: -%player%
|
||||
greeting: '&2[AreaShop]&f %region% can be rented for %price% per %duration%'
|
||||
rented:
|
||||
members: +%player%
|
||||
greeting: '&2[AreaShop]&f %region% is rented by %player% until %until%'
|
||||
forsale:
|
||||
members: -%player%
|
||||
greeting: '&2[AreaShop]&f %region% can be bought for %price%'
|
||||
sold:
|
||||
members: +%player%
|
||||
greeting: '&2[AreaShop]&f %region% is bought by %player%'
|
||||
|
||||
|
||||
########## RENTING ##########
|
||||
## How much seconds between checking if renting has expired (don't put this to low)
|
||||
checkDelay: 60
|
||||
## Timeformat to use on the signs, default is like '30-06 14:52', US format: 'MM-dd KK:mm a'
|
||||
## Search for 'java SimpleDateFormat' for more options and documentation
|
||||
timeFormatSign: 'dd-MM HH:mm'
|
||||
## Timeformat used in the chat, default is like '30 june 2014 14:52', US format: 'MMMMMMMMMMMMMMMMM dd yyyy KK:mm a'
|
||||
## Search for 'java SimpleDateFormat' for more options and documentation
|
||||
timeFormatChat: 'dd MMMMMMMMMMMMMMMMM yyyy HH:mm'
|
||||
## Time indicators, used for specifing rent duration on the signs
|
||||
## Be careful with deleting words, will break signs using those, adding is no problem
|
||||
minutes: [m, min, mins, minute, minutes, minuten, minuut]
|
||||
hours: [h, hour, hours, uur, uren]
|
||||
days: [d, day, days, dag, dagen]
|
||||
months: [M, month, months, maanden, maand]
|
||||
years: [y, year, years, jaar, jaren]
|
||||
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
### All settings below are default settings and can be overridden
|
||||
### by group settings or region settings (copy a section to a region or group and change them there)
|
||||
|
||||
########## GENERAL ##########
|
||||
general:
|
||||
## Set this to true to enable saving/restoring for regions as specified in the profile below, which is specified in the config
|
||||
enableRestore: false
|
||||
## The schematic profile as specified in the config
|
||||
schematicProfile: 'default'
|
||||
## The event commands profile as specified in the config
|
||||
eventCommandProfile: 'default'
|
||||
## The profile for the format of the sign as specified in the config
|
||||
signProfile: 'default'
|
||||
## The profile for the WorldGuard flags as specified in the config
|
||||
flagProfile: 'default'
|
||||
## The y location within the region to start searching for safe teleport spots (x and z will be in the middle of the region)
|
||||
## Possible values: bottom, middle, top
|
||||
teleportLocationY: bottom
|
||||
## If true the teleportation algorithm only allows telportation to inside the region, otherwise it will expand algorithm
|
||||
## a cube from the starting point to check for safe spots (then it could end outside the region)
|
||||
## If you set a teleport location outside of the region with /as settp then setting this to true breaks that teleport (players cannot use it)
|
||||
teleportIntoRegion: true
|
||||
|
||||
########## RENTING ##########
|
||||
rent:
|
||||
## The default price of a renting region
|
||||
price: 1000
|
||||
## The default duration of a renting region
|
||||
duration: '1 day'
|
||||
## The percentage of the renting price you get back if you unrent the region (price of time left will be multiplied by this/100)
|
||||
moneyBack: 100
|
||||
## Maximum number of extends a player can do (-1 for infinite, 0 for no extending)
|
||||
maxExtends: -1
|
||||
|
||||
########## BUYING ##########
|
||||
buy:
|
||||
## The default price of a buying region
|
||||
price: 1000
|
||||
## The percentage of the buying price you get back if you sell the region
|
||||
moneyBack: 100
|
||||
@@ -1,275 +0,0 @@
|
||||
###################################################
|
||||
# English language file for the AreaShop plugin #
|
||||
# Latest update: V2.0.2 #
|
||||
###################################################
|
||||
# Copy this file and change the strings to your #
|
||||
# favor. Then change the 'language' setting in #
|
||||
# the config to the filename (excluding .yml) #
|
||||
###################################################
|
||||
|
||||
########## General strings
|
||||
total-maximum: "You can't rent and buy more than %0% region(s) in total"
|
||||
|
||||
cmd-notValid: "That command is not valid, use '/as help' for info"
|
||||
cmd-onlyByPlayer: "This command can only be run by a player"
|
||||
cmd-weOnlyByPlayer: "Using a WorldEdit selection is only possible as a player, specify the region name as extra argument"
|
||||
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"
|
||||
|
||||
########## Help command strings
|
||||
help-header: "Help page, commands that you can execute"
|
||||
help-alias: "Command aliases: /areashop, /as"
|
||||
help-help: "&6/as help &7-&r Shows this help page"
|
||||
help-info: "&6/as info &7-&r Get info about current regions"
|
||||
help-rent: "&6/as rent &7-&r Rent a region or extend your current rent"
|
||||
help-buy: "&6/as buy &7-&r Buy a region"
|
||||
help-unrent: "&6/as unrent &7-&r Unrent a region"
|
||||
help-unrentOwn: "&6/as unrent &7-&r Unrent your own region"
|
||||
help-sell: "&6/as sell &7-&r Sell a region"
|
||||
help-sellOwn: "&6/as sell &7-&r Sell your own region"
|
||||
help-updaterents: "&6/as updaterents &7-&r Update all rent signs and regions"
|
||||
help-updatebuys: "&6/as updatebuys &7-&r Update all buy signs and regions"
|
||||
help-reload: "&6/as reload &7-&r Reload the config and languages"
|
||||
help-setrestore: "&6/as setrestore &7-&r Set the profile for restoring and on/off "
|
||||
help-setprice: "&6/as setprice &7-&r Change the price of a rent region"
|
||||
help-rentduration: "&6/as rentduration &7-&r Change the duration of a rent region"
|
||||
help-teleport: "&6/as tp &7-&r Teleport to your bought/rented regions"
|
||||
help-teleportAll: "&6/as tp &7-&r Teleport to a rent/buy region"
|
||||
help-setteleport: "&6/as settp &7-&r Set teleport position for bought/rented regions"
|
||||
help-setteleportAll: "&6/as settp &7-&r Set teleport position for a region"
|
||||
help-find: "&6/as find &7-&r Find an empty buy or rent"
|
||||
help-groupadd: "&6/as groupadd &7-&r Add a region to a group"
|
||||
help-groupdel: "&6/as groupdel &7-&r Delete a region from a group"
|
||||
help-grouplist: "&6/as grouplist &7-&r Display all groups currently registered"
|
||||
help-groupinfo: "&6/as groupinfo &7-&r Display information about a group"
|
||||
help-schemevent: "&6/as schemevent &7-&r Trigger a schematic event for a region"
|
||||
help-add: "&6/as add &7-&r Register a region as rent or buy"
|
||||
help-del: "&6/as del &7-&r Delete a registered region from AreaShop"
|
||||
help-addsign: "&6/as addsign &7-&r Add a sign to an existing region"
|
||||
help-delsign: "&6/as delsign &7-&r Delete the sign you are looking at"
|
||||
|
||||
############ Other command strings
|
||||
rent-help: "/as rent [regionname], the region you stand in will be used if not specified"
|
||||
rent-noPermission: "You don't have permission to rent a region"
|
||||
rent-maximum: "You can't rent more than %0% region(s)"
|
||||
rent-payError: "Something went wrong with paying, try again later"
|
||||
rent-rented: "You rented %0% until %1%"
|
||||
rent-extended: "You extended your rent of %0% until %1%"
|
||||
rent-extend: "You can extend your rent by rightclicking the sign again or using /as rent"
|
||||
rent-lowMoneyExtend: "You don't have enough money to extend the rent (you have %0% and you need %1%)"
|
||||
rent-lowMoneyRent: "You don't have enough money to rent this region (you have %0% and you need %1%)"
|
||||
rent-someoneElse: "Someone else already rented this region"
|
||||
rent-notRentable: "That region is not available for renting"
|
||||
rent-maxExtends: "You cannot extend this rent anymore (the maximum is %0% times), however after the rent is over you can rent this region again"
|
||||
|
||||
buy-help: "/as buy [regionname], the region you stand in will be used if not specified"
|
||||
buy-noPermission: "You don't have permission to buy a region"
|
||||
buy-notBuyable: "That region is not available for buying"
|
||||
buy-maximum: "You can't buy more than %0% region(s)"
|
||||
buy-payError: "Something went wrong with paying, try again later"
|
||||
buy-succes: "You succesfully bought %0%"
|
||||
buy-lowMoney: "You don't have enough money to buy this region (you have %0% and you need %1%)"
|
||||
buy-yours: "You already own this region"
|
||||
buy-someoneElse: "Someone else already bought this region"
|
||||
|
||||
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-unrented: "Your region has been unrented"
|
||||
unrent-other: "The region has been unrented for player %0%"
|
||||
unrent-expired: "Your rent of %0% has expired"
|
||||
|
||||
sell-help: "/as sell [regionname], the region you stand in will be used if not specified"
|
||||
sell-notRegistered: "The region can't be selled because it is not registered for buying"
|
||||
sell-notBought: "The region can't be selled because it is not someone's property"
|
||||
sell-sold: "The region has been sold for player %0%"
|
||||
sell-soldYours: "Your region has been sold"
|
||||
sell-noPermission: "You don't have permission to sell a region"
|
||||
sell-noPermissionOther: "You don't have permission to sell another region"
|
||||
|
||||
rents-updated: "All signs and regions for renting have been updated"
|
||||
rents-notUpdated: "Not all signs have been updated, maybe reload fixes it"
|
||||
rents-noPermission: "You don't have permission to update all rent signs and regions"
|
||||
|
||||
buys-updated: "All signs and regions for selling have been updated"
|
||||
buys-notUpdated: "Not all signs have been updated, maybe reload fixes it"
|
||||
buys-noPermission: "You don't have permission to update all buy signs and regions"
|
||||
|
||||
reload-reloaded: "The config has been reloaded successfully"
|
||||
reload-noPermission: "You don't have permission to reload the config"
|
||||
|
||||
info-help: "/as info <all|rented|forrent|sold|forsale|player|region>"
|
||||
info-all-rents: "Regions registered for renting: &7%0%"
|
||||
info-all-noRents: "There are no regions registered for renting"
|
||||
info-all-buys: "Regions registered for buying: &7%0%"
|
||||
info-all-noBuys: "There are no regions registered for buying"
|
||||
info-rented: "Rented regions: &7%0%"
|
||||
info-noRented: "No regions are rented"
|
||||
info-unrented: "Unrented regions: &7%0%"
|
||||
info-noUnrented: "All regions are rented"
|
||||
info-sold: "Sold regions: &7%0%"
|
||||
info-noSold: "No regions are sold"
|
||||
info-forsale: "Regions for sale: &7%0%"
|
||||
info-noForsale: "All regions are sold"
|
||||
info-playerHelp: "/as info player <name>"
|
||||
info-playerRents: "Regions rented by %0%: &7%1%"
|
||||
info-playerNoRents: "%0% has not rented a region"
|
||||
info-playerBuys: "Regions bought by %0%: &7%1%"
|
||||
info-playerNoBuys: "%0% has not bought a region"
|
||||
info-regionHelp: "/as info region [name], the region you stand in will be used if not specified"
|
||||
info-regionNoRenting: "%0% is not registered for renting"
|
||||
info-regionRenting: "&6Renting details for %0%:"
|
||||
info-regionRentedBy: "Rented by: &7%0% until %1%"
|
||||
info-regionNotRented: "Currently not rented"
|
||||
info-regionBuying: "&6Buying details for %0%:"
|
||||
info-regionNoBuying: "%0% is not registered for buying"
|
||||
info-regionNotBought: "Currently not sold"
|
||||
info-regionBoughtBy: "Bought by: &7%0%"
|
||||
info-regionSign: "Sign location(s): %0%"
|
||||
info-regionSignLocation: "&7(%0%, %1%, %2%, %3%)&r"
|
||||
info-regionNoSign: "There is no sign registered for this region"
|
||||
info-regionPriceDuration: "Price: &7%0% for each %1%"
|
||||
info-regionPrice: "Price: &7%0%"
|
||||
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"
|
||||
|
||||
setrestore-help: "/as setrestore <region> <true|false|general> [profile]"
|
||||
setrestore-noPermission: "You don't have permission to change the restore settings"
|
||||
setrestore-notRegistered: "%0% is not registered"
|
||||
setrestore-invalidSetting: "'%0%' is not a valid state, should be true, false or general"
|
||||
setrestore-success: "Succesfully set the restore setting of %0% to '%1%'"
|
||||
setrestore-successProfile: "Succesfully 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 <price> [region], the region you stand in will be used if not specified"
|
||||
setprice-notRegistered: "%0% is not registered in AreaShop"
|
||||
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%"
|
||||
|
||||
rentduration-noPermission: "You don't have permission to change the duration of a rent"
|
||||
rentduration-help: "/as rentduration <amount> <identifier> [region], the region you stand in will be used if not specified"
|
||||
rentduration-notRegistered: "%0% is not registered as a rent"
|
||||
rentduration-wrongAmount: "'%0%' is not a valid amount, use a whole number"
|
||||
rentduration-wrongFormat: "'%0%' is not a proper timeformat, check the documentation on Bukkit"
|
||||
rentduration-success: "Duration of region %0% changed to '%1%'"
|
||||
|
||||
setup-noRegion: "You did not specify a region on the second line"
|
||||
setup-wrongRegion: "The region you specified does not exist"
|
||||
setup-alreadyRentSign: "The region you specified already has a sign for renting"
|
||||
setup-alreadyBuySign: "The region you specified already has a sign for buying"
|
||||
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-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-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%)"
|
||||
|
||||
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"
|
||||
|
||||
teleport-help: "/as tp <region> [sign]"
|
||||
teleport-noRentOrBuy: "Region '%0%' is not registered as rent or buy"
|
||||
teleport-noPermission: "You don't have permission to teleport to a region"
|
||||
teleport-noPermissionOther: "You don't have permission to teleport to region you do not own"
|
||||
teleport-success: "You teleported to %0%"
|
||||
teleport-noSafe: "No safe position found in region %0%, no spots in region left or maximum tries exceeded (%1%/%2%)"
|
||||
|
||||
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-noPermissionAll: "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-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"
|
||||
|
||||
find-help: "/as find <buy|rent> [maxprice]"
|
||||
find-noPermission: "You don't have permission to teleport to signs, so you can't use find"
|
||||
find-success: "Found a %0% region: %1%, while searching with a max price of your balance: %2%"
|
||||
find-successMax: "Found a %0% region: %1%, while searching with a max price of %2%"
|
||||
find-wrongMaxPrice: "The specified maximum price is not a correct number: %0%"
|
||||
find-noneFound: "No %0% region found while searching with a max price of your balance: %1%"
|
||||
find-noneFoundMax: "No %0% region found while searching with a max price of %1%"
|
||||
|
||||
groupadd-help: "/as groupadd <group> [region], if no region specified all regions from your WorldEdit selection are used"
|
||||
groupadd-noPermission: "You don't have permission to add regions to groups"
|
||||
groupadd-noRegion: "The specified region is not registered: %0%"
|
||||
groupadd-success: "Region %0% has been added to group '%1%', this group now has %2% member(s)"
|
||||
groupadd-failed: "Region %0% is already a member of group '%1%'"
|
||||
groupadd-weSuccess: "Added to group %0%: &7%1%"
|
||||
groupadd-weFailed: "Were already in group %0%: &7%1%"
|
||||
|
||||
groupdel-help: "/as groupdel <group> [region], if no region specified all regions from your WorldEdit selection are used"
|
||||
groupdel-noPermission: "You don't have permission to remove regions from groups"
|
||||
groupdel-noRegion: "The specified region is not registered: %0%"
|
||||
groupdel-success: "Region %0% has been removed from group '%1%', this group now has %2% member(s)"
|
||||
groupdel-failed: "Region %0% is not a member of group '%1%'"
|
||||
groupdel-weSuccess: "Removed from group %0%: &7%1%"
|
||||
groupdel-weFailed: "Were not in group %0% anyway: &7%1%"
|
||||
|
||||
grouplist-noPermission: "You don't have permission to display the registered groups"
|
||||
grouplist-noGroups: "There are currently no groups registered"
|
||||
grouplist-success: "The following groups are registered: &7%0%"
|
||||
|
||||
groupinfo-help: "/as groupinfo <group>"
|
||||
groupinfo-noPermission: "You don't have permission to display information about a group"
|
||||
groupinfo-noGroup: "There is no group registered with the name '%0%', use /as grouplist to check groups"
|
||||
groupinfo-members: "The following regions are member of group %0%: &7%1%"
|
||||
groupinfo-noMembers: "Group %0% does not have any members"
|
||||
|
||||
schemevent-help: "/as schemevent <region> <created|deleted|rented|unrented|bought|sold>"
|
||||
schemevent-noRegion: "The specified region is not registered: %0%"
|
||||
schemevent-wrongEvent: "The specified event '%0%' does not exist, use one of the following: &7%1%"
|
||||
schemevent-success: "Event '%0%' has succesfully been triggered for region %1%"
|
||||
schemevent-noPermission: "You don't have permission to trigger schematic events"
|
||||
|
||||
add-help: "/as add <rent|buy> [region] [world]"
|
||||
add-noPermission: "You don't have permission to add a region to AreaShop"
|
||||
add-success: "Added as %0%: &7%1%"
|
||||
add-failed: "Already registered: &7%0%"
|
||||
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-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%"
|
||||
|
||||
addsign-help: "/as addsign [region] [profile]"
|
||||
addsign-noSign: "You are not looking at a sign"
|
||||
addsign-noRegion: "Region '%0%' cannot be found"
|
||||
addsign-noRegions: "No region found around the sign position"
|
||||
addsign-couldNotDetect: "Found multiple regions around the sign, specify region as extra argument (2 of the regions that were found: %0% and %1%)"
|
||||
addsign-couldNotDetectSign: "Found multiple regions around the sign, specify region on the second line (2 of the regions that were found: %0% and %1%)"
|
||||
addsign-wrongProfile: "The specified profile does not exist, use one of the following (check config): &7%0%"
|
||||
addsign-success: "The sign has been added to %0%"
|
||||
addsign-successProfile: "The sign has been added to %0% with profile %1%"
|
||||
addsign-alreadyRegistered: "That sign is already registered for region %0%"
|
||||
addsign-noPermission: "You don't have permission to add a sign"
|
||||
|
||||
delsign-noSign: "You are not looking at a sign"
|
||||
delsign-noPermission: "You don't have permission to delete a sign"
|
||||
delsign-noRegion: "That sign does not belong to an AreaShop region"
|
||||
delsign-success: "The sign has been removed from region %0%"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,265 +0,0 @@
|
||||
###################################################
|
||||
# French language file for the AreaShop plugin #
|
||||
# Latest update: V2.0.2 #
|
||||
###################################################
|
||||
# Copy this file and change the strings to your #
|
||||
# favor. Then change the 'language' setting in #
|
||||
# the config to the filename (excluding .yml) #
|
||||
###################################################
|
||||
|
||||
########## General strings
|
||||
total-maximum: "Vous ne pouvez pas acheter ou louer plus de %0% region(s) au total"
|
||||
|
||||
cmd-notValid: "Cette commande est incorrecte, utilisez '/as help' pour plus de détails"
|
||||
cmd-onlyByPlayer: "Cette commande ne peut être utilisé que par un joueur"
|
||||
cmd-weOnlyByPlayer: "Utiliser une séléction WorldEdit n'est possible qu'en tant que joueur. Spécifiez le nom de la région en argument supplémentaire."
|
||||
cmd-noSelection: "Vous n'avez pas de séléction WorldEdit"
|
||||
cmd-noRegionsFound: "Aucune région enregistré dans AreaShop n'a été trouvé dans votre séléction"
|
||||
cmd-noWERegionsFound: "Aucun région WorldEdit croisant votre séléction n'a été trouvé"
|
||||
|
||||
########## Help command strings
|
||||
help-header: "Pade d'aide, Commande que vous pouvez éxécuter"
|
||||
help-alias: "Alias des commandes: /areashop, /as"
|
||||
help-help: "&6/as help &7-&r Affiche la page d'aide"
|
||||
help-info: "&6/as info &7-&r Obtenir les infos sur les régions actuelles"
|
||||
help-rent: "&6/as rent &7-&r Louer une région, ou prolonger la location actuelle"
|
||||
help-buy: "&6/as buy &7-&r Acheter une région"
|
||||
help-unrent: "&6/as unrent &7-&r Dé-louer une région"
|
||||
help-unrentOwn: "&6/as unrent &7-&r Dé-louer votre propre région"
|
||||
help-sell: "&6/as sell &7-&r Vendre une région"
|
||||
help-sellOwn: "&6/as sell &7-&r Vendre votree propre région"
|
||||
help-updaterents: "&6/as updaterents &7-&r Mettre à jours toutes les pancartes et les régions louées."
|
||||
help-updatebuys: "&6/as updatebuys &7-&r Mettre à jours toutes les pancartes et les régions achetées"
|
||||
help-reload: "&6/as reload &7-&r Recharge les configs et langages"
|
||||
help-setrestore: "&6/as setrestore &7-&r Mettre le profil pour réstaurer à on/off"
|
||||
help-setprice: "&6/as setprice &7-&r Fixerle prix d'une région louée."
|
||||
help-rentduration: "&6/as rentduration &7-&r Changer la durée d'une région louée"
|
||||
help-teleport: "&6/as tp &7-&r Téléportation vers votre région acheté / louée"
|
||||
help-teleportAll: "&6/as tp &7-&r Téléportation vers une région louée / acheté"
|
||||
help-setteleport: "&6/as settp &7-&r Définie la position de téléportation pour la région louée / acheté"
|
||||
help-setteleportAll: "&6/as settp &7-&r Défini la position de téléportation pour une région"
|
||||
help-find: "&6/as find &7-&r trouve un achat ou une location vide"
|
||||
help-groupadd: "&6/as groupadd &7-&r Ajoute une région à un groupe"
|
||||
help-groupdel: "&6/as groupdel &7-&r Supprime une région d'un groupe"
|
||||
help-grouplist: "&6/as grouplist &7-&r Affiche tout les groupes enregistrés"
|
||||
help-groupinfo: "&6/as groupinfo &7-&r Affiche les informations d'un groupe"
|
||||
help-schemevent: "&6/as schemevent &7-&r Déclanche un évenement schématique d'une région"
|
||||
help-add: "&6/as add &7-&r Enregistre une région comme louée ou acheté"
|
||||
help-del: "&6/as del &7-&r Supprime une région enregistré dans AreaShop"
|
||||
help-addsign: "&6/as addsign &7-&r Ajoute une pancarte à une région existante"
|
||||
help-delsign: "&6/as delsign &7-&r Supprime la pancarte que vous regardez"
|
||||
|
||||
############ Other command strings
|
||||
rent-help: "/as rent [regionname], Si non spécifié, cible la région dans laquelle vous vous trouvez"
|
||||
rent-noPermission: "Vous n'avez pas la permission de louer une région"
|
||||
rent-maximum: "Vous ne pouvez pas louer plus de %0% région(s)"
|
||||
rent-payError: "Une erreur durant le paiement s'est produite. Essayez de nouveau plus tard"
|
||||
rent-rented: "Vous avez loué de %0% jusqu'à %1%"
|
||||
rent-extended: "Vous avez prolongé la location de %0% jusqu'à %1%"
|
||||
rent-extend: "Vous pouvez prolonger votre location avec un clic droit sur la pancarte, ou en utilisant /as rent"
|
||||
rent-lowMoneyExtend: "Vous n'avez pas assez d'argent pour prolonger la location. (Vous possédez %0% et devez payer %1%)"
|
||||
rent-lowMoneyRent: "Vous n'avez pas assez d'argent pour louer cette région. (Vous possédez %0% et devez payer %1%)"
|
||||
rent-someoneElse: "Quelqu'un d'autre a déjà louer cette région"
|
||||
rent-notRentable: "cette région n'est pas disponible à la location"
|
||||
rent-maxExtends: "Vous ne pouvez plus prolonger cette location. (Le maximum est de %0% fois). Mais lorsque la location sera terminé, vous pourrez louer de nouveau cette région"
|
||||
|
||||
buy-help: "/as buy [regionname], Si non spécifié, cible la région dans laquelle vous vous trouvez"
|
||||
buy-noPermission: "Vous n'avez pas la permission d'acheter une région"
|
||||
buy-notBuyable: "cette région n'est pas disponible à l'achat"
|
||||
buy-maximum: "Vous ne pouvez pas acheter plus de %0% région(s)"
|
||||
buy-payError: "Une erreur durant le paiement s'est produite. Essayez de nouveau plus tard"
|
||||
buy-succes: "Vous avez bien acheté %0%"
|
||||
buy-lowMoney: "Vous n'avez pas assez d'argent pour acheter cette région. (Vous possédez %0% et devez payer %1%)"
|
||||
buy-yours: "Vous avez déjà acheter cette région"
|
||||
buy-someoneElse: "Quelqu'un a déjà acheté cette région"
|
||||
|
||||
unrent-help: "/as unrent [regionname], Si non spécifié, cible la région dans laquelle vous vous trouvez"
|
||||
unrent-noPermission: "Vous n'avez pas la permission de dé-louer une région"
|
||||
unrent-noPermissionOther: "Vous n'avez pas la permission de délouer une autre région"
|
||||
unrent-notRegistered: "La région ne peut pas être dé-louée car elle n'est pas enregistré à la location"
|
||||
unrent-notRented: "La région ne peut pas être dé-louée car elle n'est pas loué"
|
||||
unrent-unrented: "Votre région a été dé-louée."
|
||||
unrent-other: "La région du joueur %0% a été dé-louée"
|
||||
unrent-expired: "Votre location de %0% a expiré"
|
||||
|
||||
sell-help: "/as sell [regionname], Si non spécifié, cible la région dans laquelle vous vous trouvez"
|
||||
sell-notRegistered: "la région ne peut pas être vendue car elle n'est pas enregistré comme acheté"
|
||||
sell-notBought: "La région ne peut pas être vendue car elle n'est pas la propriété de quelqu'un"
|
||||
sell-sold: "Cette région a été vendu au joueur %0%"
|
||||
sell-soldYours: "Votre région a été vendue"
|
||||
sell-noPermission: "Vous n'avez pas la permission de vendre une région"
|
||||
sell-noPermissionOther: "Vous n'avez pas la permission de vendre une autre région"
|
||||
|
||||
rents-updated: "Tout les panneaux et régions en location ont été mis à jour"
|
||||
rents-notUpdated: "Tout les panneaux n'ont pas été mis à jour. Recharger peut corriger le problème"
|
||||
rents-noPermission: "Vous n'avez pas la permission de mettre à jour les panneaux et régions en location"
|
||||
|
||||
buys-updated: "Tout les panneaux et régions en vente ont été mis à jour"
|
||||
buys-notUpdated: "Tout les panneaux n'ont pas été mis à jour. Recharger peut corriger le problème"
|
||||
buys-noPermission: "Vous n'avez pas la permission de mettre à jour les panneaux et régions en vente"
|
||||
|
||||
reload-reloaded: "La configuration a bien été rechargée"
|
||||
reload-noPermission: "Vous n'avez pas la permission de recharger la configuration"
|
||||
|
||||
info-help: "/as info <all|rented|forrent|sold|forsale|player|region>"
|
||||
info-all-rents: "Régions enregistrées en location: &7%0%"
|
||||
info-all-noRents: "Il n'y a pas de régions enregistrées en location"
|
||||
info-all-buys: "Régions enregistrées en vente: &7%0%"
|
||||
info-all-noBuys: "Il n'y a pas de régions enregistrées en achat"
|
||||
info-rented: "Régions louées: &7%0%"
|
||||
info-noRented: "Aucune régions louée"
|
||||
info-unrented: "régions non louées: &7%0%"
|
||||
info-noUnrented: "Toutes les régions sont louées"
|
||||
info-sold: "Régions vendues: &7%0%"
|
||||
info-noSold: "Aucune région n'est vendue"
|
||||
info-forsale: "Région en vente: &7%0%"
|
||||
info-noForsale: "Toutes les régions sont vendues"
|
||||
info-playerHelp: "/as info player <name>"
|
||||
info-playerRents: "Regions louées par %0%: &7%1%"
|
||||
info-playerNoRents: "%0% n'a de région louée"
|
||||
info-playerBuys: "Régions achetés par %0%: &7%1%"
|
||||
info-playerNoBuys: "%0% n'a pas acheté de région"
|
||||
info-regionHelp: "/as info region [name], Si non spécifié, cible la région dans laquelle vous vous trouvez"
|
||||
info-regionNoRenting: "%0% n'est pas enregistré pour la location"
|
||||
info-regionRenting: "&6Détails de location pour %0%:"
|
||||
info-regionRentedBy: "Louée par: &7%0% jusqu'au %1%"
|
||||
info-regionNotRented: "Actuellement non louée"
|
||||
info-regionBuying: "&6Détails d'achat pour %0%:"
|
||||
info-regionNoBuying: "%0% n'est pas enregistré à la vente"
|
||||
info-regionNotBought: "Actuellement non vendue"
|
||||
info-regionBoughtBy: "Acheté par: &7%0%"
|
||||
info-regionSign: "Panneau(x) de location(s): %0%"
|
||||
info-regionSignLocation: "&7(%0%, %1%, %2%, %3%)&r"
|
||||
info-regionNoSign: "Il n'y a pas de panneaux enregistré pour cette région"
|
||||
info-regionPriceDuration: "Prix: &7%0% pour chaque %1%"
|
||||
info-regionPrice: "Prix: &7%0%"
|
||||
info-regionRestore: "Réstauration activé: &7%0%"
|
||||
info-regionRestoreProfile: "profil de restauration: &7%0%"
|
||||
info-regionTPLocation: "lieu de téléportation: &7World=%0%, X=%1%, Y=%2%, Z=%3%, Pitch=%4%, Yaw=%5%"
|
||||
info-regionNoTP: "Aucun lieu de téléportation défini"
|
||||
info-regionNotExisting: "La région %0% n'est pas enregistrée"
|
||||
|
||||
setrestore-help: "/as setrestore <region> <true|false|general> [profile]"
|
||||
setrestore-noPermission: "Vous n'avez pas la permission de restaurer les paramètres"
|
||||
setrestore-notRegistered: "%0% n'est pas enregistré"
|
||||
setrestore-invalidSetting: "'%0%' est invalide. Doit être true, false ou general"
|
||||
setrestore-success: "Les paramètres ont bien été restauré de %0% à '%1%'"
|
||||
setrestore-successProfile: "Les paramètres ont bien été restauré de %0% à '%1%' et la profil à '%2%'"
|
||||
|
||||
setprice-noPermission: "Vous n'avez pas la permission de changer le prix d'une région"
|
||||
setprice-help: "/as setprice <price> [region], Si non spécifié, cible la région dans laquelle vous vous trouvez"
|
||||
setprice-notRegistered: "%0% n'est pas enregistré dans AreaShop"
|
||||
setprice-wrongPrice: "'%0%' n'est pas un rpix valide"
|
||||
setprice-successRent: "Prix de la région %0% changé de %1% à %2%"
|
||||
setprice-successBuy: "Pprix de la région %0% changé à %1%"
|
||||
|
||||
rentduration-noPermission: "Vous n'avez pas la permission de changer la durée d'une location"
|
||||
rentduration-help: "/as rentduration <amount> <identifier> [region], Si non spécifié, cible la région dans laquelle vous vous trouvez"
|
||||
rentduration-notRegistered: "%0% n'est pas enregistré comme location"
|
||||
rentduration-wrongAmount: "'%0%' n'est pas un montant valide, utilisez un nombre entier"
|
||||
rentduration-wrongFormat: "'%0%' n'est pas un format date correcte, regardez la documentation bukkit"
|
||||
rentduration-success: "Durée de la région %0% changé à '%1%'"
|
||||
|
||||
setup-noRegion: "Vous n'avez pas spécifié une région à la seconde ligne"
|
||||
setup-wrongRegion: "la région que vous avez spécifié n'existe pas"
|
||||
setup-alreadyRentSign: "La région que vous avez spécifiée possède déjà un panneau de location"
|
||||
setup-alreadyBuySign: "La région que vous avez spécifiée possède déjà un panneau de vente"
|
||||
setup-noDuration: "A la troisième ligne, vous n'avez pas spécifié la durée de location de la région"
|
||||
setup-wrongDuration: "Le temps spécifié n'est pas au bon format. Exemple: 1 day"
|
||||
setup-noPrice: "A la quatrième ligne, vous n'avez pas spécifié le prix"
|
||||
setup-wrongPrice: "Vous n'avez pas indiqué un prix correcte, utilisez un nombre entier"
|
||||
setup-rentSuccess: "La location de la région %0% est correctement configurée"
|
||||
setup-buySuccess: "L'achat de la région %0% est correctement configuré"
|
||||
setup-noPermissionRent: "Vous n'avez pas la permission de mettre en place la location de régions"
|
||||
setup-noPermissionBuy: "Vous n'avez pas la permission de mettre en place l'achat de régions"
|
||||
setup-couldNotDetect: "Multiples régions trouvées avec la même priorité et/ou parent/enfant relation. Spécifiez en un sur la deuxième ligne. (2 des régions trouvées: %0% et %1%)"
|
||||
|
||||
destroy-noPermissionRent: "Vous n'avez pas la permission de détruire le panneau de location d'une région"
|
||||
destroy-noPermissionBuy: "Vous n'avez pas la permission de détruire le panneau de vente d'une région"
|
||||
destroy-successRent: "Location de %0% supprimé"
|
||||
destroy-successBuy: "Achat de %0% supprimé"
|
||||
|
||||
teleport-help: "/as tp <region> [sign]"
|
||||
teleport-noRentOrBuy: "La région '%0%' n'est pas enregistré comme location ou achat"
|
||||
teleport-noPermission: "Vous n'avez pas la permission de vous téléporter dans une région"
|
||||
teleport-noPermissionOther: "Vous n'avez pas la permission de vous téléporter à une région qui ne vous appartient pas"
|
||||
teleport-success: "Vous avez été téléporté à %0%"
|
||||
teleport-noSafe: "Aucune position sécurisé trouvé dans la région %0%. Pas de point restant, ou tentatives maximales dépassées. (%1%/%2%)"
|
||||
|
||||
setteleport-help: "/as settp [region] [reset], Si non spécifié, cible la région dans laquelle vous vous trouvez"
|
||||
setteleport-noPermission: "Vous n'avez pas la permission de définir un point de téléportation"
|
||||
setteleport-noPermissionAll: "Vous n'avez pas la permission de définir un point de téléportation sur une région qui ne vous appartient pas"
|
||||
setteleport-noRentOrBuy: "La région '%0%' n'est pas enregistré comme location ou achat"
|
||||
setteleport-success: "Lieu de téléportation de %0% défini"
|
||||
setteleport-notInside: "Le lieu doit se trouver dans votre région"
|
||||
setteleport-reset: "le lieu de téléportation de %0% a été reset"
|
||||
|
||||
find-help: "/as find <buy|rent> [maxprice]"
|
||||
find-noPermission: "Vous n'avez pas la permission de vous téléporter à des panneaux. Vous ne pouvez donc pas utiliser find"
|
||||
find-success: "Trouvé %0% région: %1%, en recherchant avec le prix maximum de votre solde: %2%"
|
||||
find-successMax: "trouvé %0% région: %1%, en cherchant un prix maximum de %2%"
|
||||
find-wrongMaxPrice: "le prix maximum n'est pas un nombre valide: %0%"
|
||||
find-noneFound: "Aucune %0% région trouvée, en cherchant le prix maximum de votre solde: %1%"
|
||||
find-noneFoundMax: "Aucune %0% région trouvée en cherchant un prix maximum de %1%"
|
||||
|
||||
groupadd-help: "/as groupadd <group> [region], Si non spécifié, cible la région dans laquelle vous vous trouvez"
|
||||
groupadd-noPermission: "Vous n'avez pas la permission d'ajouter des régions aux groupes"
|
||||
groupadd-noRegion: "la région spécifiée n'est pas enregistré: %0%"
|
||||
groupadd-success: "La région %0% a été ajouté au groupe '%1%'. ce groupe a maintenant %2% membre(s)"
|
||||
groupadd-failed: "La région %0% est déjà membre du groupe '%1%'"
|
||||
groupadd-weSuccess: "Ajouté au groupe %0%: &7%1%"
|
||||
groupadd-weFailed: "Nous étions déjà dans le groupe %0%: &7%1%"
|
||||
|
||||
groupdel-help: "/as groupdel <group> [region], Si non spécifié, cible la région dans laquelle vous vous trouvez"
|
||||
groupdel-noPermission: "Vous n'avez pas la permission de supprimer des régions depuis les groupes"
|
||||
groupdel-noRegion: "La région spécifiée n'est pas enregistré: %0%"
|
||||
groupdel-success: "La région %0% a été supprimé du groupe '%1%', ce groupe a maintenant %2% membre(s)"
|
||||
groupdel-failed: "La région %0% n'est pas membre du groupe '%1%'"
|
||||
groupdel-weSuccess: "Supprimé du groupe %0%: &7%1%"
|
||||
groupdel-weFailed: "Nous ne sommes pas dans le groupe %0% de toute façon: &7%1%"
|
||||
|
||||
grouplist-noPermission: "Vous n'avez pas l'autorisation d'afficher les groupes enregistrés"
|
||||
grouplist-noGroups: "Il n'y a actuellement aucun groupe enregistré"
|
||||
grouplist-success: "les groupes suivants sont enregistrés: &7%0%"
|
||||
|
||||
groupinfo-help: "/as groupinfo <group>"
|
||||
groupinfo-noPermission: "Vous n'avez pas la permission d'afficher des informations sur un groupe"
|
||||
groupinfo-noGroup: "Il n'y a pas de groupe enregistré sous le nom '%0%', utilisez /as grouplist pour vérifier les groupes"
|
||||
groupinfo-members: "Les régions suivantes sont membres du groupe %0%: &7%1%"
|
||||
groupinfo-noMembers: "Le groupe %0% ne possède aucun membre"
|
||||
|
||||
schemevent-help: "/as schemevent <region> <created|deleted|rented|unrented|bought|sold>"
|
||||
schemevent-noRegion: "La région spécifiée n'est pas enregistré: %0%"
|
||||
schemevent-wrongEvent: "L'évent spécifié '%0%' n'existe pas, utilisez un des suivants: &7%1%"
|
||||
schemevent-success: "L'évent '%0%' a été déclenché pour la région %1%"
|
||||
schemevent-noPermission: "Vous n'avez pas la permission de déclencher des événements schématiques"
|
||||
|
||||
add-help: "/as add <rent|buy> [region] [world]"
|
||||
add-noPermission: "Vous n'avez pas la permission d'ajouter une région à AreaShop"
|
||||
add-success: "Ajouté comme %0%: &7%1%"
|
||||
add-failed: "Déjà enregistré: &7%0%"
|
||||
add-specifyWorld: "Spécifiez le monde de la région lors de l'utilisation de la console"
|
||||
add-incorrectWorld: "Le monde '%0%' est introuvable, essayez de nouveau (Attention à la casse)"
|
||||
add-noRegion: "La région '%0%' n'existe pas dans ce monde"
|
||||
|
||||
del-noRegion: "Le région '%0%' n'est pas enregistré à AreaShop"
|
||||
del-noPermission: "Vous n'avez pas la permission de supprimer des régions"
|
||||
del-success: "Régions supprimées: &7%0%"
|
||||
del-failed: "Pas de permission pour supprimer, ou pas enregistré: &7%0%"
|
||||
|
||||
addsign-help: "/as addsign [region] [profile]"
|
||||
addsign-noSign: "Vous ne regardez pas de panneau"
|
||||
addsign-noRegion: "La région '%0%' n'a pas été trouvé"
|
||||
addsign-noRegions: "Aucune région trouvé autour du panneau"
|
||||
addsign-couldNotDetect: "Plusieurs régions ont été trouvées à promixité du panneau. Spécifiez la région en argument supplémentaire. (2 des régions trouvées: %0% et %1%)"
|
||||
addsign-couldNotDetectSign: "Plusieurs régions ont été trouvées à proximité du panneau. Spécifiez la région à la deuxième ligne. (2 des régions trouvées: %0% et %1%)"
|
||||
addsign-wrongProfile: "le profil spécifié n'existe pas. utilisez un des suivants (vérifier la configuration): &7%0%"
|
||||
addsign-success: "Le panneau a été ajouté à %0%"
|
||||
addsign-successProfile: "Le panneau a été ajouté à %0% avec le profil %1%"
|
||||
addsign-alreadyRegistered: "Ce panneau a déjà été enregistré pour la région %0%"
|
||||
addsign-noPermission: "Vous n'avez pas la permission d'ajouter un panneau"
|
||||
|
||||
delsign-noSign: "Vous ne regardez pas un panneau"
|
||||
delsign-noPermission: "Vous n'avez pas la permission de supprimer un panneau"
|
||||
delsign-noRegion: "Ce signe n'appartient pas à une région AreaShop"
|
||||
delsign-success: "Ce panneau a été supprimé de la région %0%"
|
||||
@@ -1,173 +0,0 @@
|
||||
###################################################
|
||||
# Dutch language file for the AreaShop plugin #
|
||||
# Latest update: V1.2.1 #
|
||||
###################################################
|
||||
# Copy this file and change the strings to your #
|
||||
# favor. Then change the 'language' setting in #
|
||||
# the config to the filename (excluding .yml) #
|
||||
###################################################
|
||||
|
||||
########## Command strings
|
||||
total-maximum: "Je kunt niet meer dan %0% gebied(en) in totaal huren en kopen"
|
||||
|
||||
cmd-onlyByPlayer: "Dit commando kan alleen door een speler uitgevoert worden"
|
||||
cmd-notValid: "Dat commando is niet geldig , gebruik '/as help' voor informatie"
|
||||
|
||||
rent-regionNotRentable: "Dat gebied is niet beschikbaar om te huren"
|
||||
rent-help: "/as rent <gebiednaam>"
|
||||
rent-noPermission: "Je hebt geen toestemming om een gebied te huren"
|
||||
rent-maximum: "Je kunt niet meer dan %0% gebied(en) huren"
|
||||
rent-payError: "Er is iets mis gegaan met betalen, probeer het later opnieuw"
|
||||
rent-rented: "Je hebt %0% tot %1% gehuurd"
|
||||
rent-extended: "Je hebt je huur van %0% verlengt tot %1%"
|
||||
rent-extend: "Je kunt je huur verlengen door opnieuw op het bordje te klikken of gebruik te maken van /as rent"
|
||||
rent-lowMoneyExtend: "Je hebt niet genoeg geld om de huur te verlengen (je hebt %0% van de %1%)"
|
||||
rent-lowMoneyRent: "Je hebt niet genoeg geld om het gebied te huren (je hebt %0% van de %1%)"
|
||||
rent-someoneElse: "Iemand anders heeft dit gebied al gehuurd"
|
||||
rent-notRentable: "Dat gebied is niet beschikbaar om te huren"
|
||||
|
||||
buy-help: "/as buy <gebiednaam>"
|
||||
buy-noPermission: "Je hebt geen toestemming om een gebied te kopen"
|
||||
buy-notBuyable: "Dat gebied is niet beschikbaar om te kopen"
|
||||
buy-maximum: "Je kunt niet meer dan %0% gebied(en) kopen"
|
||||
buy-payError: "Er is iets mis gegaan met betalen, probeer het later opnieuw"
|
||||
buy-succes: "Je hebt %0% succesvol gekocht"
|
||||
buy-lowMoney: "Je hebt niet genoeg geld om het gebied te kopen (je hebt %0% van de %1%)"
|
||||
buy-yours: "Je hebt dit gebied al gekocht"
|
||||
buy-someoneElse: "Iemand anders heeft dit gebied al gekocht"
|
||||
|
||||
unrent-help: "/as unrent <gebiednaam>"
|
||||
unrent-noPermission: "Je hebt geen toestemming om te stoppen met huren"
|
||||
unrent-noPermissionOther: "Je hebt geen toestemming om iemand anders huur te stoppen"
|
||||
unrent-notRegistered: "De huur kan niet gestopt worden want het gebied is niet geregistreerd om te huren"
|
||||
unrent-notRented: "De huur kan niet gestopt worden want het gebied is niet gehuurd"
|
||||
unrent-unrented: "De huur van je gebied is gestopt"
|
||||
unrent-other: "De huur voor het gebied is gestopt voor speler %0%"
|
||||
unrent-expired: "De huur van je gebied %0% is gestopt"
|
||||
|
||||
sell-help: "/as sell <gebiednaam>"
|
||||
sell-notRegistered: "Het gebied kan niet verkocht worden want het staat niet geregistreerd om te kopen"
|
||||
sell-notBought: "Het gebied kan niet verkocht worden want het is niet gekocht"
|
||||
sell-sold: "Het gebied is verkocht voor speler %0%"
|
||||
sell-soldYours: "Je gebied is verkocht"
|
||||
sell-noPermission: "Je hebt geen toestemming om een gebied te verkopen"
|
||||
sell-noPermissionOther: "Je hebt geen toestemming om een gebied van iemand anders te verkopen"
|
||||
|
||||
rents-updated: "Alle borden en gebieden voor de verhuur zijn geupdate"
|
||||
rents-notUpdated: "Niet alle borden zijn geupdate, een reload zou het op kunnen lossen"
|
||||
rents-noPermission: "Je hebt geen toestemming om alle verhuur borden en gebieden te updaten"
|
||||
|
||||
buys-updated: "Alle borden en gebieden voor de verkoop zijn geupdate"
|
||||
buys-notUpdated: "Niet alle borden zijn geupdate, een reload zou het op kunnen lossen"
|
||||
buys-noPermission: "Je hebt geen toestemming om alle verkoop borden en gebieden te updaten"
|
||||
|
||||
reload-reloaded: "De config is succesvol opnieuw ingeladen"
|
||||
reload-noPermission: "Je hebt geen toestemming om de config opnieuw in te laden"
|
||||
|
||||
info-help: "/as info <all|rented|forrent|sold|forsale|player|region>"
|
||||
info-all-rents: "Gebieden geregistreerd voor de verhuur: %0%"
|
||||
info-all-noRents: "Er zijn geen gebieden geregistreerd voor de verhuur"
|
||||
info-all-buys: "Gebieden geregistreerd voor de verkoop: %0%"
|
||||
info-all-noBuys: "Er zijn geen gebieden geregistreerd voor de verkoop"
|
||||
info-rented: "Verhuurde gebieden: %0%"
|
||||
info-noRented: "Er zijn geen verhuurde gebieden"
|
||||
info-unrented: "Gebieden te huur: %0%"
|
||||
info-noUnrented: "Alle gebieden zijn verhuurd"
|
||||
info-sold: "Verkochte gebieden: %0%"
|
||||
info-noSold: "Alle gebieden zijn verkocht"
|
||||
info-forsale: "Gebieden te koop: %0%"
|
||||
info-noForsale: "Alle gebieden zijn verkocht"
|
||||
info-playerHelp: "/as info player <naam>"
|
||||
info-playerRents: "Gebieden gehuurd door %0%: %1%"
|
||||
info-playerNoRents: "%0% heeft geen gebied gehuurd"
|
||||
info-playerBuys: "Gebieden gekocht door %0%: %1%"
|
||||
info-playerNoBuys: "%0% heeft geen gebieden gekocht"
|
||||
info-regionHelp: "/as info region <naam>"
|
||||
info-regionNoRenting: "%0% is niet geregistreerd voor verhuur"
|
||||
info-regionRenting: "&6Huur informatie voor %0%"
|
||||
info-regionRentedBy: "Gehuurd door: %0% tot %1%"
|
||||
info-regionNotRented: "Nu niet verhuurd"
|
||||
info-regionBuying: "&6Verkoop informatie voor %0%"
|
||||
info-regionNoBuying: "%0% is niet geregistreerd voor verkoop"
|
||||
info-regionNotBought: "Nu niet verkocht"
|
||||
info-regionBoughtBy: "Gekocht door: %0%"
|
||||
info-regionSign: "Plek van het bordje: wereld=%0%, X=%1%, Y=%2%, Z=%3%"
|
||||
info-regionPriceDuration: "Prijs: %0% voor elke %1%"
|
||||
info-regionPrice: "Prijs: %0%"
|
||||
info-regionRestore: "Herstellen ingeschakeld: %0%"
|
||||
info-regionRestoreProfile: "Herstel profiel: %0%"
|
||||
|
||||
help-header: "Help pagina, commando's die jij kunt uitvoeren"
|
||||
help-alias: "Commando aliassen: /areashop, /as"
|
||||
help-help: "&6/as help &7-&r Laat deze help pagina zien"
|
||||
help-info: "&6/as info &7-&r Vraag informatie over gebieden op"
|
||||
help-rent: "&6/as rent &7-&r Huur een gebied of verleng de huur"
|
||||
help-buy: "&6/as buy &7-&r Koop een gebied"
|
||||
help-unrent: "&6/as unrent &7-&r Stop de huur van een gebied"
|
||||
help-unrentOwn: "&6/as unrent &7-&r Stop de huur van een eigen gebied"
|
||||
help-sell: "&6/as sell &7-&r Verkoop een gebied"
|
||||
help-sellOwn: "&6/as sell &7-&r Verkoop een eigen gebied"
|
||||
help-updaterents: "&6/as updaterents &7-&r Update alle huur borden en gebieden"
|
||||
help-updatebuys: "&6/as updatebuys &7-&r Update alle koop borden en gebieden"
|
||||
help-reload: "&6/as reload &7-&r Herlaad de config en de taalbestanden"
|
||||
help-rentrestore: "&6/as rentrestore &7-&r Laat dit huur gebied herstellen of niet"
|
||||
help-buyrestore: "&6/as buyrestore &7-&r Laat dit koop gebied herstellen of niet"
|
||||
help-rentprice: "&6/as rentprice &7-&r Verander de prijs van een huur gebied"
|
||||
help-buyprice: "&6/as buyprice &7-&r Verander de prijs van een koop gebied"
|
||||
help-rentduration: "&6/as rentduration &7-&r Verander de looptijd van een huur gebied"
|
||||
help-teleport: "&6/as tp &7-&r Teleporteer naar je gekochte/gehuurde gebieden"
|
||||
help-teleportAll: "&6/as tp &7-&r Teleporteer naar koop/huur gebieden"
|
||||
|
||||
rentrestore-help: "/as rentrestore <gebied> <true|false|general> [profiel]"
|
||||
rentrestore-noPermission: "Je hebt geen toestemming om herstel instellingen te veranderen bij een huur gebied"
|
||||
rentrestore-notRegistered: "%0% is niet geregistreerd als een huur gebied"
|
||||
rentrestore-invalidSetting: "'%0%' is geen goede optie, gebruik true, false of general"
|
||||
rentrestore-success: "Succesvol de herstel optie gezet van %0% naar '%1%'"
|
||||
rentrestore-successProfile: "Succesvol de herstel optie gezet van %0% naar '%1%' en het profiel naar '%2%'"
|
||||
|
||||
buyrestore-help: "/as buyrestore <gebied> <true|false|general> [profiel]"
|
||||
buyrestore-noPermission: "Je hebt geen toestemming om herstel instellingen te veranderen bij geen koop gebied"
|
||||
buyrestore-notRegistered: "%0% is niet geregistreerd als een koop gebied"
|
||||
buyrestore-invalidSetting: "'%0%' is geen goede optie, gebruik true, false of general"
|
||||
buyrestore-success: "Succesvol de herstel optie gezet van %0% naar '%1%'"
|
||||
buyrestore-successProfile: "Succesvol de herstel optie gezet van %0% naar '%1%' en het profiel naar '%2%'"
|
||||
|
||||
rentprice-noPermission: "Je hebt geen toestemming om de prijs van een huur gebied te veranderen"
|
||||
rentprice-help: "/as rentprice <gebied> <prijs>"
|
||||
rentprice-notRegistered: "%0% is niet geregistreerd als een huur gebied"
|
||||
rentprice-wrongPrice: "'%0%' is geen goede prijs"
|
||||
rentprice-success: "Prijs van gebied %0% is veranderd naar %1% per %2%"
|
||||
|
||||
buyprice-noPermission: "Je hebt geen toestemming om de prijs van een koop gebied te veranderen"
|
||||
buyprice-help: "/as buyprice <gebied> <prijs>"
|
||||
buyprice-notRegistered: "%0% is niet geregistreerd als koop gebied"
|
||||
buyprice-wrongPrice: "'%0%' is geen goede prijs"
|
||||
buyprice-success: "Prijs van gebied %0% is veranderd naar %1%"
|
||||
|
||||
rentduration-noPermission: "Je hebt geen toestemming om de looptijd van een huur gebied te veranderen"
|
||||
rentduration-help: "/as rentduration <gebied> <aantal> <soort>"
|
||||
rentduration-notRegistered: "%0% is niet geregistreerd als een huur gebied"
|
||||
rentduration-wrongPrice: "'%0%' is geen goede prijs, gebruik een geheel getal"
|
||||
rentduration-wrongFormat: "'%0%' is geen goed tijdformaat, bekijk de documentatie op Bukkit"
|
||||
rentduration-success: "Looptijd van gebeid %0% veranderd naar '%1%'"
|
||||
|
||||
setup-noRegion: "Je hebt geen gebied aangegeven op de tweede regel"
|
||||
setup-wrongRegion: "Het aangegeven gebied bestaat niet"
|
||||
setup-alreadyRentSign: "Het aangegeven gebied heeft al een bord voor huren"
|
||||
setup-alreadyBuySign: "Het aangegeven gebied heeft al een bord voor kopen"
|
||||
setup-noDuration: "Je hebt geen tijdsduur voor het huren aangegeven, zet dit op de derde regel"
|
||||
setup-wrongDuration: "De aangegeven tijdsduur is niet in het correcte formaat, voorbeeld: 1 dag"
|
||||
setup-noPrice: "Je hebt geen prijs aangegeven op de vierde regel"
|
||||
setup-wrongPrice: "Je hebt de prijs niet goed aangegeven, gebruik een nummer"
|
||||
setup-rentSuccess: "Huren van gebied %0% is goed opgezet"
|
||||
setup-buySuccess: "Kopen van gebied %0% is goed opgezet"
|
||||
setup-noPermissionRent: "Je hebt geen toestemming om huur gebieden op te zetten"
|
||||
setup-noPermissionBuy: "Je hebt geen toestemming om koop gebieden op te zetten"
|
||||
setup-couldNotDetect: "Meerdere gebieden gevonden met dezelfde prioriteit en/of parent/child relatie, geeft een specifieke aan op de tweede regel (2 van de gebieden die gevonden zijn: %0% en %1%)"
|
||||
|
||||
teleport-help: "/as tp <gebied> <aantal> <soort>"
|
||||
teleport-noRentOrBuy: "Gebied '%0%' is niet geregistreerd als koop of huur gebied"
|
||||
teleport-noPermission: "Je hebt geen toestemming om te teleporteren naar een gebied"
|
||||
teleport-noPermissionOther: "Je hebt geen toestemming om te teleporteren naar een gebied dat niet van jou is"
|
||||
teleport-success: "Je bent naar %0% geteleporteerd"
|
||||
teleport-noSafe: "Geen veilige plek gevonden in gebied %0%, verander het gebied of stel de teleporteer positie in"
|
||||
@@ -1,153 +0,0 @@
|
||||
name: AreaShop
|
||||
main: nl.evolutioncoding.AreaShop.AreaShop
|
||||
version: 2.0.2
|
||||
depend: [Vault, WorldGuard, WorldEdit]
|
||||
softdepend: [Multiverse-Core]
|
||||
commands:
|
||||
AreaShop:
|
||||
description: For all commands use /as help
|
||||
usage: /AreaShop or /AS
|
||||
permission: areashop.help
|
||||
permission-message: You don't have <permission>
|
||||
aliases: [as]
|
||||
permissions:
|
||||
areashop.*:
|
||||
description: Give access to all commands of AreaShop
|
||||
children:
|
||||
areashop.help: true
|
||||
areashop.createrent: true
|
||||
areashop.createbuy: true
|
||||
areashop.destroyrent: true
|
||||
areashop.destroybuy: true
|
||||
areashop.rent: true
|
||||
areashop.buy: true
|
||||
areashop.unrent: true
|
||||
areashop.info: true
|
||||
areashop.updaterents: true
|
||||
areashop.updatebuys: true
|
||||
areashop.reload: true
|
||||
areashop.setrestore: true
|
||||
areashop.setprice: true
|
||||
areashop.rentduration: true
|
||||
areashop.teleportall: true
|
||||
areashop.setteleportall: true
|
||||
areashop.teleportsign: true
|
||||
areashop.tabcomplete: true
|
||||
areashop.setteleportoutsideregion: true
|
||||
areashop.find: true
|
||||
areashop.groupadd: true
|
||||
areashop.groupdel: true
|
||||
areashop.grouplist: true
|
||||
areashop.groupinfo: true
|
||||
areashop.limits.unlimited: true
|
||||
areashop.schematicevents: true
|
||||
areashop.addsign: true
|
||||
areashop.delsign: true
|
||||
areashop.help:
|
||||
description: Allows you to see the help pages
|
||||
default: true
|
||||
areashop.rent:
|
||||
description: Allows you to rent a region
|
||||
default: true
|
||||
areashop.buy:
|
||||
description: Allows you to buy a region
|
||||
default: true
|
||||
areashop.unrent:
|
||||
description: Allows you to unrent a specific region
|
||||
default: op
|
||||
areashop.unrentown:
|
||||
description: Allows you to unrent your own region
|
||||
default: true
|
||||
areashop.sell:
|
||||
description: Allows you to sell a specific region
|
||||
default: op
|
||||
areashop.sellown:
|
||||
description: Allows you to sell your own region
|
||||
default: true
|
||||
areashop.createrent:
|
||||
description: Allows you to set up signs for renting regions
|
||||
default: op
|
||||
areashop.createbuy:
|
||||
description: Allows you to set up signs for buying regions
|
||||
default: op
|
||||
areashop.destroyrent:
|
||||
description: Allows you to break signs used for renting regions
|
||||
default: op
|
||||
areashop.destroybuy:
|
||||
description: Allows you to break signs used for renting regions
|
||||
default: op
|
||||
areashop.info:
|
||||
description: Allows you check the status of regions and players
|
||||
default: true
|
||||
areashop.updaterents:
|
||||
description: Allows you to update all rent signs and regions
|
||||
default: op
|
||||
areashop.updatebuys:
|
||||
description: Allows you to update all buy signs and regions
|
||||
default: op
|
||||
areashop.reload:
|
||||
description: Allows you to reload the config
|
||||
default: op
|
||||
areashop.setrestore:
|
||||
description: Allows you to change the restore settings
|
||||
default: op
|
||||
areashop.setprice:
|
||||
description: Allows you to change the price
|
||||
default: op
|
||||
areashop.rentduration:
|
||||
description: Allows you to change the duration of a rent
|
||||
default: op
|
||||
areashop.teleport:
|
||||
description: Teleport to your region
|
||||
default: true
|
||||
areashop.teleportall:
|
||||
description: Teleport to all regions
|
||||
default: true
|
||||
areashop.teleportsign:
|
||||
description: Teleport to signs of regions
|
||||
default: true
|
||||
areashop.setteleport:
|
||||
description: Set the teleport spot for your region
|
||||
default: true
|
||||
areashop.setteleportall:
|
||||
description: Set the teleport for other regions
|
||||
default: op
|
||||
areashop.setteleportoutsideregion:
|
||||
description: Set the teleport location outside the WorldGuard region
|
||||
default: op
|
||||
areashop.tabcomplete:
|
||||
description: Allows you to tabcomplete all commands (also where you dont have permission)
|
||||
default: op
|
||||
areashop.find:
|
||||
description: Allows you to teleport to a free region (/as find)
|
||||
default: true
|
||||
areashop.groupadd:
|
||||
description: Allows you to add regions to groups
|
||||
default: op
|
||||
areashop.groupdel:
|
||||
description: Allows you to delete regions from groups
|
||||
default: op
|
||||
areashop.grouplist:
|
||||
description: Allows you to list all the groups currently created
|
||||
default: op
|
||||
areashop.groupinfo:
|
||||
description: Allows you to display information about a group (all members)
|
||||
default: op
|
||||
areashop.rentextendbypass:
|
||||
description: Bypass the extend limit on rents
|
||||
default: op
|
||||
areashop.limits.default:
|
||||
description: Assign limits as set in the 'default' group in the 'limitGroups' section of the config
|
||||
default: not op
|
||||
areashop.limits.unlimited:
|
||||
description: Assign limits as set in the 'unlimited' group in the 'limitGroups' section of the config
|
||||
default: op
|
||||
areashop.schematicevents:
|
||||
description: Allows you to trigger schematic events for regions
|
||||
default: op
|
||||
areashop.addsign:
|
||||
description: Allows you to add signs to existing regions
|
||||
default: op
|
||||
areashop.delsign:
|
||||
description: Allows you to delete signs from existing regions
|
||||
default: op
|
||||
@@ -0,0 +1,230 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>areashop</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>AreaShop</name>
|
||||
<version>2.3.2</version> <!-- Main plugin version -->
|
||||
|
||||
<parent>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-parent</artifactId>
|
||||
<version>parent</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
<version>1.7.9-R0.2</version>
|
||||
<type>jar</type>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-worldguard-5</artifactId>
|
||||
<version>WorldGuard-5</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-worldguard-6</artifactId>
|
||||
<version>WorldGuard-6</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-worldguard-6_1_3</artifactId>
|
||||
<version>WorldGuard-6_1_3</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-interface</artifactId>
|
||||
<version>AreaShopInterface</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-worldedit-5</artifactId>
|
||||
<version>WorldEdit-5</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-worldedit-6</artifactId>
|
||||
<version>WorldEdit-6</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q</groupId>
|
||||
<artifactId>worldedit</artifactId>
|
||||
<version>6.0.0-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q</groupId>
|
||||
<artifactId>worldguard</artifactId>
|
||||
<version>6.0.0-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.milkbowl.vault</groupId>
|
||||
<artifactId>VaultAPI</artifactId>
|
||||
<version>1.4</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<profiles>
|
||||
<!-- Copy the jar file to a test server, activate by using -DcopyResult="/path/to/test/server" -->
|
||||
<profile>
|
||||
<id>test-locally</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>copyResult</name>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<version>1.8</version>
|
||||
<configuration>
|
||||
<target>
|
||||
<copy file="./target/${project.build.finalName}.jar" tofile="${copyResult}\${project.build.finalName}.jar"/>
|
||||
</target>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
|
||||
<!-- Package the source files in a jar, activate by using -Dsources -->
|
||||
<profile>
|
||||
<id>package-sources</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>sources</name>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<id>attach-sources</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
|
||||
<!-- Produce javadoc files, activate by using -Djavadoc -->
|
||||
<profile>
|
||||
<id>generate-javadoc</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>javadoc</name>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>2.10.4</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<id>attach-javadocs</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<excludePackageNames>me.wiefferink.areashop.lib</excludePackageNames>
|
||||
<destDir>${javadoc}</destDir>
|
||||
<links>
|
||||
<link>https://hub.spigotmc.org/javadocs/bukkit/</link>
|
||||
<link>http://docs.sk89q.com/worldedit/apidocs/</link>
|
||||
<link>http://docs.sk89q.com/worldguard/apidocs/</link>
|
||||
</links>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<build>
|
||||
<directory>target</directory>
|
||||
<finalName>AreaShop</finalName>
|
||||
<resources>
|
||||
<resource>
|
||||
<targetPath>.</targetPath>
|
||||
<filtering>true</filtering>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>plugin.yml</include>
|
||||
<include>config.yml</include>
|
||||
<include>hiddenConfig.yml</include>
|
||||
<include>default.yml</include>
|
||||
<include>README.md</include>
|
||||
<include>lang/*.yml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>2.4.3</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.5.1</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,717 @@
|
||||
package me.wiefferink.areashop;
|
||||
|
||||
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
||||
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
|
||||
import me.wiefferink.areashop.features.DebugFeature;
|
||||
import me.wiefferink.areashop.features.Feature;
|
||||
import me.wiefferink.areashop.features.SignsFeature;
|
||||
import me.wiefferink.areashop.features.WorldGuardRegionFlagsFeature;
|
||||
import me.wiefferink.areashop.interfaces.AreaShopInterface;
|
||||
import me.wiefferink.areashop.interfaces.WorldEditInterface;
|
||||
import me.wiefferink.areashop.interfaces.WorldGuardInterface;
|
||||
import me.wiefferink.areashop.lib.Metrics;
|
||||
import me.wiefferink.areashop.lib.Updater;
|
||||
import me.wiefferink.areashop.lib.Updater.UpdateResult;
|
||||
import me.wiefferink.areashop.lib.Updater.UpdateType;
|
||||
import me.wiefferink.areashop.listeners.PlayerLoginLogoutListener;
|
||||
import me.wiefferink.areashop.listeners.SignBreakListener;
|
||||
import me.wiefferink.areashop.listeners.SignChangeListener;
|
||||
import me.wiefferink.areashop.listeners.SignClickListener;
|
||||
import me.wiefferink.areashop.managers.CommandManager;
|
||||
import me.wiefferink.areashop.managers.FileManager;
|
||||
import me.wiefferink.areashop.managers.SignLinkerManager;
|
||||
import me.wiefferink.areashop.messages.LanguageManager;
|
||||
import me.wiefferink.areashop.messages.Message;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang.exception.ExceptionUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.permissions.Permission;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* Main class for the AreaShop plugin
|
||||
* Contains methods to get parts of the plugins functionality and definitions for constants
|
||||
*/
|
||||
public final class AreaShop extends JavaPlugin implements AreaShopInterface {
|
||||
// Statically available instance
|
||||
private static AreaShop instance = null;
|
||||
|
||||
// General variables
|
||||
private WorldGuardPlugin worldGuard = null;
|
||||
private WorldGuardInterface worldGuardInterface = null;
|
||||
private WorldEditPlugin worldEdit = null;
|
||||
private WorldEditInterface worldEditInterface = null;
|
||||
private FileManager fileManager = null;
|
||||
private LanguageManager languageManager = null;
|
||||
private CommandManager commandManager = null;
|
||||
private SignLinkerManager signLinkerManager = null;
|
||||
private boolean debug = false;
|
||||
private List<String> chatprefix = null;
|
||||
private Updater updater = null;
|
||||
private boolean updateAvailable = false;
|
||||
private boolean ready = false;
|
||||
|
||||
// Folders and file names
|
||||
public static final String languageFolder = "lang";
|
||||
public static final String schematicFolder = "schem";
|
||||
public static final String schematicExtension = ".schematic";
|
||||
public static final String regionsFolder = "regions";
|
||||
public static final String groupsFile = "groups.yml";
|
||||
public static final String defaultFile = "default.yml";
|
||||
public static final String configFile = "config.yml";
|
||||
public static final String configFileHidden = "hiddenConfig.yml";
|
||||
public static final String versionFile = "versions";
|
||||
|
||||
// Euro tag for in the config
|
||||
public static final String currencyEuro = "%euro%";
|
||||
|
||||
// Constants for handling file versions
|
||||
public static final String versionFiles = "files";
|
||||
public static final int versionFilesCurrent = 3;
|
||||
|
||||
// Keys for replacing parts of flags, commands, strings
|
||||
public static final String tagPlayerName = "%player%";
|
||||
public static final String tagPlayerUUID = "%uuid%";
|
||||
public static final String tagWorldName = "%world%";
|
||||
public static final String tagRegionName = "%region%";
|
||||
public static final String tagRegionType = "%type%";
|
||||
public static final String tagPrice = "%price%";
|
||||
public static final String tagRawPrice = "%rawprice%";
|
||||
public static final String tagDuration = "%duration%";
|
||||
public static final String tagRentedUntil = "%until%";
|
||||
public static final String tagRentedUntilShort = "%untilshort%";
|
||||
public static final String tagWidth = "%width%"; // x-axis
|
||||
public static final String tagHeight = "%height%"; // y-axis
|
||||
public static final String tagDepth = "%depth%"; // z-axis
|
||||
public static final String tagTimeLeft = "%timeleft%";
|
||||
public static final String tagClicker = "%clicker%";
|
||||
public static final String tagResellPrice = "%resellprice%";
|
||||
public static final String tagRawResellPrice = "%rawresellprice%";
|
||||
public static final String tagFriends = "%friends%";
|
||||
public static final String tagFriendsUUID = "%friendsuuid%";
|
||||
public static final String tagMoneyBackPercentage = "%moneybackpercent%";
|
||||
public static final String tagMoneyBackAmount = "%moneyback%";
|
||||
public static final String tagRawMoneyBackAmount = "%rawmoneyback%";
|
||||
public static final String tagMaxExtends = "%maxextends%";
|
||||
public static final String tagExtendsLeft = "%extendsleft%";
|
||||
public static final String tagMaxRentTime = "%maxrenttime%";
|
||||
public static final String tagMaxInactiveTime = "%inactivetime%";
|
||||
public static final String tagLandlord = "%landlord%";
|
||||
public static final String tagLandlordUUID = "%landlorduuid%";
|
||||
public static final String tagDateTime = "%datetime%";
|
||||
public static final String tagDateTimeShort = "%datetimeshort%";
|
||||
public static final String tagYear = "%year%";
|
||||
public static final String tagMonth = "%month%";
|
||||
public static final String tagDay = "%day%";
|
||||
public static final String tagHour = "%hour%";
|
||||
public static final String tagMinute = "%minute%";
|
||||
public static final String tagSecond = "%second%";
|
||||
public static final String tagMillisecond = "%millisecond%";
|
||||
public static final String tagEpoch = "%epoch%";
|
||||
public static final String tagTeleportX = "%tpx%";
|
||||
public static final String tagTeleportY = "%tpy%";
|
||||
public static final String tagTeleportZ = "%tpz%";
|
||||
public static final String tagTeleportBlockX = "%tpblockx%";
|
||||
public static final String tagTeleportBlockY = "%tpblocky%";
|
||||
public static final String tagTeleportBlockZ = "%tpblockz%";
|
||||
public static final String tagTeleportPitch = "%tppitch%";
|
||||
public static final String tagTeleportYaw = "%tpyaw%";
|
||||
public static final String tagTeleportPitchRound = "%tppitchround%";
|
||||
public static final String tagTeleportYawRound = "%tpyawround%";
|
||||
public static final String tagTeleportWorld = "%tpworld%";
|
||||
|
||||
public static AreaShop getInstance() {
|
||||
return AreaShop.instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called on start or reload of the server
|
||||
*/
|
||||
public void onEnable() {
|
||||
AreaShop.instance = this;
|
||||
boolean error = false;
|
||||
|
||||
// Check if WorldGuard is present
|
||||
String wgVersion = null;
|
||||
String rawVersion = null;
|
||||
int major = 0, minor = 0, fixes = 0;
|
||||
Integer build = null;
|
||||
Plugin plugin = getServer().getPluginManager().getPlugin("WorldGuard");
|
||||
if (plugin == null || !(plugin instanceof WorldGuardPlugin)) {
|
||||
getLogger().severe("WorldGuard plugin is not present or has not loaded correctly");
|
||||
error = true;
|
||||
} else {
|
||||
worldGuard = (WorldGuardPlugin)plugin;
|
||||
// Get correct WorldGuardInterface (handles things that changed version to version)
|
||||
rawVersion = worldGuard.getDescription().getVersion();
|
||||
if(rawVersion.contains("-SNAPSHOT;")) {
|
||||
String buildNumber = rawVersion.substring(rawVersion.indexOf("-SNAPSHOT;")+10, rawVersion.length());
|
||||
if(rawVersion.contains("-")) {
|
||||
buildNumber = buildNumber.substring(0, buildNumber.indexOf("-"));
|
||||
}
|
||||
try {
|
||||
build = Integer.parseInt(buildNumber);
|
||||
} catch(NumberFormatException e) {
|
||||
getLogger().warning("Could not correctly parse the build of WorldGuard, raw version: "+rawVersion+", buildNumber: "+buildNumber);
|
||||
}
|
||||
}
|
||||
// Clear stuff from the version string that is not a number
|
||||
String[] versionParts = rawVersion.split("\\.");
|
||||
for(int i = 0; i < versionParts.length; i++) {
|
||||
Pattern pattern = Pattern.compile("^\\d+");
|
||||
Matcher matcher = pattern.matcher(versionParts[i]);
|
||||
if(matcher.find()) {
|
||||
versionParts[i] = matcher.group();
|
||||
}
|
||||
}
|
||||
// Find major, minor and fix numbers
|
||||
try {
|
||||
if(versionParts.length > 0) {
|
||||
major = Integer.parseInt(versionParts[0]);
|
||||
}
|
||||
if(versionParts.length > 1) {
|
||||
minor = Integer.parseInt(versionParts[1]);
|
||||
}
|
||||
if(versionParts.length > 2) {
|
||||
fixes = Integer.parseInt(versionParts[2]);
|
||||
}
|
||||
} catch(NumberFormatException e) {
|
||||
getLogger().warning("Something went wrong while parsing WorldGuard version number: "+rawVersion);
|
||||
}
|
||||
// Determine correct implementation to use
|
||||
if(major >= 6 && minor >= 1 && fixes > 3) {
|
||||
wgVersion = "6_1_3";
|
||||
} else if(build != null && build >= 1672) {
|
||||
if(build > 1672) {
|
||||
wgVersion = "6_1_3"; // Flag name to flag object method changed
|
||||
} else {
|
||||
// Build 1672 is broken, flags changed but no FlagContext added yet
|
||||
error = true;
|
||||
getLogger().severe("Build 1672 of WorldGuard is broken, update to a later build or a stable version!");
|
||||
}
|
||||
} else if(worldGuard.getDescription().getVersion().startsWith("5.")) {
|
||||
wgVersion = "5";
|
||||
} else {
|
||||
wgVersion = "6"; // Schematic methods changed
|
||||
}
|
||||
// Load chosen implementation
|
||||
try {
|
||||
final Class<?> clazz = Class.forName("me.wiefferink.areashop.handlers.WorldGuardHandler"+wgVersion);
|
||||
// Check if we have a NMSHandler class at that location.
|
||||
if (WorldGuardInterface.class.isAssignableFrom(clazz)) { // Make sure it actually implements WorldGuardInterface
|
||||
worldGuardInterface = (WorldGuardInterface)clazz.getConstructor(AreaShopInterface.class).newInstance(this); // Set our handler
|
||||
}
|
||||
} catch (final Exception e) {
|
||||
getLogger().severe("Could not load the handler for WorldGuard (tried to load "+wgVersion+"), report this problem to the author:"+ExceptionUtils.getStackTrace(e));
|
||||
error = true;
|
||||
wgVersion = null;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if WorldEdit is present
|
||||
String weVersion = null;
|
||||
plugin = getServer().getPluginManager().getPlugin("WorldEdit");
|
||||
if (plugin == null || !(plugin instanceof WorldEditPlugin)) {
|
||||
getLogger().severe("WorldEdit plugin is not present or has not loaded correctly");
|
||||
error = true;
|
||||
} else {
|
||||
worldEdit = (WorldEditPlugin)plugin;
|
||||
// Get correct WorldEditInterface (handles things that changed version to version)
|
||||
if(worldEdit.getDescription().getVersion().startsWith("5.")) {
|
||||
weVersion = "5";
|
||||
} else {
|
||||
weVersion = "6";
|
||||
}
|
||||
try {
|
||||
final Class<?> clazz = Class.forName("me.wiefferink.areashop.handlers.WorldEditHandler"+weVersion);
|
||||
// Check if we have a NMSHandler class at that location.
|
||||
if (WorldEditInterface.class.isAssignableFrom(clazz)) { // Make sure it actually implements WorldEditInterface
|
||||
worldEditInterface = (WorldEditInterface)clazz.getConstructor(AreaShopInterface.class).newInstance(this); // Set our handler
|
||||
}
|
||||
} catch (final Exception e) {
|
||||
getLogger().severe("Could not load the handler for WorldEdit (tried to load "+weVersion+"), report this problem to the author: "+ExceptionUtils.getStackTrace(e));
|
||||
error = true;
|
||||
weVersion = null;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if Vault is present
|
||||
if(getServer().getPluginManager().getPlugin("Vault") == null) {
|
||||
getLogger().severe("Vault plugin is not present or has not loaded correctly");
|
||||
error = true;
|
||||
}
|
||||
|
||||
// Load all data from files and check versions
|
||||
fileManager = new FileManager(this);
|
||||
error = error | !fileManager.loadFiles();
|
||||
|
||||
// Print loaded version of WG and WE in debug
|
||||
if(wgVersion != null) {
|
||||
AreaShop.debug("Loaded WorldGuardHandler"+wgVersion+" (raw version: "+rawVersion+", major:"+major+", minor:"+minor+", fixes:"+fixes+", build:"+build+")");
|
||||
}
|
||||
if(weVersion != null) {
|
||||
AreaShop.debug("Loaded WorldEditHandler" + weVersion);
|
||||
}
|
||||
|
||||
// Create a LanguageMananager
|
||||
languageManager = new LanguageManager(this);
|
||||
|
||||
if(error) {
|
||||
getLogger().severe("The plugin has not started, fix the errors listed above");
|
||||
} else {
|
||||
// Register the event listeners
|
||||
getServer().getPluginManager().registerEvents(new SignChangeListener(this), this);
|
||||
getServer().getPluginManager().registerEvents(new SignBreakListener(this), this);
|
||||
getServer().getPluginManager().registerEvents(new SignClickListener(this), this);
|
||||
getServer().getPluginManager().registerEvents(new PlayerLoginLogoutListener(this), this);
|
||||
|
||||
setupFeatures();
|
||||
setupTasks();
|
||||
|
||||
// Startup the CommandManager (registers itself for the command)
|
||||
commandManager = new CommandManager(this);
|
||||
|
||||
// Create a signLinkerManager
|
||||
signLinkerManager = new SignLinkerManager(this);
|
||||
|
||||
// Enable Metrics if config allows it
|
||||
if(getConfig().getBoolean("sendStats")) {
|
||||
startMetrics();
|
||||
}
|
||||
|
||||
// Register dynamic permission (things declared in config)
|
||||
registerDynamicPermissions();
|
||||
|
||||
// Dont initialize the updatechecker if disabled in the config
|
||||
if(getConfig().getBoolean("checkForUpdates")) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
updater = new Updater(AreaShop.getInstance(), 76518, null, UpdateType.NO_DOWNLOAD, false);
|
||||
AreaShop.debug("Result=" + updater.getResult().toString() + ", Latest=" + updater.getLatestName() + ", Type=" + updater.getLatestType());
|
||||
updateAvailable = updater.getResult() == UpdateResult.UPDATE_AVAILABLE;
|
||||
if(updateAvailable) {
|
||||
AreaShop.getInstance().getLogger().info("Update from AreaShop V" + AreaShop.getInstance().getDescription().getVersion() + " to " + updater.getLatestName() + " available, get the latest version at http://dev.bukkit.org/bukkit-plugins/regionbuyandrent/");
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for(Player player : Utils.getOnlinePlayers()) {
|
||||
if(player.hasPermission("areashop.notifyupdate")) {
|
||||
AreaShop.getInstance().message(player, "update-playerNotify", AreaShop.getInstance().getDescription().getVersion(), AreaShop.getInstance().getUpdater().getLatestName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}.runTask(AreaShop.getInstance());
|
||||
}
|
||||
} catch(Exception e) {
|
||||
AreaShop.debug("Something went wrong with the Updater:");
|
||||
AreaShop.debug(e.getMessage());
|
||||
updateAvailable = false;
|
||||
}
|
||||
}
|
||||
}.runTaskAsynchronously(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called on shutdown or reload of the server
|
||||
*/
|
||||
public void onDisable() {
|
||||
// Update lastactive time for players that are online now
|
||||
for(GeneralRegion region : fileManager.getRegions()) {
|
||||
Player player = Bukkit.getPlayer(region.getOwner());
|
||||
if(player != null) {
|
||||
region.updateLastActiveTime();
|
||||
}
|
||||
}
|
||||
fileManager.saveRequiredFilesAtOnce();
|
||||
Bukkit.getServer().getScheduler().cancelTasks(this);
|
||||
|
||||
worldGuard = null;
|
||||
worldEdit = null;
|
||||
fileManager = null;
|
||||
languageManager = null;
|
||||
commandManager = null;
|
||||
chatprefix = null;
|
||||
debug = false;
|
||||
ready = false;
|
||||
updater = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Instanciate and register all Feature classes
|
||||
*/
|
||||
public void setupFeatures() {
|
||||
Set<Feature> features = new HashSet<>();
|
||||
|
||||
features.add(new DebugFeature());
|
||||
features.add(new SignsFeature());
|
||||
features.add(new WorldGuardRegionFlagsFeature());
|
||||
|
||||
// Register as listener when necessary
|
||||
for(Feature feature : features) {
|
||||
if(feature instanceof Listener) {
|
||||
getServer().getPluginManager().registerEvents((Listener)feature, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if the plugin is ready to be used
|
||||
* @return true if the plugin is ready, false otherwise
|
||||
*/
|
||||
public boolean isReady() {
|
||||
return ready;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set if the plugin is ready to be used or not (not to be used from another plugin!)
|
||||
* @param ready Indicate if the plugin is ready to be used
|
||||
*/
|
||||
public void setReady(boolean ready) {
|
||||
this.ready = ready;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set if the plugin should output debug messages (loaded from config normally)
|
||||
* @param debug Indicates if the plugin should output debug messages or not
|
||||
*/
|
||||
public void setDebug(boolean debug) {
|
||||
this.debug = debug;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the chatprefix to use in the chat (loaded from config normally)
|
||||
* @param chatprefix The string to use in front of chat messages (supports formatting codes)
|
||||
*/
|
||||
public void setChatprefix(List<String> chatprefix) {
|
||||
this.chatprefix = chatprefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to get the WorldGuard plugin
|
||||
* @return WorldGuardPlugin
|
||||
*/
|
||||
public WorldGuardPlugin getWorldGuard() {
|
||||
return worldGuard;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to get WorldGuardInterface for version dependent things
|
||||
* @return WorldGuardInterface
|
||||
*/
|
||||
public WorldGuardInterface getWorldGuardHandler() {
|
||||
return this.worldGuardInterface;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to get the WorldEdit plugin
|
||||
* @return WorldEditPlugin
|
||||
*/
|
||||
public WorldEditPlugin getWorldEdit() {
|
||||
return worldEdit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to get WorldGuardInterface for version dependent things
|
||||
* @return WorldGuardInterface
|
||||
*/
|
||||
public WorldEditInterface getWorldEditHandler() {
|
||||
return this.worldEditInterface;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to get the LanguageManager
|
||||
* @return the LanguageManager
|
||||
*/
|
||||
public LanguageManager getLanguageManager() {
|
||||
return languageManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to get the CommandManager
|
||||
* @return the CommandManager
|
||||
*/
|
||||
public CommandManager getCommandManager() {
|
||||
return commandManager;
|
||||
}
|
||||
|
||||
public SignLinkerManager getSignlinkerManager() {
|
||||
return signLinkerManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to get the Vault plugin
|
||||
* @return Economy
|
||||
*/
|
||||
public Economy getEconomy() {
|
||||
RegisteredServiceProvider<Economy> economy = getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class);
|
||||
if (economy == null || economy.getProvider() == null) {
|
||||
getLogger().severe("There is no economy provider to support Vault, make sure you installed an economy plugin");
|
||||
return null;
|
||||
}
|
||||
return economy.getProvider();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current chatPrefix
|
||||
* @return The current chatPrefix
|
||||
*/
|
||||
public List<String> getChatPrefix() {
|
||||
return chatprefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the FileManager (loads/save regions and can be used to get regions)
|
||||
* @return The fileManager
|
||||
*/
|
||||
public FileManager getFileManager() {
|
||||
return fileManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the updater (check the update result)
|
||||
* @return The updater
|
||||
*/
|
||||
public Updater getUpdater() {
|
||||
return updater;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if an update for AreaShop is available
|
||||
* @return true if an update is available, otherwise false
|
||||
*/
|
||||
public boolean updateAvailable() {
|
||||
return updateAvailable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register dynamic permissions controlled by config settings
|
||||
*/
|
||||
public void registerDynamicPermissions() {
|
||||
// Register limit groups of amount of regions a player can have
|
||||
ConfigurationSection section = getConfig().getConfigurationSection("limitGroups");
|
||||
if(section == null) {
|
||||
return;
|
||||
}
|
||||
for(String group : section.getKeys(false)) {
|
||||
if(!"default".equals(group)) {
|
||||
Permission perm = new Permission("areashop.limits." + group);
|
||||
try {
|
||||
Bukkit.getPluginManager().addPermission(perm);
|
||||
} catch(IllegalArgumentException e) {
|
||||
getLogger().warning("Could not add the following permission to be used as limit: "+perm.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
Bukkit.getPluginManager().recalculatePermissionDefaults(Bukkit.getPluginManager().getPermission("playerwarps.limits"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Register all required tasks
|
||||
*/
|
||||
public void setupTasks() {
|
||||
// Rent expiration timer
|
||||
long expirationCheck = Utils.millisToTicks(Utils.getDurationFromSecondsOrString("expiration.delay"));
|
||||
final AreaShop finalPlugin = this;
|
||||
if(expirationCheck > 0) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if(isReady()) {
|
||||
finalPlugin.getFileManager().checkRents();
|
||||
AreaShop.debugTask("Checking rent expirations...");
|
||||
} else {
|
||||
AreaShop.debugTask("Skipped checking rent expirations, plugin not ready");
|
||||
}
|
||||
}
|
||||
}.runTaskTimer(this, 1, expirationCheck);
|
||||
}
|
||||
// Inactive unrenting/selling timer
|
||||
long inactiveCheck = Utils.millisToTicks(Utils.getDurationFromMinutesOrString("inactive.delay"));
|
||||
if(inactiveCheck > 0) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if(isReady()) {
|
||||
finalPlugin.getFileManager().checkForInactiveRegions();
|
||||
AreaShop.debugTask("Checking for regions with players that are inactive too long...");
|
||||
} else {
|
||||
AreaShop.debugTask("Skipped checking for regions of inactive players, plugin not ready");
|
||||
}
|
||||
}
|
||||
}.runTaskTimer(this, inactiveCheck, inactiveCheck);
|
||||
}
|
||||
// Periodic updating of signs for timeleft tags
|
||||
long periodicUpdate = Utils.millisToTicks(Utils.getDurationFromSecondsOrString("signs.delay"));
|
||||
if(periodicUpdate > 0) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if(isReady()) {
|
||||
finalPlugin.getFileManager().performPeriodicSignUpdate();
|
||||
AreaShop.debugTask("Performing periodic sign update...");
|
||||
} else {
|
||||
AreaShop.debugTask("Skipped performing periodic sign update, plugin not ready");
|
||||
}
|
||||
}
|
||||
}.runTaskTimer(this, periodicUpdate, periodicUpdate);
|
||||
}
|
||||
// Saving regions and group settings
|
||||
long saveFiles = Utils.millisToTicks(Utils.getDurationFromMinutesOrString("saving.delay"));
|
||||
if(saveFiles > 0) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if(isReady()) {
|
||||
finalPlugin.getFileManager().saveRequiredFiles();
|
||||
AreaShop.debugTask("Saving required files...");
|
||||
} else {
|
||||
AreaShop.debugTask("Skipped saving required files, plugin not ready");
|
||||
}
|
||||
}
|
||||
}.runTaskTimer(this, saveFiles, saveFiles);
|
||||
}
|
||||
// Sending warnings about rent regions to online players
|
||||
long expireWarning = Utils.millisToTicks(Utils.getDurationFromMinutesOrString("expireWarning.delay"));
|
||||
if(expireWarning > 0) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if(isReady()) {
|
||||
finalPlugin.getFileManager().sendRentExpireWarnings();
|
||||
AreaShop.debugTask("Sending rent expire warnings...");
|
||||
} else {
|
||||
AreaShop.debugTask("Skipped sending rent expire warnings, plugin not ready");
|
||||
}
|
||||
}
|
||||
}.runTaskTimer(this, expireWarning, expireWarning);
|
||||
}
|
||||
// Update all regions on startup
|
||||
if(getConfig().getBoolean("updateRegionsOnStartup")) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
finalPlugin.getFileManager().updateAllRegions();
|
||||
AreaShop.debugTask("Updating all regions at startup...");
|
||||
}
|
||||
}.runTaskLater(this, 20L);
|
||||
}
|
||||
}
|
||||
|
||||
public void messageNoPrefix(Object target, String key, Object... replacements) {
|
||||
Message.fromKey(key).replacements(replacements).send(target);
|
||||
}
|
||||
|
||||
public void message(Object target, String key, Object... replacements) {
|
||||
Message.fromKey(key).prefix().replacements(replacements).send(target);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the config
|
||||
*/
|
||||
@Override
|
||||
public YamlConfiguration getConfig() {
|
||||
return fileManager.getConfig();
|
||||
}
|
||||
|
||||
/**
|
||||
* Start the Metrics stats collection
|
||||
*/
|
||||
private void startMetrics() {
|
||||
try {
|
||||
Metrics metrics = new Metrics(this);
|
||||
metrics.start();
|
||||
} catch (Exception e) {
|
||||
AreaShop.debug("Could not start Metrics");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sends an debug message to the console
|
||||
* @param message The message that should be printed to the console
|
||||
*/
|
||||
public static void debug(Object... message) {
|
||||
if(AreaShop.getInstance().debug) {
|
||||
AreaShop.getInstance().getLogger().info("Debug: "+StringUtils.join(message, " "));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Non-static debug to use as implementation of the interface
|
||||
*/
|
||||
public void debugI(String message) {
|
||||
AreaShop.debug(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Print a warning to the console
|
||||
* @param message The message to print
|
||||
*/
|
||||
public static void warn(String... message) {
|
||||
AreaShop.getInstance().getLogger().warning(StringUtils.join(message, " "));
|
||||
}
|
||||
|
||||
/**
|
||||
* Print an information message to the console
|
||||
* @param message The message to print
|
||||
*/
|
||||
public static void info(String... message) {
|
||||
AreaShop.getInstance().getLogger().info(StringUtils.join(message, " "));
|
||||
}
|
||||
|
||||
/**
|
||||
* Print debug message for periodic task
|
||||
* @param message The message to print
|
||||
*/
|
||||
public static void debugTask(String message) {
|
||||
if(AreaShop.getInstance().getConfig().getBoolean("debugTask")) {
|
||||
AreaShop.debug(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reload all files of the plugin and update all regions
|
||||
* confirmationReceiver The CommandSender that should receive confirmation messages, null for nobody
|
||||
* @param confirmationReceiver The CommandSender which should be notified when complete
|
||||
*/
|
||||
public void reload(final CommandSender confirmationReceiver) {
|
||||
setReady(false);
|
||||
fileManager.saveRequiredFilesAtOnce();
|
||||
fileManager.loadFiles();
|
||||
languageManager.startup();
|
||||
message(confirmationReceiver, "reload-reloading");
|
||||
fileManager.checkRents();
|
||||
fileManager.updateAllRegions(confirmationReceiver);
|
||||
}
|
||||
/**
|
||||
* Reload all files of the plugin and update all regions
|
||||
*/
|
||||
public void reload() {
|
||||
reload(null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,746 @@
|
||||
package me.wiefferink.areashop;
|
||||
|
||||
import com.sk89q.worldedit.BlockVector;
|
||||
import com.sk89q.worldedit.bukkit.selections.CuboidSelection;
|
||||
import com.sk89q.worldedit.bukkit.selections.Selection;
|
||||
import com.sk89q.worldguard.protection.managers.RegionManager;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
import me.wiefferink.areashop.messages.Message;
|
||||
import me.wiefferink.areashop.regions.BuyRegion;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
import me.wiefferink.areashop.regions.RentRegion;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.*;
|
||||
|
||||
public class Utils {
|
||||
|
||||
// Not used
|
||||
private Utils() {}
|
||||
|
||||
private static YamlConfiguration config;
|
||||
private static ArrayList<String> identifiers;
|
||||
private static ArrayList<String> seconds;
|
||||
private static ArrayList<String> minutes;
|
||||
private static ArrayList<String> hours;
|
||||
private static ArrayList<String> days;
|
||||
private static ArrayList<String> weeks;
|
||||
private static ArrayList<String> months;
|
||||
private static ArrayList<String> years;
|
||||
|
||||
public static void initialize(YamlConfiguration pluginConfig) {
|
||||
config = pluginConfig;
|
||||
|
||||
// Setup individual identifiers
|
||||
seconds = new ArrayList<>(config.getStringList("seconds"));
|
||||
minutes = new ArrayList<>(config.getStringList("minutes"));
|
||||
hours = new ArrayList<>(config.getStringList("hours"));
|
||||
days = new ArrayList<>(config.getStringList("days"));
|
||||
weeks = new ArrayList<>(config.getStringList("weeks"));
|
||||
months = new ArrayList<>(config.getStringList("months"));
|
||||
years = new ArrayList<>(config.getStringList("years"));
|
||||
// Setup all time identifiers
|
||||
identifiers = new ArrayList<>();
|
||||
identifiers.addAll(seconds);
|
||||
identifiers.addAll(minutes);
|
||||
identifiers.addAll(hours);
|
||||
identifiers.addAll(days);
|
||||
identifiers.addAll(weeks);
|
||||
identifiers.addAll(months);
|
||||
identifiers.addAll(years);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a message with a list of parts
|
||||
* @param replacements The parts to use
|
||||
* @param messagePart The message to use for the parts
|
||||
* @return A Message object containing the parts combined into one message
|
||||
*/
|
||||
public static Message combinedMessage(Collection<?> replacements, String messagePart) {
|
||||
return combinedMessage(replacements, messagePart, ", ");
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a message with a list of parts
|
||||
* @param replacements The parts to use
|
||||
* @param messagePart The message to use for the parts
|
||||
* @param combiner The string to use as combiner
|
||||
* @return A Message object containing the parts combined into one message
|
||||
*/
|
||||
public static Message combinedMessage(Collection<?> replacements, String messagePart, String combiner) {
|
||||
Message result = Message.none();
|
||||
boolean first = true;
|
||||
for(Object part : replacements) {
|
||||
if(first) {
|
||||
first = false;
|
||||
} else {
|
||||
result.append(combiner);
|
||||
}
|
||||
result.append(Message.fromKey(messagePart).replacements(part));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the online players
|
||||
* Provides backwards compatibility for 1.7- where it returns an array
|
||||
* @return Online players
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static Collection<? extends Player> getOnlinePlayers() {
|
||||
try {
|
||||
Method onlinePlayerMethod = Server.class.getMethod("getOnlinePlayers");
|
||||
if(onlinePlayerMethod.getReturnType().equals(Collection.class)) {
|
||||
return ((Collection<? extends Player>)onlinePlayerMethod.invoke(Bukkit.getServer()));
|
||||
} else {
|
||||
return Arrays.asList((Player[])onlinePlayerMethod.invoke(Bukkit.getServer()));
|
||||
}
|
||||
} catch(Exception ex) {
|
||||
AreaShop.debug("getOnlinePlayers error: "+ex.getMessage());
|
||||
}
|
||||
return new HashSet<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a map from a location, to save it in the config
|
||||
* @param location The location to transform
|
||||
* @param setPitchYaw true to save the pitch and yaw, otherwise false
|
||||
* @return The map with the location values
|
||||
*/
|
||||
public static ConfigurationSection locationToConfig(Location location, boolean setPitchYaw) {
|
||||
if(location == null) {
|
||||
return null;
|
||||
}
|
||||
ConfigurationSection result = new YamlConfiguration();
|
||||
result.set("world", location.getWorld().getName());
|
||||
result.set("x", location.getX());
|
||||
result.set("y", location.getY());
|
||||
result.set("z", location.getZ());
|
||||
if(setPitchYaw) {
|
||||
result.set("yaw", Float.toString(location.getYaw()));
|
||||
result.set("pitch", Float.toString(location.getPitch()));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a map from a location, to save it in the config (without pitch and yaw)
|
||||
* @param location The location to transform
|
||||
* @return The map with the location values
|
||||
*/
|
||||
public static ConfigurationSection locationToConfig(Location location) {
|
||||
return locationToConfig(location, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a location from a map, reconstruction from the config values
|
||||
* @param config The config section to reconstruct from
|
||||
* @return The location
|
||||
*/
|
||||
public static Location configToLocation(ConfigurationSection config) {
|
||||
if(config == null
|
||||
|| !config.isString("world")
|
||||
|| !config.isDouble("x")
|
||||
|| !config.isDouble("y")
|
||||
|| !config.isDouble("z")
|
||||
|| Bukkit.getWorld(config.getString("world")) == null) {
|
||||
return null;
|
||||
}
|
||||
Location result = new Location(
|
||||
Bukkit.getWorld(config.getString("world")),
|
||||
config.getDouble("x"),
|
||||
config.getDouble("y"),
|
||||
config.getDouble("z"));
|
||||
if(config.isString("yaw") && config.isString("pitch")) {
|
||||
result.setPitch(Float.parseFloat(config.getString("pitch")));
|
||||
result.setYaw(Float.parseFloat(config.getString("yaw")));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a comma-separated list
|
||||
* @param input Collection of object which should be concatenated with comma's in between
|
||||
* @return Innput object concatenated with comma's in between
|
||||
*/
|
||||
public static String createCommaSeparatedList(Collection<?> input) {
|
||||
String result = "";
|
||||
boolean first = true;
|
||||
for(Object object : input) {
|
||||
if(object != null) {
|
||||
if(first) {
|
||||
first = false;
|
||||
result += object.toString();
|
||||
} else {
|
||||
result += ", " + object.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert milliseconds to ticks
|
||||
* @param milliseconds Milliseconds to convert
|
||||
* @return milliseconds divided by 50 (20 ticks per second)
|
||||
*/
|
||||
public static long millisToTicks(long milliseconds) {
|
||||
return milliseconds/50;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert milliseconds to a human readable format
|
||||
* @param milliseconds The amount of milliseconds to convert
|
||||
* @return A formatted string based on the language file
|
||||
*/
|
||||
public static String millisToHumanFormat(long milliseconds) {
|
||||
long timeLeft = milliseconds+500;
|
||||
// To seconds
|
||||
timeLeft = timeLeft/1000;
|
||||
if(timeLeft <= 0) {
|
||||
return Message.fromKey("timeleft-ended").getPlain();
|
||||
} else if(timeLeft == 1) {
|
||||
return Message.fromKey("timeleft-second").replacements(timeLeft).getPlain();
|
||||
} else if(timeLeft <= 120) {
|
||||
return Message.fromKey("timeleft-seconds").replacements(timeLeft).getPlain();
|
||||
}
|
||||
// To minutes
|
||||
timeLeft = timeLeft/60;
|
||||
if(timeLeft <= 120) {
|
||||
return Message.fromKey("timeleft-minutes").replacements(timeLeft).getPlain();
|
||||
}
|
||||
// To hours
|
||||
timeLeft = timeLeft/60;
|
||||
if(timeLeft <= 48) {
|
||||
return Message.fromKey("timeleft-hours").replacements(timeLeft).getPlain();
|
||||
}
|
||||
// To days
|
||||
timeLeft = timeLeft/24;
|
||||
if(timeLeft <= 60) {
|
||||
return Message.fromKey("timeleft-days").replacements(timeLeft).getPlain();
|
||||
}
|
||||
// To months
|
||||
timeLeft = timeLeft/30;
|
||||
if(timeLeft <= 24) {
|
||||
return Message.fromKey("timeleft-months").replacements(timeLeft).getPlain();
|
||||
}
|
||||
// To years
|
||||
timeLeft = timeLeft/12;
|
||||
return Message.fromKey("timeleft-years").replacements(timeLeft).getPlain();
|
||||
}
|
||||
|
||||
private static final BlockFace[] facings = {BlockFace.NORTH, BlockFace.NORTH_EAST, BlockFace.EAST, BlockFace.SOUTH_EAST, BlockFace.SOUTH, BlockFace.SOUTH_WEST, BlockFace.WEST, BlockFace.NORTH_WEST};
|
||||
|
||||
/**
|
||||
* Get the facing direction based on the yaw
|
||||
* @param yaw The horizontal angle that for example the player is looking
|
||||
* @return The Block Face of the angle
|
||||
*/
|
||||
public static BlockFace yawToFacing(float yaw) {
|
||||
return facings[Math.round(yaw / 45f) & 0x7];
|
||||
}
|
||||
|
||||
// ======================================================================
|
||||
// Methods to get WorldGuard or AreaShop regions by location or selection
|
||||
// ======================================================================
|
||||
/**
|
||||
* Get all AreaShop regions intersecting with a WorldEdit selection
|
||||
* @param selection The selection to check
|
||||
* @return A list with all the AreaShop regions intersecting with the selection
|
||||
*/
|
||||
public static List<GeneralRegion> getASRegionsInSelection(Selection selection) {
|
||||
ArrayList<GeneralRegion> result = new ArrayList<>();
|
||||
for(ProtectedRegion region : getWERegionsInSelection(selection)) {
|
||||
GeneralRegion asRegion = AreaShop.getInstance().getFileManager().getRegion(region.getId());
|
||||
if(asRegion != null) {
|
||||
result.add(asRegion);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* Get all AreaShop regions containing a location
|
||||
* @param location The location to check
|
||||
* @return A list with all the AreaShop regions that contain the location
|
||||
*/
|
||||
public static List<GeneralRegion> getASRegionsByLocation(Location location) {
|
||||
Selection selection = new CuboidSelection(location.getWorld(), location, location);
|
||||
return getASRegionsInSelection(selection);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all WorldGuard regions intersecting with a WorldEdit selection
|
||||
* @param selection The selection to check
|
||||
* @return A list with all the WorldGuard regions intersecting with the selection
|
||||
*/
|
||||
public static List<ProtectedRegion> getWERegionsInSelection(Selection selection) {
|
||||
// Get all regions inside or intersecting with the WorldEdit selection of the player
|
||||
World world = selection.getWorld();
|
||||
RegionManager regionManager = AreaShop.getInstance().getWorldGuard().getRegionManager(world);
|
||||
ArrayList<ProtectedRegion> result = new ArrayList<>();
|
||||
Location selectionMin = selection.getMinimumPoint();
|
||||
Location selectionMax = selection.getMaximumPoint();
|
||||
for(ProtectedRegion region : regionManager.getRegions().values()) {
|
||||
BlockVector regionMin = region.getMinimumPoint();
|
||||
BlockVector regionMax = region.getMaximumPoint();
|
||||
if(
|
||||
( // x part, resolves to true if the selection and region overlap anywhere on the x-axis
|
||||
(regionMin.getBlockX() <= selectionMax.getBlockX() && regionMin.getBlockX() >= selectionMin.getBlockX())
|
||||
|| (regionMax.getBlockX() <= selectionMax.getBlockX() && regionMax.getBlockX() >= selectionMin.getBlockX())
|
||||
|| (selectionMin.getBlockX() >= regionMin.getBlockX() && selectionMin.getBlockX() <= regionMax.getBlockX())
|
||||
|| (selectionMax.getBlockX() >= regionMin.getBlockX() && selectionMax.getBlockX() <= regionMax.getBlockX())
|
||||
) && ( // Y part, resolves to true if the selection and region overlap anywhere on the y-axis
|
||||
(regionMin.getBlockY() <= selectionMax.getBlockY() && regionMin.getBlockY() >= selectionMin.getBlockY())
|
||||
|| (regionMax.getBlockY() <= selectionMax.getBlockY() && regionMax.getBlockY() >= selectionMin.getBlockY())
|
||||
|| (selectionMin.getBlockY() >= regionMin.getBlockY() && selectionMin.getBlockY() <= regionMax.getBlockY())
|
||||
|| (selectionMax.getBlockY() >= regionMin.getBlockY() && selectionMax.getBlockY() <= regionMax.getBlockY())
|
||||
) && ( // Z part, resolves to true if the selection and region overlap anywhere on the z-axis
|
||||
(regionMin.getBlockZ() <= selectionMax.getBlockZ() && regionMin.getBlockZ() >= selectionMin.getBlockZ())
|
||||
|| (regionMax.getBlockZ() <= selectionMax.getBlockZ() && regionMax.getBlockZ() >= selectionMin.getBlockZ())
|
||||
|| (selectionMin.getBlockZ() >= regionMin.getBlockZ() && selectionMin.getBlockZ() <= regionMax.getBlockZ())
|
||||
|| (selectionMax.getBlockZ() >= regionMin.getBlockZ() && selectionMax.getBlockZ() <= regionMax.getBlockZ())
|
||||
)
|
||||
) {
|
||||
result.add(region);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of regions around a location
|
||||
* - Returns highest priority, child instead of parent regions
|
||||
* @param location The location to check for regions
|
||||
* @return empty list if no regions found, 1 member if 1 region is a priority, more if regions with the same priority
|
||||
*/
|
||||
public static List<ProtectedRegion> getApplicableRegions(Location location) {
|
||||
List<ProtectedRegion> result = new ArrayList<>();
|
||||
Set<ProtectedRegion> regions = AreaShop.getInstance().getWorldGuardHandler().getApplicableRegionsSet(location);
|
||||
if(regions != null) {
|
||||
boolean first = true;
|
||||
for(ProtectedRegion pr : regions) {
|
||||
if(first) {
|
||||
result.add(pr);
|
||||
first = false;
|
||||
} else {
|
||||
if(pr.getPriority() > result.get(0).getPriority()) {
|
||||
result.clear();
|
||||
result.add(pr);
|
||||
} else if(pr.getParent() != null && pr.getParent().equals(result.get(0))) {
|
||||
result.clear();
|
||||
result.add(pr);
|
||||
} else {
|
||||
result.add(pr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the most important rental AreaShop regions
|
||||
* - Returns highest priority, child instead of parent regions
|
||||
* @param location The location to check for regions
|
||||
* @return empty list if no regions found, 1 member if 1 region is a priority, more if regions with the same priority
|
||||
*/
|
||||
public static List<RentRegion> getApplicableRentRegions(Location location) {
|
||||
List<RentRegion> result = new ArrayList<>();
|
||||
for(GeneralRegion region : getApplicableASRegions(location, GeneralRegion.RegionType.RENT)) {
|
||||
result.add((RentRegion)region);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the most important buy AreaShop regions
|
||||
* - Returns highest priority, child instead of parent regions
|
||||
* @param location The location to check for regions
|
||||
* @return empty list if no regions found, 1 member if 1 region is a priority, more if regions with the same priority
|
||||
*/
|
||||
public static List<BuyRegion> getApplicableBuyRegions(Location location) {
|
||||
List<BuyRegion> result = new ArrayList<>();
|
||||
for(GeneralRegion region : getApplicableASRegions(location, GeneralRegion.RegionType.BUY)) {
|
||||
result.add((BuyRegion)region);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the most important AreaShop regions
|
||||
* - Returns highest priority, child instead of parent regions
|
||||
* @param location The location to check for regions
|
||||
* @return empty list if no regions found, 1 member if 1 region is a priority, more if regions with the same priority
|
||||
*/
|
||||
public static List<GeneralRegion> getAllApplicableRegions(Location location) {
|
||||
return getApplicableASRegions(location, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the most important AreaShop regions
|
||||
* - Returns highest priority, child instead of parent regions
|
||||
* @param location The location to check for regions
|
||||
* @param type The type of regions to look for, null for all
|
||||
* @return empty list if no regions found, 1 member if 1 region is a priority, more if regions with the same priority
|
||||
*/
|
||||
public static List<GeneralRegion> getApplicableASRegions(Location location, GeneralRegion.RegionType type) {
|
||||
List<GeneralRegion> result = new ArrayList<>();
|
||||
Set<ProtectedRegion> regions = AreaShop.getInstance().getWorldGuardHandler().getApplicableRegionsSet(location);
|
||||
if(regions != null) {
|
||||
List<GeneralRegion> candidates = new ArrayList<>();
|
||||
for(ProtectedRegion pr : regions) {
|
||||
GeneralRegion region = AreaShop.getInstance().getFileManager().getRegion(pr.getId());
|
||||
if(region != null && (
|
||||
(type == GeneralRegion.RegionType.RENT && region.isRentRegion())
|
||||
|| (type == GeneralRegion.RegionType.BUY && region.isBuyRegion())
|
||||
|| type == null)) {
|
||||
candidates.add(region);
|
||||
}
|
||||
}
|
||||
boolean first = true;
|
||||
for(GeneralRegion region : candidates) {
|
||||
if(region == null) {
|
||||
AreaShop.debug("skipped null region");
|
||||
continue;
|
||||
}
|
||||
if(first) {
|
||||
result.add(region);
|
||||
first = false;
|
||||
} else {
|
||||
if(region.getRegion().getPriority() > result.get(0).getRegion().getPriority()) {
|
||||
result.clear();
|
||||
result.add(region);
|
||||
} else if(region.getRegion().getParent() != null && region.getRegion().getParent().equals(result.get(0).getRegion())) {
|
||||
result.clear();
|
||||
result.add(region);
|
||||
} else {
|
||||
result.add(region);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return new ArrayList<>(result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convert color and formatting codes to bukkit values
|
||||
* @param input Start string with color and formatting codes in it
|
||||
* @return String with the color and formatting codes in the bukkit format
|
||||
*/
|
||||
public static String applyColors(String input) {
|
||||
String result = null;
|
||||
if(input != null) {
|
||||
result = ChatColor.translateAlternateColorCodes('&', input);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Format the currency amount with the characters before and after
|
||||
* @param amount Amount of money to format
|
||||
* @return Currency character format string
|
||||
*/
|
||||
public static String formatCurrency(double amount) {
|
||||
String before = config.getString("moneyCharacter");
|
||||
before = before.replace(AreaShop.currencyEuro, "\u20ac");
|
||||
String after = config.getString("moneyCharacterAfter");
|
||||
after = after.replace(AreaShop.currencyEuro, "\u20ac");
|
||||
String result;
|
||||
// Check for infinite and NaN
|
||||
if(Double.isInfinite(amount)) {
|
||||
result = "\u221E"; // Infinite symbol
|
||||
} else if(Double.isNaN(amount)) {
|
||||
result = "NaN";
|
||||
} else {
|
||||
// Add metric
|
||||
double metricAbove = config.getDouble("metricSuffixesAbove");
|
||||
if(metricAbove != -1 && amount >= metricAbove) {
|
||||
if(amount >= 1000000000000000000000000.0) {
|
||||
amount = amount/1000000000000000000000000.0;
|
||||
after = "Y"+after;
|
||||
} else if(amount >= 1000000000000000000000.0) {
|
||||
amount = amount/1000000000000000000000.0;
|
||||
after = "Z"+after;
|
||||
} else if(amount >= 1000000000000000000.0) {
|
||||
amount = amount/1000000000000000000.0;
|
||||
after = "E"+after;
|
||||
} else if(amount >= 1000000000000000.0) {
|
||||
amount = amount/1000000000000000.0;
|
||||
after = "P"+after;
|
||||
} else if(amount >= 1000000000000.0) {
|
||||
amount = amount/1000000000000.0;
|
||||
after = "T"+after;
|
||||
} else if(amount >= 1000000000.0) {
|
||||
amount = amount/1000000000.0;
|
||||
after = "G"+after;
|
||||
} else if(amount >= 1000000.0) {
|
||||
amount = amount/1000000.0;
|
||||
after = "M"+after;
|
||||
} else if(amount >= 1000.0) {
|
||||
amount = amount/1000.0;
|
||||
after = "k"+after;
|
||||
}
|
||||
BigDecimal bigDecimal = new BigDecimal(amount);
|
||||
if(bigDecimal.toString().contains(".")) {
|
||||
int frontLength = bigDecimal.toString().substring(0, bigDecimal.toString().indexOf('.')).length();
|
||||
bigDecimal = bigDecimal.setScale(config.getInt("fractionalNumbers")+(3-frontLength), RoundingMode.HALF_UP);
|
||||
}
|
||||
result = bigDecimal.toString();
|
||||
} else {
|
||||
BigDecimal bigDecimal = new BigDecimal(amount);
|
||||
bigDecimal = bigDecimal.setScale(config.getInt("fractionalNumbers"), RoundingMode.HALF_UP);
|
||||
amount = bigDecimal.doubleValue();
|
||||
result = bigDecimal.toString();
|
||||
if(config.getBoolean("hideEmptyFractionalPart") && (amount%1.0) == 0.0 && result.contains(".")) {
|
||||
result = result.substring(0, result.indexOf('.'));
|
||||
}
|
||||
}
|
||||
}
|
||||
result = result.replace(".", config.getString("decimalMark"));
|
||||
return before+result+after;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if the string is a correct time period
|
||||
* @param time String that has to be checked
|
||||
* @return true if format is correct, false if not
|
||||
*/
|
||||
public static boolean checkTimeFormat(String time) {
|
||||
// Check if the string is not empty and check the length
|
||||
if(time == null || time.length() <= 1 || time.indexOf(' ') == -1 || time.indexOf(' ') >= (time.length()-1)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if the suffix is one of these values
|
||||
String suffix = time.substring(time.indexOf(' ')+1, time.length());
|
||||
if(!identifiers.contains(suffix)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// check if the part before the space is a number
|
||||
String prefix = time.substring(0, (time.indexOf(' ')));
|
||||
return prefix.matches("\\d+");
|
||||
}
|
||||
|
||||
/**
|
||||
* Methode to tranlate a duration string to a millisecond value
|
||||
* @param duration The duration string
|
||||
* @return The duration in milliseconds translated from the durationstring, or if it is invalid then 0
|
||||
*/
|
||||
public static long durationStringToLong(String duration) {
|
||||
if(duration == null) {
|
||||
return 0;
|
||||
} else if(duration.equalsIgnoreCase("disabled") || duration.equalsIgnoreCase("unlimited")) {
|
||||
return -1;
|
||||
} else if(duration.indexOf(' ') == -1) {
|
||||
return 0;
|
||||
}
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTimeInMillis(0);
|
||||
|
||||
String durationString = duration.substring(duration.indexOf(' ')+1, duration.length());
|
||||
int durationInt = 0;
|
||||
try {
|
||||
durationInt = Integer.parseInt(duration.substring(0, duration.indexOf(' ')));
|
||||
} catch(NumberFormatException exception) {
|
||||
// No Number found, add zero
|
||||
}
|
||||
|
||||
if(seconds.contains(durationString)) {
|
||||
calendar.add(Calendar.SECOND, durationInt);
|
||||
} else if(minutes.contains(durationString)) {
|
||||
calendar.add(Calendar.MINUTE, durationInt);
|
||||
} else if(hours.contains(durationString)) {
|
||||
calendar.add(Calendar.HOUR, durationInt);
|
||||
} else if(days.contains(durationString)) {
|
||||
calendar.add(Calendar.DAY_OF_MONTH, durationInt);
|
||||
} else if(weeks.contains(durationString)) {
|
||||
calendar.add(Calendar.DAY_OF_MONTH, durationInt*7);
|
||||
} else if(months.contains(durationString)) {
|
||||
calendar.add(Calendar.MONTH, durationInt);
|
||||
} else if(years.contains(durationString)) {
|
||||
calendar.add(Calendar.YEAR, durationInt);
|
||||
}
|
||||
return calendar.getTimeInMillis();
|
||||
}
|
||||
|
||||
// LEGACY TIME INPUT CONVERSION
|
||||
|
||||
/**
|
||||
* Get setting from config that could be only a number indicating seconds
|
||||
* or a string indicating a duration string
|
||||
* @param path Path of the setting to read
|
||||
* @return milliseconds that the setting indicates
|
||||
*/
|
||||
public static long getDurationFromSecondsOrString(String path) {
|
||||
if(config.isLong(path) || config.isInt(path)) {
|
||||
long setting = config.getLong(path);
|
||||
if(setting != -1) {
|
||||
setting = setting*1000;
|
||||
}
|
||||
return setting;
|
||||
} else {
|
||||
return durationStringToLong(config.getString(path));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get setting from config that could be only a number indicating minutes
|
||||
* or a string indicating a duration string
|
||||
* @param path Path of the setting to read
|
||||
* @return milliseconds that the setting indicates
|
||||
*/
|
||||
public static long getDurationFromMinutesOrString(String path) {
|
||||
if(config.isLong(path) || config.isInt(path)) {
|
||||
long setting = config.getLong(path);
|
||||
if(setting != -1) {
|
||||
setting = setting*60*1000;
|
||||
}
|
||||
return setting;
|
||||
} else {
|
||||
return durationStringToLong(config.getString(path));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse a time setting that could be minutes or a duration string
|
||||
* @param input The string to parse
|
||||
* @return milliseconds that the string indicates
|
||||
*/
|
||||
public static long getDurationFromMinutesOrStringInput(String input) {
|
||||
long number;
|
||||
try {
|
||||
number = Long.parseLong(input);
|
||||
if(number != -1) {
|
||||
number = number*60*1000;
|
||||
}
|
||||
return number;
|
||||
} catch(NumberFormatException e) {
|
||||
return durationStringToLong(input);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a start of the message with a maximum length
|
||||
* @param message The message
|
||||
* @param maximumLength The maximum length to return
|
||||
* @return The start of the message with at most maximumLength characters
|
||||
*/
|
||||
public static String getMessageStart(Message message, int maximumLength) {
|
||||
String messageStart = "";
|
||||
for(int i = 0; i < message.getRaw().size() && messageStart.length() < maximumLength; i++) {
|
||||
messageStart += message.getRaw().get(i).substring(0, Math.min(maximumLength, message.getRaw().get(i).length()));
|
||||
}
|
||||
return messageStart.substring(0, Math.min(maximumLength, messageStart.length()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse a time setting that could be seconds or a duration string
|
||||
* @param input The string to parse
|
||||
* @return seconds that the string indicates
|
||||
*/
|
||||
public static long getDurationFromSecondsOrStringInput(String input) {
|
||||
long number;
|
||||
try {
|
||||
number = Long.parseLong(input);
|
||||
if(number != -1) {
|
||||
number = number*1000;
|
||||
}
|
||||
return number;
|
||||
} catch(NumberFormatException e) {
|
||||
return durationStringToLong(input);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if an input is numeric
|
||||
* @param input The input to check
|
||||
* @return true if the input is numeric, otherwise false
|
||||
*/
|
||||
public static boolean isNumeric(String input) {
|
||||
try {
|
||||
Integer.parseInt(input);
|
||||
return true;
|
||||
} catch(NumberFormatException ignored) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// NAME <-> UUID CONVERSION
|
||||
|
||||
/**
|
||||
* Conversion to name by uuid
|
||||
* @param uuid The uuid in string format
|
||||
* @return the name of the player
|
||||
*/
|
||||
public static String toName(String uuid) {
|
||||
String result = "";
|
||||
if(uuid != null) {
|
||||
try {
|
||||
UUID parsed = UUID.fromString(uuid);
|
||||
result = toName(parsed);
|
||||
} catch(IllegalArgumentException e) {
|
||||
// Incorrect UUID
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Conversion to name by uuid object
|
||||
* @param uuid The uuid in string format
|
||||
* @return the name of the player
|
||||
*/
|
||||
public static String toName(UUID uuid) {
|
||||
if(uuid == null) {
|
||||
return "";
|
||||
} else {
|
||||
String name = Bukkit.getOfflinePlayer(uuid).getName();
|
||||
if(name != null) {
|
||||
return name;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Conversion from name to uuid
|
||||
* @param name The name of the player
|
||||
* @return The uuid of the player
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Fake deprecation by Bukkit to inform developers, method will stay
|
||||
public static String toUUID(String name) {
|
||||
if(name == null) {
|
||||
return null;
|
||||
} else {
|
||||
return Bukkit.getOfflinePlayer(name).getUniqueId().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,239 @@
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import com.sk89q.worldedit.bukkit.selections.Selection;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.managers.FileManager;
|
||||
import me.wiefferink.areashop.regions.BuyRegion;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
import me.wiefferink.areashop.regions.RentRegion;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.TreeSet;
|
||||
|
||||
public class AddCommand extends CommandAreaShop {
|
||||
|
||||
public AddCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop add";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.createrent") || target.hasPermission("areashop.createbuy")) {
|
||||
return "help-add";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(final CommandSender sender, final String[] args) {
|
||||
if( !sender.hasPermission("areashop.createrent")
|
||||
&& !sender.hasPermission("areashop.createrent.member")
|
||||
&& !sender.hasPermission("areashop.createrent.owner")
|
||||
|
||||
&& !sender.hasPermission("areashop.createbuy")
|
||||
&& !sender.hasPermission("areashop.createbuy.member")
|
||||
&& !sender.hasPermission("areashop.createbuy.owner")) {
|
||||
plugin.message(sender, "add-noPermission");
|
||||
return;
|
||||
}
|
||||
|
||||
if(args.length < 2 || args[1] == null || (!"rent".equals(args[1].toLowerCase()) && !"buy".equals(args[1].toLowerCase()))) {
|
||||
plugin.message(sender, "add-help");
|
||||
return;
|
||||
}
|
||||
List<ProtectedRegion> regions = new ArrayList<>();
|
||||
World world;
|
||||
Player player = null;
|
||||
if(sender instanceof Player) {
|
||||
player = (Player)sender;
|
||||
}
|
||||
if(args.length == 2) {
|
||||
if(player == null) {
|
||||
plugin.message(sender, "cmd-weOnlyByPlayer");
|
||||
return;
|
||||
}
|
||||
Selection selection = plugin.getWorldEdit().getSelection(player);
|
||||
if(selection == null) {
|
||||
plugin.message(player, "cmd-noSelection");
|
||||
return;
|
||||
}
|
||||
world = selection.getWorld();
|
||||
regions = Utils.getWERegionsInSelection(selection);
|
||||
if(regions.size() == 0) {
|
||||
plugin.message(player, "cmd-noWERegionsFound");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if(player != null) {
|
||||
if(args.length == 4) {
|
||||
world = Bukkit.getWorld(args[3]);
|
||||
if(world == null) {
|
||||
plugin.message(sender, "add-incorrectWorld", args[3]);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
world = ((Player)sender).getWorld();
|
||||
}
|
||||
} else {
|
||||
if(args.length < 4) {
|
||||
plugin.message(sender, "add-specifyWorld");
|
||||
return;
|
||||
} else {
|
||||
world = Bukkit.getWorld(args[3]);
|
||||
if(world == null) {
|
||||
plugin.message(sender, "add-incorrectWorld", args[3]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
ProtectedRegion region = plugin.getWorldGuard().getRegionManager(world).getRegion(args[2]);
|
||||
if(region == null) {
|
||||
plugin.message(sender, "add-noRegion", args[2]);
|
||||
return;
|
||||
}
|
||||
regions.add(region);
|
||||
}
|
||||
final boolean isRent = "rent".equals(args[1].toLowerCase());
|
||||
final List<ProtectedRegion> finalRegions = regions;
|
||||
final Player finalPlayer = player;
|
||||
final World finalWorld = world;
|
||||
AreaShop.debug("Starting add task with " + regions.size() + " regions");
|
||||
new BukkitRunnable() {
|
||||
private int current = 0;
|
||||
private TreeSet<GeneralRegion> regionsSuccess = new TreeSet<>();
|
||||
private TreeSet<GeneralRegion> regionsAlready = new TreeSet<>();
|
||||
private TreeSet<String> namesBlacklisted = new TreeSet<>();
|
||||
private TreeSet<String> namesNoPermission = new TreeSet<>();
|
||||
private TreeSet<String> namesExternal = new TreeSet<>();
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
for(int i=0; i<plugin.getConfig().getInt("adding.regionsPerTick"); i++) {
|
||||
if(current < finalRegions.size()) {
|
||||
ProtectedRegion region = finalRegions.get(current);
|
||||
// Determine if the player is an owner or member of the region
|
||||
boolean isMember = finalPlayer != null && plugin.getWorldGuardHandler().containsMember(region, finalPlayer.getUniqueId());
|
||||
boolean isOwner = finalPlayer != null && plugin.getWorldGuardHandler().containsMember(region, finalPlayer.getUniqueId());
|
||||
String type;
|
||||
if(isRent) {
|
||||
type = "rent";
|
||||
} else {
|
||||
type = "buy";
|
||||
}
|
||||
FileManager.AddResult result = plugin.getFileManager().checkRegionAdd(sender, region, isRent ? GeneralRegion.RegionType.RENT : GeneralRegion.RegionType.BUY);
|
||||
if(result == FileManager.AddResult.ALREADYADDED) {
|
||||
regionsAlready.add(plugin.getFileManager().getRegion(region.getId()));
|
||||
} else if(result == FileManager.AddResult.BLACKLISTED) {
|
||||
namesBlacklisted.add(region.getId());
|
||||
} else if(result == FileManager.AddResult.NOPERMISSION) {
|
||||
namesNoPermission.add(region.getId());
|
||||
} else {
|
||||
// Check if the player should be landlord
|
||||
boolean landlord = (!sender.hasPermission("areashop.create" + type)
|
||||
&& ((sender.hasPermission("areashop.create" + type + ".owner") && isOwner)
|
||||
|| (sender.hasPermission("areashop.create" + type + ".member") && isMember)));
|
||||
if(isRent) {
|
||||
RentRegion rent = new RentRegion(plugin, region.getId(), finalWorld);
|
||||
// Set landlord
|
||||
if(landlord) {
|
||||
rent.setLandlord(finalPlayer.getUniqueId(), finalPlayer.getName());
|
||||
}
|
||||
// Run commands
|
||||
rent.runEventCommands(GeneralRegion.RegionEvent.CREATED, true);
|
||||
plugin.getFileManager().addRent(rent);
|
||||
rent.handleSchematicEvent(GeneralRegion.RegionEvent.CREATED);
|
||||
|
||||
rent.update();
|
||||
|
||||
// Run commands
|
||||
rent.runEventCommands(GeneralRegion.RegionEvent.CREATED, false);
|
||||
regionsSuccess.add(rent);
|
||||
} else {
|
||||
BuyRegion buy = new BuyRegion(plugin, region.getId(), finalWorld);
|
||||
// Set landlord
|
||||
if(landlord) {
|
||||
buy.setLandlord(finalPlayer.getUniqueId(), finalPlayer.getName());
|
||||
}
|
||||
// Run commands
|
||||
buy.runEventCommands(GeneralRegion.RegionEvent.CREATED, true);
|
||||
|
||||
plugin.getFileManager().addBuy(buy);
|
||||
buy.handleSchematicEvent(GeneralRegion.RegionEvent.CREATED);
|
||||
|
||||
buy.update();
|
||||
|
||||
// Run commands
|
||||
buy.runEventCommands(GeneralRegion.RegionEvent.CREATED, false);
|
||||
regionsSuccess.add(buy);
|
||||
}
|
||||
}
|
||||
current++;
|
||||
}
|
||||
}
|
||||
if(current >= finalRegions.size()) {
|
||||
if(!regionsSuccess.isEmpty()) {
|
||||
plugin.message(sender, "add-success", args[1], Utils.combinedMessage(regionsSuccess, "region"));
|
||||
}
|
||||
if(!regionsAlready.isEmpty()) {
|
||||
plugin.message(sender, "add-failed", Utils.combinedMessage(regionsAlready, "region"));
|
||||
}
|
||||
if(!namesBlacklisted.isEmpty()) {
|
||||
plugin.message(sender, "add-blacklisted", Utils.createCommaSeparatedList(namesBlacklisted));
|
||||
}
|
||||
if(!namesNoPermission.isEmpty()) {
|
||||
plugin.message(sender, "add-noPermissionRegions", Utils.createCommaSeparatedList(namesNoPermission));
|
||||
plugin.message(sender, "add-noPermissionOwnerMember");
|
||||
}
|
||||
this.cancel();
|
||||
}
|
||||
}
|
||||
}.runTaskTimer(plugin, 1, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
List<String> result = new ArrayList<>();
|
||||
if(toComplete == 2) {
|
||||
if(sender.hasPermission("areashop.createrent")) {
|
||||
result.add("rent");
|
||||
}
|
||||
if(sender.hasPermission("areashop.createbuy")) {
|
||||
result.add("buy");
|
||||
}
|
||||
} else if(toComplete == 3) {
|
||||
if(sender instanceof Player) {
|
||||
Player player = (Player)sender;
|
||||
if(sender.hasPermission("areashop.createrent") || sender.hasPermission("areashop.createbuy")) {
|
||||
for(ProtectedRegion region : plugin.getWorldGuard().getRegionManager(player.getWorld()).getRegions().values()) {
|
||||
result.add(region.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,146 @@
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.regions.BuyRegion;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
import me.wiefferink.areashop.regions.RentRegion;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AddfriendCommand extends CommandAreaShop {
|
||||
|
||||
public AddfriendCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop addfriend";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.addfriendall") || target.hasPermission("areashop.addfriend")) {
|
||||
return "help-addFriend";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!sender.hasPermission("areashop.addfriend") && !sender.hasPermission("areashop.addfriendall")) {
|
||||
plugin.message(sender, "addfriend-noPermission");
|
||||
return;
|
||||
}
|
||||
|
||||
if(args.length < 2) {
|
||||
plugin.message(sender, "addfriend-help");
|
||||
return;
|
||||
}
|
||||
|
||||
GeneralRegion region;
|
||||
if(args.length <= 2) {
|
||||
if (sender instanceof Player) {
|
||||
// get the region by location
|
||||
List<GeneralRegion> regions = Utils.getAllApplicableRegions(((Player) sender).getLocation());
|
||||
if (regions.isEmpty()) {
|
||||
plugin.message(sender, "cmd-noRegionsAtLocation");
|
||||
return;
|
||||
} else if (regions.size() > 1) {
|
||||
plugin.message(sender, "cmd-moreRegionsAtLocation");
|
||||
return;
|
||||
} else {
|
||||
region = regions.get(0);
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "cmd-automaticRegionOnlyByPlayer");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
region = plugin.getFileManager().getRegion(args[2]);
|
||||
if(region == null) {
|
||||
plugin.message(sender, "cmd-notRegistered", args[2]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(sender.hasPermission("areashop.addfriendall")) {
|
||||
if((region.isRentRegion() && !((RentRegion)region).isRented())
|
||||
|| (region.isBuyRegion() && !((BuyRegion)region).isSold())) {
|
||||
plugin.message(sender, "addfriend-noOwner", region);
|
||||
return;
|
||||
}
|
||||
OfflinePlayer friend = Bukkit.getOfflinePlayer(args[1]);
|
||||
if(friend.getLastPlayed() == 0 && !plugin.getConfig().getBoolean("addFriendNotExistingPlayers")) {
|
||||
plugin.message(sender, "addfriend-notVisited", args[1], region);
|
||||
return;
|
||||
}
|
||||
if(region.getFriendsFeature().getFriends().contains(friend.getUniqueId())) {
|
||||
plugin.message(sender, "addfriend-alreadyAdded", friend.getName(), region);
|
||||
return;
|
||||
}
|
||||
if(region.isOwner(friend.getUniqueId())) {
|
||||
plugin.message(sender, "addfriend-self", friend.getName(), region);
|
||||
return;
|
||||
}
|
||||
if(region.getFriendsFeature().addFriend(friend.getUniqueId(), sender)) {
|
||||
region.update();
|
||||
plugin.message(sender, "addfriend-successOther", friend.getName(), region);
|
||||
}
|
||||
} else {
|
||||
if(sender.hasPermission("areashop.addfriend") && sender instanceof Player) {
|
||||
if(region.isOwner((Player)sender)) {
|
||||
OfflinePlayer friend = Bukkit.getOfflinePlayer(args[1]);
|
||||
if(friend.getLastPlayed() == 0 && !plugin.getConfig().getBoolean("addFriendNotExistingPlayers")) {
|
||||
plugin.message(sender, "addfriend-notVisited", args[1], region);
|
||||
return;
|
||||
}
|
||||
if(region.getFriendsFeature().getFriends().contains(friend.getUniqueId())) {
|
||||
plugin.message(sender, "addfriend-alreadyAdded", friend.getName(), region);
|
||||
return;
|
||||
}
|
||||
if(region.isOwner(friend.getUniqueId())) {
|
||||
plugin.message(sender, "addfriend-self", friend.getName(), region);
|
||||
return;
|
||||
}
|
||||
|
||||
if(region.getFriendsFeature().addFriend(friend.getUniqueId(), sender)) {
|
||||
region.update();
|
||||
plugin.message(sender, "addfriend-success", friend.getName(), region);
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "addfriend-noPermissionOther", region);
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "addfriend-noPermission", region);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
ArrayList<String> result = new ArrayList<>();
|
||||
if(toComplete == 2) {
|
||||
for(Player player : Utils.getOnlinePlayers()) {
|
||||
result.add(player.getName());
|
||||
}
|
||||
} else if(toComplete == 3) {
|
||||
result.addAll(plugin.getFileManager().getRegionNames());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+130
-132
@@ -1,132 +1,130 @@
|
||||
package nl.evolutioncoding.AreaShop.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import nl.evolutioncoding.AreaShop.AreaShop;
|
||||
import nl.evolutioncoding.AreaShop.Utils;
|
||||
import nl.evolutioncoding.AreaShop.regions.GeneralRegion;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.material.Sign;
|
||||
import org.bukkit.util.BlockIterator;
|
||||
|
||||
import com.sk89q.worldedit.bukkit.selections.CuboidSelection;
|
||||
|
||||
public class AddsignCommand extends CommandAreaShop {
|
||||
|
||||
public AddsignCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop addsign";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.addsign")) {
|
||||
return plugin.getLanguageManager().getLang("help-addsign");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, Command command, String[] args) {
|
||||
if (!(sender instanceof Player)) {
|
||||
plugin.message(sender, "cmd-onlyByPlayer");
|
||||
return;
|
||||
}
|
||||
Player player = (Player)sender;
|
||||
if(!player.hasPermission("areashop.addsign")) {
|
||||
plugin.message(sender, "addsign-noPermission");
|
||||
return;
|
||||
}
|
||||
// Get the sign
|
||||
Block block = null;
|
||||
BlockIterator blockIterator = new BlockIterator(player, 100);
|
||||
while(blockIterator.hasNext() && block == null) {
|
||||
Block next = blockIterator.next();
|
||||
if(next.getType() != Material.AIR) {
|
||||
block = next;
|
||||
}
|
||||
}
|
||||
if(block == null || !(block.getType() == Material.WALL_SIGN || block.getType() == Material.SIGN_POST)) {
|
||||
plugin.message(sender, "addsign-noSign");
|
||||
return;
|
||||
}
|
||||
|
||||
GeneralRegion region = null;
|
||||
if(args.length > 1) {
|
||||
// Get region by argument
|
||||
region = plugin.getFileManager().getRegion(args[1]);
|
||||
if(region == null) {
|
||||
plugin.message(sender, "addsign-noRegion", args[1]);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// Get region by sign position
|
||||
List<GeneralRegion> regions = plugin.getFileManager().getASRegionsInSelection(new CuboidSelection(block.getWorld(), block.getLocation(), block.getLocation()));
|
||||
if(regions.isEmpty()) {
|
||||
plugin.message(sender, "addsign-noRegions");
|
||||
return;
|
||||
} else if(regions.size() > 1) {
|
||||
plugin.message(sender, "addsign-couldNotDetect", regions.get(0).getName(), regions.get(1).getName());
|
||||
return;
|
||||
}
|
||||
region = regions.get(0);
|
||||
}
|
||||
Sign sign = (Sign)block.getState().getData();
|
||||
String profile = null;
|
||||
if(args.length > 2) {
|
||||
profile = args[2];
|
||||
Set<String> profiles = plugin.config().getConfigurationSection("signProfiles").getKeys(false);
|
||||
if(!profiles.contains(profile)) {
|
||||
plugin.message(sender, "addsign-wrongProfile", Utils.createCommaSeparatedList(profiles));
|
||||
return;
|
||||
}
|
||||
}
|
||||
GeneralRegion signRegion = plugin.getFileManager().getRegionBySignLocation(block.getLocation());
|
||||
if(signRegion != null) {
|
||||
plugin.message(sender, "addsign-alreadyRegistered", signRegion.getName());
|
||||
return;
|
||||
}
|
||||
|
||||
region.addSign(block.getLocation(), block.getType(), sign.getFacing(), profile);
|
||||
if(profile == null) {
|
||||
plugin.message(sender, "addsign-success", region.getName());
|
||||
} else {
|
||||
plugin.message(sender, "addsign-successProfile", region.getName(), profile);
|
||||
}
|
||||
region.updateSigns();
|
||||
region.save();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start) {
|
||||
List<String> result = new ArrayList<String>();
|
||||
if(toComplete == 2) {
|
||||
result.addAll(plugin.getFileManager().getRegionNames());
|
||||
} else if(toComplete == 3) {
|
||||
result.addAll(plugin.config().getStringList("signProfiles"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import com.sk89q.worldedit.bukkit.selections.CuboidSelection;
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.features.SignsFeature;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.material.Sign;
|
||||
import org.bukkit.util.BlockIterator;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class AddsignCommand extends CommandAreaShop {
|
||||
|
||||
public AddsignCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop addsign";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.addsign")) {
|
||||
return "help-addsign";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!sender.hasPermission("areashop.addsign")) {
|
||||
plugin.message(sender, "addsign-noPermission");
|
||||
return;
|
||||
}
|
||||
if (!(sender instanceof Player)) {
|
||||
plugin.message(sender, "cmd-onlyByPlayer");
|
||||
return;
|
||||
}
|
||||
Player player = (Player)sender;
|
||||
|
||||
// Get the sign
|
||||
Block block = null;
|
||||
BlockIterator blockIterator = new BlockIterator(player, 100);
|
||||
while(blockIterator.hasNext() && block == null) {
|
||||
Block next = blockIterator.next();
|
||||
if(next.getType() != Material.AIR) {
|
||||
block = next;
|
||||
}
|
||||
}
|
||||
if(block == null || !(block.getType() == Material.WALL_SIGN || block.getType() == Material.SIGN_POST)) {
|
||||
plugin.message(sender, "addsign-noSign");
|
||||
return;
|
||||
}
|
||||
|
||||
GeneralRegion region;
|
||||
if(args.length > 1) {
|
||||
// Get region by argument
|
||||
region = plugin.getFileManager().getRegion(args[1]);
|
||||
if(region == null) {
|
||||
plugin.message(sender, "cmd-notRegistered", args[1]);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// Get region by sign position
|
||||
List<GeneralRegion> regions = Utils.getASRegionsInSelection(new CuboidSelection(block.getWorld(), block.getLocation(), block.getLocation()));
|
||||
if(regions.isEmpty()) {
|
||||
plugin.message(sender, "addsign-noRegions");
|
||||
return;
|
||||
} else if(regions.size() > 1) {
|
||||
plugin.message(sender, "addsign-couldNotDetect", regions.get(0).getName(), regions.get(1).getName());
|
||||
return;
|
||||
}
|
||||
region = regions.get(0);
|
||||
}
|
||||
Sign sign = (Sign)block.getState().getData();
|
||||
String profile = null;
|
||||
if(args.length > 2) {
|
||||
profile = args[2];
|
||||
Set<String> profiles = plugin.getConfig().getConfigurationSection("signProfiles").getKeys(false);
|
||||
if(!profiles.contains(profile)) {
|
||||
plugin.message(sender, "addsign-wrongProfile", Utils.createCommaSeparatedList(profiles), region);
|
||||
return;
|
||||
}
|
||||
}
|
||||
SignsFeature.RegionSign regionSign = SignsFeature.getSignByLocation(block.getLocation());
|
||||
if(regionSign != null) {
|
||||
plugin.message(sender, "addsign-alreadyRegistered", regionSign.getRegion());
|
||||
return;
|
||||
}
|
||||
|
||||
region.getSignsFeature().addSign(block.getLocation(), block.getType(), sign.getFacing(), profile);
|
||||
if(profile == null) {
|
||||
plugin.message(sender, "addsign-success", region);
|
||||
} else {
|
||||
plugin.message(sender, "addsign-successProfile", profile, region);
|
||||
}
|
||||
region.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
List<String> result = new ArrayList<>();
|
||||
if(toComplete == 2) {
|
||||
result.addAll(plugin.getFileManager().getRegionNames());
|
||||
} else if(toComplete == 3) {
|
||||
result.addAll(plugin.getConfig().getStringList("signProfiles"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+74
-74
@@ -1,74 +1,74 @@
|
||||
package nl.evolutioncoding.AreaShop.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import nl.evolutioncoding.AreaShop.AreaShop;
|
||||
import nl.evolutioncoding.AreaShop.regions.BuyRegion;
|
||||
import nl.evolutioncoding.AreaShop.regions.GeneralRegion;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class BuyCommand extends CommandAreaShop {
|
||||
|
||||
public BuyCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop buy";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.buy")) {
|
||||
return plugin.getLanguageManager().getLang("help-buy");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, Command command, String[] args) {
|
||||
if (!(sender instanceof Player)) {
|
||||
plugin.message(sender, "cmd-onlyByPlayer");
|
||||
return;
|
||||
}
|
||||
Player player = (Player)sender;
|
||||
if(args.length > 1 && args[1] != null) {
|
||||
BuyRegion region = plugin.getFileManager().getBuy(args[1]);
|
||||
if(region == null) {
|
||||
plugin.message(player, "buy-notBuyable");
|
||||
} else {
|
||||
region.buy(player);
|
||||
}
|
||||
} else {
|
||||
// get the region by location
|
||||
List<GeneralRegion> regions = plugin.getFileManager().getApplicalbeASRegions(player.getLocation());
|
||||
if(regions.size() != 1) {
|
||||
plugin.message(sender, "buy-help");
|
||||
} else {
|
||||
if(!regions.get(0).isBuyRegion()) {
|
||||
plugin.message(sender, "buy-notBuyable");
|
||||
} else {
|
||||
((BuyRegion)regions.get(0)).buy(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start) {
|
||||
ArrayList<String> result = new ArrayList<String>();
|
||||
if(toComplete == 2) {
|
||||
for(BuyRegion region : plugin.getFileManager().getBuys()) {
|
||||
if(!region.isSold()) {
|
||||
result.add(region.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.regions.BuyRegion;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BuyCommand extends CommandAreaShop {
|
||||
|
||||
public BuyCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop buy";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.buy")) {
|
||||
return "help-buy";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!sender.hasPermission("areashop.buy")) {
|
||||
plugin.message(sender, "buy-noPermission");
|
||||
return;
|
||||
}
|
||||
if (!(sender instanceof Player)) {
|
||||
plugin.message(sender, "cmd-onlyByPlayer");
|
||||
return;
|
||||
}
|
||||
Player player = (Player)sender;
|
||||
if(args.length > 1 && args[1] != null) {
|
||||
BuyRegion region = plugin.getFileManager().getBuy(args[1]);
|
||||
if(region == null) {
|
||||
plugin.message(player, "buy-notBuyable");
|
||||
} else {
|
||||
region.buy(player);
|
||||
}
|
||||
} else {
|
||||
// get the region by location
|
||||
List<BuyRegion> regions = Utils.getApplicableBuyRegions(((Player) sender).getLocation());
|
||||
if (regions.isEmpty()) {
|
||||
plugin.message(sender, "cmd-noRegionsAtLocation");
|
||||
} else if (regions.size() > 1) {
|
||||
plugin.message(sender, "cmd-moreRegionsAtLocation");
|
||||
} else {
|
||||
regions.get(0).buy(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
ArrayList<String> result = new ArrayList<>();
|
||||
if(toComplete == 2) {
|
||||
for(BuyRegion region : plugin.getFileManager().getBuys()) {
|
||||
if(!region.isSold()) {
|
||||
result.add(region.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
+68
-66
@@ -1,66 +1,68 @@
|
||||
package nl.evolutioncoding.AreaShop.commands;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import nl.evolutioncoding.AreaShop.AreaShop;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
/**
|
||||
* Abstract class for generalising command classes
|
||||
*/
|
||||
public abstract class CommandAreaShop {
|
||||
AreaShop plugin;
|
||||
|
||||
/**
|
||||
* Save the instance of the main plugin class
|
||||
* @param plugin The main plugin
|
||||
*/
|
||||
public CommandAreaShop(AreaShop plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
public boolean canExecute(Command command, String[] args) {
|
||||
String commandString = command.getName();
|
||||
for(String argument : args) {
|
||||
commandString += " " + argument;
|
||||
}
|
||||
if(commandString.length() > getCommandStart().length()) {
|
||||
return commandString.toLowerCase().startsWith(getCommandStart().toLowerCase() + " ");
|
||||
}
|
||||
return commandString.toLowerCase().startsWith(getCommandStart().toLowerCase());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of string to complete a command with (raw list, not matching ones not filtered out)
|
||||
* @param toComplete The number of the argument that has to be completed
|
||||
* @param start The already given start of the command
|
||||
* @return A collection with all the possibilities for argument to complete
|
||||
*/
|
||||
public abstract List<String> getTabCompleteList(int toComplete, String[] start);
|
||||
|
||||
/**
|
||||
* Get the argument that comes after the base command that this command reacts to
|
||||
* @return
|
||||
*/
|
||||
public abstract String getCommandStart();
|
||||
|
||||
/**
|
||||
* Returns the correct help string for the reciever
|
||||
* @param target The CommandSender that the help message is for
|
||||
* @return The help message according to the permissions of the reciever
|
||||
*/
|
||||
public abstract String getHelp(CommandSender target);
|
||||
|
||||
/**
|
||||
* Execute a (sub)command if the conditions are met
|
||||
* @param sender The commandSender that executed the command
|
||||
* @param commandAreaShop The command that has been executed
|
||||
* @param args The arguments that are given
|
||||
*/
|
||||
public abstract void execute(CommandSender sender, Command command, String[] args);
|
||||
|
||||
|
||||
|
||||
}
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Abstract class for generalising command classes
|
||||
*/
|
||||
public abstract class CommandAreaShop {
|
||||
AreaShop plugin;
|
||||
|
||||
/**
|
||||
* Save the instance of the main plugin class
|
||||
* @param plugin The main plugin
|
||||
*/
|
||||
public CommandAreaShop(AreaShop plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
public boolean canExecute(Command command, String[] args) {
|
||||
String commandString = command.getName();
|
||||
for(String argument : args) {
|
||||
commandString += " " + argument;
|
||||
}
|
||||
if(commandString.length() > getCommandStart().length()) {
|
||||
return commandString.toLowerCase().startsWith(getCommandStart().toLowerCase() + " ");
|
||||
}
|
||||
return commandString.toLowerCase().startsWith(getCommandStart().toLowerCase());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of string to complete a command with (raw list, not matching ones not filtered out)
|
||||
* @param toComplete The number of the argument that has to be completed
|
||||
* @param start The already given start of the command
|
||||
* @param sender The CommandSender that wants to tab complete
|
||||
* @return A collection with all the possibilities for argument to complete
|
||||
*/
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the argument that comes after the base command that this command reacts to
|
||||
* @return The string that should be in front of the command for this class to act
|
||||
*/
|
||||
public abstract String getCommandStart();
|
||||
|
||||
/**
|
||||
* Returns the correct help string key to be used on the help page
|
||||
* @param target The CommandSender that the help message is for
|
||||
* @return The help message key according to the permissions of the reciever
|
||||
*/
|
||||
public abstract String getHelp(CommandSender target);
|
||||
|
||||
/**
|
||||
* Execute a (sub)command if the conditions are met
|
||||
* @param sender The commandSender that executed the command
|
||||
* @param args The arguments that are given
|
||||
*/
|
||||
public abstract void execute(CommandSender sender, String[] args);
|
||||
|
||||
|
||||
|
||||
}
|
||||
+136
-133
@@ -1,133 +1,136 @@
|
||||
package nl.evolutioncoding.AreaShop.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import nl.evolutioncoding.AreaShop.AreaShop;
|
||||
import nl.evolutioncoding.AreaShop.Utils;
|
||||
import nl.evolutioncoding.AreaShop.regions.BuyRegion;
|
||||
import nl.evolutioncoding.AreaShop.regions.GeneralRegion;
|
||||
import nl.evolutioncoding.AreaShop.regions.RentRegion;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.sk89q.worldedit.bukkit.selections.Selection;
|
||||
|
||||
public class DelCommand extends CommandAreaShop {
|
||||
|
||||
public DelCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop del";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.destroyrent") || target.hasPermission("areashop.destroybuy")) {
|
||||
return plugin.getLanguageManager().getLang("help-del");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, Command command, String[] args) {
|
||||
if(!sender.hasPermission("areashop.destroybuy") && !sender.hasPermission("areashop.destroyrent")) {
|
||||
plugin.message(sender, "del-noPermission");
|
||||
return;
|
||||
}
|
||||
if(args.length < 2) {
|
||||
// Only players can have a selection
|
||||
if(!(sender instanceof Player)) {
|
||||
plugin.message(sender, "cmd-weOnlyByPlayer");
|
||||
return;
|
||||
}
|
||||
Player player = (Player)sender;
|
||||
Selection selection = plugin.getWorldEdit().getSelection(player);
|
||||
if(selection == null) {
|
||||
plugin.message(player, "cmd-noSelection");
|
||||
return;
|
||||
}
|
||||
List<GeneralRegion> regions = plugin.getFileManager().getASRegionsInSelection(selection);
|
||||
if(regions == null || regions.size() == 0) {
|
||||
plugin.message(player, "cmd-noRegionsFound");
|
||||
return;
|
||||
}
|
||||
// Start removing the region that he has permission for
|
||||
ArrayList<String> namesSuccess = new ArrayList<String>();
|
||||
ArrayList<String> namesFailed = new ArrayList<String>();
|
||||
for(GeneralRegion region : regions) {
|
||||
if(region.isRentRegion()) {
|
||||
if(!sender.hasPermission("areashop.destroyrent")) {
|
||||
namesFailed.add(region.getName());
|
||||
} else {
|
||||
plugin.getFileManager().removeRent((RentRegion)region, true);
|
||||
namesSuccess.add(region.getName());
|
||||
}
|
||||
} else if(region.isBuyRegion()) {
|
||||
if(!sender.hasPermission("areashop.destroybuy")) {
|
||||
namesFailed.add(region.getName());
|
||||
} else {
|
||||
plugin.getFileManager().removeBuy((BuyRegion)region, true);
|
||||
namesSuccess.add(region.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
// send messages
|
||||
if(namesSuccess.size() != 0) {
|
||||
plugin.message(sender, "del-success", Utils.createCommaSeparatedList(namesSuccess));
|
||||
}
|
||||
if(namesFailed.size() != 0) {
|
||||
plugin.message(sender, "del-failed", Utils.createCommaSeparatedList(namesFailed));
|
||||
}
|
||||
} else {
|
||||
GeneralRegion region = plugin.getFileManager().getRegion(args[1]);
|
||||
if(region == null) {
|
||||
plugin.message(sender, "del-noRegion", args[1]);
|
||||
return;
|
||||
}
|
||||
if(region.isRentRegion()) {
|
||||
/* Remove the rent if the player has permission */
|
||||
if(sender.hasPermission("areashop.destroyrent")) {
|
||||
plugin.getFileManager().removeRent((RentRegion)region, true);
|
||||
plugin.message(sender, "destroy-successRent", region.getName());
|
||||
} else {
|
||||
plugin.message(sender, "destroy-noPermissionRent");
|
||||
}
|
||||
} else if(region.isBuyRegion()) {
|
||||
/* Remove the buy if the player has permission */
|
||||
if(sender.hasPermission("areashop.destroybuy")) {
|
||||
plugin.getFileManager().removeBuy((BuyRegion)region, true);
|
||||
plugin.message(sender, "destroy-successBuy", region.getName());
|
||||
} else {
|
||||
plugin.message(sender, "destroy-noPermissionBuy");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start) {
|
||||
List<String> result = new ArrayList<String>();
|
||||
if(toComplete == 2) {
|
||||
result = plugin.getFileManager().getRegionNames();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import com.sk89q.worldedit.bukkit.selections.Selection;
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.regions.BuyRegion;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
import me.wiefferink.areashop.regions.RentRegion;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.TreeSet;
|
||||
|
||||
public class DelCommand extends CommandAreaShop {
|
||||
|
||||
public DelCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop del";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.destroyrent") || target.hasPermission("areashop.destroybuy")) {
|
||||
return "help-del";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if( !sender.hasPermission("areashop.destroybuy")
|
||||
&& !sender.hasPermission("areashop.destroybuy.landlord")
|
||||
|
||||
&& !sender.hasPermission("areashop.destroyrent")
|
||||
&& !sender.hasPermission("areashop.destroyrent.landlord")) {
|
||||
plugin.message(sender, "del-noPermission");
|
||||
return;
|
||||
}
|
||||
if(args.length < 2) {
|
||||
// Only players can have a selection
|
||||
if(!(sender instanceof Player)) {
|
||||
plugin.message(sender, "cmd-weOnlyByPlayer");
|
||||
return;
|
||||
}
|
||||
Player player = (Player)sender;
|
||||
Selection selection = plugin.getWorldEdit().getSelection(player);
|
||||
if(selection == null) {
|
||||
plugin.message(player, "cmd-noSelection");
|
||||
return;
|
||||
}
|
||||
List<GeneralRegion> regions = Utils.getASRegionsInSelection(selection);
|
||||
if(regions == null || regions.size() == 0) {
|
||||
plugin.message(player, "cmd-noRegionsFound");
|
||||
return;
|
||||
}
|
||||
// Start removing the regions that he has permission for
|
||||
ArrayList<String> namesSuccess = new ArrayList<>();
|
||||
TreeSet<GeneralRegion> namesFailed = new TreeSet<>();
|
||||
for(GeneralRegion region : regions) {
|
||||
boolean isLandlord = region.isLandlord(((Player)sender).getUniqueId());
|
||||
if(region.isRentRegion()) {
|
||||
if(!sender.hasPermission("areashop.destroyrent") && !(isLandlord && sender.hasPermission("areashop.destroyrent.landlord"))) {
|
||||
namesFailed.add(region);
|
||||
} else {
|
||||
plugin.getFileManager().removeRent((RentRegion)region, true);
|
||||
namesSuccess.add(region.getName());
|
||||
}
|
||||
} else if(region.isBuyRegion()) {
|
||||
if(!sender.hasPermission("areashop.destroybuy") && !(isLandlord && sender.hasPermission("areashop.destroybuy.landlord"))) {
|
||||
namesFailed.add(region);
|
||||
} else {
|
||||
plugin.getFileManager().removeBuy((BuyRegion)region, true);
|
||||
namesSuccess.add(region.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
// send messages
|
||||
if(namesSuccess.size() != 0) {
|
||||
plugin.message(sender, "del-success", Utils.createCommaSeparatedList(namesSuccess));
|
||||
}
|
||||
if(namesFailed.size() != 0) {
|
||||
plugin.message(sender, "del-failed", Utils.combinedMessage(namesFailed, "region"));
|
||||
}
|
||||
} else {
|
||||
GeneralRegion region = plugin.getFileManager().getRegion(args[1]);
|
||||
if(region == null) {
|
||||
plugin.message(sender, "cmd-notRegistered", args[1]);
|
||||
return;
|
||||
}
|
||||
boolean isLandlord = sender instanceof Player && region.isLandlord(((Player)sender).getUniqueId());
|
||||
if(region.isRentRegion()) {
|
||||
// Remove the rent if the player has permission
|
||||
if(sender.hasPermission("areashop.destroyrent") || (isLandlord && sender.hasPermission("areashop.destroyrent.landlord"))) {
|
||||
plugin.getFileManager().removeRent((RentRegion)region, true);
|
||||
plugin.message(sender, "destroy-successRent", region);
|
||||
} else {
|
||||
plugin.message(sender, "destroy-noPermissionRent", region);
|
||||
}
|
||||
} else if(region.isBuyRegion()) {
|
||||
// Remove the buy if the player has permission
|
||||
if(sender.hasPermission("areashop.destroybuy") || (isLandlord && sender.hasPermission("areashop.destroybuy.landlord"))) {
|
||||
plugin.getFileManager().removeBuy((BuyRegion)region, true);
|
||||
plugin.message(sender, "destroy-successBuy", region);
|
||||
} else {
|
||||
plugin.message(sender, "destroy-noPermissionBuy", region);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
List<String> result = new ArrayList<>();
|
||||
if(toComplete == 2) {
|
||||
result = plugin.getFileManager().getRegionNames();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,144 @@
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.regions.BuyRegion;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
import me.wiefferink.areashop.regions.RentRegion;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DelfriendCommand extends CommandAreaShop {
|
||||
|
||||
public DelfriendCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop delfriend";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.delfriendall") || target.hasPermission("areashop.delfriend")) {
|
||||
return "help-delFriend";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a person can remove friends
|
||||
* @param person The person to check
|
||||
* @param region The region to check for
|
||||
* @return true if the person can remove friends, otherwise false
|
||||
*/
|
||||
public static boolean canUse(CommandSender person, GeneralRegion region) {
|
||||
if(person.hasPermission("areashop.delfriendall")) {
|
||||
return true;
|
||||
}
|
||||
if(person instanceof Player) {
|
||||
Player player = (Player)person;
|
||||
return region.isOwner(player) && player.hasPermission("areashop.delfriend");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!sender.hasPermission("areashop.delfriend") && !sender.hasPermission("areashop.delfriendall")) {
|
||||
plugin.message(sender, "delfriend-noPermission");
|
||||
return;
|
||||
}
|
||||
if(args.length < 2) {
|
||||
plugin.message(sender, "delfriend-help");
|
||||
return;
|
||||
}
|
||||
GeneralRegion region;
|
||||
if(args.length <= 2) {
|
||||
if (sender instanceof Player) {
|
||||
// get the region by location
|
||||
List<GeneralRegion> regions = Utils.getAllApplicableRegions(((Player) sender).getLocation());
|
||||
if (regions.isEmpty()) {
|
||||
plugin.message(sender, "cmd-noRegionsAtLocation");
|
||||
return;
|
||||
} else if (regions.size() > 1) {
|
||||
plugin.message(sender, "cmd-moreRegionsAtLocation");
|
||||
return;
|
||||
} else {
|
||||
region = regions.get(0);
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "cmd-automaticRegionOnlyByPlayer");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
region = plugin.getFileManager().getRegion(args[2]);
|
||||
if(region == null) {
|
||||
plugin.message(sender, "cmd-notRegistered", args[2]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(sender.hasPermission("areashop.delfriendall")) {
|
||||
if((region.isRentRegion() && !((RentRegion)region).isRented())
|
||||
|| (region.isBuyRegion() && !((BuyRegion)region).isSold())) {
|
||||
plugin.message(sender, "delfriend-noOwner", region);
|
||||
return;
|
||||
}
|
||||
OfflinePlayer friend = Bukkit.getOfflinePlayer(args[1]);
|
||||
if(!region.getFriendsFeature().getFriends().contains(friend.getUniqueId())) {
|
||||
plugin.message(sender, "delfriend-notAdded", friend.getName(), region);
|
||||
return;
|
||||
}
|
||||
if(region.getFriendsFeature().deleteFriend(friend.getUniqueId(), sender)) {
|
||||
region.update();
|
||||
plugin.message(sender, "delfriend-successOther", friend.getName(), region);
|
||||
}
|
||||
} else {
|
||||
if(sender.hasPermission("areashop.delfriend") && sender instanceof Player) {
|
||||
if(region.isOwner((Player)sender)) {
|
||||
OfflinePlayer friend = Bukkit.getOfflinePlayer(args[1]);
|
||||
if(!region.getFriendsFeature().getFriends().contains(friend.getUniqueId())) {
|
||||
plugin.message(sender, "delfriend-notAdded", friend.getName(), region);
|
||||
return;
|
||||
}
|
||||
if(region.getFriendsFeature().deleteFriend(friend.getUniqueId(), sender)) {
|
||||
region.update();
|
||||
plugin.message(sender, "delfriend-success", friend.getName(), region);
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "delfriend-noPermissionOther", region);
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "delfriend-noPermission", region);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
ArrayList<String> result = new ArrayList<>();
|
||||
if(toComplete == 2) {
|
||||
for(Player player : Utils.getOnlinePlayers()) {
|
||||
result.add(player.getName());
|
||||
}
|
||||
} else if(toComplete == 3) {
|
||||
result.addAll(plugin.getFileManager().getRegionNames());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+82
-85
@@ -1,85 +1,82 @@
|
||||
package nl.evolutioncoding.AreaShop.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import nl.evolutioncoding.AreaShop.AreaShop;
|
||||
import nl.evolutioncoding.AreaShop.regions.GeneralRegion;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.BlockIterator;
|
||||
|
||||
public class DelsignCommand extends CommandAreaShop {
|
||||
|
||||
public DelsignCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop delsign";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.delsign")) {
|
||||
return plugin.getLanguageManager().getLang("help-delsign");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, Command command, String[] args) {
|
||||
if (!(sender instanceof Player)) {
|
||||
plugin.message(sender, "cmd-onlyByPlayer");
|
||||
return;
|
||||
}
|
||||
Player player = (Player)sender;
|
||||
if(!player.hasPermission("areashop.delsign")) {
|
||||
plugin.message(sender, "delsign-noPermission");
|
||||
return;
|
||||
}
|
||||
// Get the sign
|
||||
Block block = null;
|
||||
BlockIterator blockIterator = new BlockIterator(player, 100);
|
||||
while(blockIterator.hasNext() && block == null) {
|
||||
Block next = blockIterator.next();
|
||||
if(next.getType() != Material.AIR) {
|
||||
block = next;
|
||||
}
|
||||
}
|
||||
if(block == null || !(block.getType() == Material.WALL_SIGN || block.getType() == Material.SIGN_POST)) {
|
||||
plugin.message(sender, "delsign-noSign");
|
||||
return;
|
||||
}
|
||||
GeneralRegion region = plugin.getFileManager().getRegionBySignLocation(block.getLocation());
|
||||
if(region == null) {
|
||||
plugin.message(sender, "delsign-noRegion");
|
||||
return;
|
||||
}
|
||||
plugin.message(sender, "delsign-success", region.getName());
|
||||
region.removeSign(block.getLocation());
|
||||
region.updateSigns();
|
||||
region.save();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start) {
|
||||
return new ArrayList<String>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.features.SignsFeature;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.BlockIterator;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DelsignCommand extends CommandAreaShop {
|
||||
|
||||
public DelsignCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop delsign";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.delsign")) {
|
||||
return "help-delsign";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!sender.hasPermission("areashop.delsign")) {
|
||||
plugin.message(sender, "delsign-noPermission");
|
||||
return;
|
||||
}
|
||||
if (!(sender instanceof Player)) {
|
||||
plugin.message(sender, "cmd-onlyByPlayer");
|
||||
return;
|
||||
}
|
||||
Player player = (Player)sender;
|
||||
|
||||
// Get the sign
|
||||
Block block = null;
|
||||
BlockIterator blockIterator = new BlockIterator(player, 100);
|
||||
while(blockIterator.hasNext() && block == null) {
|
||||
Block next = blockIterator.next();
|
||||
if(next.getType() != Material.AIR) {
|
||||
block = next;
|
||||
}
|
||||
}
|
||||
if(block == null || !(block.getType() == Material.WALL_SIGN || block.getType() == Material.SIGN_POST)) {
|
||||
plugin.message(sender, "delsign-noSign");
|
||||
return;
|
||||
}
|
||||
SignsFeature.RegionSign regionSign = SignsFeature.getSignByLocation(block.getLocation());
|
||||
if(regionSign == null) {
|
||||
plugin.message(sender, "delsign-noRegion");
|
||||
return;
|
||||
}
|
||||
plugin.message(sender, "delsign-success", regionSign.getRegion());
|
||||
regionSign.remove();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,184 @@
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.messages.Message;
|
||||
import me.wiefferink.areashop.regions.BuyRegion;
|
||||
import me.wiefferink.areashop.regions.RegionGroup;
|
||||
import me.wiefferink.areashop.regions.RentRegion;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class FindCommand extends CommandAreaShop {
|
||||
|
||||
public FindCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop find";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.find")) {
|
||||
return "help-find";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!sender.hasPermission("areashop.find")) {
|
||||
plugin.message(sender, "find-noPermission");
|
||||
return;
|
||||
}
|
||||
if (!(sender instanceof Player)) {
|
||||
plugin.message(sender, "cmd-onlyByPlayer");
|
||||
return;
|
||||
}
|
||||
if(args.length <= 1 || args[1] == null || (!args[1].equalsIgnoreCase("buy") && !args[1].equalsIgnoreCase("rent"))) {
|
||||
plugin.message(sender, "find-help");
|
||||
return;
|
||||
}
|
||||
Player player = (Player)sender;
|
||||
double balance = 0.0;
|
||||
if(plugin.getEconomy() != null) {
|
||||
balance = plugin.getEconomy().getBalance(player);
|
||||
}
|
||||
double maxPrice = 0;
|
||||
boolean maxPriceSet = false;
|
||||
RegionGroup group = null;
|
||||
// Parse optional price argument
|
||||
if(args.length >= 3) {
|
||||
try {
|
||||
maxPrice = Double.parseDouble(args[2]);
|
||||
maxPriceSet = true;
|
||||
} catch(NumberFormatException e) {
|
||||
plugin.message(sender, "find-wrongMaxPrice", args[2]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Parse optional group argument
|
||||
if(args.length >= 4) {
|
||||
group = plugin.getFileManager().getGroup(args[3]);
|
||||
if(group == null) {
|
||||
plugin.message(sender, "find-wrongGroup", args[3]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(args[1].equalsIgnoreCase("buy")) {
|
||||
List<BuyRegion> regions = plugin.getFileManager().getBuys();
|
||||
List<BuyRegion> results = new ArrayList<>();
|
||||
for(BuyRegion region : regions) {
|
||||
if(!region.isSold()
|
||||
&& ((region.getPrice() <= balance && !maxPriceSet) || (region.getPrice() <= maxPrice && maxPriceSet))
|
||||
&& (group == null || group.isMember(region))) {
|
||||
results.add(region);
|
||||
}
|
||||
}
|
||||
if(!results.isEmpty()) {
|
||||
// Draw a random one
|
||||
BuyRegion region = results.get(new Random().nextInt(results.size()));
|
||||
Message onlyInGroup = Message.none();
|
||||
if(group != null) {
|
||||
onlyInGroup = Message.fromKey("find-onlyInGroup").replacements(args[3]);
|
||||
}
|
||||
if(maxPriceSet) {
|
||||
plugin.message(player, "find-successMax", "buy", Utils.formatCurrency(maxPrice), onlyInGroup, region);
|
||||
} else {
|
||||
plugin.message(player, "find-success", "buy", Utils.formatCurrency(balance), onlyInGroup, region);
|
||||
}
|
||||
region.teleportPlayer(player, region.getBooleanSetting("general.findTeleportToSign"), false);
|
||||
} else {
|
||||
Message onlyInGroup = Message.none();
|
||||
if(group != null) {
|
||||
onlyInGroup = Message.fromKey("find-onlyInGroup").replacements(args[3]);
|
||||
}
|
||||
if(maxPriceSet) {
|
||||
plugin.message(player, "find-noneFoundMax", "buy", Utils.formatCurrency(maxPrice), onlyInGroup);
|
||||
} else {
|
||||
plugin.message(player, "find-noneFound", "buy", Utils.formatCurrency(balance), onlyInGroup);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
List<RentRegion> regions = plugin.getFileManager().getRents();
|
||||
List<RentRegion> results = new ArrayList<>();
|
||||
for(RentRegion region : regions) {
|
||||
if(!region.isRented()
|
||||
&& ((region.getPrice() <= balance && !maxPriceSet) || (region.getPrice() <= maxPrice && maxPriceSet))
|
||||
&& (group == null || group.isMember(region))) {
|
||||
results.add(region);
|
||||
}
|
||||
}
|
||||
if(!results.isEmpty()) {
|
||||
// Draw a random one
|
||||
RentRegion region = results.get(new Random().nextInt(results.size()));
|
||||
Message onlyInGroup = Message.none();
|
||||
if(group != null) {
|
||||
onlyInGroup = Message.fromKey("find-onlyInGroup").replacements(args[3]);
|
||||
}
|
||||
if(maxPriceSet) {
|
||||
plugin.message(player, "find-successMax", "rent", Utils.formatCurrency(maxPrice), onlyInGroup, region);
|
||||
} else {
|
||||
plugin.message(player, "find-success", "rent", Utils.formatCurrency(balance), onlyInGroup, region);
|
||||
}
|
||||
region.teleportPlayer(player, region.getBooleanSetting("general.findTeleportToSign"), false);
|
||||
} else {
|
||||
Message onlyInGroup = Message.none();
|
||||
if(group != null) {
|
||||
onlyInGroup = Message.fromKey("find-onlyInGroup").replacements(args[3]);
|
||||
}
|
||||
if(maxPriceSet) {
|
||||
plugin.message(player, "find-noneFoundMax", "rent", Utils.formatCurrency(maxPrice), onlyInGroup);
|
||||
} else {
|
||||
plugin.message(player, "find-noneFound", "rent", Utils.formatCurrency(balance), onlyInGroup);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
ArrayList<String> result = new ArrayList<>();
|
||||
if(toComplete == 2) {
|
||||
result.add("buy");
|
||||
result.add("rent");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+118
-117
@@ -1,117 +1,118 @@
|
||||
package nl.evolutioncoding.AreaShop.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import nl.evolutioncoding.AreaShop.AreaShop;
|
||||
import nl.evolutioncoding.AreaShop.Utils;
|
||||
import nl.evolutioncoding.AreaShop.regions.GeneralRegion;
|
||||
import nl.evolutioncoding.AreaShop.regions.RegionGroup;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.sk89q.worldedit.bukkit.selections.Selection;
|
||||
|
||||
public class GroupaddCommand extends CommandAreaShop {
|
||||
|
||||
public GroupaddCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop groupadd";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.groupadd")) {
|
||||
return plugin.getLanguageManager().getLang("help-groupadd");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, Command command, String[] args) {
|
||||
if(!sender.hasPermission("areashop.groupadd")) {
|
||||
plugin.message(sender, "groupadd-noPermission");
|
||||
return;
|
||||
}
|
||||
if(args.length < 2 || args[1] == null) {
|
||||
plugin.message(sender, "groupadd-help");
|
||||
return;
|
||||
}
|
||||
RegionGroup group = plugin.getFileManager().getGroup(args[1]);
|
||||
if(group == null) {
|
||||
group = new RegionGroup(plugin, args[1]);
|
||||
plugin.getFileManager().addGroup(group);
|
||||
}
|
||||
if(args.length == 2) {
|
||||
if(!(sender instanceof Player)) {
|
||||
plugin.message(sender, "cmd-weOnlyByPlayer");
|
||||
return;
|
||||
}
|
||||
Player player = (Player)sender;
|
||||
Selection selection = plugin.getWorldEdit().getSelection(player);
|
||||
if(selection == null) {
|
||||
plugin.message(player, "cmd-noSelection");
|
||||
return;
|
||||
}
|
||||
List<GeneralRegion> regions = plugin.getFileManager().getASRegionsInSelection(selection);
|
||||
if(regions.size() == 0) {
|
||||
plugin.message(player, "cmd-noRegionsFound");
|
||||
return;
|
||||
}
|
||||
ArrayList<String> namesSuccess = new ArrayList<String>();
|
||||
ArrayList<String> namesFailed = new ArrayList<String>();
|
||||
for(GeneralRegion region : regions) {
|
||||
if(group.addMember(region)) {
|
||||
namesSuccess.add(region.getName());
|
||||
} else {
|
||||
namesFailed.add(region.getName());
|
||||
}
|
||||
}
|
||||
if(namesSuccess.size() != 0) {
|
||||
plugin.message(player, "groupadd-weSuccess", group.getName(), Utils.createCommaSeparatedList(namesSuccess));
|
||||
}
|
||||
if(namesFailed.size() != 0) {
|
||||
plugin.message(player, "groupadd-weFailed", group.getName(), Utils.createCommaSeparatedList(namesFailed));
|
||||
}
|
||||
} else {
|
||||
GeneralRegion region = plugin.getFileManager().getRegion(args[2]);
|
||||
if(region == null) {
|
||||
plugin.message(sender, "groupadd-noRegion", args[2]);
|
||||
return;
|
||||
}
|
||||
if(group.addMember(region)) {
|
||||
plugin.message(sender, "groupadd-success", region.getName(), group.getName(), group.getMembers().size());
|
||||
} else {
|
||||
plugin.message(sender, "groupadd-failed", region.getName(), group.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start) {
|
||||
List<String> result = new ArrayList<String>();
|
||||
if(toComplete == 2) {
|
||||
result = plugin.getFileManager().getGroupNames();
|
||||
} else if(toComplete == 3) {
|
||||
result = plugin.getFileManager().getRegionNames();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import com.sk89q.worldedit.bukkit.selections.Selection;
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
import me.wiefferink.areashop.regions.RegionGroup;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.TreeSet;
|
||||
|
||||
public class GroupaddCommand extends CommandAreaShop {
|
||||
|
||||
public GroupaddCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop groupadd";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.groupadd")) {
|
||||
return "help-groupadd";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!sender.hasPermission("areashop.groupadd")) {
|
||||
plugin.message(sender, "groupadd-noPermission");
|
||||
return;
|
||||
}
|
||||
if(args.length < 2 || args[1] == null) {
|
||||
plugin.message(sender, "groupadd-help");
|
||||
return;
|
||||
}
|
||||
RegionGroup group = plugin.getFileManager().getGroup(args[1]);
|
||||
if(group == null) {
|
||||
group = new RegionGroup(plugin, args[1]);
|
||||
plugin.getFileManager().addGroup(group);
|
||||
}
|
||||
if(args.length == 2) {
|
||||
if(!(sender instanceof Player)) {
|
||||
plugin.message(sender, "cmd-weOnlyByPlayer");
|
||||
return;
|
||||
}
|
||||
Player player = (Player)sender;
|
||||
Selection selection = plugin.getWorldEdit().getSelection(player);
|
||||
if(selection == null) {
|
||||
plugin.message(player, "cmd-noSelection");
|
||||
return;
|
||||
}
|
||||
List<GeneralRegion> regions = Utils.getASRegionsInSelection(selection);
|
||||
if(regions.size() == 0) {
|
||||
plugin.message(player, "cmd-noRegionsFound");
|
||||
return;
|
||||
}
|
||||
TreeSet<GeneralRegion> regionsSuccess = new TreeSet<>();
|
||||
TreeSet<GeneralRegion> regionsFailed = new TreeSet<>();
|
||||
for(GeneralRegion region : regions) {
|
||||
if(group.addMember(region)) {
|
||||
regionsSuccess.add(region);
|
||||
} else {
|
||||
regionsFailed.add(region);
|
||||
}
|
||||
}
|
||||
if(regionsSuccess.size() != 0) {
|
||||
plugin.message(player, "groupadd-weSuccess", group.getName(), Utils.combinedMessage(regionsSuccess, "region"));
|
||||
}
|
||||
if(regionsFailed.size() != 0) {
|
||||
plugin.message(player, "groupadd-weFailed", group.getName(), Utils.combinedMessage(regionsFailed, "region"));
|
||||
}
|
||||
// Update all regions, this does it in a task, updating them without lag
|
||||
plugin.getFileManager().updateRegions(new ArrayList<>(regionsSuccess), player);
|
||||
} else {
|
||||
GeneralRegion region = plugin.getFileManager().getRegion(args[2]);
|
||||
if(region == null) {
|
||||
plugin.message(sender, "cmd-notRegistered", args[2]);
|
||||
return;
|
||||
}
|
||||
if(group.addMember(region)) {
|
||||
region.update();
|
||||
plugin.message(sender, "groupadd-success", group.getName(), group.getMembers().size(), region);
|
||||
} else {
|
||||
plugin.message(sender, "groupadd-failed", group.getName(), region);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
List<String> result = new ArrayList<>();
|
||||
if(toComplete == 2) {
|
||||
result = plugin.getFileManager().getGroupNames();
|
||||
} else if(toComplete == 3) {
|
||||
result = plugin.getFileManager().getRegionNames();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+119
-117
@@ -1,117 +1,119 @@
|
||||
package nl.evolutioncoding.AreaShop.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import nl.evolutioncoding.AreaShop.AreaShop;
|
||||
import nl.evolutioncoding.AreaShop.Utils;
|
||||
import nl.evolutioncoding.AreaShop.regions.GeneralRegion;
|
||||
import nl.evolutioncoding.AreaShop.regions.RegionGroup;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.sk89q.worldedit.bukkit.selections.Selection;
|
||||
|
||||
public class GroupdelCommand extends CommandAreaShop {
|
||||
|
||||
public GroupdelCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop groupdel";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.groupdel")) {
|
||||
return plugin.getLanguageManager().getLang("help-groupdel");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, Command command, String[] args) {
|
||||
if(!sender.hasPermission("areashop.groupdel")) {
|
||||
plugin.message(sender, "groupdel-noPermission");
|
||||
return;
|
||||
}
|
||||
if(args.length < 2 || args[1] == null) {
|
||||
plugin.message(sender, "groupdel-help");
|
||||
return;
|
||||
}
|
||||
RegionGroup group = plugin.getFileManager().getGroup(args[1]);
|
||||
if(group == null) {
|
||||
group = new RegionGroup(plugin, args[1]);
|
||||
plugin.getFileManager().addGroup(group);
|
||||
}
|
||||
if(args.length == 2) {
|
||||
if(!(sender instanceof Player)) {
|
||||
plugin.message(sender, "cmd-weOnlyByPlayer");
|
||||
return;
|
||||
}
|
||||
Player player = (Player)sender;
|
||||
Selection selection = plugin.getWorldEdit().getSelection(player);
|
||||
if(selection == null) {
|
||||
plugin.message(player, "cmd-noSelection");
|
||||
return;
|
||||
}
|
||||
List<GeneralRegion> regions = plugin.getFileManager().getASRegionsInSelection(selection);
|
||||
if(regions.size() == 0) {
|
||||
plugin.message(player, "cmd-noRegionsFound");
|
||||
return;
|
||||
}
|
||||
ArrayList<String> namesSuccess = new ArrayList<String>();
|
||||
ArrayList<String> namesFailed = new ArrayList<String>();
|
||||
for(GeneralRegion region : regions) {
|
||||
if(group.removeMember(region)) {
|
||||
namesSuccess.add(region.getName());
|
||||
} else {
|
||||
namesFailed.add(region.getName());
|
||||
}
|
||||
}
|
||||
if(namesSuccess.size() != 0) {
|
||||
plugin.message(player, "groupdel-weSuccess", group.getName(), Utils.createCommaSeparatedList(namesSuccess));
|
||||
}
|
||||
if(namesFailed.size() != 0) {
|
||||
plugin.message(player, "groupdel-weFailed", group.getName(), Utils.createCommaSeparatedList(namesFailed));
|
||||
}
|
||||
} else {
|
||||
GeneralRegion region = plugin.getFileManager().getRegion(args[2]);
|
||||
if(region == null) {
|
||||
plugin.message(sender, "groupdel-noRegion", args[2]);
|
||||
return;
|
||||
}
|
||||
if(group.removeMember(region)) {
|
||||
plugin.message(sender, "groupdel-success", region.getName(), group.getName(), group.getMembers().size());
|
||||
} else {
|
||||
plugin.message(sender, "groupdel-failed", region.getName(), group.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start) {
|
||||
List<String> result = new ArrayList<String>();
|
||||
if(toComplete == 2) {
|
||||
result = plugin.getFileManager().getGroupNames();
|
||||
} else if(toComplete == 3) {
|
||||
result = plugin.getFileManager().getRegionNames();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import com.sk89q.worldedit.bukkit.selections.Selection;
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
import me.wiefferink.areashop.regions.RegionGroup;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.TreeSet;
|
||||
|
||||
public class GroupdelCommand extends CommandAreaShop {
|
||||
|
||||
public GroupdelCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop groupdel";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.groupdel")) {
|
||||
return "help-groupdel";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!sender.hasPermission("areashop.groupdel")) {
|
||||
plugin.message(sender, "groupdel-noPermission");
|
||||
return;
|
||||
}
|
||||
if(args.length < 2 || args[1] == null) {
|
||||
plugin.message(sender, "groupdel-help");
|
||||
return;
|
||||
}
|
||||
RegionGroup group = plugin.getFileManager().getGroup(args[1]);
|
||||
if(group == null) {
|
||||
group = new RegionGroup(plugin, args[1]);
|
||||
plugin.getFileManager().addGroup(group);
|
||||
}
|
||||
if(args.length == 2) {
|
||||
if(!(sender instanceof Player)) {
|
||||
plugin.message(sender, "cmd-weOnlyByPlayer");
|
||||
return;
|
||||
}
|
||||
Player player = (Player)sender;
|
||||
Selection selection = plugin.getWorldEdit().getSelection(player);
|
||||
if(selection == null) {
|
||||
plugin.message(player, "cmd-noSelection");
|
||||
return;
|
||||
}
|
||||
List<GeneralRegion> regions = Utils.getASRegionsInSelection(selection);
|
||||
if(regions.size() == 0) {
|
||||
plugin.message(player, "cmd-noRegionsFound");
|
||||
return;
|
||||
}
|
||||
TreeSet<GeneralRegion> regionsSuccess = new TreeSet<>();
|
||||
TreeSet<GeneralRegion> regionsFailed = new TreeSet<>();
|
||||
for(GeneralRegion region : regions) {
|
||||
if(group.removeMember(region)) {
|
||||
regionsSuccess.add(region);
|
||||
} else {
|
||||
regionsFailed.add(region);
|
||||
}
|
||||
}
|
||||
if(regionsSuccess.size() != 0) {
|
||||
plugin.message(player, "groupdel-weSuccess", group.getName(), Utils.combinedMessage(regionsSuccess, "region"));
|
||||
}
|
||||
if(regionsFailed.size() != 0) {
|
||||
plugin.message(player, "groupdel-weFailed", group.getName(), Utils.combinedMessage(regionsFailed, "region"));
|
||||
}
|
||||
// Update all regions, this does it in a task, updating them without lag
|
||||
plugin.getFileManager().updateRegions(new ArrayList<>(regionsSuccess), player);
|
||||
group.saveRequired();
|
||||
} else {
|
||||
GeneralRegion region = plugin.getFileManager().getRegion(args[2]);
|
||||
if(region == null) {
|
||||
plugin.message(sender, "cmd-notRegistered", args[2]);
|
||||
return;
|
||||
}
|
||||
if(group.removeMember(region)) {
|
||||
region.update();
|
||||
plugin.message(sender, "groupdel-success", group.getName(), group.getMembers().size(), region);
|
||||
} else {
|
||||
plugin.message(sender, "groupdel-failed", group.getName(), region);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
List<String> result = new ArrayList<>();
|
||||
if(toComplete == 2) {
|
||||
result = plugin.getFileManager().getGroupNames();
|
||||
} else if(toComplete == 3) {
|
||||
result = plugin.getFileManager().getRegionNames();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+73
-75
@@ -1,75 +1,73 @@
|
||||
package nl.evolutioncoding.AreaShop.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import nl.evolutioncoding.AreaShop.AreaShop;
|
||||
import nl.evolutioncoding.AreaShop.Utils;
|
||||
import nl.evolutioncoding.AreaShop.regions.RegionGroup;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
public class GroupinfoCommand extends CommandAreaShop {
|
||||
|
||||
public GroupinfoCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop groupinfo";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.groupinfo")) {
|
||||
return plugin.getLanguageManager().getLang("help-groupinfo");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, Command command, String[] args) {
|
||||
if(!sender.hasPermission("areashop.groupinfo")) {
|
||||
plugin.message(sender, "groupinfo-noPermission");
|
||||
return;
|
||||
}
|
||||
if(args.length < 2 || args[1] == null) {
|
||||
plugin.message(sender, "groupinfo-help");
|
||||
return;
|
||||
}
|
||||
RegionGroup group = plugin.getFileManager().getGroup(args[1]);
|
||||
if(group == null) {
|
||||
plugin.message(sender, "groupinfo-noGroup", args[1]);
|
||||
return;
|
||||
}
|
||||
List<String> members = group.getMembers();
|
||||
if(members.size() == 0) {
|
||||
plugin.message(sender, "groupinfo-noMembers", group.getName());
|
||||
} else {
|
||||
plugin.message(sender, "groupinfo-members", group.getName(), Utils.createCommaSeparatedList(members));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start) {
|
||||
List<String> result = new ArrayList<String>();
|
||||
if(toComplete == 2) {
|
||||
result = plugin.getFileManager().getGroupNames();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.regions.RegionGroup;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GroupinfoCommand extends CommandAreaShop {
|
||||
|
||||
public GroupinfoCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop groupinfo";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.groupinfo")) {
|
||||
return "help-groupinfo";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!sender.hasPermission("areashop.groupinfo")) {
|
||||
plugin.message(sender, "groupinfo-noPermission");
|
||||
return;
|
||||
}
|
||||
if(args.length < 2 || args[1] == null) {
|
||||
plugin.message(sender, "groupinfo-help");
|
||||
return;
|
||||
}
|
||||
RegionGroup group = plugin.getFileManager().getGroup(args[1]);
|
||||
if(group == null) {
|
||||
plugin.message(sender, "groupinfo-noGroup", args[1]);
|
||||
return;
|
||||
}
|
||||
List<String> members = group.getMembers();
|
||||
if(members.size() == 0) {
|
||||
plugin.message(sender, "groupinfo-noMembers", group.getName());
|
||||
} else {
|
||||
plugin.message(sender, "groupinfo-members", group.getName(), Utils.createCommaSeparatedList(members));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
List<String> result = new ArrayList<>();
|
||||
if(toComplete == 2) {
|
||||
result = plugin.getFileManager().getGroupNames();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+58
-60
@@ -1,60 +1,58 @@
|
||||
package nl.evolutioncoding.AreaShop.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import nl.evolutioncoding.AreaShop.AreaShop;
|
||||
import nl.evolutioncoding.AreaShop.Utils;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
public class GrouplistCommand extends CommandAreaShop {
|
||||
|
||||
public GrouplistCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop grouplist";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.grouplist")) {
|
||||
return plugin.getLanguageManager().getLang("help-grouplist");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, Command command, String[] args) {
|
||||
if(!sender.hasPermission("areashop.grouplist")) {
|
||||
plugin.message(sender, "grouplist-noPermission");
|
||||
return;
|
||||
}
|
||||
List<String> groups = plugin.getFileManager().getGroupNames();
|
||||
if(groups.size() == 0) {
|
||||
plugin.message(sender, "grouplist-noGroups");
|
||||
} else {
|
||||
plugin.message(sender, "grouplist-success", Utils.createCommaSeparatedList(groups));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start) {
|
||||
return new ArrayList<String>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GrouplistCommand extends CommandAreaShop {
|
||||
|
||||
public GrouplistCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop grouplist";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.grouplist")) {
|
||||
return "help-grouplist";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!sender.hasPermission("areashop.grouplist")) {
|
||||
plugin.message(sender, "grouplist-noPermission");
|
||||
return;
|
||||
}
|
||||
List<String> groups = plugin.getFileManager().getGroupNames();
|
||||
if(groups.size() == 0) {
|
||||
plugin.message(sender, "grouplist-noGroups");
|
||||
} else {
|
||||
plugin.message(sender, "grouplist-success", Utils.createCommaSeparatedList(groups));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
public class HelpCommand extends CommandAreaShop {
|
||||
|
||||
public HelpCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop help";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.help")) {
|
||||
return "help-help";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
plugin.getCommandManager().showHelp(sender);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,537 @@
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.messages.Message;
|
||||
import me.wiefferink.areashop.regions.BuyRegion;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
import me.wiefferink.areashop.regions.RegionGroup;
|
||||
import me.wiefferink.areashop.regions.RentRegion;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class InfoCommand extends CommandAreaShop {
|
||||
|
||||
public InfoCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop info";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.info")) {
|
||||
return "help-info";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a page of a list of regions
|
||||
* @param sender The CommandSender to send the messages to
|
||||
* @param regions The regions to display
|
||||
* @param filterGroup The group to filter the regions by
|
||||
* @param keyHeader The header to print above the page
|
||||
* @param pageInput The page number, if any
|
||||
* @param baseCommand The command to execute for next/previous page
|
||||
*/
|
||||
private void showSortedPagedList(CommandSender sender, List<? extends GeneralRegion> regions, RegionGroup filterGroup, String keyHeader, String pageInput, String baseCommand) {
|
||||
int MAX_ITEMS = 20;
|
||||
int ITEMS_PER_PAGE = MAX_ITEMS-2;
|
||||
int page = 1;
|
||||
if(pageInput != null && Utils.isNumeric(pageInput)) {
|
||||
try {
|
||||
page = Integer.parseInt(pageInput);
|
||||
} catch(NumberFormatException e) {
|
||||
plugin.message(sender, "info-wrongPage", pageInput);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(filterGroup != null) {
|
||||
for(Iterator<? extends GeneralRegion> it = regions.iterator(); it.hasNext(); ) {
|
||||
if(!filterGroup.isMember(it.next())) {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(regions.isEmpty()) {
|
||||
plugin.message(sender, "info-noRegions");
|
||||
} else {
|
||||
long start = Calendar.getInstance().getTimeInMillis();
|
||||
// First sort by type, then by name
|
||||
Collections.sort(regions, new Comparator<GeneralRegion>() {
|
||||
@Override
|
||||
public int compare(GeneralRegion one, GeneralRegion two) {
|
||||
int typeCompare = getTypeOrder(two).compareTo(getTypeOrder(one));
|
||||
if(typeCompare != 0) {
|
||||
return typeCompare;
|
||||
} else {
|
||||
return one.getName().compareTo(two.getName());
|
||||
}
|
||||
}
|
||||
});
|
||||
// Header
|
||||
Message limitedToGroup = Message.none();
|
||||
if(filterGroup != null) {
|
||||
limitedToGroup = Message.fromKey("info-limitedToGroup").replacements(filterGroup.getName());
|
||||
}
|
||||
plugin.message(sender, keyHeader, limitedToGroup);
|
||||
// Page entries
|
||||
int totalPages = (int)Math.ceil(regions.size()/(double)ITEMS_PER_PAGE); // Clip page to correct boundaries, not much need to tell the user
|
||||
if(regions.size() == ITEMS_PER_PAGE+1) { // 19 total items is mapped to 1 page of 19
|
||||
ITEMS_PER_PAGE++;
|
||||
totalPages = 1;
|
||||
}
|
||||
page = Math.max(1, Math.min(totalPages, page));
|
||||
int linesPrinted = 1; // header
|
||||
for(int i = (page-1)*ITEMS_PER_PAGE; i < page*ITEMS_PER_PAGE && i < regions.size(); i++) {
|
||||
String state;
|
||||
GeneralRegion region = regions.get(i);
|
||||
if(region.getType() == GeneralRegion.RegionType.RENT) {
|
||||
if(region.getOwner() == null) {
|
||||
state = "Forrent";
|
||||
} else {
|
||||
state = "Rented";
|
||||
}
|
||||
} else {
|
||||
if(region.getOwner() == null) {
|
||||
state = "Forsale";
|
||||
} else if(!((BuyRegion)region).isInResellingMode()) {
|
||||
state = "Sold";
|
||||
} else {
|
||||
state = "Reselling";
|
||||
}
|
||||
}
|
||||
plugin.messageNoPrefix(sender, "info-entry"+state, region);
|
||||
linesPrinted++;
|
||||
}
|
||||
Message footer = Message.none();
|
||||
// Previous button
|
||||
if(page > 1) {
|
||||
footer.append(Message.fromKey("info-pagePrevious").replacements(baseCommand+" "+(page-1)));
|
||||
} else {
|
||||
footer.append(Message.fromKey("info-pageNoPrevious"));
|
||||
}
|
||||
// Page status
|
||||
if(totalPages > 1) {
|
||||
String pageString = ""+page;
|
||||
for(int i = pageString.length(); i < (totalPages+"").length(); i++) {
|
||||
pageString = "0"+pageString;
|
||||
}
|
||||
footer.append(Message.fromKey("info-pageStatus").replacements(page, totalPages));
|
||||
if(page < totalPages) {
|
||||
footer.append(Message.fromKey("info-pageNext").replacements(baseCommand+" "+(page+1)));
|
||||
} else {
|
||||
footer.append(Message.fromKey("info-pageNoNext"));
|
||||
}
|
||||
// Fill up space if the page is not full (aligns header nicely)
|
||||
for(int i = linesPrinted; i < MAX_ITEMS-1; i++) {
|
||||
sender.sendMessage(" ");
|
||||
}
|
||||
footer.send(sender);
|
||||
long end = Calendar.getInstance().getTimeInMillis();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an integer to order by type, usable for Comparators
|
||||
* @param region The region to get the order for
|
||||
* @return An integer for sorting by type
|
||||
*/
|
||||
private Integer getTypeOrder(GeneralRegion region) {
|
||||
if(region.getType() == GeneralRegion.RegionType.RENT) {
|
||||
if(region.getOwner() == null) {
|
||||
return 1;
|
||||
} else {
|
||||
return 2;
|
||||
}
|
||||
} else {
|
||||
if(region.getOwner() == null) {
|
||||
return 3;
|
||||
} else if(!((BuyRegion)region).isInResellingMode()) {
|
||||
return 4;
|
||||
} else {
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!sender.hasPermission("areashop.info")) {
|
||||
plugin.message(sender, "info-noPermission");
|
||||
return;
|
||||
}
|
||||
if(args.length > 1 && args[1] != null) {
|
||||
// Get filter group (only used by some commands)
|
||||
RegionGroup filterGroup = null;
|
||||
Set<String> groupFilters = new HashSet<>(Arrays.asList("all", "rented", "forrent", "sold", "forsale", "reselling"));
|
||||
if(groupFilters.contains(args[1].toLowerCase()) && args.length > 2) {
|
||||
if(!Utils.isNumeric(args[2])) {
|
||||
filterGroup = plugin.getFileManager().getGroup(args[2]);
|
||||
if(filterGroup == null) {
|
||||
plugin.message(sender, "info-noFiltergroup", args[2]);
|
||||
return;
|
||||
}
|
||||
// Pass page number to args[2] if available
|
||||
if(args.length > 3) {
|
||||
args[2] = args[3];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// All regions
|
||||
if(args[1].equalsIgnoreCase("all")) {
|
||||
showSortedPagedList(sender, plugin.getFileManager().getRegions(), filterGroup, "info-allHeader", (args.length > 2 ? args[2] : null), "/areashop info all");
|
||||
}
|
||||
|
||||
// Rented regions
|
||||
else if(args[1].equalsIgnoreCase("rented")) {
|
||||
List<RentRegion> regions = plugin.getFileManager().getRents();
|
||||
for(Iterator<RentRegion> it = regions.iterator(); it.hasNext(); ) {
|
||||
if(!it.next().isRented()) {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
showSortedPagedList(sender, regions, filterGroup, "info-rentedHeader", (args.length > 2 ? args[2] : null), "/areashop info rented");
|
||||
}
|
||||
// Forrent regions
|
||||
else if(args[1].equalsIgnoreCase("forrent")) {
|
||||
List<RentRegion> regions = plugin.getFileManager().getRents();
|
||||
for(Iterator<RentRegion> it = regions.iterator(); it.hasNext(); ) {
|
||||
if(it.next().isRented()) {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
showSortedPagedList(sender, regions, filterGroup, "info-forrentHeader", (args.length > 2 ? args[2] : null), "/areashop info forrent");
|
||||
}
|
||||
// Sold regions
|
||||
else if(args[1].equalsIgnoreCase("sold")) {
|
||||
List<BuyRegion> regions = plugin.getFileManager().getBuys();
|
||||
for(Iterator<BuyRegion> it = regions.iterator(); it.hasNext(); ) {
|
||||
if(!it.next().isSold()) {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
showSortedPagedList(sender, regions, filterGroup, "info-soldHeader", (args.length > 2 ? args[2] : null), "/areashop info sold");
|
||||
}
|
||||
// Forsale regions
|
||||
else if(args[1].equalsIgnoreCase("forsale")) {
|
||||
List<BuyRegion> regions = plugin.getFileManager().getBuys();
|
||||
for(Iterator<BuyRegion> it = regions.iterator(); it.hasNext(); ) {
|
||||
if(it.next().isSold()) {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
showSortedPagedList(sender, regions, filterGroup, "info-forsaleHeader", (args.length > 2 ? args[2] : null), "/areashop info forsale");
|
||||
}
|
||||
// Reselling regions
|
||||
else if(args[1].equalsIgnoreCase("reselling")) {
|
||||
List<BuyRegion> regions = plugin.getFileManager().getBuys();
|
||||
for(Iterator<BuyRegion> it = regions.iterator(); it.hasNext(); ) {
|
||||
if(!it.next().isInResellingMode()) {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
showSortedPagedList(sender, regions, filterGroup, "info-resellingHeader", (args.length > 2 ? args[2] : null), "/areashop info reselling");
|
||||
}
|
||||
|
||||
// List of regions without a group
|
||||
else if(args[1].equalsIgnoreCase("nogroup")) {
|
||||
List<GeneralRegion> regions = plugin.getFileManager().getRegions();
|
||||
for(RegionGroup group : plugin.getFileManager().getGroups()) {
|
||||
regions.removeAll(group.getMemberRegions());
|
||||
}
|
||||
if(regions.isEmpty()) {
|
||||
plugin.message(sender, "info-nogroupNone");
|
||||
} else {
|
||||
showSortedPagedList(sender, regions, filterGroup, "info-nogroupHeader", (args.length > 2 ? args[2] : null), "/areashop info nogroup");
|
||||
}
|
||||
}
|
||||
|
||||
// Region info
|
||||
else if(args[1].equalsIgnoreCase("region")) {
|
||||
if(args.length > 1) {
|
||||
RentRegion rent = null;
|
||||
BuyRegion buy = null;
|
||||
if(args.length > 2) {
|
||||
rent = plugin.getFileManager().getRent(args[2]);
|
||||
buy = plugin.getFileManager().getBuy(args[2]);
|
||||
} else {
|
||||
if (sender instanceof Player) {
|
||||
// get the region by location
|
||||
List<GeneralRegion> regions = Utils.getAllApplicableRegions(((Player) sender).getLocation());
|
||||
if (regions.isEmpty()) {
|
||||
plugin.message(sender, "cmd-noRegionsAtLocation");
|
||||
return;
|
||||
} else if (regions.size() > 1) {
|
||||
plugin.message(sender, "cmd-moreRegionsAtLocation");
|
||||
return;
|
||||
} else {
|
||||
if(regions.get(0).isRentRegion()) {
|
||||
rent = (RentRegion)regions.get(0);
|
||||
} else if(regions.get(0).isBuyRegion()) {
|
||||
buy = (BuyRegion)regions.get(0);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "cmd-automaticRegionOnlyByPlayer");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(rent == null && buy == null) {
|
||||
plugin.message(sender, "info-regionNotExisting", args[2]);
|
||||
return;
|
||||
}
|
||||
|
||||
if(rent != null) {
|
||||
plugin.message(sender, "info-regionHeaderRent", rent);
|
||||
if(rent.isRented()) {
|
||||
plugin.messageNoPrefix(sender, "info-regionRented", rent);
|
||||
plugin.messageNoPrefix(sender, "info-regionExtending", rent);
|
||||
// Money back
|
||||
if(UnrentCommand.canUse(sender, rent)) {
|
||||
plugin.messageNoPrefix(sender, "info-regionMoneyBackRentClick", rent);
|
||||
} else {
|
||||
plugin.messageNoPrefix(sender, "info-regionMoneyBackRent", rent);
|
||||
}
|
||||
// Friends
|
||||
if(!rent.getFriendsFeature().getFriendNames().isEmpty()) {
|
||||
String messagePart = "info-friend";
|
||||
if(DelfriendCommand.canUse(sender, rent)) {
|
||||
messagePart = "info-friendRemove";
|
||||
}
|
||||
plugin.messageNoPrefix(sender, "info-regionFriends", rent, Utils.combinedMessage(rent.getFriendsFeature().getFriendNames(), messagePart));
|
||||
}
|
||||
} else {
|
||||
plugin.messageNoPrefix(sender, "info-regionCanBeRented", rent);
|
||||
}
|
||||
if(rent.getLandlordName() != null) {
|
||||
plugin.messageNoPrefix(sender, "info-regionLandlord", rent);
|
||||
}
|
||||
// Maximum extends
|
||||
if(rent.getMaxExtends() != -1) {
|
||||
if(rent.getMaxExtends() == 0) {
|
||||
plugin.messageNoPrefix(sender, "info-regionNoExtending", rent);
|
||||
} else if(rent.isRented()) {
|
||||
plugin.messageNoPrefix(sender, "info-regionExtendsLeft", rent);
|
||||
} else {
|
||||
plugin.messageNoPrefix(sender, "info-regionMaxExtends", rent);
|
||||
}
|
||||
}
|
||||
if(rent.getMaxRentTime() != -1) {
|
||||
plugin.messageNoPrefix(sender, "info-regionMaxRentTime", rent);
|
||||
}
|
||||
if(rent.getInactiveTimeUntilUnrent() != -1) {
|
||||
plugin.messageNoPrefix(sender, "info-regionInactiveUnrent", rent);
|
||||
}
|
||||
// Teleport
|
||||
Message tp = Message.fromKey("info-prefix");
|
||||
boolean foundSomething = false;
|
||||
if(TeleportCommand.canUse(sender, rent)) {
|
||||
foundSomething = true;
|
||||
tp.append(Message.fromKey("info-regionTeleport").replacements(rent));
|
||||
}
|
||||
if(SetteleportCommand.canUse(sender, rent)) {
|
||||
if(foundSomething) {
|
||||
tp.append(", ");
|
||||
}
|
||||
foundSomething = true;
|
||||
tp.append(Message.fromKey("info-setRegionTeleport").replacements(rent));
|
||||
}
|
||||
if(foundSomething) {
|
||||
tp.append(".");
|
||||
tp.send(sender);
|
||||
}
|
||||
// Signs
|
||||
List<String> signLocations = new ArrayList<>();
|
||||
for(Location location : rent.getSignsFeature().getSignLocations()) {
|
||||
signLocations.add(Message.fromKey("info-regionSignLocation").replacements(location.getWorld().getName(), location.getBlockX(), location.getBlockY(), location.getBlockZ()).getPlain());
|
||||
}
|
||||
if(!signLocations.isEmpty()) {
|
||||
plugin.messageNoPrefix(sender, "info-regionSigns", signLocations.toArray());
|
||||
}
|
||||
// Groups
|
||||
if(sender.hasPermission("areashop.groupinfo") && !rent.getGroupNames().isEmpty()) {
|
||||
plugin.messageNoPrefix(sender, "info-regionGroups", Utils.createCommaSeparatedList(rent.getGroupNames()));
|
||||
}
|
||||
// Restoring
|
||||
if(rent.isRestoreEnabled()) {
|
||||
if(sender.hasPermission("areashop.setrestore")) {
|
||||
plugin.messageNoPrefix(sender, "info-regionRestoringRent", rent, Message.fromKey("info-regionRestoringProfile").replacements(rent.getRestoreProfile()));
|
||||
} else {
|
||||
plugin.messageNoPrefix(sender, "info-regionRestoringRent", rent, "");
|
||||
}
|
||||
}
|
||||
// Restrictions
|
||||
if(!rent.isRented()) {
|
||||
if(rent.restrictedToRegion()) {
|
||||
plugin.messageNoPrefix(sender, "info-regionRestrictedRegionRent", rent);
|
||||
} else if(rent.restrictedToWorld()) {
|
||||
plugin.messageNoPrefix(sender, "info-regionRestrictedWorldRent", rent);
|
||||
}
|
||||
}
|
||||
plugin.messageNoPrefix(sender, "info-regionFooterRent", rent);
|
||||
} else if(buy != null) {
|
||||
plugin.message(sender, "info-regionHeaderBuy", buy);
|
||||
if(buy.isSold()) {
|
||||
if(buy.isInResellingMode()) {
|
||||
plugin.messageNoPrefix(sender, "info-regionReselling", buy);
|
||||
plugin.messageNoPrefix(sender, "info-regionReselPrice", buy);
|
||||
} else {
|
||||
plugin.messageNoPrefix(sender, "info-regionBought", buy);
|
||||
}
|
||||
// Money back
|
||||
if(SellCommand.canUse(sender, buy)) {
|
||||
plugin.messageNoPrefix(sender, "info-regionMoneyBackBuyClick", buy);
|
||||
} else {
|
||||
plugin.messageNoPrefix(sender, "info-regionMoneyBackBuy", buy);
|
||||
}
|
||||
// Friends
|
||||
if(!buy.getFriendsFeature().getFriendNames().isEmpty()) {
|
||||
String messagePart = "info-friend";
|
||||
if(DelfriendCommand.canUse(sender, buy)) {
|
||||
messagePart = "info-friendRemove";
|
||||
}
|
||||
plugin.messageNoPrefix(sender, "info-regionFriends", buy, Utils.combinedMessage(buy.getFriendsFeature().getFriendNames(), messagePart));
|
||||
}
|
||||
} else {
|
||||
plugin.messageNoPrefix(sender, "info-regionCanBeBought", buy);
|
||||
}
|
||||
if(buy.getLandlord() != null) {
|
||||
plugin.messageNoPrefix(sender, "info-regionLandlord", buy);
|
||||
}
|
||||
if(buy.getInactiveTimeUntilSell() != -1) {
|
||||
plugin.messageNoPrefix(sender, "info-regionInactiveSell", buy);
|
||||
}
|
||||
// Teleport
|
||||
Message tp = Message.fromKey("info-prefix");
|
||||
boolean foundSomething = false;
|
||||
if(TeleportCommand.canUse(sender, buy)) {
|
||||
foundSomething = true;
|
||||
tp.append(Message.fromKey("info-regionTeleport").replacements(buy));
|
||||
}
|
||||
if(SetteleportCommand.canUse(sender, buy)) {
|
||||
if(foundSomething) {
|
||||
tp.append(", ");
|
||||
}
|
||||
foundSomething = true;
|
||||
tp.append(Message.fromKey("info-setRegionTeleport").replacements(buy));
|
||||
}
|
||||
if(foundSomething) {
|
||||
tp.append(".");
|
||||
tp.send(sender);
|
||||
}
|
||||
// Signs
|
||||
List<String> signLocations = new ArrayList<>();
|
||||
for(Location location : buy.getSignsFeature().getSignLocations()) {
|
||||
signLocations.add(Message.fromKey("info-regionSignLocation").replacements(location.getWorld().getName(), location.getBlockX(), location.getBlockY(), location.getBlockZ()).getPlain());
|
||||
}
|
||||
if(!signLocations.isEmpty()) {
|
||||
plugin.messageNoPrefix(sender, "info-regionSigns", signLocations.toArray());
|
||||
}
|
||||
// Groups
|
||||
if(sender.hasPermission("areashop.groupinfo") && !buy.getGroupNames().isEmpty()) {
|
||||
plugin.messageNoPrefix(sender, "info-regionGroups", Utils.createCommaSeparatedList(buy.getGroupNames()));
|
||||
}
|
||||
// Restoring
|
||||
if(buy.isRestoreEnabled()) {
|
||||
if(sender.hasPermission("areashop.setrestore")) {
|
||||
plugin.messageNoPrefix(sender, "info-regionRestoringBuy", buy, Message.fromKey("info-regionRestoringProfile").replacements(buy.getRestoreProfile()));
|
||||
} else {
|
||||
plugin.messageNoPrefix(sender, "info-regionRestoringBuy", buy, "");
|
||||
}
|
||||
}
|
||||
// Restrictions
|
||||
if(!buy.isSold()) {
|
||||
if(buy.restrictedToRegion()) {
|
||||
plugin.messageNoPrefix(sender, "info-regionRestrictedRegionBuy", buy);
|
||||
} else if(buy.restrictedToWorld()) {
|
||||
plugin.messageNoPrefix(sender, "info-regionRestrictedWorldBuy", buy);
|
||||
}
|
||||
}
|
||||
plugin.messageNoPrefix(sender, "info-regionFooterBuy", buy);
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "info-regionHelp");
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "info-help");
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "info-help");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create a comma-space separated list from a collection of strings
|
||||
* @param list The collection with strings
|
||||
* @return A comma-space separated list of the strings in the collection
|
||||
*/
|
||||
public String createCommaString(Collection<String> list) {
|
||||
String result = "";
|
||||
boolean first = true;
|
||||
for(String part : list) {
|
||||
if(first) {
|
||||
result += part;
|
||||
first = false;
|
||||
} else {
|
||||
result += ", " + part;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
List<String> result = new ArrayList<>();
|
||||
if(toComplete == 2) {
|
||||
result.addAll(Arrays.asList("all", "rented", "forrent", "sold", "forsale", "player", "region", "nogroup", "reselling"));
|
||||
} else if(toComplete == 3) {
|
||||
if(start[2].equalsIgnoreCase("player")) {
|
||||
for(Player player : Utils.getOnlinePlayers()) {
|
||||
result.add(player.getName());
|
||||
}
|
||||
} else if(start[2].equalsIgnoreCase("region")) {
|
||||
result.addAll(plugin.getFileManager().getBuyNames());
|
||||
result.addAll(plugin.getFileManager().getRentNames());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.messages.Message;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class LinksignsCommand extends CommandAreaShop {
|
||||
|
||||
public LinksignsCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop linksigns";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.linksigns")) {
|
||||
return "help-linksigns";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!sender.hasPermission("areashop.linksigns")) {
|
||||
plugin.message(sender, "linksigns-noPermission");
|
||||
return;
|
||||
}
|
||||
if (!(sender instanceof Player)) {
|
||||
plugin.message(sender, "cmd-onlyByPlayer");
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = (Player)sender;
|
||||
if(plugin.getSignlinkerManager().isInSignLinkMode(player)) {
|
||||
plugin.getSignlinkerManager().exitSignLinkMode(player);
|
||||
} else {
|
||||
// Get the profile
|
||||
String profile = null;
|
||||
if(args.length > 1) {
|
||||
profile = args[1];
|
||||
Set<String> profiles = plugin.getConfig().getConfigurationSection("signProfiles").getKeys(false);
|
||||
if(!profiles.contains(profile)) {
|
||||
ArrayList<String> message = new ArrayList<>();
|
||||
for(String p : profiles) {
|
||||
if(!message.isEmpty()) {
|
||||
message.add(", ");
|
||||
}
|
||||
message.addAll(Message.fromKey("addsign-profile").replacements(p).get());
|
||||
}
|
||||
plugin.message(sender, "addsign-wrongProfile", Message.fromList(message));
|
||||
return;
|
||||
}
|
||||
}
|
||||
plugin.getSignlinkerManager().enterSignLinkMode(player, profile);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
List<String> result = new ArrayList<>();
|
||||
if(toComplete == 2) {
|
||||
result.addAll(plugin.getFileManager().getRegionNames());
|
||||
} else if(toComplete == 3) {
|
||||
result.addAll(plugin.getConfig().getStringList("signProfiles"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.regions.BuyRegion;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
import me.wiefferink.areashop.regions.RentRegion;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public class MeCommand extends CommandAreaShop {
|
||||
|
||||
public MeCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop me";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.me")) {
|
||||
return "help-me";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!sender.hasPermission("areashop.me")) {
|
||||
plugin.message(sender, "me-noPermission");
|
||||
return;
|
||||
}
|
||||
OfflinePlayer player = null;
|
||||
if(!(sender instanceof Player)) {
|
||||
if(args.length <= 1) {
|
||||
plugin.message(sender, "me-notAPlayer");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
player = (OfflinePlayer)sender;
|
||||
}
|
||||
if(args.length > 1) {
|
||||
player = Bukkit.getOfflinePlayer(args[1]);
|
||||
if(player == null) {
|
||||
plugin.message(sender, "me-noPlayer", args[1]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(player == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the regions owned by the player
|
||||
Set<RentRegion> rentRegions = new HashSet<>();
|
||||
for(RentRegion region : plugin.getFileManager().getRents()) {
|
||||
if(region.isOwner(player)) {
|
||||
rentRegions.add(region);
|
||||
}
|
||||
}
|
||||
Set<BuyRegion> buyRegions = new HashSet<>();
|
||||
for(BuyRegion region : plugin.getFileManager().getBuys()) {
|
||||
if(region.isOwner(player)) {
|
||||
buyRegions.add(region);
|
||||
}
|
||||
}
|
||||
// Get the regions the player is added as friend
|
||||
Set<GeneralRegion> friendRegions = new HashSet<>();
|
||||
for(GeneralRegion region : plugin.getFileManager().getRegions()) {
|
||||
if(region.getFriendsFeature().getFriends() != null && region.getFriendsFeature().getFriends().contains(player.getUniqueId())) {
|
||||
friendRegions.add(region);
|
||||
}
|
||||
}
|
||||
|
||||
// Send messages
|
||||
boolean foundSome = !rentRegions.isEmpty() || !buyRegions.isEmpty() || !friendRegions.isEmpty();
|
||||
if(foundSome) {
|
||||
plugin.message(sender, "me-header", player.getName());
|
||||
}
|
||||
if(!rentRegions.isEmpty()) {
|
||||
for(RentRegion region : rentRegions) {
|
||||
plugin.messageNoPrefix(sender, "me-rentLine", region);
|
||||
}
|
||||
}
|
||||
if(!buyRegions.isEmpty()) {
|
||||
for(BuyRegion region : buyRegions) {
|
||||
plugin.messageNoPrefix(sender, "me-buyLine", region);
|
||||
}
|
||||
}
|
||||
if(!friendRegions.isEmpty()) {
|
||||
for(GeneralRegion region : friendRegions) {
|
||||
plugin.messageNoPrefix(sender, "me-friendLine", region);
|
||||
}
|
||||
}
|
||||
|
||||
if(!foundSome) {
|
||||
plugin.message(sender, "me-nothing", player.getName());
|
||||
} else {
|
||||
plugin.messageNoPrefix(sender, "me-clickHint");
|
||||
}
|
||||
}
|
||||
|
||||
public static void show() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.messages.Message;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MessageCommand extends CommandAreaShop {
|
||||
|
||||
public MessageCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop message";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.message")) {
|
||||
return "help-message";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(final CommandSender sender, final String[] args) {
|
||||
if(!sender.hasPermission("areashop.message")) {
|
||||
plugin.message(sender, "message-noPermission");
|
||||
return;
|
||||
}
|
||||
|
||||
if(args.length < 3) {
|
||||
plugin.message(sender, "message-help");
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = Bukkit.getPlayer(args[1]);
|
||||
if(player == null) {
|
||||
plugin.message(sender, "message-notOnline", args[1]);
|
||||
return;
|
||||
}
|
||||
|
||||
String[] messageArgs = new String[args.length-2];
|
||||
System.arraycopy(args, 2, messageArgs, 0, args.length-2);
|
||||
String message = StringUtils.join(messageArgs);
|
||||
|
||||
Message.fromString(message).send(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
List<String> result = new ArrayList<>();
|
||||
if(toComplete == 2) {
|
||||
for(Player player : Utils.getOnlinePlayers()) {
|
||||
result.add(player.getName());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
public class ReloadCommand extends CommandAreaShop {
|
||||
|
||||
public ReloadCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop reload";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.reload")) {
|
||||
return "help-reload";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(sender.hasPermission("areashop.reload")) {
|
||||
// Reload the configuration files and update all region flags/signs
|
||||
plugin.reload(sender);
|
||||
} else {
|
||||
plugin.message(sender, "reload-noPermission");
|
||||
}
|
||||
}
|
||||
}
|
||||
+74
-75
@@ -1,75 +1,74 @@
|
||||
package nl.evolutioncoding.AreaShop.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import nl.evolutioncoding.AreaShop.AreaShop;
|
||||
import nl.evolutioncoding.AreaShop.regions.GeneralRegion;
|
||||
import nl.evolutioncoding.AreaShop.regions.RentRegion;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class RentCommand extends CommandAreaShop {
|
||||
|
||||
public RentCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop rent";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.rent")) {
|
||||
return plugin.getLanguageManager().getLang("help-rent");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, Command command, String[] args) {
|
||||
if (!(sender instanceof Player)) {
|
||||
plugin.message(sender, "cmd-onlyByPlayer");
|
||||
return;
|
||||
}
|
||||
Player player = (Player)sender;
|
||||
if(args.length > 1 && args[1] != null) {
|
||||
RentRegion rent = plugin.getFileManager().getRent(args[1]);
|
||||
if(rent == null) {
|
||||
plugin.message(sender, "rent-notRentable");
|
||||
} else {
|
||||
rent.rent(player);
|
||||
}
|
||||
} else {
|
||||
// get the region by location
|
||||
List<GeneralRegion> regions = plugin.getFileManager().getApplicalbeASRegions(player.getLocation());
|
||||
if(regions.size() != 1) {
|
||||
plugin.message(sender, "rent-help");
|
||||
} else {
|
||||
if(!regions.get(0).isRentRegion()) {
|
||||
plugin.message(sender, "rent-notRentable");
|
||||
} else {
|
||||
((RentRegion)regions.get(0)).rent(player);
|
||||
}
|
||||
plugin.saveConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start) {
|
||||
ArrayList<String> result = new ArrayList<String>();
|
||||
if(toComplete == 2) {
|
||||
for(RentRegion region : plugin.getFileManager().getRents()) {
|
||||
if(!region.isRented()) {
|
||||
result.add(region.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.regions.RentRegion;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RentCommand extends CommandAreaShop {
|
||||
|
||||
public RentCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop rent";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.rent")) {
|
||||
return "help-rent";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!sender.hasPermission("areashop.rent")) {
|
||||
plugin.message(sender, "rent-noPermission");
|
||||
return;
|
||||
}
|
||||
if (!(sender instanceof Player)) {
|
||||
plugin.message(sender, "cmd-onlyByPlayer");
|
||||
return;
|
||||
}
|
||||
Player player = (Player)sender;
|
||||
if(args.length > 1 && args[1] != null) {
|
||||
RentRegion rent = plugin.getFileManager().getRent(args[1]);
|
||||
if(rent == null) {
|
||||
plugin.message(sender, "rent-notRentable");
|
||||
} else {
|
||||
rent.rent(player);
|
||||
}
|
||||
} else {
|
||||
// get the region by location
|
||||
List<RentRegion> regions = Utils.getApplicableRentRegions(((Player) sender).getLocation());
|
||||
if (regions.isEmpty()) {
|
||||
plugin.message(sender, "cmd-noRegionsAtLocation");
|
||||
} else if (regions.size() > 1) {
|
||||
plugin.message(sender, "cmd-moreRegionsAtLocation");
|
||||
} else {
|
||||
regions.get(0).rent(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
ArrayList<String> result = new ArrayList<>();
|
||||
if(toComplete == 2) {
|
||||
for(RentRegion region : plugin.getFileManager().getRents()) {
|
||||
if(!region.isRented()) {
|
||||
result.add(region.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.regions.BuyRegion;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ResellCommand extends CommandAreaShop {
|
||||
|
||||
public ResellCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop resell";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.resellall") || target.hasPermission("areashop.resell")) {
|
||||
return "help-resell";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!sender.hasPermission("areashop.resell") && !sender.hasPermission("areashop.resellall")) {
|
||||
plugin.message(sender, "resell-noPermissionOther");
|
||||
return;
|
||||
}
|
||||
|
||||
if(args.length <= 1) {
|
||||
plugin.message(sender, "resell-help");
|
||||
return;
|
||||
}
|
||||
double price;
|
||||
try {
|
||||
price = Double.parseDouble(args[1]);
|
||||
} catch(NumberFormatException e) {
|
||||
plugin.message(sender, "resell-wrongPrice", args[1]);
|
||||
return;
|
||||
}
|
||||
BuyRegion buy;
|
||||
if(args.length <= 2) {
|
||||
if (sender instanceof Player) {
|
||||
// get the region by location
|
||||
List<BuyRegion> regions = Utils.getApplicableBuyRegions(((Player) sender).getLocation());
|
||||
if (regions.isEmpty()) {
|
||||
plugin.message(sender, "cmd-noRegionsAtLocation");
|
||||
return;
|
||||
} else if (regions.size() > 1) {
|
||||
plugin.message(sender, "cmd-moreRegionsAtLocation");
|
||||
return;
|
||||
} else {
|
||||
buy = regions.get(0);
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "cmd-automaticRegionOnlyByPlayer");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
buy = plugin.getFileManager().getBuy(args[2]);
|
||||
if(buy == null) {
|
||||
plugin.message(sender, "resell-notRegistered", args[2]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(buy == null) {
|
||||
plugin.message(sender, "cmd-noRegionsAtLocation");
|
||||
return;
|
||||
}
|
||||
if(!buy.isSold()) {
|
||||
plugin.message(sender, "resell-notBought", buy);
|
||||
return;
|
||||
}
|
||||
if(sender.hasPermission("areashop.resellall")) {
|
||||
buy.enableReselling(price);
|
||||
buy.update();
|
||||
plugin.message(sender, "resell-success", buy);
|
||||
} else if(sender.hasPermission("areashop.resell") && sender instanceof Player) {
|
||||
if(buy.isOwner((Player)sender)) {
|
||||
buy.enableReselling(price);
|
||||
buy.update();
|
||||
plugin.message(sender, "resell-success", buy);
|
||||
} else {
|
||||
plugin.message(sender, "resell-noPermissionOther", buy);
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "resell-noPermission", buy);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
ArrayList<String> result = new ArrayList<>();
|
||||
if(toComplete == 3) {
|
||||
for(BuyRegion region : plugin.getFileManager().getBuys()) {
|
||||
if(region.isSold() && !region.isInResellingMode()) {
|
||||
result.add(region.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+89
-88
@@ -1,88 +1,89 @@
|
||||
package nl.evolutioncoding.AreaShop.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import nl.evolutioncoding.AreaShop.AreaShop;
|
||||
import nl.evolutioncoding.AreaShop.Utils;
|
||||
import nl.evolutioncoding.AreaShop.regions.GeneralRegion;
|
||||
import nl.evolutioncoding.AreaShop.regions.GeneralRegion.RegionEvent;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
public class SchematiceventCommand extends CommandAreaShop {
|
||||
|
||||
public SchematiceventCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop schemevent";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.schematicevents")) {
|
||||
return plugin.getLanguageManager().getLang("help-schemevent");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, Command command, String[] args) {
|
||||
if(!sender.hasPermission("areashop.schematicevents")) {
|
||||
plugin.message(sender, "schemevent-noPermission");
|
||||
return;
|
||||
}
|
||||
|
||||
if(args.length < 3 || args[1] == null || args[2] == null) {
|
||||
plugin.message(sender, "schemevent-help");
|
||||
return;
|
||||
}
|
||||
GeneralRegion region = plugin.getFileManager().getRegion(args[1]);
|
||||
if(region == null) {
|
||||
plugin.message(sender, "schemevent-noRegion", args[1]);
|
||||
return;
|
||||
}
|
||||
|
||||
RegionEvent event = null;
|
||||
boolean exception = false;
|
||||
try {
|
||||
event = RegionEvent.valueOf(args[2].toUpperCase());
|
||||
} catch(IllegalArgumentException e) {
|
||||
exception = true;
|
||||
}
|
||||
// Check for a totally wrong event or a non matching event
|
||||
if(exception) {
|
||||
ArrayList<String> values = new ArrayList<String>();
|
||||
for(RegionEvent value : RegionEvent.values()) {
|
||||
values.add(value.getValue().toLowerCase());
|
||||
}
|
||||
plugin.message(sender, "schemevent-wrongEvent", args[2], Utils.createCommaSeparatedList(values));
|
||||
return;
|
||||
}
|
||||
region.handleSchematicEvent(event);
|
||||
plugin.message(sender, "schemevent-success", args[2], region.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start) {
|
||||
ArrayList<String> result = new ArrayList<String>();
|
||||
if(toComplete == 2) {
|
||||
result.addAll(plugin.getFileManager().getRegionNames());
|
||||
} else if(toComplete == 3) {
|
||||
GeneralRegion region = plugin.getFileManager().getRegion(start[2]);
|
||||
if(region != null) {
|
||||
if(region.isRentRegion()) {
|
||||
result.addAll(Arrays.asList("created", "deleted", "rented", "unrented"));
|
||||
} else if(region.isBuyRegion()) {
|
||||
result.addAll(Arrays.asList("created", "deleted", "bought", "sold"));
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class SchematiceventCommand extends CommandAreaShop {
|
||||
|
||||
public SchematiceventCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop schemevent";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.schematicevents")) {
|
||||
return "help-schemevent";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!sender.hasPermission("areashop.schematicevents")) {
|
||||
plugin.message(sender, "schemevent-noPermission");
|
||||
return;
|
||||
}
|
||||
|
||||
if(args.length < 3 || args[1] == null || args[2] == null) {
|
||||
plugin.message(sender, "schemevent-help");
|
||||
return;
|
||||
}
|
||||
GeneralRegion region = plugin.getFileManager().getRegion(args[1]);
|
||||
if(region == null) {
|
||||
plugin.message(sender, "cmd-notRegistered", args[1]);
|
||||
return;
|
||||
}
|
||||
if(region.getRegion() == null) {
|
||||
plugin.message(sender, "general-noRegion", region);
|
||||
return;
|
||||
}
|
||||
GeneralRegion.RegionEvent event = null;
|
||||
boolean exception = false;
|
||||
try {
|
||||
event = GeneralRegion.RegionEvent.valueOf(args[2].toUpperCase());
|
||||
} catch(IllegalArgumentException e) {
|
||||
exception = true;
|
||||
}
|
||||
// Check for a totally wrong event or a non matching event
|
||||
if(exception) {
|
||||
ArrayList<String> values = new ArrayList<>();
|
||||
for(GeneralRegion.RegionEvent value : GeneralRegion.RegionEvent.values()) {
|
||||
values.add(value.getValue().toLowerCase());
|
||||
}
|
||||
plugin.message(sender, "schemevent-wrongEvent", args[2], Utils.createCommaSeparatedList(values), region);
|
||||
return;
|
||||
}
|
||||
region.handleSchematicEvent(event);
|
||||
region.update();
|
||||
plugin.message(sender, "schemevent-success", args[2], region);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
ArrayList<String> result = new ArrayList<>();
|
||||
if(toComplete == 2) {
|
||||
result.addAll(plugin.getFileManager().getRegionNames());
|
||||
} else if(toComplete == 3) {
|
||||
GeneralRegion region = plugin.getFileManager().getRegion(start[2]);
|
||||
if(region != null) {
|
||||
if(region.isRentRegion()) {
|
||||
result.addAll(Arrays.asList("created", "deleted", "rented", "unrented"));
|
||||
} else if(region.isBuyRegion()) {
|
||||
result.addAll(Arrays.asList("created", "deleted", "bought", "sold"));
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.regions.BuyRegion;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SellCommand extends CommandAreaShop {
|
||||
|
||||
public SellCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop sell";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.sell") || target.hasPermission("areashop.sellown")) {
|
||||
return "help-sell";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a person can sell the region
|
||||
* @param person The person to check
|
||||
* @param region The region to check for
|
||||
* @return true if the person can sell it, otherwise false
|
||||
*/
|
||||
public static boolean canUse(CommandSender person, GeneralRegion region) {
|
||||
if(person.hasPermission("areashop.sell")) {
|
||||
return true;
|
||||
}
|
||||
if(person instanceof Player) {
|
||||
Player player = (Player)person;
|
||||
return region.isOwner(player) && person.hasPermission("areashop.sellown");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!sender.hasPermission("areashop.sell") && !sender.hasPermission("areashop.sellown")) {
|
||||
plugin.message(sender, "sell-noPermission");
|
||||
return;
|
||||
}
|
||||
BuyRegion buy;
|
||||
if(args.length <= 1) {
|
||||
if (sender instanceof Player) {
|
||||
// get the region by location
|
||||
List<BuyRegion> regions = Utils.getApplicableBuyRegions(((Player) sender).getLocation());
|
||||
if (regions.isEmpty()) {
|
||||
plugin.message(sender, "cmd-noRegionsAtLocation");
|
||||
return;
|
||||
} else if (regions.size() > 1) {
|
||||
plugin.message(sender, "cmd-moreRegionsAtLocation");
|
||||
return;
|
||||
} else {
|
||||
buy = regions.get(0);
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "cmd-automaticRegionOnlyByPlayer");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
buy = plugin.getFileManager().getBuy(args[1]);
|
||||
}
|
||||
if(buy == null) {
|
||||
plugin.message(sender, "sell-notRegistered");
|
||||
return;
|
||||
}
|
||||
if(!buy.isSold()) {
|
||||
plugin.message(sender, "sell-notBought", buy);
|
||||
return;
|
||||
}
|
||||
buy.sell(true, sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
ArrayList<String> result = new ArrayList<>();
|
||||
if(toComplete == 2) {
|
||||
for(BuyRegion region : plugin.getFileManager().getBuys()) {
|
||||
if(region.isSold()) {
|
||||
result.add(region.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.regions.RentRegion;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SetdurationCommand extends CommandAreaShop {
|
||||
|
||||
public SetdurationCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop setduration";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.setduration")) {
|
||||
return "help-setduration";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!sender.hasPermission("areashop.setduration") && (!sender.hasPermission("areashop.setduration.landlord") && sender instanceof Player)) {
|
||||
plugin.message(sender, "setduration-noPermission");
|
||||
return;
|
||||
}
|
||||
if(args.length < 3 || args[1] == null || args[2] == null) {
|
||||
plugin.message(sender, "setduration-help");
|
||||
return;
|
||||
}
|
||||
int regionArgument = 3;
|
||||
if(args.length >= 2 && ("default".equalsIgnoreCase(args[1]) || "reset".equalsIgnoreCase(args[1]))) {
|
||||
regionArgument = 2;
|
||||
}
|
||||
RentRegion rent;
|
||||
if(args.length <= regionArgument) {
|
||||
if (sender instanceof Player) {
|
||||
// get the region by location
|
||||
List<RentRegion> regions = Utils.getApplicableRentRegions(((Player) sender).getLocation());
|
||||
if (regions.isEmpty()) {
|
||||
plugin.message(sender, "cmd-noRegionsAtLocation");
|
||||
return;
|
||||
} else if (regions.size() > 1) {
|
||||
plugin.message(sender, "cmd-moreRegionsAtLocation");
|
||||
return;
|
||||
} else {
|
||||
rent = regions.get(0);
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "cmd-automaticRegionOnlyByPlayer");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
rent = plugin.getFileManager().getRent(args[regionArgument]);
|
||||
}
|
||||
if(rent == null) {
|
||||
plugin.message(sender, "setduration-notRegistered", args[regionArgument]);
|
||||
return;
|
||||
}
|
||||
if(!sender.hasPermission("areashop.setduration") && !(sender instanceof Player && rent.isLandlord(((Player)sender).getUniqueId()))) {
|
||||
plugin.message(sender, "setduration-noLandlord", rent);
|
||||
return;
|
||||
}
|
||||
if("default".equalsIgnoreCase(args[1]) || "reset".equalsIgnoreCase(args[1])) {
|
||||
rent.setDuration(null);
|
||||
rent.update();
|
||||
plugin.message(sender, "setduration-successRemoved", rent);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Integer.parseInt(args[1]);
|
||||
} catch(NumberFormatException e) {
|
||||
plugin.message(sender, "setduration-wrongAmount", args[1], rent);
|
||||
return;
|
||||
}
|
||||
if(!Utils.checkTimeFormat(args[1]+" "+args[2])) {
|
||||
plugin.message(sender, "setduration-wrongFormat", args[1]+" "+args[2], rent);
|
||||
return;
|
||||
}
|
||||
rent.setDuration(args[1]+" "+args[2]);
|
||||
rent.update();
|
||||
plugin.message(sender, "setduration-success", rent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
List<String> result = new ArrayList<>();
|
||||
if(toComplete == 2) {
|
||||
result = plugin.getFileManager().getRentNames();
|
||||
} else if(toComplete == 4) {
|
||||
result.addAll(plugin.getConfig().getStringList("minutes"));
|
||||
result.addAll(plugin.getConfig().getStringList("hours"));
|
||||
result.addAll(plugin.getConfig().getStringList("days"));
|
||||
result.addAll(plugin.getConfig().getStringList("months"));
|
||||
result.addAll(plugin.getConfig().getStringList("years"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SetlandlordCommand extends CommandAreaShop {
|
||||
|
||||
public SetlandlordCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop setlandlord";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.setlandlord")) {
|
||||
return "help-setlandlord";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!sender.hasPermission("areashop.setlandlord")) {
|
||||
plugin.message(sender, "setlandlord-noPermission");
|
||||
return;
|
||||
}
|
||||
if(args.length < 2) {
|
||||
plugin.message(sender, "setlandlord-help");
|
||||
return;
|
||||
}
|
||||
@SuppressWarnings("deprecation")
|
||||
OfflinePlayer player = Bukkit.getOfflinePlayer(args[1]);
|
||||
GeneralRegion region;
|
||||
if(args.length < 3) {
|
||||
if (sender instanceof Player) {
|
||||
// get the region by location
|
||||
List<GeneralRegion> regions = Utils.getAllApplicableRegions(((Player) sender).getLocation());
|
||||
if (regions.isEmpty()) {
|
||||
plugin.message(sender, "cmd-noRegionsAtLocation");
|
||||
return;
|
||||
} else if (regions.size() > 1) {
|
||||
plugin.message(sender, "cmd-moreRegionsAtLocation");
|
||||
return;
|
||||
} else {
|
||||
region = regions.get(0);
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "cmd-automaticRegionOnlyByPlayer");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
region = plugin.getFileManager().getRegion(args[2]);
|
||||
}
|
||||
if(region == null) {
|
||||
plugin.message(sender, "cmd-notRegistered", args[2]);
|
||||
return;
|
||||
}
|
||||
String playerName = player.getName();
|
||||
if(playerName == null || playerName.isEmpty()) {
|
||||
playerName = args[1];
|
||||
}
|
||||
region.setLandlord(player.getUniqueId(), playerName);
|
||||
region.update();
|
||||
plugin.message(sender, "setlandlord-success", playerName, region);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
ArrayList<String> result = new ArrayList<>();
|
||||
if(toComplete == 2) {
|
||||
for(Player player : Utils.getOnlinePlayers()) {
|
||||
result.add(player.getName());
|
||||
}
|
||||
} else if(toComplete == 3) {
|
||||
result.addAll(plugin.getFileManager().getRegionNames());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.regions.BuyRegion;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
import me.wiefferink.areashop.regions.RentRegion;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
public class SetownerCommand extends CommandAreaShop {
|
||||
|
||||
public SetownerCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop setowner";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.setownerrent") || target.hasPermission("areashop.setownerbuy")) {
|
||||
return "help-setowner";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!sender.hasPermission("areashop.setownerrent") && !sender.hasPermission("areashop.setownerbuy")) {
|
||||
plugin.message(sender, "setowner-noPermission");
|
||||
return;
|
||||
}
|
||||
GeneralRegion region;
|
||||
if(args.length < 2) {
|
||||
plugin.message(sender, "setowner-help");
|
||||
return;
|
||||
}
|
||||
if(args.length == 2) {
|
||||
if (sender instanceof Player) {
|
||||
// get the region by location
|
||||
List<GeneralRegion> regions = Utils.getAllApplicableRegions(((Player) sender).getLocation());
|
||||
if (regions.isEmpty()) {
|
||||
plugin.message(sender, "cmd-noRegionsAtLocation");
|
||||
return;
|
||||
} else if (regions.size() > 1) {
|
||||
plugin.message(sender, "cmd-moreRegionsAtLocation");
|
||||
return;
|
||||
} else {
|
||||
region = regions.get(0);
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "cmd-automaticRegionOnlyByPlayer");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
region = plugin.getFileManager().getRegion(args[2]);
|
||||
}
|
||||
if(region == null) {
|
||||
plugin.message(sender, "setowner-notRegistered");
|
||||
return;
|
||||
}
|
||||
|
||||
if(region.isRentRegion() && !sender.hasPermission("areashop.setownerrent")) {
|
||||
plugin.message(sender, "setowner-noPermissionRent", region);
|
||||
return;
|
||||
}
|
||||
if(region.isBuyRegion() && !sender.hasPermission("areashop.setownerbuy")) {
|
||||
plugin.message(sender, "setowner-noPermissionBuy", region);
|
||||
return;
|
||||
}
|
||||
|
||||
UUID uuid = null;
|
||||
@SuppressWarnings("deprecation")
|
||||
OfflinePlayer player = Bukkit.getOfflinePlayer(args[1]);
|
||||
if(player != null) {
|
||||
uuid = player.getUniqueId();
|
||||
}
|
||||
if(uuid == null) {
|
||||
plugin.message(sender, "setowner-noPlayer", args[1], region);
|
||||
return;
|
||||
}
|
||||
|
||||
if(region.isRentRegion()) {
|
||||
RentRegion rent = (RentRegion)region;
|
||||
if(rent.isRenter(uuid)) {
|
||||
// extend
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTimeInMillis(rent.getRentedUntil() + rent.getDuration());
|
||||
rent.setRentedUntil(calendar.getTimeInMillis());
|
||||
rent.setRenter(uuid);
|
||||
rent.update();
|
||||
plugin.message(sender, "setowner-succesRentExtend", region);
|
||||
} else {
|
||||
// change
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
long current = calendar.getTimeInMillis();
|
||||
if(rent.isRented()) {
|
||||
current = rent.getRentedUntil();
|
||||
}
|
||||
calendar.setTimeInMillis(current + rent.getDuration());
|
||||
rent.setRentedUntil(calendar.getTimeInMillis());
|
||||
rent.setRenter(uuid);
|
||||
rent.update();
|
||||
plugin.message(sender, "setowner-succesRent", region);
|
||||
}
|
||||
}
|
||||
if(region.isBuyRegion()) {
|
||||
BuyRegion buy = (BuyRegion)region;
|
||||
buy.setBuyer(uuid);
|
||||
buy.update();
|
||||
plugin.message(sender, "setowner-succesBuy", region);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
ArrayList<String> result = new ArrayList<>();
|
||||
if(toComplete == 2) {
|
||||
for(Player player : Utils.getOnlinePlayers()) {
|
||||
result.add(player.getName());
|
||||
}
|
||||
} else if(toComplete == 3) {
|
||||
result.addAll(plugin.getFileManager().getRegionNames());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.regions.BuyRegion;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
import me.wiefferink.areashop.regions.RentRegion;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SetpriceCommand extends CommandAreaShop {
|
||||
|
||||
public SetpriceCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop setprice";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.setprice")) {
|
||||
return "help-setprice";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!sender.hasPermission("areashop.setprice") && (!sender.hasPermission("areashop.setprice.landlord") && sender instanceof Player)) {
|
||||
plugin.message(sender, "setprice-noPermission");
|
||||
return;
|
||||
}
|
||||
if(args.length < 2 || args[1] == null) {
|
||||
plugin.message(sender, "setprice-help");
|
||||
return;
|
||||
}
|
||||
GeneralRegion region;
|
||||
if(args.length < 3) {
|
||||
if (sender instanceof Player) {
|
||||
// get the region by location
|
||||
List<GeneralRegion> regions = Utils.getAllApplicableRegions(((Player) sender).getLocation());
|
||||
if (regions.isEmpty()) {
|
||||
plugin.message(sender, "cmd-noRegionsAtLocation");
|
||||
return;
|
||||
} else if (regions.size() > 1) {
|
||||
plugin.message(sender, "cmd-moreRegionsAtLocation");
|
||||
return;
|
||||
} else {
|
||||
region = regions.get(0);
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "cmd-automaticRegionOnlyByPlayer");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
region = plugin.getFileManager().getRegion(args[2]);
|
||||
}
|
||||
if(region == null) {
|
||||
plugin.message(sender, "setprice-notRegistered", args[2]);
|
||||
return;
|
||||
}
|
||||
if(!sender.hasPermission("areashop.setprice") && !(sender instanceof Player && region.isLandlord(((Player)sender).getUniqueId()))) {
|
||||
plugin.message(sender, "setprice-noLandlord", region);
|
||||
return;
|
||||
}
|
||||
if("default".equalsIgnoreCase(args[1]) || "reset".equalsIgnoreCase(args[1])) {
|
||||
if(region.isRentRegion()) {
|
||||
((RentRegion)region).removePrice();
|
||||
} else if(region.isBuyRegion()) {
|
||||
((BuyRegion)region).removePrice();
|
||||
}
|
||||
region.update();
|
||||
plugin.message(sender, "setprice-successRemoved", region);
|
||||
return;
|
||||
}
|
||||
double price;
|
||||
try {
|
||||
price = Double.parseDouble(args[1]);
|
||||
} catch(NumberFormatException e) {
|
||||
plugin.message(sender, "setprice-wrongPrice", args[1], region);
|
||||
return;
|
||||
}
|
||||
if(region.isRentRegion()) {
|
||||
((RentRegion)region).setPrice(price);
|
||||
plugin.message(sender, "setprice-successRent", region);
|
||||
} else if(region.isBuyRegion()) {
|
||||
((BuyRegion)region).setPrice(price);
|
||||
plugin.message(sender, "setprice-successBuy", region);
|
||||
}
|
||||
region.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
List<String> result = new ArrayList<>();
|
||||
if(toComplete == 3) {
|
||||
result = plugin.getFileManager().getRegionNames();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
+78
-77
@@ -1,77 +1,78 @@
|
||||
package nl.evolutioncoding.AreaShop.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import nl.evolutioncoding.AreaShop.AreaShop;
|
||||
import nl.evolutioncoding.AreaShop.regions.GeneralRegion;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
public class SetrestoreCommand extends CommandAreaShop {
|
||||
|
||||
public SetrestoreCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop setrestore";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.setrestore")) {
|
||||
return plugin.getLanguageManager().getLang("help-setrestore");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, Command command, String[] args) {
|
||||
if(!sender.hasPermission("areashop.setrestore")) {
|
||||
plugin.message(sender, "setrestore-noPermission");
|
||||
return;
|
||||
}
|
||||
if(args.length <= 2 || args[1] == null || args[2] == null) {
|
||||
plugin.message(sender, "setrestore-help");
|
||||
return;
|
||||
}
|
||||
GeneralRegion region = plugin.getFileManager().getRegion(args[1]);
|
||||
if(region == null) {
|
||||
plugin.message(sender, "setrestore-notRegistered", args[1]);
|
||||
return;
|
||||
}
|
||||
String value = null;
|
||||
if(args[2].equalsIgnoreCase("true") || args[2].equalsIgnoreCase("false") || args[2].equalsIgnoreCase("general")) {
|
||||
value = args[2].toLowerCase();
|
||||
} else {
|
||||
plugin.message(sender, "setrestore-invalidSetting", args[2]);
|
||||
return;
|
||||
}
|
||||
region.setRestoreSetting(value);
|
||||
if(args.length > 3) {
|
||||
region.setRestoreProfile(args[3]);
|
||||
plugin.message(sender, "setrestore-successProfile", region.getName(), value, args[3]);
|
||||
} else {
|
||||
plugin.message(sender, "setrestore-success", region.getName(), value);
|
||||
}
|
||||
region.save();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start) {
|
||||
List<String> result = new ArrayList<String>();
|
||||
if(toComplete == 2) {
|
||||
result = plugin.getFileManager().getRegionNames();
|
||||
} else if(toComplete == 3) {
|
||||
result.add("true");
|
||||
result.add("false");
|
||||
result.add("general");
|
||||
} else if(toComplete == 4) {
|
||||
result.addAll(plugin.config().getConfigurationSection("schematicProfiles").getKeys(false));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SetrestoreCommand extends CommandAreaShop {
|
||||
|
||||
public SetrestoreCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop setrestore";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.setrestore")) {
|
||||
return "help-setrestore";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!sender.hasPermission("areashop.setrestore")) {
|
||||
plugin.message(sender, "setrestore-noPermission");
|
||||
return;
|
||||
}
|
||||
if(args.length <= 2 || args[1] == null || args[2] == null) {
|
||||
plugin.message(sender, "setrestore-help");
|
||||
return;
|
||||
}
|
||||
GeneralRegion region = plugin.getFileManager().getRegion(args[1]);
|
||||
if(region == null) {
|
||||
plugin.message(sender, "setrestore-notRegistered", args[1]);
|
||||
return;
|
||||
}
|
||||
Boolean value = null;
|
||||
if(args[2].equalsIgnoreCase("true")) {
|
||||
value = true;
|
||||
} else if(args[2].equalsIgnoreCase("false")) {
|
||||
value = false;
|
||||
}
|
||||
region.setRestoreSetting(value);
|
||||
String valueString = "general";
|
||||
if(value != null) {
|
||||
valueString = value+"";
|
||||
}
|
||||
if(args.length > 3) {
|
||||
region.setSchematicProfile(args[3]);
|
||||
plugin.message(sender, "setrestore-successProfile", valueString, args[3], region);
|
||||
} else {
|
||||
plugin.message(sender, "setrestore-success", valueString, region);
|
||||
}
|
||||
region.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
List<String> result = new ArrayList<>();
|
||||
if(toComplete == 2) {
|
||||
result = plugin.getFileManager().getRegionNames();
|
||||
} else if(toComplete == 3) {
|
||||
result.add("true");
|
||||
result.add("false");
|
||||
result.add("general");
|
||||
} else if(toComplete == 4) {
|
||||
result.addAll(plugin.getConfig().getConfigurationSection("schematicProfiles").getKeys(false));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.regions.BuyRegion;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
import me.wiefferink.areashop.regions.RentRegion;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SetteleportCommand extends CommandAreaShop {
|
||||
|
||||
public SetteleportCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop settp";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.teleportall") || target.hasPermission("areashop.teleport")) {
|
||||
return "help-setteleport";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a person can set the teleport location of the region
|
||||
* @param person The person to check
|
||||
* @param region The region to check for
|
||||
* @return true if the person can set the teleport location, otherwise false
|
||||
*/
|
||||
public static boolean canUse(CommandSender person, GeneralRegion region) {
|
||||
if(!(person instanceof Player)) {
|
||||
return false;
|
||||
}
|
||||
Player player = (Player)person;
|
||||
return player.hasPermission("areashop.setteleportall")
|
||||
|| region.isOwner(player) && player.hasPermission("areashop.setteleport");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!sender.hasPermission("areashop.setteleport") && !sender.hasPermission("areashop.setteleportall")) {
|
||||
plugin.message(sender, "setteleport-noPermission");
|
||||
return;
|
||||
}
|
||||
if (!(sender instanceof Player)) {
|
||||
plugin.message(sender, "onlyByPlayer");
|
||||
return;
|
||||
}
|
||||
Player player = (Player)sender;
|
||||
GeneralRegion region;
|
||||
if(args.length < 2) {
|
||||
// get the region by location
|
||||
List<GeneralRegion> regions = Utils.getAllApplicableRegions(((Player)sender).getLocation());
|
||||
if(regions.isEmpty()) {
|
||||
plugin.message(sender, "cmd-noRegionsAtLocation");
|
||||
return;
|
||||
} else if(regions.size() > 1) {
|
||||
plugin.message(sender, "cmd-moreRegionsAtLocation");
|
||||
return;
|
||||
} else {
|
||||
region = regions.get(0);
|
||||
}
|
||||
} else {
|
||||
region = plugin.getFileManager().getRegion(args[1]);
|
||||
}
|
||||
|
||||
boolean owner;
|
||||
|
||||
if(region == null) {
|
||||
plugin.message(player, "setteleport-noRentOrBuy", args[1]);
|
||||
return;
|
||||
}
|
||||
if(region.isRentRegion()) {
|
||||
owner = player.getUniqueId().equals(((RentRegion)region).getRenter());
|
||||
} else {
|
||||
owner = player.getUniqueId().equals(((BuyRegion)region).getBuyer());
|
||||
}
|
||||
if(!player.hasPermission("areashop.setteleport")) {
|
||||
plugin.message(player, "setteleport-noPermission", region);
|
||||
return;
|
||||
} else if(!owner && !player.hasPermission("areashop.setteleportall")) {
|
||||
plugin.message(player, "setteleport-noPermissionOther", region);
|
||||
return;
|
||||
}
|
||||
|
||||
ProtectedRegion wgRegion = region.getRegion();
|
||||
if(args.length > 2 && args[2] != null && (args[2].equalsIgnoreCase("reset") || args[2].equalsIgnoreCase("yes") || args[2].equalsIgnoreCase("true"))) {
|
||||
region.setTeleport(null);
|
||||
region.update();
|
||||
plugin.message(player, "setteleport-reset", region);
|
||||
return;
|
||||
}
|
||||
if(!player.hasPermission("areashop.setteleportoutsideregion") && (wgRegion == null || !wgRegion.contains(player.getLocation().getBlockX(), player.getLocation().getBlockY(), player.getLocation().getBlockZ()))) {
|
||||
plugin.message(player, "setteleport-notInside", region);
|
||||
return;
|
||||
}
|
||||
region.setTeleport(player.getLocation());
|
||||
region.update();
|
||||
plugin.message(player, "setteleport-success", region);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
ArrayList<String> result = new ArrayList<>();
|
||||
if(toComplete == 2) {
|
||||
result.addAll(plugin.getFileManager().getRegionNames());
|
||||
} else if(toComplete == 3) {
|
||||
result.add("reset");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,229 @@
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import com.sk89q.worldedit.BlockVector;
|
||||
import com.sk89q.worldedit.bukkit.selections.Selection;
|
||||
import com.sk89q.worldguard.protection.managers.RegionManager;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedCuboidRegion;
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.messages.Message;
|
||||
import me.wiefferink.areashop.regions.BuyRegion;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
import me.wiefferink.areashop.regions.RegionGroup;
|
||||
import me.wiefferink.areashop.regions.RentRegion;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class StackCommand extends CommandAreaShop {
|
||||
|
||||
public StackCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop stack";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.stack")) {
|
||||
return "help-stack";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
// Check permission
|
||||
if(!sender.hasPermission("areashop.stack")) {
|
||||
plugin.message(sender, "stack-noPermission");
|
||||
return;
|
||||
}
|
||||
// Only from ingame
|
||||
if (!(sender instanceof Player)) {
|
||||
plugin.message(sender, "cmd-onlyByPlayer");
|
||||
return;
|
||||
}
|
||||
final Player player = (Player)sender;
|
||||
// Specify enough arguments
|
||||
if(args.length < 5) {
|
||||
plugin.message(sender, "stack-help");
|
||||
return;
|
||||
}
|
||||
// Check amount
|
||||
int tempAmount = -1;
|
||||
try {
|
||||
tempAmount = Integer.parseInt(args[1]);
|
||||
} catch(NumberFormatException e) {
|
||||
// Incorrect number
|
||||
}
|
||||
if(tempAmount <= 0) {
|
||||
plugin.message(player, "stack-wrongAmount", args[1]);
|
||||
return;
|
||||
}
|
||||
// Check gap
|
||||
int gap;
|
||||
try {
|
||||
gap = Integer.parseInt(args[2]);
|
||||
} catch(NumberFormatException e) {
|
||||
plugin.message(player, "stack-wrongGap", args[2]);
|
||||
return;
|
||||
}
|
||||
// Check region type
|
||||
if(!"rent".equalsIgnoreCase(args[4]) && !"buy".equalsIgnoreCase(args[4])) {
|
||||
plugin.message(sender, "stack-help");
|
||||
return;
|
||||
}
|
||||
// Get WorldEdit selection
|
||||
final Selection selection = plugin.getWorldEdit().getSelection(player);
|
||||
if(selection == null) {
|
||||
plugin.message(player, "stack-noSelection");
|
||||
return;
|
||||
}
|
||||
// Get or create group
|
||||
RegionGroup group = null;
|
||||
if(args.length > 5) {
|
||||
group = plugin.getFileManager().getGroup(args[5]);
|
||||
if(group == null) {
|
||||
group = new RegionGroup(plugin, args[5]);
|
||||
plugin.getFileManager().addGroup(group);
|
||||
}
|
||||
}
|
||||
// Get facing of the player (must be clearly one of the four directions to make sure it is no mistake)
|
||||
BlockFace facing = Utils.yawToFacing(player.getLocation().getYaw());
|
||||
if(!(facing == BlockFace.NORTH || facing == BlockFace.EAST || facing == BlockFace.SOUTH || facing == BlockFace.WEST)) {
|
||||
plugin.message(player, "stack-unclearDirection", facing.toString().toLowerCase().replace('_', '-'));
|
||||
return;
|
||||
}
|
||||
final Location shift = new Location(selection.getWorld(), 0, 0, 0);
|
||||
if(facing == BlockFace.SOUTH) {
|
||||
shift.setZ(-selection.getLength() - gap);
|
||||
} else if(facing == BlockFace.WEST) {
|
||||
shift.setX(selection.getWidth() + gap);
|
||||
} else if(facing == BlockFace.NORTH) {
|
||||
shift.setZ(selection.getLength() + gap);
|
||||
} else if(facing == BlockFace.EAST) {
|
||||
shift.setX(-selection.getWidth() - gap);
|
||||
}
|
||||
AreaShop.debug(" calculated shift vector: " + shift + ", with facing=" + facing);
|
||||
// Create regions and add them to AreaShop
|
||||
final String namePrefix = args[3];
|
||||
final int regionsPerTick = plugin.getConfig().getInt("adding.regionsPerTick");
|
||||
final boolean rentRegions = "rent".equalsIgnoreCase(args[4]);
|
||||
final int amount = tempAmount;
|
||||
final RegionGroup finalGroup = group;
|
||||
String type;
|
||||
if(rentRegions) {
|
||||
type = "rent";
|
||||
} else {
|
||||
type = "buy";
|
||||
}
|
||||
Message groupsMessage = Message.none();
|
||||
if(group != null) {
|
||||
groupsMessage = Message.fromKey("stack-addToGroup").replacements(group.getName());
|
||||
}
|
||||
plugin.message(player, "stack-accepted", amount, type, gap, namePrefix, groupsMessage);
|
||||
plugin.message(player, "stack-addStart", amount, regionsPerTick*20);
|
||||
new BukkitRunnable() {
|
||||
private int current = 0;
|
||||
private RegionManager manager = AreaShop.getInstance().getWorldGuard().getRegionManager(selection.getWorld());
|
||||
private int counter = 1;
|
||||
@Override
|
||||
public void run() {
|
||||
for(int i=0; i<regionsPerTick; i++) {
|
||||
if(current < amount) {
|
||||
// Create the region name
|
||||
String counterName = counter+"";
|
||||
int minimumLength = plugin.getConfig().getInt("stackRegionNumberLength");
|
||||
while(counterName.length() < minimumLength) {
|
||||
counterName = "0"+counterName;
|
||||
}
|
||||
String regionName = namePrefix + counterName;
|
||||
while(manager.getRegion(regionName) != null || AreaShop.getInstance().getFileManager().getRegion(regionName) != null) {
|
||||
counter++;
|
||||
counterName = counter+"";
|
||||
minimumLength = plugin.getConfig().getInt("stackRegionNumberLength");
|
||||
while(counterName.length() < minimumLength) {
|
||||
counterName = "0"+counterName;
|
||||
}
|
||||
regionName = namePrefix + counterName;
|
||||
}
|
||||
// Add the region to WorldGuard (at startposition shifted by the number of this region times the blocks it should shift)
|
||||
ProtectedCuboidRegion region = new ProtectedCuboidRegion(regionName,
|
||||
new BlockVector(
|
||||
selection.getMinimumPoint().getBlockX() + shift.getBlockX()*current,
|
||||
selection.getMinimumPoint().getBlockY() + shift.getBlockY()*current,
|
||||
selection.getMinimumPoint().getBlockZ() + shift.getBlockZ()*current
|
||||
),
|
||||
new BlockVector(
|
||||
selection.getMaximumPoint().getBlockX() + shift.getBlockX()*current,
|
||||
selection.getMaximumPoint().getBlockY() + shift.getBlockY()*current,
|
||||
selection.getMaximumPoint().getBlockZ() + shift.getBlockZ()*current
|
||||
)
|
||||
);
|
||||
manager.addRegion(region);
|
||||
// Add the region to AreaShop
|
||||
if(rentRegions) {
|
||||
RentRegion rent = new RentRegion(plugin, region.getId(), selection.getWorld());
|
||||
if(finalGroup != null) {
|
||||
finalGroup.addMember(rent);
|
||||
}
|
||||
rent.runEventCommands(GeneralRegion.RegionEvent.CREATED, true);
|
||||
plugin.getFileManager().addRent(rent);
|
||||
rent.handleSchematicEvent(GeneralRegion.RegionEvent.CREATED);
|
||||
rent.runEventCommands(GeneralRegion.RegionEvent.CREATED, false);
|
||||
rent.update();
|
||||
} else {
|
||||
BuyRegion buy = new BuyRegion(plugin, region.getId(), selection.getWorld());
|
||||
if(finalGroup != null) {
|
||||
finalGroup.addMember(buy);
|
||||
}
|
||||
buy.runEventCommands(GeneralRegion.RegionEvent.CREATED, true);
|
||||
plugin.getFileManager().addBuy(buy);
|
||||
buy.handleSchematicEvent(GeneralRegion.RegionEvent.CREATED);
|
||||
buy.runEventCommands(GeneralRegion.RegionEvent.CREATED, false);
|
||||
buy.update();
|
||||
}
|
||||
current++;
|
||||
}
|
||||
}
|
||||
if(current >= amount) {
|
||||
if(player.isOnline()) {
|
||||
plugin.message(player, "stack-addComplete");
|
||||
}
|
||||
this.cancel();
|
||||
}
|
||||
}
|
||||
}.runTaskTimer(plugin, 1, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
List<String> result = new ArrayList<>();
|
||||
if(toComplete == 5) {
|
||||
result.add("rent");
|
||||
result.add("buy");
|
||||
} else if(toComplete == 6) {
|
||||
result.addAll(plugin.getFileManager().getGroupNames());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.regions.BuyRegion;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class StopresellCommand extends CommandAreaShop {
|
||||
|
||||
public StopresellCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop stopresell";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.stopresellall") || target.hasPermission("areashop.stopresell")) {
|
||||
return "help-stopResell";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!sender.hasPermission("areashop.stopresell") && !sender.hasPermission("areashop.stopresellall")) {
|
||||
plugin.message(sender, "stopresell-noPermissionOther");
|
||||
return;
|
||||
}
|
||||
|
||||
BuyRegion buy;
|
||||
if(args.length <= 1) {
|
||||
if (sender instanceof Player) {
|
||||
// get the region by location
|
||||
List<BuyRegion> regions = Utils.getApplicableBuyRegions(((Player) sender).getLocation());
|
||||
if (regions.isEmpty()) {
|
||||
plugin.message(sender, "cmd-noRegionsAtLocation");
|
||||
return;
|
||||
} else if (regions.size() > 1) {
|
||||
plugin.message(sender, "cmd-moreRegionsAtLocation");
|
||||
return;
|
||||
} else {
|
||||
buy = regions.get(0);
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "cmd-automaticRegionOnlyByPlayer");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
buy = plugin.getFileManager().getBuy(args[1]);
|
||||
if(buy == null) {
|
||||
plugin.message(sender, "stopresell-notRegistered", args[1]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(buy == null) {
|
||||
plugin.message(sender, "cmd-noRegionsAtLocation");
|
||||
return;
|
||||
}
|
||||
if(!buy.isInResellingMode()) {
|
||||
plugin.message(sender, "stopresell-notResell", buy);
|
||||
return;
|
||||
}
|
||||
if(sender.hasPermission("areashop.stopresellall")) {
|
||||
buy.disableReselling();
|
||||
buy.update();
|
||||
plugin.message(sender, "stopresell-success", buy);
|
||||
} else if(sender.hasPermission("areashop.stopresell") && sender instanceof Player) {
|
||||
if(buy.isOwner((Player)sender)) {
|
||||
buy.disableReselling();
|
||||
buy.update();
|
||||
plugin.message(sender, "stopresell-success", buy);
|
||||
} else {
|
||||
plugin.message(sender, "stopresell-noPermissionOther", buy);
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "stopresell-noPermission", buy);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
ArrayList<String> result = new ArrayList<>();
|
||||
if(toComplete == 2) {
|
||||
for(BuyRegion region : plugin.getFileManager().getBuys()) {
|
||||
if(region.isSold() && region.isInResellingMode()) {
|
||||
result.add(region.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TeleportCommand extends CommandAreaShop {
|
||||
|
||||
public TeleportCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop tp";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.teleportall") || target.hasPermission("areashop.teleport")) {
|
||||
return "help-teleport";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a person can teleport to the region (assuming he is not teleporting to a sign)
|
||||
* @param person The person to check
|
||||
* @param region The region to check for
|
||||
* @return true if the person can teleport to it, otherwise false
|
||||
*/
|
||||
public static boolean canUse(CommandSender person, GeneralRegion region) {
|
||||
if(!(person instanceof Player)) {
|
||||
return false;
|
||||
}
|
||||
Player player = (Player)person;
|
||||
return player.hasPermission("areashop.teleportall")
|
||||
|| region.isOwner(player) && player.hasPermission("areashop.teleport")
|
||||
|| region.getFriendsFeature().getFriends().contains(player.getUniqueId()) && player.hasPermission("areashop.teleportfriend");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!sender.hasPermission("areashop.teleport") && !sender.hasPermission("areashop.teleportall") && !sender.hasPermission("areashop.teleportsign") && !sender.hasPermission("areashop.teleportsignall") && !sender.hasPermission("areashop.teleportfriend") && !sender.hasPermission("teleportfriendsign")) {
|
||||
plugin.message(sender, "teleport-noPermission");
|
||||
return;
|
||||
}
|
||||
if (!(sender instanceof Player)) {
|
||||
plugin.message(sender, "cmd-onlyByPlayer");
|
||||
return;
|
||||
}
|
||||
if(args.length <= 1 || args[1] == null) {
|
||||
plugin.message(sender, "teleport-help");
|
||||
return;
|
||||
}
|
||||
Player player = (Player)sender;
|
||||
GeneralRegion region = plugin.getFileManager().getRegion(args[1]);
|
||||
if(region == null) {
|
||||
plugin.message(player, "teleport-noRentOrBuy", args[1]);
|
||||
return;
|
||||
}
|
||||
if(args.length >= 3 && (args[2].equalsIgnoreCase("sign") || args[2].equalsIgnoreCase("yes") || args[2].equalsIgnoreCase("true"))) {
|
||||
region.teleportPlayer(player, true);
|
||||
} else {
|
||||
region.teleportPlayer(player, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
ArrayList<String> result = new ArrayList<>();
|
||||
if(toComplete == 2) {
|
||||
result.addAll(plugin.getFileManager().getRegionNames());
|
||||
} else if(toComplete == 3) {
|
||||
result.add("sign");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
import me.wiefferink.areashop.regions.RentRegion;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class UnrentCommand extends CommandAreaShop {
|
||||
|
||||
public UnrentCommand(AreaShop plugin) {
|
||||
super(plugin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandStart() {
|
||||
return "areashop unrent";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp(CommandSender target) {
|
||||
if(target.hasPermission("areashop.unrent") || target.hasPermission("areashop.unrentown")) {
|
||||
return "help-unrent";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a person can unrent the region
|
||||
* @param person The person to check
|
||||
* @param region The region to check for
|
||||
* @return true if the person can unrent it, otherwise false
|
||||
*/
|
||||
public static boolean canUse(CommandSender person, GeneralRegion region) {
|
||||
if(person.hasPermission("areashop.unrent")) {
|
||||
return true;
|
||||
}
|
||||
if(person instanceof Player) {
|
||||
Player player = (Player)person;
|
||||
return region.isOwner(player) && person.hasPermission("areashop.unrentown");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if(!sender.hasPermission("areashop.unrent") && !sender.hasPermission("areashop.unrentown")) {
|
||||
plugin.message(sender, "unrent-noPermission");
|
||||
return;
|
||||
}
|
||||
RentRegion rent;
|
||||
if(args.length <= 1) {
|
||||
if (sender instanceof Player) {
|
||||
// get the region by location
|
||||
List<RentRegion> regions = Utils.getApplicableRentRegions(((Player) sender).getLocation());
|
||||
if (regions.isEmpty()) {
|
||||
plugin.message(sender, "cmd-noRegionsAtLocation");
|
||||
return;
|
||||
} else if (regions.size() > 1) {
|
||||
plugin.message(sender, "cmd-moreRegionsAtLocation");
|
||||
return;
|
||||
} else {
|
||||
rent = regions.get(0);
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "cmd-automaticRegionOnlyByPlayer");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
rent = plugin.getFileManager().getRent(args[1]);
|
||||
}
|
||||
if(rent == null) {
|
||||
plugin.message(sender, "unrent-notRegistered");
|
||||
return;
|
||||
}
|
||||
if(!rent.isRented()) {
|
||||
plugin.message(sender, "unrent-notRented", rent);
|
||||
return;
|
||||
}
|
||||
rent.unRent(true, sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
ArrayList<String> result = new ArrayList<>();
|
||||
if(toComplete == 2) {
|
||||
for(RentRegion region : plugin.getFileManager().getRents()) {
|
||||
if(region.isRented()) {
|
||||
result.add(region.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package me.wiefferink.areashop.events;
|
||||
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
public class CancellableAreaShopEvent extends Event {
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private boolean cancelled;
|
||||
private String reason;
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancel the event from happening
|
||||
* @param reason The reason of cancelling, used for display to the user, should end with a dot
|
||||
*/
|
||||
public void cancel(String reason) {
|
||||
this.cancelled = true;
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
/**
|
||||
* Let the event continue, possible overwriting a cancel() call from another plugin
|
||||
*/
|
||||
public void allow() {
|
||||
this.cancelled = false;
|
||||
this.reason = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the event has been cancelled
|
||||
* @return true if the event has been cancelled, otherwise false
|
||||
*/
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the reason why this event is cancelled
|
||||
* @return null if there is no reason or the event is not cancelled, otherwise a string
|
||||
*/
|
||||
public String getReason() {
|
||||
return reason;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package me.wiefferink.areashop.events;
|
||||
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
public class NotifyAreaShopEvent extends Event {
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package me.wiefferink.areashop.events.ask;
|
||||
|
||||
import me.wiefferink.areashop.events.CancellableAreaShopEvent;
|
||||
import me.wiefferink.areashop.regions.BuyRegion;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
* Broadcasted when a player tries to buy a region.
|
||||
*/
|
||||
public class BuyingRegionEvent extends CancellableAreaShopEvent {
|
||||
|
||||
private BuyRegion region;
|
||||
private Player player;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param region The region that is about to get bought
|
||||
* @param player The player that tries to buy the region
|
||||
*/
|
||||
public BuyingRegionEvent(BuyRegion region, Player player) {
|
||||
this.region = region;
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the region that is about to be bought
|
||||
* @return the region that is about to be bought
|
||||
*/
|
||||
public BuyRegion getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the player that is trying to buy the region
|
||||
* @return The player that is trying to buy the region
|
||||
*/
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package me.wiefferink.areashop.events.ask;
|
||||
|
||||
import me.wiefferink.areashop.events.CancellableAreaShopEvent;
|
||||
import me.wiefferink.areashop.regions.RentRegion;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
* Broadcasted when a player tries to rent a region
|
||||
*/
|
||||
public class RentingRegionEvent extends CancellableAreaShopEvent {
|
||||
|
||||
private RentRegion region;
|
||||
private Player player;
|
||||
private boolean extending;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param region The region that is about to be rented
|
||||
* @param player The player that tries to rent the region
|
||||
* @param extending true if the player is extending the rental of the region, otherwise false
|
||||
*/
|
||||
public RentingRegionEvent(RentRegion region, Player player, boolean extending) {
|
||||
this.region = region;
|
||||
this.player = player;
|
||||
this.extending = extending;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the region that is about to be rented
|
||||
* @return the region that is about to be rented
|
||||
*/
|
||||
public RentRegion getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the player that is trying to rent the region
|
||||
* @return The player that is trying to rent the region
|
||||
*/
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the player is extending the region or renting it for the first time
|
||||
* @return true if the player tries to extend the region, false if he tries to rent it the first time
|
||||
*/
|
||||
public boolean isExtending() {
|
||||
return extending;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package me.wiefferink.areashop.events.ask;
|
||||
|
||||
import me.wiefferink.areashop.events.CancellableAreaShopEvent;
|
||||
import me.wiefferink.areashop.regions.BuyRegion;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
* Broadcasted when a player tries to resell a region
|
||||
*/
|
||||
public class ResellingRegionEvent extends CancellableAreaShopEvent {
|
||||
|
||||
private BuyRegion region;
|
||||
private Player player;
|
||||
|
||||
/**
|
||||
* Contructor
|
||||
* @param region The region that the player is trying to resell
|
||||
* @param player The player that is trying to buy this region from the current owner
|
||||
*/
|
||||
public ResellingRegionEvent(BuyRegion region, Player player) {
|
||||
this.region = region;
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the region that is about to be bought
|
||||
* @return the region that is about to be bought
|
||||
*/
|
||||
public BuyRegion getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the player that is trying to buy the region
|
||||
* @return The player that is trying to buy the region
|
||||
*/
|
||||
public Player getBuyer() {
|
||||
return player;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package me.wiefferink.areashop.events.ask;
|
||||
|
||||
import me.wiefferink.areashop.events.CancellableAreaShopEvent;
|
||||
import me.wiefferink.areashop.regions.BuyRegion;
|
||||
|
||||
/**
|
||||
* Broadcasted when a region is about to get sold
|
||||
*/
|
||||
public class SellingRegionEvent extends CancellableAreaShopEvent {
|
||||
|
||||
private BuyRegion region;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param region The region that is about to get sold
|
||||
*/
|
||||
public SellingRegionEvent(BuyRegion region) {
|
||||
this.region = region;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the region that is about to be sold
|
||||
* @return the region that is about to be sold
|
||||
*/
|
||||
public BuyRegion getRegion() {
|
||||
return region;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package me.wiefferink.areashop.events.ask;
|
||||
|
||||
import me.wiefferink.areashop.events.CancellableAreaShopEvent;
|
||||
import me.wiefferink.areashop.regions.RentRegion;
|
||||
|
||||
/**
|
||||
* Broadcasted when a region is about to be unrented
|
||||
*/
|
||||
public class UnrentingRegionEvent extends CancellableAreaShopEvent {
|
||||
|
||||
private RentRegion region;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param region The region that is about to be unrented
|
||||
*/
|
||||
public UnrentingRegionEvent(RentRegion region) {
|
||||
this.region = region;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the region that is about to be rented
|
||||
* @return the region that is about to be rented
|
||||
*/
|
||||
public RentRegion getRegion() {
|
||||
return region;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package me.wiefferink.areashop.events.askandnotify;
|
||||
|
||||
import me.wiefferink.areashop.events.CancellableAreaShopEvent;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
/**
|
||||
* Broadcasted when a friend is being added to a region
|
||||
*/
|
||||
public class AddFriendEvent extends CancellableAreaShopEvent {
|
||||
|
||||
private GeneralRegion region;
|
||||
private OfflinePlayer friend;
|
||||
private CommandSender by;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param region The region the friend is getting added to
|
||||
* @param friend The friend that is about to be added
|
||||
* @param by The CommandSender that is adding the friend, or null if none
|
||||
*/
|
||||
public AddFriendEvent(GeneralRegion region, OfflinePlayer friend, CommandSender by) {
|
||||
this.region = region;
|
||||
this.friend = friend;
|
||||
this.by = by;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the region where the friend is getting added to
|
||||
* @return the region
|
||||
*/
|
||||
public GeneralRegion getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the OfflinePlayer that is getting added as friend
|
||||
* @return The friend that is getting added
|
||||
*/
|
||||
public OfflinePlayer getFriend() {
|
||||
return friend;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the CommandSender that is adding the friend
|
||||
* @return null if none, a CommandSender if done by someone (likely Player or ConsoleCommandSender)
|
||||
*/
|
||||
public CommandSender getBy() {
|
||||
return by;
|
||||
}
|
||||
}
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
package me.wiefferink.areashop.events.askandnotify;
|
||||
|
||||
import me.wiefferink.areashop.events.CancellableAreaShopEvent;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
/**
|
||||
* Broadcasted when a friend is being added to a region
|
||||
*/
|
||||
public class DeleteFriendEvent extends CancellableAreaShopEvent {
|
||||
|
||||
private GeneralRegion region;
|
||||
private OfflinePlayer friend;
|
||||
private CommandSender by;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param region The region the friend is getting added to
|
||||
* @param friend The friend that is about to be added
|
||||
* @param by The CommandSender that is adding the friend, or null if none
|
||||
*/
|
||||
public DeleteFriendEvent(GeneralRegion region, OfflinePlayer friend, CommandSender by) {
|
||||
this.region = region;
|
||||
this.friend = friend;
|
||||
this.by = by;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the region where the friend is getting added to
|
||||
* @return the region
|
||||
*/
|
||||
public GeneralRegion getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the OfflinePlayer that is getting added as friend
|
||||
* @return The friend that is getting added
|
||||
*/
|
||||
public OfflinePlayer getFriend() {
|
||||
return friend;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the CommandSender that is adding the friend
|
||||
* @return null if none, a CommandSender if done by someone (likely Player or ConsoleCommandSender)
|
||||
*/
|
||||
public CommandSender getBy() {
|
||||
return by;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package me.wiefferink.areashop.events.notify;
|
||||
|
||||
import me.wiefferink.areashop.events.NotifyAreaShopEvent;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
|
||||
/**
|
||||
* Broadcasted when a region has been added to AreaShop
|
||||
*/
|
||||
public class AddedRegionEvent extends NotifyAreaShopEvent {
|
||||
|
||||
private GeneralRegion region;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param region The region that has been added
|
||||
*/
|
||||
public AddedRegionEvent(GeneralRegion region) {
|
||||
this.region = region;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the region that has been added
|
||||
* @return the region that has been added
|
||||
*/
|
||||
public GeneralRegion getRegion() {
|
||||
return region;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package me.wiefferink.areashop.events.notify;
|
||||
|
||||
import me.wiefferink.areashop.events.NotifyAreaShopEvent;
|
||||
import me.wiefferink.areashop.regions.BuyRegion;
|
||||
|
||||
/**
|
||||
* Broadcasted when a region has been bought
|
||||
*/
|
||||
public class BoughtRegionEvent extends NotifyAreaShopEvent {
|
||||
|
||||
private BuyRegion region;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param region The region that has been bought
|
||||
*/
|
||||
public BoughtRegionEvent(BuyRegion region) {
|
||||
this.region = region;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the region that has been bought
|
||||
* @return the region that has been bought
|
||||
*/
|
||||
public BuyRegion getRegion() {
|
||||
return region;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package me.wiefferink.areashop.events.notify;
|
||||
|
||||
import me.wiefferink.areashop.events.NotifyAreaShopEvent;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
|
||||
/**
|
||||
* Broadcasted when the data of a region changes.
|
||||
* Should be used for updating displays that use region data.
|
||||
*/
|
||||
public class RegionUpdateEvent extends NotifyAreaShopEvent {
|
||||
|
||||
private GeneralRegion region;
|
||||
|
||||
/**
|
||||
* Contructor
|
||||
* @param region The region that has been updated
|
||||
*/
|
||||
public RegionUpdateEvent(GeneralRegion region) {
|
||||
this.region = region;
|
||||
}
|
||||
|
||||
/**
|
||||
* The region that has been updated
|
||||
* @return The GeneralRegion that has been updated
|
||||
*/
|
||||
public GeneralRegion getRegion() {
|
||||
return region;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package me.wiefferink.areashop.events.notify;
|
||||
|
||||
import me.wiefferink.areashop.events.NotifyAreaShopEvent;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
|
||||
/**
|
||||
* Broadcasted when a region has been removed from AreaShop
|
||||
*/
|
||||
public class RemovedRegionEvent extends NotifyAreaShopEvent {
|
||||
|
||||
private GeneralRegion region;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param region The region that has been removed
|
||||
*/
|
||||
public RemovedRegionEvent(GeneralRegion region) {
|
||||
this.region = region;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the region that has been removed
|
||||
* @return the region that has been removed
|
||||
*/
|
||||
public GeneralRegion getRegion() {
|
||||
return region;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package me.wiefferink.areashop.events.notify;
|
||||
|
||||
import me.wiefferink.areashop.events.NotifyAreaShopEvent;
|
||||
import me.wiefferink.areashop.regions.RentRegion;
|
||||
|
||||
/**
|
||||
* Broadcasted when a region has been rented
|
||||
*/
|
||||
public class RentedRegionEvent extends NotifyAreaShopEvent {
|
||||
|
||||
private RentRegion region;
|
||||
private boolean extended;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param region The region that has been rented
|
||||
* @param extended true if the region has been extended, false if this is the first time buying the region
|
||||
*/
|
||||
public RentedRegionEvent(RentRegion region, boolean extended) {
|
||||
this.region = region;
|
||||
this.extended = extended;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the region that has been rented
|
||||
* @return the region that has been rented
|
||||
*/
|
||||
public RentRegion getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the region was extended or rented for the first time
|
||||
* @return true if the region was extended, false when rented for the first time
|
||||
*/
|
||||
public boolean hasExtended() {
|
||||
return extended;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package me.wiefferink.areashop.events.notify;
|
||||
|
||||
import me.wiefferink.areashop.events.NotifyAreaShopEvent;
|
||||
import me.wiefferink.areashop.regions.BuyRegion;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Broadcasted when a region has been resold
|
||||
*/
|
||||
public class ResoldRegionEvent extends NotifyAreaShopEvent {
|
||||
|
||||
private BuyRegion region;
|
||||
private UUID from;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param region The region that has been resold
|
||||
* @param from The player from who the region has been resold to the current owner
|
||||
*/
|
||||
public ResoldRegionEvent(BuyRegion region, UUID from) {
|
||||
this.region = region;
|
||||
this.from = from;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the region that has been bought
|
||||
* @return the region that has been bought
|
||||
*/
|
||||
public BuyRegion getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the player that the region has been bought from
|
||||
* @return The UUID of the player that the region has been bought from
|
||||
*/
|
||||
public UUID getFromPlayer() {
|
||||
return from;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package me.wiefferink.areashop.events.notify;
|
||||
|
||||
import me.wiefferink.areashop.events.NotifyAreaShopEvent;
|
||||
import me.wiefferink.areashop.regions.BuyRegion;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Broadcasted when a region is sold
|
||||
*/
|
||||
public class SoldRegionEvent extends NotifyAreaShopEvent {
|
||||
|
||||
private BuyRegion region;
|
||||
private UUID oldBuyer;
|
||||
private double refundedMoney;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param region The region that has been sold
|
||||
* @param oldBuyer The player for which the region has been sold
|
||||
* @param refundedMoney The amount of money that has been refunded
|
||||
*/
|
||||
public SoldRegionEvent(BuyRegion region, UUID oldBuyer, double refundedMoney) {
|
||||
this.region = region;
|
||||
this.oldBuyer = oldBuyer;
|
||||
this.refundedMoney = refundedMoney;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the region that has been sold
|
||||
* @return the region that has been sold
|
||||
*/
|
||||
public BuyRegion getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the player that the region is sold for
|
||||
* @return The UUID of the player that the region is sold for
|
||||
*/
|
||||
public UUID getOldBuyer() {
|
||||
return oldBuyer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the amount that is paid back to the player
|
||||
* @return The amount of money paid back to the player
|
||||
*/
|
||||
public double getRefundedMoney() {
|
||||
return refundedMoney;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package me.wiefferink.areashop.events.notify;
|
||||
|
||||
import me.wiefferink.areashop.events.NotifyAreaShopEvent;
|
||||
import me.wiefferink.areashop.regions.RentRegion;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Broadcasted when a region has been unrented
|
||||
*/
|
||||
public class UnrentedRegionEvent extends NotifyAreaShopEvent {
|
||||
|
||||
private RentRegion region;
|
||||
private UUID oldRenter;
|
||||
private double refundedMoney;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param region The region that has been unrented
|
||||
* @param oldRenter The player that rented the region before it was unrented
|
||||
* @param refundedMoney The amount of money that has been refunded
|
||||
*/
|
||||
public UnrentedRegionEvent(RentRegion region, UUID oldRenter, double refundedMoney) {
|
||||
this.region = region;
|
||||
this.oldRenter = oldRenter;
|
||||
this.refundedMoney = refundedMoney;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the region that has been unrented
|
||||
* @return the region that has been unrented
|
||||
*/
|
||||
public RentRegion getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the player that the region was unrented for
|
||||
* @return The UUID of the player that the region was unrented for
|
||||
*/
|
||||
public UUID getOldRenter() {
|
||||
return oldRenter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the amount that is paid back to the player
|
||||
* @return The amount of money paid back to the player
|
||||
*/
|
||||
public double getRefundedMoney() {
|
||||
return refundedMoney;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package me.wiefferink.areashop.features;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.events.ask.*;
|
||||
import me.wiefferink.areashop.events.askandnotify.AddFriendEvent;
|
||||
import me.wiefferink.areashop.events.askandnotify.DeleteFriendEvent;
|
||||
import me.wiefferink.areashop.events.notify.*;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
public class DebugFeature extends Feature implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void buyingRegion(BuyingRegionEvent event) {
|
||||
AreaShop.debug("BuyingRegionEvent: " + event.getPlayer().getName() + " is trying to buy " + event.getRegion().getName());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void boughtRegion(BoughtRegionEvent event) {
|
||||
AreaShop.debug("BoughtRegionEvent: " + event.getRegion().getPlayerName() + " bought " + event.getRegion().getName());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void sellingRegion(SellingRegionEvent event) {
|
||||
AreaShop.debug("SellingRegionEvent: " + event.getRegion().getName() + " is trying to sell " + event.getRegion().getName());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void soldRegion(SoldRegionEvent event) {
|
||||
AreaShop.debug("SoldRegionEvent: "+Utils.toName(event.getOldBuyer())+" sold "+event.getRegion().getName());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void resellingRegion(ResellingRegionEvent event) {
|
||||
AreaShop.debug("ResellingRegionEvent: " + event.getRegion().getName() + " is trying to resell " + event.getRegion().getName());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void resoldRegion(ResoldRegionEvent event) {
|
||||
AreaShop.debug("ResoldRegionEvent: "+Utils.toName(event.getFromPlayer())+" resold "+event.getRegion().getName()+" to "+event.getRegion().getPlayerName());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void rentingRegion(RentingRegionEvent event) {
|
||||
AreaShop.debug("RentingRegionEvent: " + event.getPlayer().getName() + " is trying to rent " + event.getRegion().getName() + ", extending=" + event.isExtending());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void rentedRegion(RentedRegionEvent event) {
|
||||
AreaShop.debug("RentedRegionEvent: " + event.getRegion().getPlayerName() + " rented " + event.getRegion().getName() + ", extending=" + event.hasExtended());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void unrentingRegion(UnrentingRegionEvent event) {
|
||||
AreaShop.debug("UnrentingRegionEvent: " + event.getRegion().getPlayerName() + " is trying to unrent " + event.getRegion().getName());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void unrentedRegion(UnrentedRegionEvent event) {
|
||||
AreaShop.debug("UnrentedRegionEvent: "+Utils.toName(event.getOldRenter())+" unrented "+event.getRegion().getName());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void regionUpdate(RegionUpdateEvent event) {
|
||||
//AreaShop.debug("RegionUpdateEvent: " + event.getRegion().getName() + " updated");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void addedRegion(AddedRegionEvent event) {
|
||||
AreaShop.debug("AddedRegionEvent: "+event.getRegion().getName());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void removedRegion(RemovedRegionEvent event) {
|
||||
AreaShop.debug("RemovedRegionEvent: "+event.getRegion().getName());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void addedFriend(AddFriendEvent event) {
|
||||
AreaShop.debug("AddFriendEvent: region "+event.getRegion().getName()+", "+event.getFriend().getName()+" by "+(event.getBy() == null ? "<nobody>" : event.getBy().getName()));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void deleteFriend(DeleteFriendEvent event) {
|
||||
AreaShop.debug("DeleteFriendEvent: region "+event.getRegion().getName()+", "+event.getFriend().getName()+" by "+(event.getBy() == null ? "<nobody>" : event.getBy().getName()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package me.wiefferink.areashop.features;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
|
||||
public class Feature {
|
||||
AreaShop plugin = AreaShop.getInstance();
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package me.wiefferink.areashop.features;
|
||||
|
||||
import me.wiefferink.areashop.events.askandnotify.AddFriendEvent;
|
||||
import me.wiefferink.areashop.events.askandnotify.DeleteFriendEvent;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class FriendsFeature extends Feature {
|
||||
|
||||
private GeneralRegion region;
|
||||
|
||||
public FriendsFeature(GeneralRegion region) {
|
||||
this.region = region;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a friend to the region
|
||||
* @param player The UUID of the player to add
|
||||
* @param by The CommandSender that is adding the friend, or null
|
||||
* @return true if the friend has been added, false if adding a friend was cancelled by another plugin
|
||||
*/
|
||||
public boolean addFriend(UUID player, CommandSender by) {
|
||||
// Fire and check event
|
||||
AddFriendEvent event = new AddFriendEvent(region, Bukkit.getOfflinePlayer(player), by);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if(event.isCancelled()) {
|
||||
plugin.message(by, "general-cancelled", event.getReason(), this);
|
||||
return false;
|
||||
}
|
||||
|
||||
Set<String> friends = new HashSet<>(region.getConfig().getStringList("general.friends"));
|
||||
friends.add(player.toString());
|
||||
List<String> list = new ArrayList<>(friends);
|
||||
region.setSetting("general.friends", list);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a friend from the region
|
||||
* @param player The UUID of the player to delete
|
||||
* @param by The CommandSender that is adding the friend, or null
|
||||
* @return true if the friend has been added, false if adding a friend was cancelled by another plugin
|
||||
*/
|
||||
public boolean deleteFriend(UUID player, CommandSender by) {
|
||||
// Fire and check event
|
||||
DeleteFriendEvent event = new DeleteFriendEvent(region, Bukkit.getOfflinePlayer(player), by);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if(event.isCancelled()) {
|
||||
plugin.message(by, "general-cancelled", event.getReason(), this);
|
||||
return false;
|
||||
}
|
||||
|
||||
Set<String> friends = new HashSet<>(region.getConfig().getStringList("general.friends"));
|
||||
friends.remove(player.toString());
|
||||
List<String> list = new ArrayList<>(friends);
|
||||
if(list.isEmpty()) {
|
||||
region.setSetting("general.friends", null);
|
||||
} else {
|
||||
region.setSetting("general.friends", list);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of friends added to this region
|
||||
* @return Friends added to this region
|
||||
*/
|
||||
public Set<UUID> getFriends() {
|
||||
HashSet<UUID> result = new HashSet<>();
|
||||
for(String friend : region.getConfig().getStringList("general.friends")) {
|
||||
try {
|
||||
UUID id = UUID.fromString(friend);
|
||||
result.add(id);
|
||||
} catch(IllegalArgumentException e) {
|
||||
// Don't add it
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of friends added to this region
|
||||
* @return Friends added to this region
|
||||
*/
|
||||
public Set<String> getFriendNames() {
|
||||
HashSet<String> result = new HashSet<>();
|
||||
for(UUID friend : getFriends()) {
|
||||
OfflinePlayer player = Bukkit.getOfflinePlayer(friend);
|
||||
if(player != null) {
|
||||
result.add(player.getName());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove all friends that are added to this region
|
||||
*/
|
||||
public void clearFriends() {
|
||||
region.setSetting("general.friends", null);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,346 @@
|
||||
package me.wiefferink.areashop.features;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.events.notify.RegionUpdateEvent;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.Sign;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class SignsFeature extends Feature implements Listener {
|
||||
|
||||
private static Map<String, RegionSign> allSigns = new HashMap<>();
|
||||
|
||||
private GeneralRegion region;
|
||||
private Map<String, RegionSign> signs;
|
||||
|
||||
public SignsFeature() {
|
||||
|
||||
}
|
||||
|
||||
public SignsFeature(GeneralRegion region) {
|
||||
this.region = region;
|
||||
signs = new HashMap<>();
|
||||
// Setup current signs
|
||||
ConfigurationSection signSection = region.getConfig().getConfigurationSection("general.signs");
|
||||
if(signSection != null) {
|
||||
for(String signKey : signSection.getKeys(false)) {
|
||||
RegionSign sign = new RegionSign(region, this, signKey);
|
||||
Location location = sign.getLocation();
|
||||
if(location == null) {
|
||||
AreaShop.warn("Sign with key "+signKey+" of region "+region.getName()+" does not have a proper location");
|
||||
continue;
|
||||
}
|
||||
signs.put(sign.getStringLocation(), sign);
|
||||
}
|
||||
allSigns.putAll(signs);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a location to a string to use as map key
|
||||
* @param location The location to get the key for
|
||||
* @return A string to use in a map for a location
|
||||
*/
|
||||
public static String locationToString(Location location) {
|
||||
return location.getWorld().getName()+";"+location.getBlockX()+";"+location.getBlockY()+";"+location.getBlockZ();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a sign by a location
|
||||
* @param location The location to get the sign for
|
||||
* @return The RegionSign that is at the location, or null if none
|
||||
*/
|
||||
public static RegionSign getSignByLocation(Location location) {
|
||||
return allSigns.get(locationToString(location));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void regionUpdate(RegionUpdateEvent event) {
|
||||
event.getRegion().getSignsFeature().update();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update all signs connected to this region
|
||||
* @return true if all signs are updated correctly, false if one or more updates failed
|
||||
*/
|
||||
public boolean update() {
|
||||
boolean result = true;
|
||||
for(RegionSign sign : signs.values()) {
|
||||
result = result&sign.update();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if any of the signs need periodic updating
|
||||
* @return true if one or more of the signs need periodic updating, otherwise false
|
||||
*/
|
||||
public boolean needsPeriodicUpdate() {
|
||||
boolean result = false;
|
||||
for(RegionSign sign : signs.values()) {
|
||||
result = result|sign.needsPeriodicUpdate();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list with all sign locations
|
||||
* @return A List with all sign locations
|
||||
*/
|
||||
public List<Location> getSignLocations() {
|
||||
List<Location> result = new ArrayList<>();
|
||||
for(RegionSign sign : signs.values()) {
|
||||
result.add(sign.getLocation());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a sign to this region
|
||||
* @param location The location of the sign
|
||||
* @param signType The type of the sign (WALL_SIGN or SIGN_POST)
|
||||
* @param facing The orientation of the sign
|
||||
* @param profile The profile to use with this sign (null for default)
|
||||
*/
|
||||
public void addSign(Location location, Material signType, BlockFace facing, String profile) {
|
||||
int i = 0;
|
||||
while(region.getConfig().isSet("general.signs."+i)) {
|
||||
i++;
|
||||
}
|
||||
String signPath = "general.signs."+i+".";
|
||||
region.setSetting(signPath+"location", Utils.locationToConfig(location));
|
||||
region.setSetting(signPath+"facing", facing.name());
|
||||
region.setSetting(signPath+"signType", signType.name());
|
||||
if(profile != null && profile.length() != 0) {
|
||||
region.setSetting(signPath+"profile", profile);
|
||||
}
|
||||
// Add to the map
|
||||
RegionSign sign = new RegionSign(region, this, i+"");
|
||||
signs.put(sign.getStringLocation(), sign);
|
||||
allSigns.put(sign.getStringLocation(), sign);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if there is a sign from this region at the specified location
|
||||
* @param location Location to check
|
||||
* @return true if this region has a sign at the location, otherwise false
|
||||
*/
|
||||
public boolean isSignOfRegion(Location location) {
|
||||
Set<String> signs;
|
||||
if(region.getConfig().getConfigurationSection("general.signs") == null) {
|
||||
return false;
|
||||
}
|
||||
signs = region.getConfig().getConfigurationSection("general.signs").getKeys(false);
|
||||
for(String sign : signs) {
|
||||
Location signLocation = Utils.configToLocation(region.getConfig().getConfigurationSection("general.signs."+sign+".location"));
|
||||
if(signLocation != null
|
||||
&& signLocation.getWorld().equals(location.getWorld())
|
||||
&& signLocation.getBlockX() == location.getBlockX()
|
||||
&& signLocation.getBlockY() == location.getBlockY()
|
||||
&& signLocation.getBlockZ() == location.getBlockZ()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sign that is connected to a region to display information and interact with the region
|
||||
*/
|
||||
public class RegionSign {
|
||||
|
||||
private GeneralRegion region;
|
||||
private SignsFeature signsFeature;
|
||||
private String key;
|
||||
|
||||
public RegionSign(GeneralRegion region, SignsFeature signsFeature, String key) {
|
||||
this.region = region;
|
||||
this.signsFeature = signsFeature;
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the location of this sign
|
||||
* @return The location of this sign
|
||||
*/
|
||||
public Location getLocation() {
|
||||
return Utils.configToLocation(region.getConfig().getConfigurationSection("general.signs."+key+".location"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Location string to be used as key in maps
|
||||
* @return Location string
|
||||
*/
|
||||
public String getStringLocation() {
|
||||
return locationToString(getLocation());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the region this sign is linked to
|
||||
* @return The region this sign is linked to
|
||||
*/
|
||||
public GeneralRegion getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove this sign from the region
|
||||
*/
|
||||
public void remove() {
|
||||
getLocation().getBlock().setType(Material.AIR);
|
||||
signs.remove(getStringLocation());
|
||||
allSigns.remove(getStringLocation());
|
||||
region.setSetting("general.signs."+key, null);
|
||||
}
|
||||
|
||||
public String getProfile() {
|
||||
String profile = region.getConfig().getString("general.signs."+key+".profile");
|
||||
if(profile == null || profile.length() == 0) {
|
||||
profile = region.getStringSetting("general.signProfile");
|
||||
}
|
||||
return profile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update this sign
|
||||
* @return true if the update was successful, otherwise false
|
||||
*/
|
||||
public boolean update() {
|
||||
if(region.isDeleted()) {
|
||||
return false;
|
||||
}
|
||||
YamlConfiguration config = region.getConfig();
|
||||
// Get the prefix
|
||||
String prefix = "signProfiles."+getProfile()+"."+region.getState().getValue().toLowerCase()+".";
|
||||
// Get the lines
|
||||
String[] signLines = new String[4];
|
||||
signLines[0] = plugin.getConfig().getString(prefix+"line1");
|
||||
signLines[1] = plugin.getConfig().getString(prefix+"line2");
|
||||
signLines[2] = plugin.getConfig().getString(prefix+"line3");
|
||||
signLines[3] = plugin.getConfig().getString(prefix+"line4");
|
||||
// Check if the sign should be present
|
||||
Block block = getLocation().getBlock();
|
||||
if(!plugin.getConfig().isSet(prefix)
|
||||
|| ((signLines[0] == null || signLines[0].length() == 0)
|
||||
&& (signLines[1] == null || signLines[1].length() == 0)
|
||||
&& (signLines[2] == null || signLines[2].length() == 0)
|
||||
&& (signLines[3] == null || signLines[3].length() == 0))) {
|
||||
block.setType(Material.AIR);
|
||||
} else {
|
||||
Sign signState = null;
|
||||
if(block.getType() != Material.WALL_SIGN && block.getType() != Material.SIGN_POST) {
|
||||
Material signType;
|
||||
try {
|
||||
signType = Material.valueOf(config.getString("general.signs."+key+".signType"));
|
||||
} catch(NullPointerException|IllegalArgumentException e) {
|
||||
signType = null;
|
||||
}
|
||||
if(signType != Material.WALL_SIGN && signType != Material.SIGN_POST) {
|
||||
AreaShop.debug(" setting sign failed");
|
||||
return false;
|
||||
}
|
||||
block.setType(signType);
|
||||
signState = (Sign)block.getState();
|
||||
org.bukkit.material.Sign signData = (org.bukkit.material.Sign)signState.getData();
|
||||
BlockFace signFace;
|
||||
try {
|
||||
signFace = BlockFace.valueOf(config.getString("general.signs."+key+".facing"));
|
||||
} catch(NullPointerException|IllegalArgumentException e) {
|
||||
signFace = null;
|
||||
}
|
||||
if(signFace != null) {
|
||||
signData.setFacingDirection(signFace);
|
||||
signState.setData(signData);
|
||||
}
|
||||
}
|
||||
if(signState == null) {
|
||||
signState = (Sign)block.getState();
|
||||
}
|
||||
org.bukkit.material.Sign signData = (org.bukkit.material.Sign)signState.getData();
|
||||
if(!config.isString("general.signs."+key+".signType")) {
|
||||
region.setSetting("general.signs."+key+".signType", signState.getType().toString());
|
||||
}
|
||||
if(!config.isString("general.signs."+key+".facing")) {
|
||||
region.setSetting("general.signs."+key+".facing", signData.getFacing().toString());
|
||||
}
|
||||
// Apply replacements and color and then set it on the sign
|
||||
for(int i = 0; i < signLines.length; i++) {
|
||||
if(signLines[i] == null) {
|
||||
signState.setLine(i, "");
|
||||
continue;
|
||||
}
|
||||
signLines[i] = region.applyAllReplacements(signLines[i]);
|
||||
signLines[i] = Utils.applyColors(signLines[i]);
|
||||
signState.setLine(i, signLines[i]);
|
||||
}
|
||||
signState.update();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the sign needs to update periodically
|
||||
* @return true if it needs periodic updates, otherwise false
|
||||
*/
|
||||
public boolean needsPeriodicUpdate() {
|
||||
// Get the prefix
|
||||
String prefix = "signProfiles."+getProfile()+"."+region.getState().getValue().toLowerCase()+".line";
|
||||
String line;
|
||||
// Get the lines
|
||||
for(int i = 1; i < 5; i++) {
|
||||
line = plugin.getConfig().getString(prefix+i);
|
||||
if(line != null && line.length() != 0 && line.contains(AreaShop.tagTimeLeft)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run commands when a player clicks a sign
|
||||
* @param clicker The player that clicked the sign
|
||||
* @param clickType The type of clicking
|
||||
* @return true if the commands ran successfully, false if any of them failed
|
||||
*/
|
||||
public boolean runSignCommands(Player clicker, GeneralRegion.ClickType clickType) {
|
||||
// Get the profile set in the config
|
||||
String profile = region.getConfig().getString("general.signs."+key+".profile");
|
||||
if(profile == null || profile.length() == 0) {
|
||||
profile = region.getStringSetting("general.signProfile");
|
||||
}
|
||||
|
||||
// Get paths (state may change after running them)
|
||||
String playerPath = "signProfiles."+profile+"."+region.getState().getValue().toLowerCase()+"."+clickType.getValue()+"Player";
|
||||
String consolePath = "signProfiles."+profile+"."+region.getState().getValue().toLowerCase()+"."+clickType.getValue()+"Console";
|
||||
|
||||
// Run player commands if specified
|
||||
List<String> playerCommands = new ArrayList<>();
|
||||
for(String command : plugin.getConfig().getStringList(playerPath)) {
|
||||
playerCommands.add(command.replace(AreaShop.tagClicker, clicker.getName()));
|
||||
}
|
||||
region.runCommands(clicker, playerCommands);
|
||||
|
||||
// Run console commands if specified
|
||||
List<String> consoleCommands = new ArrayList<>();
|
||||
for(String command : plugin.getConfig().getStringList(consolePath)) {
|
||||
consoleCommands.add(command.replace(AreaShop.tagClicker, clicker.getName()));
|
||||
}
|
||||
region.runCommands(Bukkit.getConsoleSender(), consoleCommands);
|
||||
|
||||
return !playerCommands.isEmpty() || !consoleCommands.isEmpty();
|
||||
}
|
||||
}
|
||||
}
|
||||
+206
@@ -0,0 +1,206 @@
|
||||
package me.wiefferink.areashop.features;
|
||||
|
||||
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
|
||||
import com.sk89q.worldguard.protection.flags.Flag;
|
||||
import com.sk89q.worldguard.protection.flags.InvalidFlagFormat;
|
||||
import com.sk89q.worldguard.protection.flags.RegionGroupFlag;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.events.notify.RegionUpdateEvent;
|
||||
import me.wiefferink.areashop.messages.Message;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public class WorldGuardRegionFlagsFeature extends Feature implements Listener {
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void regionUpdate(RegionUpdateEvent event) {
|
||||
updateRegionFlags(event.getRegion());
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the region flags/options to the values of a ConfigurationSection
|
||||
* @param region The region to update the flags for
|
||||
* @return true if the flags have been set correctly, otherwise false
|
||||
*/
|
||||
protected boolean updateRegionFlags(GeneralRegion region) {
|
||||
boolean result = true;
|
||||
|
||||
// General region flags
|
||||
String allPath = "flagProfiles."+region.getStringSetting("general.flagProfile")+".ALL";
|
||||
ConfigurationSection generalFlags = plugin.getConfig().getConfigurationSection(allPath);
|
||||
if(plugin.getConfig().isSet(allPath) && generalFlags != null) { // Explicitely check if it is set, so don't apply if only in the default config
|
||||
result = updateRegionFlags(region, generalFlags);
|
||||
}
|
||||
|
||||
// Specific region flags
|
||||
String specificPath = "flagProfiles."+region.getStringSetting("general.flagProfile")+"."+region.getState().getValue();
|
||||
if(plugin.getConfig().isSet(specificPath)) { // Do no apply default flags if they are removed from the active config
|
||||
ConfigurationSection specificFlags = plugin.getConfig().getConfigurationSection(specificPath);
|
||||
result = result && specificFlags != null && updateRegionFlags(region, specificFlags);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* Set the region flags/options to the values of a ConfigurationSection
|
||||
* @param region The region to update the flags for
|
||||
* @param flags The flags to apply
|
||||
* @return true if the flags have been set correctly, otherwise false
|
||||
*/
|
||||
protected boolean updateRegionFlags(GeneralRegion region, ConfigurationSection flags) {
|
||||
boolean result = true;
|
||||
|
||||
Set<String> flagNames = flags.getKeys(false);
|
||||
WorldGuardPlugin worldGuard = plugin.getWorldGuard();
|
||||
|
||||
// Get the region
|
||||
ProtectedRegion wRegion = region.getRegion();
|
||||
if(wRegion == null) {
|
||||
AreaShop.debug("Region '" + region.getName() + "' does not exist, setting flags failed");
|
||||
return false;
|
||||
}
|
||||
// Loop through all flags that are set in the config
|
||||
for(String flagName : flagNames) {
|
||||
String value = Message.fromString(flags.getString(flagName)).replacements(region).getPlain();
|
||||
// In the config normal Bukkit color codes are used, those only need to be translated on 5.X WorldGuard versions
|
||||
if(plugin.getWorldGuard().getDescription().getVersion().startsWith("5.")) {
|
||||
value = translateBukkitToWorldGuardColors(value);
|
||||
}
|
||||
if(flagName.equalsIgnoreCase("members")) {
|
||||
plugin.getWorldGuardHandler().setMembers(wRegion, value);
|
||||
//AreaShop.debug(" Flag " + flagName + " set: " + members.toUserFriendlyString());
|
||||
} else if(flagName.equalsIgnoreCase("owners")) {
|
||||
plugin.getWorldGuardHandler().setOwners(wRegion, value);
|
||||
//AreaShop.debug(" Flag " + flagName + " set: " + owners.toUserFriendlyString());
|
||||
} else if(flagName.equalsIgnoreCase("priority")) {
|
||||
try {
|
||||
int priority = Integer.parseInt(value);
|
||||
wRegion.setPriority(priority);
|
||||
//AreaShop.debug(" Flag " + flagName + " set: " + value);
|
||||
} catch(NumberFormatException e) {
|
||||
AreaShop.warn("The value of flag "+flagName+" is not a number");
|
||||
result = false;
|
||||
}
|
||||
} else if(flagName.equalsIgnoreCase("parent")) {
|
||||
if(region.getWorld() == null || worldGuard.getRegionManager(region.getWorld()) == null) {
|
||||
continue;
|
||||
}
|
||||
ProtectedRegion parentRegion = worldGuard.getRegionManager(region.getWorld()).getRegion(value);
|
||||
if(parentRegion != null) {
|
||||
try {
|
||||
wRegion.setParent(parentRegion);
|
||||
//AreaShop.debug(" Flag " + flagName + " set: " + value);
|
||||
} catch(ProtectedRegion.CircularInheritanceException e) {
|
||||
AreaShop.warn("The parent set in the config is not correct (circular inheritance)");
|
||||
}
|
||||
} else {
|
||||
AreaShop.warn("The parent set in the config is not correct (region does not exist)");
|
||||
}
|
||||
} else {
|
||||
// Parse all other normal flags (groups are also handled)
|
||||
String flagSetting = null;
|
||||
com.sk89q.worldguard.protection.flags.RegionGroup groupValue = null;
|
||||
|
||||
Flag<?> foundFlag = plugin.getWorldGuardHandler().fuzzyMatchFlag(flagName);
|
||||
if(foundFlag == null) {
|
||||
AreaShop.warn("Found wrong flag in flagProfiles section: "+flagName+", check if that is the correct WorldGuard flag");
|
||||
continue;
|
||||
}
|
||||
RegionGroupFlag groupFlag = foundFlag.getRegionGroupFlag();
|
||||
if(value == null || value.isEmpty()) {
|
||||
wRegion.setFlag(foundFlag, null);
|
||||
if(groupFlag != null) {
|
||||
wRegion.setFlag(groupFlag, null);
|
||||
}
|
||||
//AreaShop.debug(" Flag " + flagName + " reset (+ possible group of flag)");
|
||||
} else {
|
||||
if(groupFlag == null) {
|
||||
flagSetting = value;
|
||||
} else {
|
||||
for(String part : value.split(" ")) {
|
||||
if(part.startsWith("g:")) {
|
||||
if(part.length() > 2) {
|
||||
try {
|
||||
groupValue = plugin.getWorldGuardHandler().parseFlagGroupInput(groupFlag, part.substring(2));
|
||||
} catch(InvalidFlagFormat e) {
|
||||
AreaShop.warn("Found wrong group value for flag "+flagName);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(flagSetting == null) {
|
||||
flagSetting = part;
|
||||
} else {
|
||||
flagSetting += " " + part;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(flagSetting != null) {
|
||||
try {
|
||||
setFlag(wRegion, foundFlag, flagSetting);
|
||||
//AreaShop.debug(" Flag " + flagName + " set: " + flagSetting);
|
||||
} catch(InvalidFlagFormat e) {
|
||||
AreaShop.warn("Found wrong value for flag "+flagName);
|
||||
}
|
||||
}
|
||||
if(groupValue != null) {
|
||||
if(groupValue == groupFlag.getDefault()) {
|
||||
wRegion.setFlag(groupFlag, null);
|
||||
//AreaShop.debug(" Group of flag " + flagName + " set to default: " + groupValue);
|
||||
} else {
|
||||
wRegion.setFlag(groupFlag, groupValue);
|
||||
//AreaShop.debug(" Group of flag " + flagName + " set: " + groupValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Indicate that the regions needs to be saved
|
||||
plugin.getFileManager().saveIsRequiredForRegionWorld(region.getWorldName());
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a WorldGuard region flag
|
||||
* @param region The WorldGuard region to set
|
||||
* @param flag The flag to set
|
||||
* @param value The value to set the flag to
|
||||
* @param <V> They type of flag to set
|
||||
* @throws InvalidFlagFormat When the value of the flag is wrong
|
||||
*/
|
||||
private <V> void setFlag(ProtectedRegion region, Flag<V> flag, String value) throws InvalidFlagFormat {
|
||||
region.setFlag(flag, plugin.getWorldGuardHandler().parseFlagInput(flag, value));
|
||||
}
|
||||
|
||||
/**
|
||||
* Translate the color codes you put in greeting/farewell messages to the weird color codes of WorldGuard
|
||||
* @param message The message where the color codes should be translated (this message has bukkit color codes)
|
||||
* @return The string with the WorldGuard color codes
|
||||
*/
|
||||
public String translateBukkitToWorldGuardColors(String message) {
|
||||
String result = message;
|
||||
result = result.replace("&c", "&r");
|
||||
result = result.replace("&4", "&R");
|
||||
result = result.replace("&e", "&y");
|
||||
result = result.replace("&6", "&Y");
|
||||
result = result.replace("&a", "&g");
|
||||
result = result.replace("&2", "&G");
|
||||
result = result.replace("&b", "&c");
|
||||
result = result.replace("&3", "&C");
|
||||
result = result.replace("&9", "&b");
|
||||
result = result.replace("&1", "&B");
|
||||
result = result.replace("&d", "&p");
|
||||
result = result.replace("&5", "&P");
|
||||
result = result.replace("&0", "&0");
|
||||
result = result.replace("&8", "&1");
|
||||
result = result.replace("&7", "&2");
|
||||
result = result.replace("&f", "&w");
|
||||
result = result.replace("&r", "&x");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
+742
-758
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,750 @@
|
||||
package me.wiefferink.areashop.lib;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import org.apache.commons.lang.exception.ExceptionUtils;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.JSONValue;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.util.Enumeration;
|
||||
import java.util.logging.Level;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipFile;
|
||||
|
||||
/**
|
||||
* Check for updates on BukkitDev for a given plugin, and download the updates if needed.
|
||||
* <p/>
|
||||
* <b>VERY, VERY IMPORTANT</b>: Because there are no standards for adding auto-update toggles in your plugin's config, this system provides NO CHECK WITH YOUR CONFIG to make sure the user has allowed auto-updating.
|
||||
* <br>
|
||||
* It is a <b>BUKKIT POLICY</b> that you include a boolean value in your config that prevents the auto-updater from running <b>AT ALL</b>.
|
||||
* <br>
|
||||
* If you fail to include this option in your config, your plugin will be <b>REJECTED</b> when you attempt to submit it to dev.bukkit.org.
|
||||
* <p/>
|
||||
* An example of a good configuration option would be something similar to 'auto-update: true' - if this value is set to false you may NOT run the auto-updater.
|
||||
* <br>
|
||||
* If you are unsure about these rules, please read the plugin submission guidelines: http://goo.gl/8iU5l
|
||||
*
|
||||
* @author Gravity
|
||||
* @version 2.3
|
||||
*/
|
||||
|
||||
public class Updater {
|
||||
|
||||
/* Constants */
|
||||
|
||||
// Remote file's title
|
||||
private static final String TITLE_VALUE = "name";
|
||||
// Remote file's download link
|
||||
private static final String LINK_VALUE = "downloadUrl";
|
||||
// Remote file's release type
|
||||
private static final String TYPE_VALUE = "releaseType";
|
||||
// Remote file's build version
|
||||
private static final String VERSION_VALUE = "gameVersion";
|
||||
// Path to GET
|
||||
private static final String QUERY = "/servermods/files?projectIds=";
|
||||
// Slugs will be appended to this to get to the project's RSS feed
|
||||
private static final String HOST = "https://api.curseforge.com";
|
||||
// User-agent when querying Curse
|
||||
private static final String USER_AGENT = "Updater (by Gravity)";
|
||||
// Used for locating version numbers in file names
|
||||
private static final String DELIMETER = "^V|[\\s_-]V";
|
||||
// If the version number contains one of these, don't update.
|
||||
private static final String[] NO_UPDATE_TAG = { "-DEV", "-PRE", "-SNAPSHOT" };
|
||||
// Used for downloading files
|
||||
private static final int BYTE_SIZE = 1024;
|
||||
// Config key for api key
|
||||
private static final String API_KEY_CONFIG_KEY = "api-key";
|
||||
// Config key for disabling Updater
|
||||
private static final String DISABLE_CONFIG_KEY = "disable";
|
||||
// Default api key value in config
|
||||
private static final String API_KEY_DEFAULT = "PUT_API_KEY_HERE";
|
||||
// Default disable value in config
|
||||
private static final boolean DISABLE_DEFAULT = false;
|
||||
|
||||
/* User-provided variables */
|
||||
|
||||
// Plugin running Updater
|
||||
private final Plugin plugin;
|
||||
// Type of update check to run
|
||||
private final UpdateType type;
|
||||
// Whether to announce file downloads
|
||||
private final boolean announce;
|
||||
// The plugin file (jar)
|
||||
private final File file;
|
||||
// The folder that downloads will be placed in
|
||||
private final File updateFolder;
|
||||
// The provided callback (if any)
|
||||
private final UpdateCallback callback;
|
||||
// Project's Curse ID
|
||||
private int id = -1;
|
||||
// BukkitDev ServerMods API key
|
||||
private String apiKey = null;
|
||||
|
||||
/* Collected from Curse API */
|
||||
|
||||
private String versionName;
|
||||
private String versionLink;
|
||||
private String versionType;
|
||||
private String versionGameVersion;
|
||||
|
||||
/* Update process variables */
|
||||
|
||||
// Connection to RSS
|
||||
private URL url;
|
||||
// Updater thread
|
||||
private Thread thread;
|
||||
// Used for determining the outcome of the update process
|
||||
private Updater.UpdateResult result = Updater.UpdateResult.SUCCESS;
|
||||
|
||||
/**
|
||||
* Gives the developer the result of the update process. Can be obtained by called {@link #getResult()}
|
||||
*/
|
||||
public enum UpdateResult {
|
||||
/**
|
||||
* The updater found an update, and has readied it to be loaded the next time the server restarts/reloads.
|
||||
*/
|
||||
SUCCESS,
|
||||
/**
|
||||
* The updater did not find an update, and nothing was downloaded.
|
||||
*/
|
||||
NO_UPDATE,
|
||||
/**
|
||||
* The server administrator has disabled the updating system.
|
||||
*/
|
||||
DISABLED,
|
||||
/**
|
||||
* The updater found an update, but was unable to download it.
|
||||
*/
|
||||
FAIL_DOWNLOAD,
|
||||
/**
|
||||
* For some reason, the updater was unable to contact dev.bukkit.org to download the file.
|
||||
*/
|
||||
FAIL_DBO,
|
||||
/**
|
||||
* When running the version check, the file on DBO did not contain a recognizable version.
|
||||
*/
|
||||
FAIL_NOVERSION,
|
||||
/**
|
||||
* The id provided by the plugin running the updater was invalid and doesn't exist on DBO.
|
||||
*/
|
||||
FAIL_BADID,
|
||||
/**
|
||||
* The server administrator has improperly configured their API key in the configuration.
|
||||
*/
|
||||
FAIL_APIKEY,
|
||||
/**
|
||||
* The updater found an update, but because of the UpdateType being set to NO_DOWNLOAD, it wasn't downloaded.
|
||||
*/
|
||||
UPDATE_AVAILABLE
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows the developer to specify the type of update that will be run.
|
||||
*/
|
||||
public enum UpdateType {
|
||||
/**
|
||||
* Run a version check, and then if the file is out of date, download the newest version.
|
||||
*/
|
||||
DEFAULT,
|
||||
/**
|
||||
* Don't run a version check, just find the latest update and download it.
|
||||
*/
|
||||
NO_VERSION_CHECK,
|
||||
/**
|
||||
* Get information about the version and the download size, but don't actually download anything.
|
||||
*/
|
||||
NO_DOWNLOAD
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents the various release types of a file on BukkitDev.
|
||||
*/
|
||||
public enum ReleaseType {
|
||||
/**
|
||||
* An "alpha" file.
|
||||
*/
|
||||
ALPHA,
|
||||
/**
|
||||
* A "beta" file.
|
||||
*/
|
||||
BETA,
|
||||
/**
|
||||
* A "release" file.
|
||||
*/
|
||||
RELEASE
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the updater.
|
||||
*
|
||||
* @param plugin The plugin that is checking for an update.
|
||||
* @param id The dev.bukkit.org id of the project.
|
||||
* @param file The file that the plugin is running from, get this by doing this.getFile() from within your main class.
|
||||
* @param type Specify the type of update this will be. See {@link UpdateType}
|
||||
* @param announce True if the program should announce the progress of new updates in console.
|
||||
*/
|
||||
public Updater(Plugin plugin, int id, File file, UpdateType type, boolean announce) {
|
||||
this(plugin, id, file, type, null, announce);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the updater with the provided callback.
|
||||
*
|
||||
* @param plugin The plugin that is checking for an update.
|
||||
* @param id The dev.bukkit.org id of the project.
|
||||
* @param file The file that the plugin is running from, get this by doing this.getFile() from within your main class.
|
||||
* @param type Specify the type of update this will be. See {@link UpdateType}
|
||||
* @param callback The callback instance to notify when the Updater has finished
|
||||
*/
|
||||
public Updater(Plugin plugin, int id, File file, UpdateType type, UpdateCallback callback) {
|
||||
this(plugin, id, file, type, callback, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the updater with the provided callback.
|
||||
*
|
||||
* @param plugin The plugin that is checking for an update.
|
||||
* @param id The dev.bukkit.org id of the project.
|
||||
* @param file The file that the plugin is running from, get this by doing this.getFile() from within your main class.
|
||||
* @param type Specify the type of update this will be. See {@link UpdateType}
|
||||
* @param callback The callback instance to notify when the Updater has finished
|
||||
* @param announce True if the program should announce the progress of new updates in console.
|
||||
*/
|
||||
public Updater(Plugin plugin, int id, File file, UpdateType type, UpdateCallback callback, boolean announce) {
|
||||
this.plugin = plugin;
|
||||
this.type = type;
|
||||
this.announce = announce;
|
||||
this.file = file;
|
||||
this.id = id;
|
||||
this.updateFolder = this.plugin.getServer().getUpdateFolderFile();
|
||||
this.callback = callback;
|
||||
|
||||
final File pluginFile = this.plugin.getDataFolder().getParentFile();
|
||||
final File updaterFile = new File(pluginFile, "Updater");
|
||||
final File updaterConfigFile = new File(updaterFile, "config.yml");
|
||||
|
||||
YamlConfiguration config = new YamlConfiguration();
|
||||
config.options().header("This configuration file affects all plugins using the Updater system (version 2+ - http://forums.bukkit.org/threads/96681/ )" + '\n'
|
||||
+ "If you wish to use your API key, read http://wiki.bukkit.org/ServerMods_API and place it below." + '\n'
|
||||
+ "Some updating systems will not adhere to the disabled value, but these may be turned off in their plugin's configuration.");
|
||||
config.addDefault(API_KEY_CONFIG_KEY, API_KEY_DEFAULT);
|
||||
config.addDefault(DISABLE_CONFIG_KEY, DISABLE_DEFAULT);
|
||||
|
||||
if (!updaterFile.exists()) {
|
||||
this.fileIOOrError(updaterFile, updaterFile.mkdir(), true);
|
||||
}
|
||||
|
||||
boolean createFile = !updaterConfigFile.exists();
|
||||
try {
|
||||
if (createFile) {
|
||||
this.fileIOOrError(updaterConfigFile, updaterConfigFile.createNewFile(), true);
|
||||
config.options().copyDefaults(true);
|
||||
config.save(updaterConfigFile);
|
||||
} else {
|
||||
config.load(updaterConfigFile);
|
||||
}
|
||||
} catch (final Exception e) {
|
||||
final String message;
|
||||
if (createFile) {
|
||||
message = "The updater could not create configuration at " + updaterFile.getAbsolutePath();
|
||||
} else {
|
||||
message = "The updater could not load configuration at " + updaterFile.getAbsolutePath();
|
||||
}
|
||||
this.plugin.getLogger().log(Level.SEVERE, message, e);
|
||||
}
|
||||
|
||||
if (config.getBoolean(DISABLE_CONFIG_KEY)) {
|
||||
this.result = UpdateResult.DISABLED;
|
||||
return;
|
||||
}
|
||||
|
||||
String key = config.getString(API_KEY_CONFIG_KEY);
|
||||
if (API_KEY_DEFAULT.equalsIgnoreCase(key) || "".equals(key)) {
|
||||
key = null;
|
||||
}
|
||||
|
||||
this.apiKey = key;
|
||||
|
||||
try {
|
||||
this.url = new URL(Updater.HOST + Updater.QUERY + this.id);
|
||||
} catch (final MalformedURLException e) {
|
||||
this.plugin.getLogger().log(Level.SEVERE, "The project ID provided for updating, " + this.id + " is invalid.", e);
|
||||
this.result = UpdateResult.FAIL_BADID;
|
||||
}
|
||||
|
||||
if (this.result != UpdateResult.FAIL_BADID) {
|
||||
this.thread = new Thread(new UpdateRunnable());
|
||||
this.thread.start();
|
||||
} else {
|
||||
runUpdater();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the result of the update process.
|
||||
*
|
||||
* @return result of the update process.
|
||||
* @see UpdateResult
|
||||
*/
|
||||
public Updater.UpdateResult getResult() {
|
||||
this.waitForThread();
|
||||
return this.result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the latest version's release type.
|
||||
*
|
||||
* @return latest version's release type.
|
||||
* @see ReleaseType
|
||||
*/
|
||||
public ReleaseType getLatestType() {
|
||||
this.waitForThread();
|
||||
if (this.versionType != null) {
|
||||
for (ReleaseType type : ReleaseType.values()) {
|
||||
if (this.versionType.equalsIgnoreCase(type.name())) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the latest version's game version (such as "CB 1.2.5-R1.0").
|
||||
*
|
||||
* @return latest version's game version.
|
||||
*/
|
||||
public String getLatestGameVersion() {
|
||||
this.waitForThread();
|
||||
return this.versionGameVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the latest version's name (such as "Project v1.0").
|
||||
*
|
||||
* @return latest version's name.
|
||||
*/
|
||||
public String getLatestName() {
|
||||
this.waitForThread();
|
||||
return this.versionName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the latest version's direct file link.
|
||||
*
|
||||
* @return latest version's file link.
|
||||
*/
|
||||
public String getLatestFileLink() {
|
||||
this.waitForThread();
|
||||
return this.versionLink;
|
||||
}
|
||||
|
||||
/**
|
||||
* As the result of Updater output depends on the thread's completion, it is necessary to wait for the thread to finish
|
||||
* before allowing anyone to check the result.
|
||||
*/
|
||||
private void waitForThread() {
|
||||
if ((this.thread != null) && this.thread.isAlive()) {
|
||||
try {
|
||||
this.thread.join();
|
||||
} catch (final InterruptedException e) {
|
||||
this.plugin.getLogger().log(Level.SEVERE, null, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Save an update from dev.bukkit.org into the server's update folder.
|
||||
*
|
||||
* @param file the name of the file to save it as.
|
||||
*/
|
||||
private void saveFile(String file) {
|
||||
final File folder = this.updateFolder;
|
||||
|
||||
deleteOldFiles();
|
||||
if (!folder.exists()) {
|
||||
this.fileIOOrError(folder, folder.mkdir(), true);
|
||||
}
|
||||
downloadFile();
|
||||
|
||||
// Check to see if it's a zip file, if it is, unzip it.
|
||||
final File dFile = new File(folder.getAbsolutePath(), file);
|
||||
if (dFile.getName().endsWith(".zip")) {
|
||||
// Unzip
|
||||
this.unzip(dFile.getAbsolutePath());
|
||||
}
|
||||
if (this.announce) {
|
||||
this.plugin.getLogger().info("Finished updating.");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Download a file and save it to the specified folder.
|
||||
*/
|
||||
private void downloadFile() {
|
||||
BufferedInputStream in = null;
|
||||
FileOutputStream fout = null;
|
||||
try {
|
||||
URL fileUrl = new URL(this.versionLink);
|
||||
final int fileLength = fileUrl.openConnection().getContentLength();
|
||||
in = new BufferedInputStream(fileUrl.openStream());
|
||||
fout = new FileOutputStream(new File(this.updateFolder, file.getName()));
|
||||
|
||||
final byte[] data = new byte[Updater.BYTE_SIZE];
|
||||
int count;
|
||||
if (this.announce) {
|
||||
this.plugin.getLogger().info("About to download a new update: " + this.versionName);
|
||||
}
|
||||
long downloaded = 0;
|
||||
while ((count = in.read(data, 0, Updater.BYTE_SIZE)) != -1) {
|
||||
downloaded += count;
|
||||
fout.write(data, 0, count);
|
||||
final int percent = (int) ((downloaded * 100) / fileLength);
|
||||
if (this.announce && ((percent % 10) == 0)) {
|
||||
this.plugin.getLogger().info("Downloading update: " + percent + "% of " + fileLength + " bytes.");
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
this.plugin.getLogger().log(Level.WARNING, "The auto-updater tried to download a new update, but was unsuccessful.", ex);
|
||||
this.result = Updater.UpdateResult.FAIL_DOWNLOAD;
|
||||
} finally {
|
||||
try {
|
||||
if (in != null) {
|
||||
in.close();
|
||||
}
|
||||
} catch (final IOException ex) {
|
||||
this.plugin.getLogger().log(Level.SEVERE, null, ex);
|
||||
}
|
||||
try {
|
||||
if (fout != null) {
|
||||
fout.close();
|
||||
}
|
||||
} catch (final IOException ex) {
|
||||
this.plugin.getLogger().log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove possibly leftover files from the update folder.
|
||||
*/
|
||||
private void deleteOldFiles() {
|
||||
//Just a quick check to make sure we didn't leave any files from last time...
|
||||
File[] list = listFilesOrError(this.updateFolder);
|
||||
for (final File xFile : list) {
|
||||
if (xFile.getName().endsWith(".zip")) {
|
||||
this.fileIOOrError(xFile, xFile.mkdir(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Part of Zip-File-Extractor, modified by Gravity for use with Updater.
|
||||
*
|
||||
* @param file the location of the file to extract.
|
||||
*/
|
||||
private void unzip(String file) {
|
||||
final File fSourceZip = new File(file);
|
||||
try {
|
||||
final String zipPath = file.substring(0, file.length() - 4);
|
||||
ZipFile zipFile = new ZipFile(fSourceZip);
|
||||
Enumeration<? extends ZipEntry> e = zipFile.entries();
|
||||
while (e.hasMoreElements()) {
|
||||
ZipEntry entry = e.nextElement();
|
||||
File destinationFilePath = new File(zipPath, entry.getName());
|
||||
this.fileIOOrError(destinationFilePath.getParentFile(), destinationFilePath.getParentFile().mkdirs(), true);
|
||||
if (!entry.isDirectory()) {
|
||||
final BufferedInputStream bis = new BufferedInputStream(zipFile.getInputStream(entry));
|
||||
int b;
|
||||
final byte[] buffer = new byte[Updater.BYTE_SIZE];
|
||||
final FileOutputStream fos = new FileOutputStream(destinationFilePath);
|
||||
final BufferedOutputStream bos = new BufferedOutputStream(fos, Updater.BYTE_SIZE);
|
||||
while ((b = bis.read(buffer, 0, Updater.BYTE_SIZE)) != -1) {
|
||||
bos.write(buffer, 0, b);
|
||||
}
|
||||
bos.flush();
|
||||
bos.close();
|
||||
bis.close();
|
||||
final String name = destinationFilePath.getName();
|
||||
if (name.endsWith(".jar") && this.pluginExists(name)) {
|
||||
File output = new File(this.updateFolder, name);
|
||||
this.fileIOOrError(output, destinationFilePath.renameTo(output), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
zipFile.close();
|
||||
|
||||
// Move any plugin data folders that were included to the right place, Bukkit won't do this for us.
|
||||
moveNewZipFiles(zipPath);
|
||||
|
||||
} catch (final IOException e) {
|
||||
this.plugin.getLogger().log(Level.SEVERE, "The auto-updater tried to unzip a new update file, but was unsuccessful.", e);
|
||||
this.result = Updater.UpdateResult.FAIL_DOWNLOAD;
|
||||
} finally {
|
||||
this.fileIOOrError(fSourceZip, fSourceZip.delete(), false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find any new files extracted from an update into the plugin's data directory.
|
||||
* @param zipPath path of extracted files.
|
||||
*/
|
||||
private void moveNewZipFiles(String zipPath) {
|
||||
File[] list = listFilesOrError(new File(zipPath));
|
||||
for (final File dFile : list) {
|
||||
if (dFile.isDirectory() && this.pluginExists(dFile.getName())) {
|
||||
// Current dir
|
||||
final File oFile = new File(this.plugin.getDataFolder().getParent(), dFile.getName());
|
||||
// List of existing files in the new dir
|
||||
final File[] dList = listFilesOrError(dFile);
|
||||
// List of existing files in the current dir
|
||||
final File[] oList = listFilesOrError(oFile);
|
||||
for (File cFile : dList) {
|
||||
// Loop through all the files in the new dir
|
||||
boolean found = false;
|
||||
for (final File xFile : oList) {
|
||||
// Loop through all the contents in the current dir to see if it exists
|
||||
if (xFile.getName().equals(cFile.getName())) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
// Move the new file into the current dir
|
||||
File output = new File(oFile, cFile.getName());
|
||||
this.fileIOOrError(output, cFile.renameTo(output), true);
|
||||
} else {
|
||||
// This file already exists, so we don't need it anymore.
|
||||
this.fileIOOrError(cFile, cFile.delete(), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.fileIOOrError(dFile, dFile.delete(), false);
|
||||
}
|
||||
File zip = new File(zipPath);
|
||||
this.fileIOOrError(zip, zip.delete(), false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the name of a jar is one of the plugins currently installed, used for extracting the correct files out of a zip.
|
||||
*
|
||||
* @param name a name to check for inside the plugins folder.
|
||||
* @return true if a file inside the plugins folder is named this.
|
||||
*/
|
||||
private boolean pluginExists(String name) {
|
||||
File[] plugins = listFilesOrError(new File("plugins"));
|
||||
for (final File file : plugins) {
|
||||
if (file.getName().equals(name)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check to see if the program should continue by evaluating whether the plugin is already updated, or shouldn't be updated.
|
||||
*
|
||||
* @return true if the version was located and is not the same as the remote's newest.
|
||||
*/
|
||||
private boolean versionCheck() {
|
||||
final String title = this.versionName;
|
||||
if (this.type != UpdateType.NO_VERSION_CHECK) {
|
||||
String localVersion = this.plugin.getDescription().getVersion();
|
||||
if(localVersion.contains("#")) { // Strip build number
|
||||
localVersion = localVersion.substring(0, localVersion.indexOf("#"));
|
||||
}
|
||||
if (title.split(DELIMETER).length == 2) {
|
||||
// Get the newest file's version number
|
||||
final String remoteVersion = title.split(DELIMETER)[1].split(" ")[0];
|
||||
|
||||
if (this.hasTag(localVersion) || !this.shouldUpdate(localVersion, remoteVersion)) {
|
||||
// We already have the latest version, or this build is tagged for no-update
|
||||
this.result = Updater.UpdateResult.NO_UPDATE;
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
// The file's name did not contain the string 'vVersion'
|
||||
final String authorInfo = this.plugin.getDescription().getAuthors().isEmpty() ? "" : " (" + this.plugin.getDescription().getAuthors().get(0) + ")";
|
||||
this.plugin.getLogger().warning("The author of this plugin" + authorInfo + " has misconfigured their Auto Update system");
|
||||
this.plugin.getLogger().warning("File versions should follow the format 'PluginName vVERSION'");
|
||||
this.plugin.getLogger().warning("Please notify the author of this error.");
|
||||
this.result = Updater.UpdateResult.FAIL_NOVERSION;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* <b>If you wish to run mathematical versioning checks, edit this method.</b>
|
||||
* <p>
|
||||
* With default behavior, Updater will NOT verify that a remote version available on BukkitDev
|
||||
* which is not this version is indeed an "update".
|
||||
* If a version is present on BukkitDev that is not the version that is currently running,
|
||||
* Updater will assume that it is a newer version.
|
||||
* This is because there is no standard versioning scheme, and creating a calculation that can
|
||||
* determine whether a new update is actually an update is sometimes extremely complicated.
|
||||
* </p>
|
||||
* <p>
|
||||
* Updater will call this method from {@link #versionCheck()} before deciding whether
|
||||
* the remote version is actually an update.
|
||||
* If you have a specific versioning scheme with which a mathematical determination can
|
||||
* be reliably made to decide whether one version is higher than another, you may
|
||||
* revise this method, using the local and remote version parameters, to execute the
|
||||
* appropriate check.
|
||||
* </p>
|
||||
* <p>
|
||||
* Returning a value of <b>false</b> will tell the update process that this is NOT a new version.
|
||||
* Without revision, this method will always consider a remote version at all different from
|
||||
* that of the local version a new update.
|
||||
* </p>
|
||||
* @param localVersion the current version
|
||||
* @param remoteVersion the remote version
|
||||
* @return true if Updater should consider the remote version an update, false if not.
|
||||
*/
|
||||
public boolean shouldUpdate(String localVersion, String remoteVersion) {
|
||||
return !localVersion.equalsIgnoreCase(remoteVersion);
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluate whether the version number is marked showing that it should not be updated by this program.
|
||||
*
|
||||
* @param version a version number to check for tags in.
|
||||
* @return true if updating should be disabled.
|
||||
*/
|
||||
private boolean hasTag(String version) {
|
||||
for (final String string : Updater.NO_UPDATE_TAG) {
|
||||
if (version.contains(string)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a connection to the BukkitDev API and request the newest file's details.
|
||||
*
|
||||
* @return true if successful.
|
||||
*/
|
||||
private boolean read() {
|
||||
try {
|
||||
final URLConnection conn = this.url.openConnection();
|
||||
conn.setConnectTimeout(5000);
|
||||
|
||||
if (this.apiKey != null) {
|
||||
conn.addRequestProperty("X-API-Key", this.apiKey);
|
||||
}
|
||||
conn.addRequestProperty("User-Agent", Updater.USER_AGENT);
|
||||
|
||||
conn.setDoOutput(true);
|
||||
|
||||
final BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
|
||||
final String response = reader.readLine();
|
||||
|
||||
final JSONArray array = (JSONArray) JSONValue.parse(response);
|
||||
|
||||
if (array.isEmpty()) {
|
||||
this.plugin.getLogger().warning("The updater could not find any files for the project id " + this.id);
|
||||
this.result = UpdateResult.FAIL_BADID;
|
||||
return false;
|
||||
}
|
||||
|
||||
JSONObject latestUpdate = (JSONObject) array.get(array.size() - 1);
|
||||
this.versionName = (String) latestUpdate.get(Updater.TITLE_VALUE);
|
||||
this.versionLink = (String) latestUpdate.get(Updater.LINK_VALUE);
|
||||
this.versionType = (String) latestUpdate.get(Updater.TYPE_VALUE);
|
||||
this.versionGameVersion = (String) latestUpdate.get(Updater.VERSION_VALUE);
|
||||
|
||||
return true;
|
||||
} catch (final IOException e) {
|
||||
if(e.getMessage() != null && e.getMessage().contains("HTTP response code: 403")) {
|
||||
this.plugin.getLogger().severe("dev.bukkit.org rejected the API key provided in plugins/Updater/config.yml");
|
||||
this.plugin.getLogger().severe("Please double-check your configuration to ensure it is correct.");
|
||||
this.result = UpdateResult.FAIL_APIKEY;
|
||||
} else {
|
||||
this.plugin.getLogger().severe("The updater could not contact dev.bukkit.org for updating.");
|
||||
this.plugin.getLogger().severe("If you have not recently modified your configuration and this is the first time you are seeing this message, the site may be experiencing temporary downtime.");
|
||||
this.result = UpdateResult.FAIL_DBO;
|
||||
}
|
||||
AreaShop.debug(ExceptionUtils.getStackTrace(e));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a file operation and log any errors if it fails.
|
||||
* @param file file operation is performed on.
|
||||
* @param result result of file operation.
|
||||
* @param create true if a file is being created, false if deleted.
|
||||
*/
|
||||
private void fileIOOrError(File file, boolean result, boolean create) {
|
||||
if (!result) {
|
||||
this.plugin.getLogger().severe("The updater could not " + (create ? "create" : "delete") + " file at: " + file.getAbsolutePath());
|
||||
}
|
||||
}
|
||||
|
||||
private File[] listFilesOrError(File folder) {
|
||||
File[] contents = folder.listFiles();
|
||||
if (contents == null) {
|
||||
this.plugin.getLogger().severe("The updater could not access files at: " + this.updateFolder.getAbsolutePath());
|
||||
return new File[0];
|
||||
} else {
|
||||
return contents;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called on main thread when the Updater has finished working, regardless
|
||||
* of result.
|
||||
*/
|
||||
public interface UpdateCallback {
|
||||
/**
|
||||
* Called when the updater has finished working.
|
||||
* @param updater The updater instance
|
||||
*/
|
||||
void onFinish(Updater updater);
|
||||
}
|
||||
|
||||
private class UpdateRunnable implements Runnable {
|
||||
@Override
|
||||
public void run() {
|
||||
runUpdater();
|
||||
}
|
||||
}
|
||||
|
||||
private void runUpdater() {
|
||||
if (this.url != null && (this.read() && this.versionCheck())) {
|
||||
// Obtain the results of the project's file feed
|
||||
if ((this.versionLink != null) && (this.type != UpdateType.NO_DOWNLOAD)) {
|
||||
String name = this.file.getName();
|
||||
// If it's a zip file, it shouldn't be downloaded as the plugin's name
|
||||
if (this.versionLink.endsWith(".zip")) {
|
||||
name = this.versionLink.substring(this.versionLink.lastIndexOf("/") + 1);
|
||||
}
|
||||
this.saveFile(name);
|
||||
} else {
|
||||
this.result = UpdateResult.UPDATE_AVAILABLE;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.callback != null) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
runCallback();
|
||||
}
|
||||
}.runTask(this.plugin);
|
||||
}
|
||||
}
|
||||
|
||||
private void runCallback() {
|
||||
this.callback.onFinish(this);
|
||||
}
|
||||
}
|
||||
+170
@@ -0,0 +1,170 @@
|
||||
package me.wiefferink.areashop.listeners;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
import me.wiefferink.areashop.regions.RentRegion;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerKickEvent;
|
||||
import org.bukkit.event.player.PlayerLoginEvent;
|
||||
import org.bukkit.event.player.PlayerLoginEvent.Result;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Checks for placement of signs for this plugin
|
||||
* @author NLThijs48
|
||||
*/
|
||||
public final class PlayerLoginLogoutListener implements Listener {
|
||||
private AreaShop plugin;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param plugin The AreaShop plugin
|
||||
*/
|
||||
public PlayerLoginLogoutListener(AreaShop plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a sign is changed
|
||||
* @param event The event
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPlayerLogin(PlayerLoginEvent event) {
|
||||
if(event.getResult() != Result.ALLOWED) {
|
||||
return;
|
||||
}
|
||||
final Player player = event.getPlayer();
|
||||
// Notify admins for plugin updates
|
||||
if(plugin.updateAvailable() && player.hasPermission("areashop.notifyupdate")) {
|
||||
AreaShop.getInstance().message(player, "update-playerNotify", AreaShop.getInstance().getDescription().getVersion(), AreaShop.getInstance().getUpdater().getLatestName());
|
||||
}
|
||||
// Schedule task to check for notifications, prevents a lag spike at login
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// Delay until all regions are loaded
|
||||
if(!plugin.isReady()) {
|
||||
return;
|
||||
}
|
||||
if(!player.isOnline()) {
|
||||
this.cancel();
|
||||
return;
|
||||
}
|
||||
// Notify for rents that almost run out
|
||||
for(RentRegion region : plugin.getFileManager().getRents()) {
|
||||
if(region.isRenter(player)) {
|
||||
String warningSetting = region.getStringSetting("rent.warningOnLoginTime");
|
||||
if(warningSetting == null || warningSetting.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
long warningTime = Utils.durationStringToLong(warningSetting);
|
||||
if(region.getTimeLeft() < warningTime) {
|
||||
// Send the warning message later to let it appear after general MOTD messages
|
||||
AreaShop.getInstance().message(player, "rent-expireWarning", region);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.cancel();
|
||||
}
|
||||
}.runTaskTimer(plugin, 25, 25);
|
||||
// Check if the player has regions that use an old name of him and update them
|
||||
final List<GeneralRegion> regions = new ArrayList<>(plugin.getFileManager().getRegions());
|
||||
new BukkitRunnable() {
|
||||
private int current = 0;
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
// Delay until all regions are loaded
|
||||
if(!plugin.isReady()) {
|
||||
return;
|
||||
}
|
||||
// Check all regions
|
||||
for(int i=0; i<plugin.getConfig().getInt("nameupdate.regionsPerTick"); i++) {
|
||||
if(current < regions.size()) {
|
||||
GeneralRegion region = regions.get(current);
|
||||
if(region.isOwner(player)) {
|
||||
if(region.isBuyRegion()) {
|
||||
if(!player.getName().equals(region.getStringSetting("buy.buyerName"))) {
|
||||
region.setSetting("buy.buyerName", player.getName());
|
||||
region.update();
|
||||
}
|
||||
} else if(region.isRentRegion()) {
|
||||
if(!player.getName().equals(region.getStringSetting("rent.renterName"))) {
|
||||
region.setSetting("rent.renterName", player.getName());
|
||||
region.update();
|
||||
}
|
||||
}
|
||||
}
|
||||
current++;
|
||||
}
|
||||
}
|
||||
if(current >= regions.size()) {
|
||||
this.cancel();
|
||||
}
|
||||
}
|
||||
}.runTaskTimer(plugin, 22, 1); // Wait a bit before starting to prevent a lot of stress on the server when a player joins (a lot of plugins already do stuff then)
|
||||
}
|
||||
|
||||
// Active time updates
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPlayerLogout(PlayerQuitEvent event) {
|
||||
updateLastActive(event.getPlayer());
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPlayerKick(PlayerKickEvent event) {
|
||||
updateLastActive(event.getPlayer());
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the last active time for all regions the player is owner off
|
||||
* @param player The player to update the active times for
|
||||
*/
|
||||
private void updateLastActive(Player player) {
|
||||
for(GeneralRegion region : plugin.getFileManager().getRegions()) {
|
||||
if(region.isOwner(player)) {
|
||||
region.updateLastActiveTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
package me.wiefferink.areashop.listeners;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.features.SignsFeature;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.Sign;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
import org.bukkit.event.block.BlockPhysicsEvent;
|
||||
|
||||
/**
|
||||
* Checks for placement of signs for this plugin
|
||||
* @author NLThijs48
|
||||
*/
|
||||
public final class SignBreakListener implements Listener {
|
||||
private AreaShop plugin;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param plugin The AreaShop plugin
|
||||
*/
|
||||
public SignBreakListener(AreaShop plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called when a block is broken
|
||||
* @param event The event
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onSignBreak(BlockBreakEvent event) {
|
||||
if(event.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
Block block = event.getBlock();
|
||||
// Check if it is a sign
|
||||
if(block.getType() == Material.WALL_SIGN || block.getType() == Material.SIGN_POST) {
|
||||
// Check if the rent sign is really the same as a saved rent
|
||||
SignsFeature.RegionSign regionSign = SignsFeature.getSignByLocation(block.getLocation());
|
||||
if(regionSign == null) {
|
||||
return;
|
||||
}
|
||||
// Remove the sign of the rental region if the player has permission
|
||||
if(event.getPlayer().hasPermission("areashop.delsign")) {
|
||||
regionSign.remove();
|
||||
plugin.message(event.getPlayer(), "delsign-success", regionSign.getRegion());
|
||||
} else { // Cancel the breaking of the sign
|
||||
event.setCancelled(true);
|
||||
plugin.message(event.getPlayer(), "delsign-noPermission", regionSign.getRegion());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the physics of a block change
|
||||
* @param event The event
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onIndirectSignBreak(BlockPhysicsEvent event){
|
||||
Block block = event.getBlock();
|
||||
if(event.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
if(block.getType() == Material.SIGN_POST || block.getType() == Material.WALL_SIGN){
|
||||
Sign sign = (Sign)block.getState();
|
||||
Block attachedTo = block.getRelative(((org.bukkit.material.Sign)sign.getData()).getAttachedFace());
|
||||
if(attachedTo.getType() == Material.AIR){
|
||||
// Check if the rent sign is really the same as a saved rent
|
||||
SignsFeature.RegionSign regionSign = SignsFeature.getSignByLocation(block.getLocation());
|
||||
if(regionSign != null) {
|
||||
event.setCancelled(true); // Cancel the sign breaking, will create a floating sign but at least it is not disconnected/gone
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+359
-320
@@ -1,320 +1,359 @@
|
||||
package nl.evolutioncoding.AreaShop;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import nl.evolutioncoding.AreaShop.regions.BuyRegion;
|
||||
import nl.evolutioncoding.AreaShop.regions.GeneralRegion;
|
||||
import nl.evolutioncoding.AreaShop.regions.GeneralRegion.RegionEvent;
|
||||
import nl.evolutioncoding.AreaShop.regions.RentRegion;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.SignChangeEvent;
|
||||
import org.bukkit.material.Sign;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import com.sk89q.worldedit.bukkit.selections.CuboidSelection;
|
||||
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
||||
import com.sk89q.worldguard.protection.managers.RegionManager;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
|
||||
/**
|
||||
* Checks for placement of signs for this plugin
|
||||
* @author NLThijs48
|
||||
*/
|
||||
public final class SignChangeListener implements Listener {
|
||||
AreaShop plugin;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param plugin The AreaShop plugin
|
||||
*/
|
||||
public SignChangeListener(AreaShop plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a sign is changed
|
||||
* @param event The event
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onSignChange(SignChangeEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
|
||||
// Check if the sign is meant for this plugin
|
||||
if(event.getLine(0).contains(plugin.config().getString("signTags.rent"))) {
|
||||
if(!player.hasPermission("areashop.createrent")) {
|
||||
plugin.message(player, "setup-noPermissionRent");
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the other lines
|
||||
String secondLine = event.getLine(1);
|
||||
String thirdLine = event.getLine(2);
|
||||
String fourthLine = event.getLine(3);
|
||||
|
||||
// Get the regionManager for accessing regions
|
||||
RegionManager regionManager = plugin.getWorldGuard().getRegionManager(event.getPlayer().getWorld());
|
||||
|
||||
// If the secondLine does not contain a name try to find the region by location
|
||||
if(secondLine == null || secondLine.length() == 0) {
|
||||
ApplicableRegionSet regions = regionManager.getApplicableRegions(event.getBlock().getLocation());
|
||||
if(regions != null) {
|
||||
boolean first = true;
|
||||
ProtectedRegion candidate = null;
|
||||
for(ProtectedRegion pr : regions) {
|
||||
if(first) {
|
||||
candidate = pr;
|
||||
first = false;
|
||||
} else {
|
||||
if(pr.getPriority() > candidate.getPriority()) {
|
||||
candidate = pr;
|
||||
} else if(pr.getParent() != null && pr.getParent().equals(candidate)) {
|
||||
candidate = pr;
|
||||
} else {
|
||||
plugin.message(player, "setup-couldNotDetect", candidate.getId(), pr.getId());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(candidate != null) {
|
||||
secondLine = candidate.getId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boolean priceSet = fourthLine != null && fourthLine.length() != 0;
|
||||
boolean durationSet = thirdLine != null && thirdLine.length() != 0;
|
||||
// check if all the lines are correct
|
||||
if(secondLine == null || secondLine.length() == 0) {
|
||||
plugin.message(player, "setup-noRegion");
|
||||
return;
|
||||
} else if(regionManager.getRegion(secondLine) == null) {
|
||||
plugin.message(player, "setup-wrongRegion");
|
||||
return;
|
||||
} else if(plugin.getFileManager().getRent(secondLine) != null) {
|
||||
plugin.message(player, "setup-alreadyRentSign");
|
||||
return;
|
||||
} else if(thirdLine != null && thirdLine.length() != 0 && !plugin.checkTimeFormat(thirdLine)) {
|
||||
plugin.message(player, "setup-wrongDuration");
|
||||
return;
|
||||
} else {
|
||||
double price = 0.0;
|
||||
if(priceSet) {
|
||||
// Check the fourth line
|
||||
try {
|
||||
price = Double.parseDouble(fourthLine);
|
||||
} catch (NumberFormatException e) {
|
||||
plugin.message(player, "setup-wrongPrice");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Add rent to the FileManager
|
||||
final RentRegion rent = new RentRegion(plugin, secondLine, event.getPlayer().getWorld());
|
||||
if(priceSet) {
|
||||
rent.setPrice(price);
|
||||
}
|
||||
if(durationSet) {
|
||||
rent.setDuration(thirdLine);
|
||||
}
|
||||
Sign sign = (Sign)event.getBlock().getState().getData();
|
||||
rent.addSign(event.getBlock().getLocation(), event.getBlock().getType(), sign.getFacing(), null);
|
||||
|
||||
// Run commands
|
||||
rent.runEventCommands(RegionEvent.CREATED, true);
|
||||
|
||||
plugin.getFileManager().addRent(rent);
|
||||
rent.handleSchematicEvent(RegionEvent.CREATED);
|
||||
// Update the sign later because this event will do it first
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
rent.updateSigns();
|
||||
}
|
||||
}.runTaskLater(plugin, 1);
|
||||
|
||||
// Set the flags for the region
|
||||
rent.updateRegionFlags();
|
||||
plugin.message(player, "setup-rentSuccess", rent.getName());
|
||||
// Run commands
|
||||
rent.runEventCommands(RegionEvent.CREATED, false);
|
||||
}
|
||||
} else if (event.getLine(0).contains(plugin.config().getString("signTags.buy"))) {
|
||||
// Check for permission
|
||||
if(!player.hasPermission("areashop.createbuy")) {
|
||||
plugin.message(player, "setup-noPermissionBuy");
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the other lines
|
||||
String secondLine = event.getLine(1);
|
||||
String thirdLine = event.getLine(2);
|
||||
|
||||
// Get the regionManager for accessing regions
|
||||
RegionManager regionManager = plugin.getWorldGuard().getRegionManager(event.getPlayer().getWorld());
|
||||
|
||||
// If the secondLine does not contain a name try to find the region by location
|
||||
if(secondLine == null || secondLine.length() == 0) {
|
||||
ApplicableRegionSet regions = regionManager.getApplicableRegions(event.getBlock().getLocation());
|
||||
if(regions != null) {
|
||||
boolean first = true;
|
||||
ProtectedRegion candidate = null;
|
||||
for(ProtectedRegion pr : regions) {
|
||||
if(first) {
|
||||
candidate = pr;
|
||||
first = false;
|
||||
} else {
|
||||
if(pr.getPriority() > candidate.getPriority()) {
|
||||
candidate = pr;
|
||||
} else if(pr.getParent() != null && pr.getParent().equals(candidate)) {
|
||||
candidate = pr;
|
||||
} else if(pr.getPriority() == candidate.getPriority()) {
|
||||
plugin.message(player, "setup-couldNotDetect", candidate.getId(), pr.getId());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(candidate != null) {
|
||||
secondLine = candidate.getId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boolean priceSet = thirdLine != null && thirdLine.length() != 0;
|
||||
// Check if all the lines are correct
|
||||
if(secondLine == null || secondLine.length() == 0) {
|
||||
plugin.message(player, "setup-noRegion");
|
||||
return;
|
||||
} else if(regionManager.getRegion(secondLine) == null) {
|
||||
plugin.message(player, "setup-wrongRegion");
|
||||
return;
|
||||
} else if(plugin.getFileManager().getBuy(secondLine) != null) {
|
||||
plugin.message(player, "setup-alreadyBuySign");
|
||||
return;
|
||||
} else {
|
||||
double price = 0.0;
|
||||
if(priceSet) {
|
||||
// Check the fourth line
|
||||
try {
|
||||
price = Double.parseDouble(thirdLine);
|
||||
} catch (NumberFormatException e) {
|
||||
plugin.message(player, "setup-wrongPrice");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Add buy to the FileManager
|
||||
final BuyRegion buy = new BuyRegion(plugin, secondLine, event.getPlayer().getWorld());
|
||||
if(priceSet) {
|
||||
buy.setPrice(price);
|
||||
}
|
||||
Sign sign = (Sign)event.getBlock().getState().getData();
|
||||
buy.addSign(event.getBlock().getLocation(), event.getBlock().getType(), sign.getFacing(), null);
|
||||
// Run commands
|
||||
buy.runEventCommands(RegionEvent.CREATED, true);
|
||||
|
||||
plugin.getFileManager().addBuy(buy);
|
||||
buy.handleSchematicEvent(RegionEvent.CREATED);
|
||||
// Update the sign later because this event will do it first
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
buy.updateSigns();
|
||||
}
|
||||
}.runTaskLater(plugin, 1);
|
||||
|
||||
// Set the flags for the region
|
||||
buy.updateRegionFlags();
|
||||
plugin.message(player, "setup-buySuccess", regionManager.getRegion(secondLine).getId());
|
||||
|
||||
// Run commands
|
||||
buy.runEventCommands(RegionEvent.CREATED, false);
|
||||
}
|
||||
} else if(event.getLine(0).contains(plugin.config().getString("signTags.add"))) {
|
||||
// Check for permission
|
||||
if(!player.hasPermission("areashop.addsign")) {
|
||||
plugin.message(player, "addsign-noPermission");
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the other lines
|
||||
String secondLine = event.getLine(1);
|
||||
String thirdLine = event.getLine(2);
|
||||
|
||||
GeneralRegion region = null;
|
||||
if(secondLine != null && secondLine.length() != 0) {
|
||||
// Get region by secondLine of the sign
|
||||
region = plugin.getFileManager().getRegion(secondLine);
|
||||
if(region == null) {
|
||||
plugin.message(player, "addsign-noRegion", secondLine);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// Get region by sign position
|
||||
List<GeneralRegion> regions = plugin.getFileManager().getASRegionsInSelection(new CuboidSelection(event.getBlock().getWorld(), event.getBlock().getLocation(), event.getBlock().getLocation()));
|
||||
if(regions.isEmpty()) {
|
||||
plugin.message(player, "addsign-noRegions");
|
||||
return;
|
||||
} else if(regions.size() > 1) {
|
||||
plugin.message(player, "addsign-couldNotDetectSign", regions.get(0).getName(), regions.get(1).getName());
|
||||
return;
|
||||
}
|
||||
region = regions.get(0);
|
||||
}
|
||||
Sign sign = (Sign)event.getBlock().getState().getData();
|
||||
if(thirdLine == null || thirdLine.length() == 0) {
|
||||
region.addSign(event.getBlock().getLocation(), event.getBlock().getType(), sign.getFacing(), null);
|
||||
plugin.message(player, "addsign-success", region.getName());
|
||||
} else {
|
||||
region.addSign(event.getBlock().getLocation(), event.getBlock().getType(), sign.getFacing(), thirdLine);
|
||||
plugin.message(player, "addsign-successProfile", region.getName(), thirdLine);
|
||||
}
|
||||
region.save();
|
||||
|
||||
// Update the sign later because this event will do it first
|
||||
final GeneralRegion regionUpdate = region;
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
regionUpdate.updateSigns();
|
||||
}
|
||||
}.runTaskLater(plugin, 1);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
package me.wiefferink.areashop.listeners;
|
||||
|
||||
import com.sk89q.worldedit.bukkit.selections.CuboidSelection;
|
||||
import com.sk89q.worldguard.protection.managers.RegionManager;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.managers.FileManager;
|
||||
import me.wiefferink.areashop.regions.BuyRegion;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
import me.wiefferink.areashop.regions.RentRegion;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.SignChangeEvent;
|
||||
import org.bukkit.material.Sign;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Checks for placement of signs for this plugin
|
||||
* @author NLThijs48
|
||||
*/
|
||||
public final class SignChangeListener implements Listener {
|
||||
private AreaShop plugin;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param plugin The AreaShop plugin
|
||||
*/
|
||||
public SignChangeListener(AreaShop plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a sign is changed
|
||||
* @param event The event
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onSignChange(SignChangeEvent event) {
|
||||
if(event.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
Player player = event.getPlayer();
|
||||
if(!plugin.isReady()) {
|
||||
plugin.message(player, "general-notReady");
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if the sign is meant for this plugin
|
||||
if(event.getLine(0).contains(plugin.getConfig().getString("signTags.rent"))) {
|
||||
if(!player.hasPermission("areashop.createrent") && !player.hasPermission("areashop.createrent.member") && !player.hasPermission("areashop.createrent.owner")) {
|
||||
plugin.message(player, "setup-noPermissionRent");
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the other lines
|
||||
String secondLine = event.getLine(1);
|
||||
String thirdLine = event.getLine(2);
|
||||
String fourthLine = event.getLine(3);
|
||||
|
||||
// Get the regionManager for accessing regions
|
||||
RegionManager regionManager = plugin.getWorldGuard().getRegionManager(event.getPlayer().getWorld());
|
||||
|
||||
// If the secondLine does not contain a name try to find the region by location
|
||||
if(secondLine == null || secondLine.length() == 0) {
|
||||
Set<ProtectedRegion> regions = plugin.getWorldGuardHandler().getApplicableRegionsSet(event.getBlock().getLocation());
|
||||
if(regions != null) {
|
||||
boolean first = true;
|
||||
ProtectedRegion candidate = null;
|
||||
for(ProtectedRegion pr : regions) {
|
||||
if(first) {
|
||||
candidate = pr;
|
||||
first = false;
|
||||
} else {
|
||||
if(pr.getPriority() > candidate.getPriority()) {
|
||||
candidate = pr;
|
||||
} else if(pr.getPriority() < candidate.getPriority()) {
|
||||
// Already got the correct one
|
||||
} else if(pr.getParent() != null && pr.getParent().equals(candidate)) {
|
||||
candidate = pr;
|
||||
} else if(candidate.getParent() != null && candidate.getParent().equals(pr)) {
|
||||
// Already got the correct one
|
||||
} else {
|
||||
plugin.message(player, "setup-couldNotDetect", candidate.getId(), pr.getId());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(candidate != null) {
|
||||
secondLine = candidate.getId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boolean priceSet = fourthLine != null && fourthLine.length() != 0;
|
||||
boolean durationSet = thirdLine != null && thirdLine.length() != 0;
|
||||
// check if all the lines are correct
|
||||
if(secondLine == null || secondLine.length() == 0) {
|
||||
plugin.message(player, "setup-noRegion");
|
||||
return;
|
||||
}
|
||||
ProtectedRegion region = regionManager.getRegion(secondLine);
|
||||
if(region == null) {
|
||||
plugin.message(player, "cmd-notRegistered", secondLine);
|
||||
return;
|
||||
}
|
||||
|
||||
FileManager.AddResult addResult = plugin.getFileManager().checkRegionAdd(player, regionManager.getRegion(secondLine), GeneralRegion.RegionType.RENT);
|
||||
if(addResult == FileManager.AddResult.BLACKLISTED) {
|
||||
plugin.message(player, "setup-blacklisted", secondLine);
|
||||
} else if(addResult == FileManager.AddResult.ALREADYADDED) {
|
||||
plugin.message(player, "setup-alreadyRentSign");
|
||||
} else if(addResult == FileManager.AddResult.NOPERMISSION) {
|
||||
plugin.message(player, "setup-noPermission", secondLine);
|
||||
} else if(thirdLine != null && thirdLine.length() != 0 && !Utils.checkTimeFormat(thirdLine)) {
|
||||
plugin.message(player, "setup-wrongDuration");
|
||||
} else {
|
||||
double price = 0.0;
|
||||
if(priceSet) {
|
||||
// Check the fourth line
|
||||
try {
|
||||
price = Double.parseDouble(fourthLine);
|
||||
} catch (NumberFormatException e) {
|
||||
plugin.message(player, "setup-wrongPrice");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Add rent to the FileManager
|
||||
final RentRegion rent = new RentRegion(plugin, secondLine, event.getPlayer().getWorld());
|
||||
boolean isMember = plugin.getWorldGuardHandler().containsMember(rent.getRegion(), player.getUniqueId());
|
||||
boolean isOwner = plugin.getWorldGuardHandler().containsOwner(rent.getRegion(), player.getUniqueId());
|
||||
boolean landlord = (!player.hasPermission("areashop.createrent")
|
||||
&& ((player.hasPermission("areashop.createrent.owner") && isOwner)
|
||||
|| (player.hasPermission("areashop.createrent.member") && isMember)));
|
||||
|
||||
if(landlord) {
|
||||
rent.setLandlord(player.getUniqueId(), player.getName());
|
||||
}
|
||||
if(priceSet) {
|
||||
rent.setPrice(price);
|
||||
}
|
||||
if(durationSet) {
|
||||
rent.setDuration(thirdLine);
|
||||
}
|
||||
Sign sign = (Sign)event.getBlock().getState().getData();
|
||||
rent.getSignsFeature().addSign(event.getBlock().getLocation(), event.getBlock().getType(), sign.getFacing(), null);
|
||||
|
||||
// Run commands
|
||||
rent.runEventCommands(GeneralRegion.RegionEvent.CREATED, true);
|
||||
|
||||
plugin.getFileManager().addRent(rent);
|
||||
rent.handleSchematicEvent(GeneralRegion.RegionEvent.CREATED);
|
||||
plugin.message(player, "setup-rentSuccess", rent);
|
||||
// Update the region after the event has written its lines
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
rent.update();
|
||||
}
|
||||
}.runTaskLater(plugin, 1);
|
||||
// Run commands
|
||||
rent.runEventCommands(GeneralRegion.RegionEvent.CREATED, false);
|
||||
}
|
||||
} else if (event.getLine(0).contains(plugin.getConfig().getString("signTags.buy"))) {
|
||||
// Check for permission
|
||||
if(!player.hasPermission("areashop.createbuy") && !player.hasPermission("areashop.createbuy.member") && !player.hasPermission("areashop.createbuy.owner")) {
|
||||
plugin.message(player, "setup-noPermissionBuy");
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the other lines
|
||||
String secondLine = event.getLine(1);
|
||||
String thirdLine = event.getLine(2);
|
||||
|
||||
// Get the regionManager for accessing regions
|
||||
RegionManager regionManager = plugin.getWorldGuard().getRegionManager(event.getPlayer().getWorld());
|
||||
|
||||
// If the secondLine does not contain a name try to find the region by location
|
||||
if(secondLine == null || secondLine.length() == 0) {
|
||||
Set<ProtectedRegion> regions = plugin.getWorldGuardHandler().getApplicableRegionsSet(event.getBlock().getLocation());
|
||||
if(regions != null) {
|
||||
boolean first = true;
|
||||
ProtectedRegion candidate = null;
|
||||
for(ProtectedRegion pr : regions) {
|
||||
if(first) {
|
||||
candidate = pr;
|
||||
first = false;
|
||||
} else {
|
||||
if(pr.getPriority() > candidate.getPriority()) {
|
||||
candidate = pr;
|
||||
} else if(pr.getPriority() < candidate.getPriority()) {
|
||||
// Already got the correct one
|
||||
} else if(pr.getParent() != null && pr.getParent().equals(candidate)) {
|
||||
candidate = pr;
|
||||
} else if(candidate.getParent() != null && candidate.getParent().equals(pr)) {
|
||||
// Already got the correct one
|
||||
} else {
|
||||
plugin.message(player, "setup-couldNotDetect", candidate.getId(), pr.getId());
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(candidate != null) {
|
||||
secondLine = candidate.getId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boolean priceSet = thirdLine != null && thirdLine.length() != 0;
|
||||
// Check if all the lines are correct
|
||||
if(secondLine == null || secondLine.length() == 0) {
|
||||
plugin.message(player, "setup-noRegion");
|
||||
return;
|
||||
}
|
||||
ProtectedRegion region = regionManager.getRegion(secondLine);
|
||||
if(region == null) {
|
||||
plugin.message(player, "add-noRegion", secondLine);
|
||||
return;
|
||||
}
|
||||
FileManager.AddResult addResult = plugin.getFileManager().checkRegionAdd(player, region, GeneralRegion.RegionType.BUY);
|
||||
if(addResult == FileManager.AddResult.BLACKLISTED) {
|
||||
plugin.message(player, "setup-blacklisted", secondLine);
|
||||
} else if(addResult == FileManager.AddResult.ALREADYADDED) {
|
||||
plugin.message(player, "setup-alreadyRentSign");
|
||||
} else if(addResult == FileManager.AddResult.NOPERMISSION) {
|
||||
plugin.message(player, "setup-noPermission", secondLine);
|
||||
} else {
|
||||
double price = 0.0;
|
||||
if(priceSet) {
|
||||
// Check the fourth line
|
||||
try {
|
||||
price = Double.parseDouble(thirdLine);
|
||||
} catch (NumberFormatException e) {
|
||||
plugin.message(player, "setup-wrongPrice");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Add buy to the FileManager
|
||||
final BuyRegion buy = new BuyRegion(plugin, secondLine, event.getPlayer().getWorld());
|
||||
boolean isMember = plugin.getWorldGuardHandler().containsMember(buy.getRegion(), player.getUniqueId());
|
||||
boolean isOwner = plugin.getWorldGuardHandler().containsOwner(buy.getRegion(), player.getUniqueId());
|
||||
boolean landlord = (!player.hasPermission("areashop.createbuy")
|
||||
&& ((player.hasPermission("areashop.createbuy.owner") && isOwner)
|
||||
|| (player.hasPermission("areashop.createbuy.member") && isMember)));
|
||||
|
||||
if(landlord) {
|
||||
buy.setLandlord(player.getUniqueId(), player.getName());
|
||||
}
|
||||
if(priceSet) {
|
||||
buy.setPrice(price);
|
||||
}
|
||||
Sign sign = (Sign)event.getBlock().getState().getData();
|
||||
buy.getSignsFeature().addSign(event.getBlock().getLocation(), event.getBlock().getType(), sign.getFacing(), null);
|
||||
// Run commands
|
||||
buy.runEventCommands(GeneralRegion.RegionEvent.CREATED, true);
|
||||
|
||||
plugin.getFileManager().addBuy(buy);
|
||||
buy.handleSchematicEvent(GeneralRegion.RegionEvent.CREATED);
|
||||
plugin.message(player, "setup-buySuccess", buy);
|
||||
// Update the region after the event has written its lines
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
buy.update();
|
||||
}
|
||||
}.runTaskLater(plugin, 1);
|
||||
|
||||
// Run commands
|
||||
buy.runEventCommands(GeneralRegion.RegionEvent.CREATED, false);
|
||||
}
|
||||
} else if(event.getLine(0).contains(plugin.getConfig().getString("signTags.add"))) {
|
||||
// Check for permission
|
||||
if(!player.hasPermission("areashop.addsign")) {
|
||||
plugin.message(player, "addsign-noPermission");
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the other lines
|
||||
String secondLine = event.getLine(1);
|
||||
String thirdLine = event.getLine(2);
|
||||
|
||||
GeneralRegion region;
|
||||
if(secondLine != null && secondLine.length() != 0) {
|
||||
// Get region by secondLine of the sign
|
||||
region = plugin.getFileManager().getRegion(secondLine);
|
||||
if(region == null) {
|
||||
plugin.message(player, "add-noRegion", secondLine);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// Get region by sign position
|
||||
List<GeneralRegion> regions = Utils.getASRegionsInSelection(new CuboidSelection(event.getBlock().getWorld(), event.getBlock().getLocation(), event.getBlock().getLocation()));
|
||||
if(regions.isEmpty()) {
|
||||
plugin.message(player, "addsign-noRegions");
|
||||
return;
|
||||
} else if(regions.size() > 1) {
|
||||
plugin.message(player, "addsign-couldNotDetectSign", regions.get(0).getName(), regions.get(1).getName());
|
||||
return;
|
||||
}
|
||||
region = regions.get(0);
|
||||
}
|
||||
Sign sign = (Sign)event.getBlock().getState().getData();
|
||||
if(thirdLine == null || thirdLine.length() == 0) {
|
||||
region.getSignsFeature().addSign(event.getBlock().getLocation(), event.getBlock().getType(), sign.getFacing(), null);
|
||||
plugin.message(player, "addsign-success", region);
|
||||
} else {
|
||||
region.getSignsFeature().addSign(event.getBlock().getLocation(), event.getBlock().getType(), sign.getFacing(), thirdLine);
|
||||
plugin.message(player, "addsign-successProfile", thirdLine, region);
|
||||
}
|
||||
|
||||
// Update the region later because this event will do it first
|
||||
final GeneralRegion regionUpdate = region;
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
regionUpdate.update();
|
||||
}
|
||||
}.runTaskLater(plugin, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+94
-89
@@ -1,89 +1,94 @@
|
||||
package nl.evolutioncoding.AreaShop;
|
||||
|
||||
import nl.evolutioncoding.AreaShop.regions.GeneralRegion;
|
||||
import nl.evolutioncoding.AreaShop.regions.GeneralRegion.ClickType;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
|
||||
public class SignClickListener implements Listener {
|
||||
AreaShop plugin;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param plugin The AreaShop plugin
|
||||
*/
|
||||
public SignClickListener(AreaShop plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a player interacts
|
||||
* @param event The event
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onSignClick(PlayerInteractEvent event) {
|
||||
Block block = event.getClickedBlock();
|
||||
/* Check for clicking a sign and rightclicking */
|
||||
if( (event.getAction() == Action.RIGHT_CLICK_BLOCK || event.getAction() == Action.LEFT_CLICK_BLOCK)
|
||||
&& (block.getType() == Material.SIGN_POST || block.getType() == Material.WALL_SIGN)) {
|
||||
/* Check if the rent sign is really the same as a saved rent */
|
||||
GeneralRegion result = plugin.getFileManager().getRegionBySignLocation(block.getLocation());
|
||||
if(result == null) {
|
||||
return;
|
||||
}
|
||||
String signName = result.getSignName(block.getLocation());
|
||||
Player player = event.getPlayer();
|
||||
// Get the clicktype
|
||||
ClickType clickType = null;
|
||||
if(player.isSneaking() && event.getAction() == Action.LEFT_CLICK_BLOCK) {
|
||||
clickType = ClickType.SHIFTLEFTCLICK;
|
||||
} else if(!player.isSneaking() && event.getAction() == Action.LEFT_CLICK_BLOCK) {
|
||||
clickType = ClickType.LEFTCLICK;
|
||||
} else if(player.isSneaking() && event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
||||
clickType = ClickType.SHIFTRIGHTCLICK;
|
||||
} else if(!player.isSneaking() && event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
||||
clickType = ClickType.RIGHTCLICK;
|
||||
}
|
||||
// Run the commands
|
||||
boolean runned = result.runSignCommands(signName, player, clickType);
|
||||
// Only cancel event if at least one command has been executed
|
||||
event.setCancelled(runned);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
package me.wiefferink.areashop.listeners;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.features.SignsFeature;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion.ClickType;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
|
||||
public class SignClickListener implements Listener {
|
||||
private AreaShop plugin;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param plugin The AreaShop plugin
|
||||
*/
|
||||
public SignClickListener(AreaShop plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a player interacts
|
||||
* @param event The event
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onSignClick(PlayerInteractEvent event) {
|
||||
if(event.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
Block block = event.getClickedBlock();
|
||||
// Check for clicking a sign and rightclicking
|
||||
if((event.getAction() == Action.RIGHT_CLICK_BLOCK || event.getAction() == Action.LEFT_CLICK_BLOCK)
|
||||
&& (block.getType() == Material.SIGN_POST || block.getType() == Material.WALL_SIGN)) {
|
||||
// Check if the rent sign is really the same as a saved rent
|
||||
SignsFeature.RegionSign regionSign = SignsFeature.getSignByLocation(block.getLocation());
|
||||
if(regionSign == null) {
|
||||
return;
|
||||
}
|
||||
Player player = event.getPlayer();
|
||||
if(plugin.getSignlinkerManager().isInSignLinkMode(player)) {
|
||||
return;
|
||||
}
|
||||
// Get the clicktype
|
||||
ClickType clickType = null;
|
||||
if(player.isSneaking() && event.getAction() == Action.LEFT_CLICK_BLOCK) {
|
||||
clickType = ClickType.SHIFTLEFTCLICK;
|
||||
} else if(!player.isSneaking() && event.getAction() == Action.LEFT_CLICK_BLOCK) {
|
||||
clickType = ClickType.LEFTCLICK;
|
||||
} else if(player.isSneaking() && event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
||||
clickType = ClickType.SHIFTRIGHTCLICK;
|
||||
} else if(!player.isSneaking() && event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
||||
clickType = ClickType.RIGHTCLICK;
|
||||
}
|
||||
// Run the commands
|
||||
boolean ran = regionSign.runSignCommands(player, clickType);
|
||||
// Only cancel event if at least one command has been executed
|
||||
event.setCancelled(ran);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+186
-190
@@ -1,190 +1,186 @@
|
||||
package nl.evolutioncoding.AreaShop;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.SortedSet;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import nl.evolutioncoding.AreaShop.commands.AddCommand;
|
||||
import nl.evolutioncoding.AreaShop.commands.AddsignCommand;
|
||||
import nl.evolutioncoding.AreaShop.commands.BuyCommand;
|
||||
import nl.evolutioncoding.AreaShop.commands.CommandAreaShop;
|
||||
import nl.evolutioncoding.AreaShop.commands.DelCommand;
|
||||
import nl.evolutioncoding.AreaShop.commands.DelsignCommand;
|
||||
import nl.evolutioncoding.AreaShop.commands.FindCommand;
|
||||
import nl.evolutioncoding.AreaShop.commands.GroupaddCommand;
|
||||
import nl.evolutioncoding.AreaShop.commands.GroupdelCommand;
|
||||
import nl.evolutioncoding.AreaShop.commands.GroupinfoCommand;
|
||||
import nl.evolutioncoding.AreaShop.commands.GrouplistCommand;
|
||||
import nl.evolutioncoding.AreaShop.commands.HelpCommand;
|
||||
import nl.evolutioncoding.AreaShop.commands.InfoCommand;
|
||||
import nl.evolutioncoding.AreaShop.commands.ReloadCommand;
|
||||
import nl.evolutioncoding.AreaShop.commands.RentCommand;
|
||||
import nl.evolutioncoding.AreaShop.commands.RentdurationCommand;
|
||||
import nl.evolutioncoding.AreaShop.commands.SchematiceventCommand;
|
||||
import nl.evolutioncoding.AreaShop.commands.SellCommand;
|
||||
import nl.evolutioncoding.AreaShop.commands.SetpriceCommand;
|
||||
import nl.evolutioncoding.AreaShop.commands.SetrestoreCommand;
|
||||
import nl.evolutioncoding.AreaShop.commands.SetteleportCommand;
|
||||
import nl.evolutioncoding.AreaShop.commands.TeleportCommand;
|
||||
import nl.evolutioncoding.AreaShop.commands.UnrentCommand;
|
||||
import nl.evolutioncoding.AreaShop.commands.UpdatebuysCommand;
|
||||
import nl.evolutioncoding.AreaShop.commands.UpdaterentsCommand;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabCompleter;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class CommandManager implements CommandExecutor, TabCompleter {
|
||||
AreaShop plugin;
|
||||
ArrayList<CommandAreaShop> commands;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param plugin The AreaShop plugin
|
||||
*/
|
||||
public CommandManager(AreaShop plugin) {
|
||||
this.plugin = plugin;
|
||||
commands = new ArrayList<CommandAreaShop>();
|
||||
commands.add(new HelpCommand(plugin));
|
||||
commands.add(new RentCommand(plugin));
|
||||
commands.add(new UnrentCommand(plugin));
|
||||
commands.add(new BuyCommand(plugin));
|
||||
commands.add(new SellCommand(plugin));
|
||||
commands.add(new InfoCommand(plugin));
|
||||
commands.add(new TeleportCommand(plugin));
|
||||
commands.add(new SetteleportCommand(plugin));
|
||||
commands.add(new FindCommand(plugin));
|
||||
commands.add(new UpdaterentsCommand(plugin));
|
||||
commands.add(new UpdatebuysCommand(plugin));
|
||||
commands.add(new SetrestoreCommand(plugin));
|
||||
commands.add(new SetpriceCommand(plugin));
|
||||
commands.add(new RentdurationCommand(plugin));
|
||||
commands.add(new ReloadCommand(plugin));
|
||||
commands.add(new GroupaddCommand(plugin));
|
||||
commands.add(new GroupdelCommand(plugin));
|
||||
commands.add(new GrouplistCommand(plugin));
|
||||
commands.add(new GroupinfoCommand(plugin));
|
||||
commands.add(new SchematiceventCommand(plugin));
|
||||
commands.add(new AddCommand(plugin));
|
||||
commands.add(new DelCommand(plugin));
|
||||
commands.add(new AddsignCommand(plugin));
|
||||
commands.add(new DelsignCommand(plugin));
|
||||
|
||||
/* Register commands in bukkit */
|
||||
plugin.getCommand("AreaShop").setExecutor(this);
|
||||
plugin.getCommand("AreaShop").setTabCompleter(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list with AreaShop commands
|
||||
* @return The list with AreaShop commands
|
||||
*/
|
||||
public ArrayList<CommandAreaShop> getCommands() {
|
||||
return commands;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows the help page for the CommandSender
|
||||
* @param target The CommandSender to show the help to
|
||||
*/
|
||||
public void showHelp(CommandSender target) {
|
||||
/* Add all messages to a list */
|
||||
ArrayList<String> messages = new ArrayList<String>();
|
||||
messages.add(plugin.config().getString("chatPrefix") + plugin.getLanguageManager().getLang("help-header"));
|
||||
messages.add(plugin.config().getString("chatPrefix") + plugin.getLanguageManager().getLang("help-alias"));
|
||||
for(CommandAreaShop command : commands) {
|
||||
String help = command.getHelp(target);
|
||||
if(help != null && help.length() != 0) {
|
||||
messages.add(help);
|
||||
}
|
||||
}
|
||||
|
||||
/* Send the messages to the target */
|
||||
for(String message : messages) {
|
||||
if(!plugin.config().getBoolean("useColorsInConsole") && !(target instanceof Player)) {
|
||||
target.sendMessage(ChatColor.stripColor(plugin.fixColors(message)));
|
||||
} else {
|
||||
target.sendMessage(plugin.fixColors(message));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String alias, String[] args) {
|
||||
boolean executed = false;
|
||||
for(int i=0; i<commands.size() && !executed; i++) {
|
||||
if(commands.get(i).canExecute(command, args)) {
|
||||
commands.get(i).execute(sender, command, args);
|
||||
executed = true;
|
||||
}
|
||||
}
|
||||
if(!executed && args.length == 0) {
|
||||
this.showHelp(sender);
|
||||
} else if(!executed && args.length > 0) {
|
||||
plugin.message(sender, "cmd-notValid");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
List<String> result = new ArrayList<String>();
|
||||
if(!sender.hasPermission("areashop.tabcomplete")) {
|
||||
return result;
|
||||
}
|
||||
int toCompleteNumber = args.length;
|
||||
String toCompletePrefix = args[args.length-1].toLowerCase();
|
||||
AreaShop.debug("toCompleteNumber=" + toCompleteNumber + ", toCompletePrefix=" + toCompletePrefix + ", length=" + toCompletePrefix.length());
|
||||
if(toCompleteNumber == 1) {
|
||||
for(CommandAreaShop c : commands) {
|
||||
String begin = c.getCommandStart();
|
||||
result.add(begin.substring(begin.indexOf(' ') +1));
|
||||
}
|
||||
} else {
|
||||
String[] start = new String[args.length];
|
||||
start[0] = command.getName();
|
||||
for(int i=1; i<args.length; i++) {
|
||||
start[i] = args[i-1];
|
||||
}
|
||||
for(CommandAreaShop c : commands) {
|
||||
if(c.canExecute(command, args)) {
|
||||
result = c.getTabCompleteList(toCompleteNumber, start);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Filter and sort the results
|
||||
if(result.size() > 0) {
|
||||
SortedSet<String> set = new TreeSet<String>();
|
||||
for(String suggestion : result) {
|
||||
if(suggestion.toLowerCase().startsWith(toCompletePrefix)) {
|
||||
set.add(suggestion);
|
||||
}
|
||||
}
|
||||
result.clear();
|
||||
result.addAll(set);
|
||||
}
|
||||
AreaShop.debug("Tabcomplete #" + toCompleteNumber + ", prefix="+ toCompletePrefix + ", result=" + result.toString());
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
package me.wiefferink.areashop.managers;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.commands.*;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabCompleter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.SortedSet;
|
||||
import java.util.TreeSet;
|
||||
|
||||
public class CommandManager implements CommandExecutor, TabCompleter {
|
||||
private AreaShop plugin;
|
||||
private ArrayList<CommandAreaShop> commands;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param plugin The AreaShop plugin
|
||||
*/
|
||||
public CommandManager(AreaShop plugin) {
|
||||
this.plugin = plugin;
|
||||
commands = new ArrayList<>();
|
||||
commands.add(new HelpCommand(plugin));
|
||||
commands.add(new RentCommand(plugin));
|
||||
commands.add(new UnrentCommand(plugin));
|
||||
commands.add(new BuyCommand(plugin));
|
||||
commands.add(new SellCommand(plugin));
|
||||
commands.add(new MeCommand(plugin));
|
||||
commands.add(new InfoCommand(plugin));
|
||||
commands.add(new TeleportCommand(plugin));
|
||||
commands.add(new SetteleportCommand(plugin));
|
||||
commands.add(new AddfriendCommand(plugin));
|
||||
commands.add(new DelfriendCommand(plugin));
|
||||
commands.add(new FindCommand(plugin));
|
||||
commands.add(new ResellCommand(plugin));
|
||||
commands.add(new StopresellCommand(plugin));
|
||||
commands.add(new SetrestoreCommand(plugin));
|
||||
commands.add(new SetpriceCommand(plugin));
|
||||
commands.add(new SetownerCommand(plugin));
|
||||
commands.add(new SetdurationCommand(plugin));
|
||||
commands.add(new ReloadCommand(plugin));
|
||||
commands.add(new GroupaddCommand(plugin));
|
||||
commands.add(new GroupdelCommand(plugin));
|
||||
commands.add(new GrouplistCommand(plugin));
|
||||
commands.add(new GroupinfoCommand(plugin));
|
||||
commands.add(new SchematiceventCommand(plugin));
|
||||
commands.add(new AddCommand(plugin));
|
||||
commands.add(new DelCommand(plugin));
|
||||
commands.add(new AddsignCommand(plugin));
|
||||
commands.add(new DelsignCommand(plugin));
|
||||
commands.add(new LinksignsCommand(plugin));
|
||||
commands.add(new StackCommand(plugin));
|
||||
commands.add(new SetlandlordCommand(plugin));
|
||||
commands.add(new MessageCommand(plugin));
|
||||
|
||||
// Register commands in bukkit
|
||||
plugin.getCommand("AreaShop").setExecutor(this);
|
||||
plugin.getCommand("AreaShop").setTabCompleter(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list with AreaShop commands
|
||||
* @return The list with AreaShop commands
|
||||
*/
|
||||
public ArrayList<CommandAreaShop> getCommands() {
|
||||
return commands;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows the help page for the CommandSender
|
||||
* @param target The CommandSender to show the help to
|
||||
*/
|
||||
public void showHelp(CommandSender target) {
|
||||
if(!target.hasPermission("areashop.help")) {
|
||||
plugin.message(target, "help-noPermission");
|
||||
return;
|
||||
}
|
||||
// Add all messages to a list
|
||||
ArrayList<String> messages = new ArrayList<>();
|
||||
plugin.message(target, "help-header");
|
||||
plugin.message(target, "help-alias");
|
||||
for(CommandAreaShop command : commands) {
|
||||
String help = command.getHelp(target);
|
||||
if(help != null && help.length() != 0) {
|
||||
messages.add(help);
|
||||
}
|
||||
}
|
||||
// Send the messages to the target
|
||||
for(String message : messages) {
|
||||
plugin.messageNoPrefix(target, message);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String alias, String[] args) {
|
||||
if(!plugin.isReady()) {
|
||||
plugin.message(sender, "general-notReady");
|
||||
return true;
|
||||
}
|
||||
// Redirect `/as info player <player>` to `/as me <player>`
|
||||
if(args.length == 3 && "info".equals(args[0]) && "player".equals(args[1])) {
|
||||
args[0] = "me";
|
||||
args[1] = args[2];
|
||||
}
|
||||
// Execute command
|
||||
boolean executed = false;
|
||||
for(int i=0; i<commands.size() && !executed; i++) {
|
||||
if(commands.get(i).canExecute(command, args)) {
|
||||
commands.get(i).execute(sender, args);
|
||||
executed = true;
|
||||
}
|
||||
}
|
||||
if(!executed && args.length == 0) {
|
||||
this.showHelp(sender);
|
||||
} else if(!executed && args.length > 0) {
|
||||
// Indicate that the '/as updaterents' and '/as updatebuys' commands are removed
|
||||
if("updaterents".equalsIgnoreCase(args[0]) || "updatebuys".equalsIgnoreCase(args[0])) {
|
||||
plugin.message(sender, "reload-updateCommandChanged");
|
||||
} else {
|
||||
plugin.message(sender, "cmd-notValid");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
List<String> result = new ArrayList<>();
|
||||
if(!sender.hasPermission("areashop.tabcomplete")) {
|
||||
return result;
|
||||
}
|
||||
int toCompleteNumber = args.length;
|
||||
String toCompletePrefix = args[args.length-1].toLowerCase();
|
||||
//AreaShop.debug("toCompleteNumber=" + toCompleteNumber + ", toCompletePrefix=" + toCompletePrefix + ", length=" + toCompletePrefix.length());
|
||||
if(toCompleteNumber == 1) {
|
||||
for(CommandAreaShop c : commands) {
|
||||
String begin = c.getCommandStart();
|
||||
result.add(begin.substring(begin.indexOf(' ') +1));
|
||||
}
|
||||
} else {
|
||||
String[] start = new String[args.length];
|
||||
start[0] = command.getName();
|
||||
for(int i=1; i<args.length; i++) {
|
||||
start[i] = args[i-1];
|
||||
}
|
||||
for(CommandAreaShop c : commands) {
|
||||
if(c.canExecute(command, args)) {
|
||||
result = c.getTabCompleteList(toCompleteNumber, start, sender);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Filter and sort the results
|
||||
if(result.size() > 0) {
|
||||
SortedSet<String> set = new TreeSet<>();
|
||||
for(String suggestion : result) {
|
||||
if(suggestion.toLowerCase().startsWith(toCompletePrefix)) {
|
||||
set.add(suggestion);
|
||||
}
|
||||
}
|
||||
result.clear();
|
||||
result.addAll(set);
|
||||
}
|
||||
//AreaShop.debug("Tabcomplete #" + toCompleteNumber + ", prefix="+ toCompletePrefix + ", result=" + result.toString());
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,220 @@
|
||||
package me.wiefferink.areashop.managers;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.features.SignsFeature;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.material.Sign;
|
||||
import org.bukkit.util.BlockIterator;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class SignLinkerManager implements Listener {
|
||||
private AreaShop plugin = null;
|
||||
private Map<UUID, SignLinker> signLinkers;
|
||||
private boolean eventsRegistered;
|
||||
|
||||
public SignLinkerManager(AreaShop plugin) {
|
||||
this.plugin = plugin;
|
||||
signLinkers = new HashMap<>();
|
||||
eventsRegistered = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Let a player enter sign linking mode
|
||||
* @param player The player that has to enter sign linking mode
|
||||
* @param profile The profile to use for the signs (null for default)
|
||||
*/
|
||||
public void enterSignLinkMode(Player player, String profile) {
|
||||
signLinkers.put(player.getUniqueId(), new SignLinker(player, profile));
|
||||
plugin.message(player, "linksigns-first");
|
||||
plugin.message(player, "linksigns-next");
|
||||
if(!eventsRegistered) {
|
||||
eventsRegistered = true;
|
||||
plugin.getServer().getPluginManager().registerEvents(this, plugin);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Let a player exit sign linking mode
|
||||
* @param player The player that has to exit sign linking mode
|
||||
*/
|
||||
public void exitSignLinkMode(Player player) {
|
||||
signLinkers.remove(player.getUniqueId());
|
||||
if(eventsRegistered && signLinkers.isEmpty()) {
|
||||
eventsRegistered = false;
|
||||
HandlerList.unregisterAll(this);
|
||||
}
|
||||
plugin.message(player, "linksigns-stopped");
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the player is in sign linking mode
|
||||
* @param player The player to check
|
||||
* @return true if the player is in sign linking mode, otherwise false
|
||||
*/
|
||||
public boolean isInSignLinkMode(Player player) {
|
||||
return signLinkers.containsKey(player.getUniqueId());
|
||||
}
|
||||
|
||||
/**
|
||||
* On player interactions
|
||||
* @param event The PlayerInteractEvent
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onPlayerInteract(PlayerInteractEvent event) {
|
||||
if(isInSignLinkMode(event.getPlayer())) {
|
||||
event.setCancelled(true);
|
||||
Player player = event.getPlayer();
|
||||
SignLinker linker = signLinkers.get(event.getPlayer().getUniqueId());
|
||||
if(event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
||||
// Get the region
|
||||
BlockIterator blockIterator = new BlockIterator(player, 100);
|
||||
while(blockIterator.hasNext()) {
|
||||
Block next = blockIterator.next();
|
||||
List<GeneralRegion> regions = Utils.getASRegionsByLocation(next.getLocation());
|
||||
if(regions.size() == 1) {
|
||||
linker.setRegion(regions.get(0));
|
||||
return;
|
||||
} else if(regions.size() > 1) {
|
||||
Set<String> names = new HashSet<>();
|
||||
for(GeneralRegion region : regions) {
|
||||
names.add(region.getName());
|
||||
}
|
||||
plugin.message(player, "linksigns-multipleRegions", Utils.createCommaSeparatedList(names));
|
||||
plugin.message(player, "linksigns-multipleRegionsAdvice");
|
||||
return;
|
||||
}
|
||||
}
|
||||
// No regions found within the maximum range
|
||||
plugin.message(player, "linksigns-noRegions");
|
||||
} else if(event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.LEFT_CLICK_BLOCK) {
|
||||
Block block = null;
|
||||
BlockIterator blockIterator = new BlockIterator(player, 100);
|
||||
while(blockIterator.hasNext() && block == null) {
|
||||
Block next = blockIterator.next();
|
||||
if(next.getType() != Material.AIR) {
|
||||
block = next;
|
||||
}
|
||||
}
|
||||
if(block == null || !(block.getType() == Material.WALL_SIGN || block.getType() == Material.SIGN_POST)) {
|
||||
plugin.message(player, "linksigns-noSign");
|
||||
return;
|
||||
}
|
||||
|
||||
SignsFeature.RegionSign regionSign = SignsFeature.getSignByLocation(block.getLocation());
|
||||
if(regionSign != null) {
|
||||
plugin.message(player, "linksigns-alreadyRegistered", regionSign.getRegion());
|
||||
return;
|
||||
}
|
||||
Sign sign = (Sign)block.getState().getData();
|
||||
linker.setSign(block.getLocation(), block.getType(), sign.getFacing());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle disconnection players
|
||||
* @param event The PlayerQuitEvent
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPlayerLeave(PlayerQuitEvent event) {
|
||||
signLinkers.remove(event.getPlayer().getUniqueId());
|
||||
}
|
||||
|
||||
/**
|
||||
* Class to keep track of the signlinking data
|
||||
*/
|
||||
private class SignLinker {
|
||||
private boolean hasSign = false;
|
||||
private boolean hasRegion = false;
|
||||
|
||||
public Player linker = null;
|
||||
public String profile = null;
|
||||
|
||||
public GeneralRegion region = null;
|
||||
|
||||
public Location location = null;
|
||||
public Material type = null;
|
||||
public BlockFace facing = null;
|
||||
|
||||
public SignLinker(Player linker, String profile) {
|
||||
this.linker = linker;
|
||||
this.profile = profile;
|
||||
}
|
||||
|
||||
public void setRegion(GeneralRegion region) {
|
||||
this.region = region;
|
||||
hasRegion = true;
|
||||
if(!isComplete()) {
|
||||
plugin.message(linker, "linksigns-regionFound", region);
|
||||
}
|
||||
finish();
|
||||
}
|
||||
|
||||
public void setSign(Location location, Material type, BlockFace facing) {
|
||||
this.location = location;
|
||||
this.type = type;
|
||||
this.facing = facing;
|
||||
hasSign = true;
|
||||
if(!isComplete()) {
|
||||
plugin.message(linker, "linksigns-signFound", location.getBlockX(), location.getBlockY(), location.getBlockZ());
|
||||
}
|
||||
finish();
|
||||
}
|
||||
|
||||
public void finish() {
|
||||
if(isComplete()) {
|
||||
region.getSignsFeature().addSign(location, type, facing, profile);
|
||||
if(profile == null) {
|
||||
plugin.message(linker, "addsign-success", region);
|
||||
} else {
|
||||
plugin.message(linker, "addsign-successProfile", region, profile);
|
||||
}
|
||||
region.update();
|
||||
reset();
|
||||
|
||||
plugin.message(linker, "linksigns-next");
|
||||
}
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
hasSign = false;
|
||||
hasRegion = false;
|
||||
}
|
||||
|
||||
public boolean isComplete() {
|
||||
return hasSign && hasRegion;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,875 @@
|
||||
package me.wiefferink.areashop.messages;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* FancyMessageFormat converter, a library that enables to convert
|
||||
* messages in the FancyMessageFormat to Minecraft's bulky tellraw
|
||||
* format.
|
||||
* @author NLThijs48 | http://wiefferink.me
|
||||
* @author Tobias aka Phoenix | http://www.phoenix-iv.de
|
||||
*/
|
||||
public class FancyMessageFormat {
|
||||
|
||||
private static final char TAG_BEFORE = '[';
|
||||
private static final char TAG_AFTER = ']';
|
||||
private static final char END_TAG_INDICATOR = '/';
|
||||
|
||||
/**
|
||||
* The special character that prefixes all basic chat formatting codes.
|
||||
*/
|
||||
private static final char SIMPLE_FORMAT_PREFIX_CHAR = '\u00A7';
|
||||
|
||||
/**
|
||||
* Resets all previous chat colors or formats.
|
||||
*/
|
||||
private static final char SIMPLE_FORMAT_RESET_CHAR = 'r';
|
||||
|
||||
/**
|
||||
* Lookup table for all continuous tags (marked by [])
|
||||
*/
|
||||
private static final HashMap<String, Tag> BRACKET_TAG_LIST = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Lookup table for all interactive tags
|
||||
*/
|
||||
private static final HashMap<String, Tag> INTERACTIVE_TAG_LIST = new HashMap<>();
|
||||
|
||||
static {
|
||||
// Enlist all possible tags
|
||||
// (They go into a HashMap for lookup purposes)
|
||||
cacheTags(BRACKET_TAG_LIST, Color.class);
|
||||
cacheTags(BRACKET_TAG_LIST, FormatType.class);
|
||||
cacheTags(BRACKET_TAG_LIST, FormatCloseTag.class);
|
||||
cacheTags(BRACKET_TAG_LIST, ControlTag.class);
|
||||
// Interactive tags
|
||||
cacheTags(INTERACTIVE_TAG_LIST, ClickType.class);
|
||||
cacheTags(INTERACTIVE_TAG_LIST, HoverType.class);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Puts all constants in the given Tag class into the given lookup table.
|
||||
*/
|
||||
private static <T extends Tag> void cacheTags(HashMap<String, Tag> tagList, Class<T> tags) {
|
||||
for(Tag tag : tags.getEnumConstants()) {
|
||||
for(String key : tag.getTags()) {
|
||||
tagList.put(key, tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------------------
|
||||
// ------------------------------- Public / Interface -------------------------------
|
||||
// ------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
/**
|
||||
* Parses the given FancyMessageFormat message to a JSON array that can be
|
||||
* used with the tellraw command and the like.
|
||||
* @param message The mesage to convert to JSON
|
||||
* @return JSON string that can be send to a player
|
||||
*/
|
||||
public static String convertToJSON(final String message) {
|
||||
return convertToJSON(Collections.singleton(message));
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses the given FancyMessageFormat message to a JSON array that can be
|
||||
* used with the tellraw command and the like.
|
||||
* @param inputLines Input message split at line breaks.
|
||||
* @return JSON string that can be send to a player
|
||||
*/
|
||||
public static String convertToJSON(final Iterable<String> inputLines) {
|
||||
ArrayList<String> lines = cleanInputString(inputLines);
|
||||
|
||||
LinkedList<InteractiveMessagePart> message = parse(lines);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("[");
|
||||
if(message.size() == 1) {
|
||||
sb.append(message.getFirst().toJSON());
|
||||
} else if(message.size() > 0) {
|
||||
sb.append("{\"text\":\"\",\"extra\":[");
|
||||
for(InteractiveMessagePart messagePart : message) {
|
||||
sb.append(messagePart.toJSON());
|
||||
sb.append(',');
|
||||
}
|
||||
sb.deleteCharAt(sb.length()-1);
|
||||
sb.append("]}");
|
||||
}
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Parses the given FancyMessageFormat message to a String containing control characters
|
||||
* for formatting that can be used for console outputs, but also for normal player
|
||||
* messages.
|
||||
* <p>
|
||||
* The returned message will only contain colors, bold, italic, underlining and 'magic'
|
||||
* characters. Hovers and other advanced tellraw tags will be skipped.
|
||||
* @param message Input message split at line breaks.
|
||||
* @return Plain message that can be send
|
||||
*/
|
||||
public static String convertToConsole(final String message) {
|
||||
return convertToConsole(Collections.singleton(message));
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses the given FancyMessageFormat message to a String containing control characters
|
||||
* for formatting that can be used for console outputs, but also for normal player
|
||||
* messages.
|
||||
* <p>
|
||||
* The returned message will only contain colors, bold, italic, underlining and 'magic'
|
||||
* characters. Hovers and other advanced tellraw tags will be skipped.
|
||||
* @param inputLines The raw message lines to process
|
||||
* @return Plain message that can be send
|
||||
*/
|
||||
public static String convertToConsole(final Iterable<String> inputLines) {
|
||||
if(inputLines == null) {
|
||||
return null;
|
||||
}
|
||||
LinkedList<InteractiveMessagePart> parts = parse(inputLines, false);
|
||||
StringBuilder result = new StringBuilder();
|
||||
for(InteractiveMessagePart part : parts) {
|
||||
result.append(part.toSimpleString());
|
||||
}
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Insert a message at the specified position
|
||||
* @param message The current message
|
||||
* @param insert The message to insert
|
||||
* @param line The line number to insert at
|
||||
* @param start The start of the variable to replace
|
||||
* @param end The end of the variable to replace
|
||||
*/
|
||||
public static void insertMessage(List<String> message, List<String> insert, int line, int start, int end) {
|
||||
if(insert == null || line < 0 || line >= message.size() || start < 0 || end < 0) {
|
||||
return;
|
||||
}
|
||||
String lineContent = message.remove(line);
|
||||
if(start > lineContent.length() || end > lineContent.length()) {
|
||||
return;
|
||||
}
|
||||
if(isTaggedInteractive(lineContent)) {
|
||||
lineContent = lineContent.replace("", "");
|
||||
message.add(line, lineContent.substring(0, start)+convertToConsole(insert)+lineContent.substring(end));
|
||||
return;
|
||||
}
|
||||
// Find interactive lines meant for this message
|
||||
List<String> interactives = new ArrayList<>();
|
||||
while(line < message.size() && isTaggedInteractive(message.get(line))) {
|
||||
interactives.add(message.remove(line));
|
||||
}
|
||||
// Split the line and add the parts
|
||||
int at = line;
|
||||
if(start > 0) {
|
||||
message.add(line, lineContent.substring(0, start));
|
||||
at++;
|
||||
message.addAll(at, interactives);
|
||||
at += interactives.size();
|
||||
}
|
||||
message.addAll(at, insert);
|
||||
at += insert.size();
|
||||
message.addAll(at, interactives);
|
||||
at += interactives.size();
|
||||
if(end < lineContent.length()) {
|
||||
message.add(at, lineContent.substring(end));
|
||||
at++;
|
||||
message.addAll(at, interactives);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------------------
|
||||
// ------------------------------- Private functions -------------------------------
|
||||
// ------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
/**
|
||||
* <ul>
|
||||
* <li>Splits lines at line breaks (creating a new line in the Array).
|
||||
* <li>Removes empty lines at the beginning.
|
||||
* <li>Removes lines with properties in front of the first text-line.
|
||||
* </ul>
|
||||
*/
|
||||
private static ArrayList<String> cleanInputString(Iterable<String> inputLines) {
|
||||
// Split lines at line breaks
|
||||
// In the end we will have a list with one line per element
|
||||
ArrayList<String> lines = new ArrayList<>();
|
||||
for(String line : inputLines) {
|
||||
lines.addAll(Arrays.asList(line.split("\\r?\\n")));
|
||||
}
|
||||
|
||||
// Remove any special lines at the start (a real text line should be first)
|
||||
while(!lines.isEmpty() && isTaggedInteractive(lines.get(0))) {
|
||||
lines.remove(0);
|
||||
}
|
||||
|
||||
return lines;
|
||||
}
|
||||
|
||||
|
||||
private static LinkedList<InteractiveMessagePart> parse(Iterable<String> inputLines) {
|
||||
return parse(inputLines, true);
|
||||
}
|
||||
|
||||
private static LinkedList<InteractiveMessagePart> parse(final Iterable<String> inputLines, boolean doInteractives) {
|
||||
LinkedList<InteractiveMessagePart> message = new LinkedList<>();
|
||||
|
||||
Color currentColor = null;
|
||||
Set<FormatType> currentFormatting = new HashSet<>();
|
||||
|
||||
lineLoop:
|
||||
for(String line : inputLines) {
|
||||
InteractiveMessagePart messagePart;
|
||||
TaggedContent interactiveTag = getInteractiveTag(line);
|
||||
boolean isTextLine = interactiveTag == null;
|
||||
if(!doInteractives && !isTextLine) {
|
||||
continue;
|
||||
}
|
||||
boolean isHoverLine = false;
|
||||
|
||||
if(isTextLine) {
|
||||
messagePart = new InteractiveMessagePart();
|
||||
message.add(messagePart);
|
||||
} else /* if Interactive formatting */ {
|
||||
if(message.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
messagePart = message.getLast();
|
||||
Tag tag = interactiveTag.tag;
|
||||
if(tag instanceof ClickType) {
|
||||
messagePart.clickType = (ClickType)interactiveTag.tag;
|
||||
messagePart.clickContent = interactiveTag.subsequentContent;
|
||||
} else if(tag instanceof HoverType) {
|
||||
line = interactiveTag.subsequentContent;
|
||||
isHoverLine = true;
|
||||
if(messagePart.hoverType != tag) {
|
||||
// Hover type changed
|
||||
messagePart.hoverContent = new LinkedList<>();
|
||||
messagePart.hoverType = (HoverType)tag;
|
||||
}
|
||||
// Add hover content below
|
||||
}
|
||||
}
|
||||
|
||||
if(isTextLine || isHoverLine) {
|
||||
// Parse inline tags
|
||||
|
||||
Color currentLineColor = currentColor;
|
||||
Set<FormatType> currentLineFormatting = currentFormatting;
|
||||
LinkedList<TextMessagePart> targetList = messagePart.content;
|
||||
boolean parseBreak = true;
|
||||
if(isHoverLine) {
|
||||
// Reset - use own
|
||||
currentLineColor = null;
|
||||
currentLineFormatting = new HashSet<>();
|
||||
targetList = messagePart.hoverContent;
|
||||
parseBreak = false;
|
||||
|
||||
// Add line break after previous hover line
|
||||
if(!targetList.isEmpty()) {
|
||||
targetList.getLast().text += '\n';
|
||||
}
|
||||
}
|
||||
|
||||
// Split into pieces at places where formatting changes
|
||||
while(!line.isEmpty()) {
|
||||
String textToAdd;
|
||||
TaggedContent nextTag = getNextTag(line, parseBreak);
|
||||
boolean tagged = nextTag != null;
|
||||
|
||||
if(!tagged) {
|
||||
textToAdd = line;
|
||||
line = "";
|
||||
} else {
|
||||
textToAdd = nextTag.precedingContent;
|
||||
line = nextTag.subsequentContent;
|
||||
}
|
||||
|
||||
// Add a text part with the correct formatting
|
||||
if((tagged && nextTag.tag == ControlTag.BREAK) || !textToAdd.isEmpty()) {
|
||||
TextMessagePart part = new TextMessagePart();
|
||||
part.text = textToAdd;
|
||||
part.formatTypes = new HashSet<>(currentLineFormatting);
|
||||
part.color = currentLineColor;
|
||||
targetList.add(part);
|
||||
}
|
||||
|
||||
// Handle the change in formatting if a Tag has been detected (this needs to be after creating the InteractiveMessagePart)
|
||||
if(tagged) {
|
||||
// Handle the formatting tag
|
||||
Tag tag = nextTag.tag;
|
||||
if(tag instanceof Color) {
|
||||
currentLineColor = (Color)tag;
|
||||
} else if(tag instanceof FormatType) {
|
||||
currentLineFormatting.add((FormatType)tag);
|
||||
} else if(tag instanceof FormatCloseTag) {
|
||||
currentLineFormatting.remove(((FormatCloseTag)tag).closes);
|
||||
} else if(tag == ControlTag.BREAK) {
|
||||
if(!targetList.isEmpty()) {
|
||||
targetList.getLast().text += '\n';
|
||||
}
|
||||
continue lineLoop;
|
||||
} else if(tag == ControlTag.RESET) {
|
||||
currentLineFormatting.clear();
|
||||
currentLineColor = Color.WHITE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!isHoverLine) {
|
||||
// Adapt global attributes
|
||||
currentColor = currentLineColor;
|
||||
if(messagePart.content.size() == 0) { // Prevent interactive parts without content
|
||||
message.removeLast();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Searches and returns the first continuous tag found in the given String.
|
||||
* @return The tag (plus its preceding and subsequent content) if found.
|
||||
* Null if nothing is found.
|
||||
*/
|
||||
private static TaggedContent getNextTag(String line, boolean parseBreak) {
|
||||
Pattern pattern = Pattern.compile("\\[[/a-zA-Z1-9]+\\]|&[1-9abcdeflonskr]");
|
||||
Matcher matcher = pattern.matcher(line);
|
||||
// TODO Fix for escape things, and something with parseBreak?
|
||||
while(matcher.find()) {
|
||||
Tag tag = null;
|
||||
if(matcher.group().startsWith("&")) {
|
||||
for(Color color : Color.class.getEnumConstants()) {
|
||||
if(color.getNativeFormattingCode() == matcher.group().charAt(1)) {
|
||||
tag = color;
|
||||
}
|
||||
}
|
||||
for(FormatType format : FormatType.class.getEnumConstants()) {
|
||||
if(format.getNativeFormattingCode() == matcher.group().charAt(1)) {
|
||||
tag = format;
|
||||
}
|
||||
}
|
||||
if(matcher.group().charAt(1) == SIMPLE_FORMAT_RESET_CHAR) {
|
||||
tag = ControlTag.RESET;
|
||||
}
|
||||
} else {
|
||||
tag = BRACKET_TAG_LIST.get(matcher.group().substring(1, matcher.group().length()-1).toLowerCase());
|
||||
}
|
||||
// Continue search if we found something like [abc] that is not a tag
|
||||
if(tag != null) {
|
||||
return new TaggedContent(line.substring(0, matcher.start()), tag, line.substring(matcher.end()));
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
/*
|
||||
for(int startIndex = 0; startIndex < line.length(); startIndex++) {
|
||||
int start = line.indexOf(TAG_BEFORE, startIndex);
|
||||
if(start != -1) {
|
||||
int end = line.indexOf(TAG_AFTER, start);
|
||||
if(end != -1) {
|
||||
String inBetween = line.substring(start+1, end).toLowerCase();
|
||||
if(BRACKET_TAG_LIST.containsKey(inBetween)) {
|
||||
Tag tag = BRACKET_TAG_LIST.get(inBetween);
|
||||
if(tag == ControlTag.ESCAPE) {
|
||||
// Ignore next char
|
||||
line = line.substring(0, start)+line.substring(end+1);
|
||||
startIndex = start;
|
||||
} else if(!parseBreak && tag == ControlTag.ESCAPE) {
|
||||
// Ignore break
|
||||
startIndex = end+1;
|
||||
} else {
|
||||
String previousContent = line.substring(0, start);
|
||||
String subsequentContent = line.substring(end+1);
|
||||
return new TaggedContent(previousContent, tag, subsequentContent);
|
||||
}
|
||||
} else {
|
||||
startIndex = start;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* If the given line defines an interactive property (e.g. "hover: myText")
|
||||
* the tag / property will be returned. Otherwise null is returned.
|
||||
*/
|
||||
private static TaggedContent getInteractiveTag(String line) {
|
||||
for(int index = 0; index < line.length(); index++) {
|
||||
char c = line.charAt(index);
|
||||
if(c == ' ' || c == '\t') {
|
||||
// Ignore (Skip spacing)
|
||||
} else {
|
||||
int end = line.indexOf(": ", index);
|
||||
if(end != -1) {
|
||||
String inBetween = line.substring(index, end).toLowerCase();
|
||||
if(INTERACTIVE_TAG_LIST.containsKey(inBetween)) {
|
||||
Tag tag = INTERACTIVE_TAG_LIST.get(inBetween);
|
||||
String subsequentContent = line.substring(end+2);
|
||||
return new TaggedContent(null, tag, subsequentContent);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if a line is an advanced declaration like hover or command
|
||||
* @param line The line to check
|
||||
* @return true if the line is interactive, false when it is a text line
|
||||
*/
|
||||
public static boolean isTaggedInteractive(String line) {
|
||||
return getInteractiveTag(line) != null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Produce a string in double quotes with backslash sequences in all the
|
||||
* right places.
|
||||
* @param string A String
|
||||
* @return A String correctly formatted for insertion in a JSON text.
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 2002 JSON.org
|
||||
* Licensed under the Apache License, Version 2.0
|
||||
*/
|
||||
private static String quoteStringJson(String string) {
|
||||
if(string == null || string.length() == 0) {
|
||||
return "\"\"";
|
||||
}
|
||||
|
||||
char c;
|
||||
int i;
|
||||
int len = string.length();
|
||||
StringBuilder sb = new StringBuilder(len+4);
|
||||
String t;
|
||||
|
||||
sb.append('"');
|
||||
for(i = 0; i < len; i += 1) {
|
||||
c = string.charAt(i);
|
||||
switch(c) {
|
||||
case '\\':
|
||||
case '"':
|
||||
sb.append('\\');
|
||||
sb.append(c);
|
||||
break;
|
||||
case '/':
|
||||
sb.append('\\');
|
||||
sb.append(c);
|
||||
break;
|
||||
case '\b':
|
||||
sb.append("\\b");
|
||||
break;
|
||||
case '\t':
|
||||
sb.append("\\t");
|
||||
break;
|
||||
case '\n':
|
||||
sb.append("\\n");
|
||||
break;
|
||||
case '\f':
|
||||
sb.append("\\f");
|
||||
break;
|
||||
case '\r':
|
||||
sb.append("\\r");
|
||||
break;
|
||||
default:
|
||||
if(c < ' ') {
|
||||
t = "000"+Integer.toHexString(c);
|
||||
sb.append("\\u");
|
||||
sb.append(t.substring(t.length()-4));
|
||||
} else {
|
||||
sb.append(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
sb.append('"');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------------------
|
||||
// ------------------------------- Helper classes -------------------------------
|
||||
// ------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
private static class TaggedContent {
|
||||
final String precedingContent;
|
||||
final Tag tag;
|
||||
final String subsequentContent;
|
||||
|
||||
public TaggedContent(String pre, Tag tag, String sub) {
|
||||
this.precedingContent = pre;
|
||||
this.tag = tag;
|
||||
this.subsequentContent = sub;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Holds a string with basic (non-interactive) formatting.
|
||||
*/
|
||||
private static class TextMessagePart {
|
||||
String text = "";
|
||||
Color color = null;
|
||||
Set<FormatType> formatTypes = new HashSet<>();
|
||||
|
||||
/**
|
||||
* Get a simple colored/formatted string
|
||||
* @return String with formatting
|
||||
*/
|
||||
String toSimpleString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
// Color
|
||||
if(color != null) {
|
||||
sb.append(SIMPLE_FORMAT_PREFIX_CHAR);
|
||||
sb.append(color.getNativeFormattingCode());
|
||||
}
|
||||
// Formatting
|
||||
for(FormatType format : formatTypes) {
|
||||
sb.append(SIMPLE_FORMAT_PREFIX_CHAR);
|
||||
sb.append(format.getNativeFormattingCode());
|
||||
}
|
||||
// Text
|
||||
sb.append(text);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a JSON component for this message part
|
||||
* @return This part formatted in JSON
|
||||
*/
|
||||
String toJSON() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append('{');
|
||||
sb.append("\"text\":").append(quoteStringJson(text));
|
||||
if(color != null && color != Color.WHITE) {
|
||||
sb.append(",\"color\":\"").append(color.jsonValue).append("\"");
|
||||
}
|
||||
for(FormatType formatting : formatTypes) {
|
||||
sb.append(",\"");
|
||||
sb.append(formatting.jsonKey).append("\":");
|
||||
sb.append("true");
|
||||
}
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
boolean hasFormatting() {
|
||||
return !(color == Color.WHITE && formatTypes.isEmpty());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TextMessagePart(text:"+text+", color:"+color+", formatting:"+formatTypes.toString()+")";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Holds a string with interactive formatting.
|
||||
*/
|
||||
private static class InteractiveMessagePart {
|
||||
|
||||
LinkedList<TextMessagePart> content = new LinkedList<>();
|
||||
|
||||
// Click
|
||||
ClickType clickType = null;
|
||||
String clickContent = "";
|
||||
|
||||
// Hover
|
||||
HoverType hoverType = null;
|
||||
LinkedList<TextMessagePart> hoverContent = null;
|
||||
|
||||
/**
|
||||
* Get a simple colored/formatted string
|
||||
* @return String with formatting
|
||||
*/
|
||||
String toSimpleString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for(TextMessagePart part : content) {
|
||||
sb.append(part.toSimpleString());
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a JSON component for this message part
|
||||
* @return This part formatted in JSON
|
||||
*/
|
||||
String toJSON() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if(content.size() == 1) {
|
||||
// Add attributes to TextMessagePart object
|
||||
sb.append(content.getFirst().toJSON());
|
||||
sb.deleteCharAt(sb.length()-1);
|
||||
} else {
|
||||
sb.append('{');
|
||||
sb.append("\"text\":\"\",\"extra\":[");
|
||||
for(TextMessagePart textPart : content) {
|
||||
sb.append(textPart.toJSON());
|
||||
sb.append(',');
|
||||
}
|
||||
sb.deleteCharAt(sb.length()-1);
|
||||
sb.append(']');
|
||||
}
|
||||
if(clickType != null) {
|
||||
sb.append(',');
|
||||
sb.append("\"clickEvent\":{");
|
||||
sb.append("\"action\":\"").append(clickType.getJsonKey()).append("\",");
|
||||
sb.append("\"value\":").append(quoteStringJson(clickContent));
|
||||
sb.append('}');
|
||||
}
|
||||
if(hoverType != null) {
|
||||
sb.append(',');
|
||||
sb.append("\"hoverEvent\":{");
|
||||
sb.append("\"action\":\"").append(hoverType.getJsonKey()).append("\",");
|
||||
sb.append("\"value\":");
|
||||
if(hoverContent.size() == 1) {
|
||||
TextMessagePart hoverPart = hoverContent.getFirst();
|
||||
if(hoverPart.hasFormatting()) {
|
||||
sb.append(hoverPart.toJSON());
|
||||
} else {
|
||||
sb.append(quoteStringJson(hoverPart.text));
|
||||
}
|
||||
} else {
|
||||
sb.append('[');
|
||||
for(TextMessagePart hoverPart : hoverContent) {
|
||||
sb.append(hoverPart.toJSON());
|
||||
sb.append(',');
|
||||
}
|
||||
sb.deleteCharAt(sb.length()-1);
|
||||
sb.append(']');
|
||||
}
|
||||
sb.append('}');
|
||||
}
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "InteractiveMessagePart(textMessageParts:"+content+", clickType:"+clickType+", clickContent:"+clickContent+", hoverType:"+hoverType+", hoverContent:"+hoverContent+")";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// --------------------------------------- Tags ---------------------------------------
|
||||
|
||||
|
||||
interface Tag {
|
||||
/**
|
||||
* Tag text(s) used in the FancyMessageFormat (The text between '[' and ']')
|
||||
*/
|
||||
String[] getTags();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Indicates formatting that is applied until explicitly stopped.
|
||||
* Can also be used in simple Minecraft messages (Non-JSON).
|
||||
*/
|
||||
interface ContinuousTag extends Tag {
|
||||
/**
|
||||
* The character that defines upcoming formatting in a native (non-JSON) Minecraft message.
|
||||
*/
|
||||
char getNativeFormattingCode();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Indicates formatting that allows cursor interaction. Requires the
|
||||
* Minecraft JSON / tellraw format.
|
||||
*/
|
||||
interface InteractiveMessageTag extends Tag {
|
||||
String getJsonKey();
|
||||
}
|
||||
|
||||
|
||||
enum Color implements ContinuousTag {
|
||||
WHITE('f'),
|
||||
BLACK('0'),
|
||||
BLUE('9'),
|
||||
DARK_BLUE('1', "darkblue"),
|
||||
GREEN('a'),
|
||||
DARK_GREEN('2', "darkgreen"),
|
||||
AQUA('b'),
|
||||
DARK_AQUA('3', "darkaqua"),
|
||||
RED('c'),
|
||||
DARK_RED('4', "darkred"),
|
||||
LIGHT_PURPLE('d', "lightpurple"),
|
||||
DARK_PURPLE('5', "darkpurple"),
|
||||
YELLOW('e'),
|
||||
GOLD('6'),
|
||||
GRAY('7', "grey"),
|
||||
DARK_GRAY('8', "dark_grey", "darkgray", "darkgrey");
|
||||
|
||||
final char bytecode;
|
||||
final String jsonValue;
|
||||
final String[] tags;
|
||||
|
||||
Color(char bytecode, String... extraTags) {
|
||||
this.bytecode = bytecode;
|
||||
this.jsonValue = this.name().toLowerCase();
|
||||
this.tags = new String[extraTags.length+1];
|
||||
this.tags[0] = this.name().toLowerCase();
|
||||
System.arraycopy(extraTags, 0, this.tags, 1, extraTags.length);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
@Override
|
||||
public char getNativeFormattingCode() {
|
||||
return bytecode;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
enum FormatType implements ContinuousTag {
|
||||
BOLD('l', "bold", "b", "bold"),
|
||||
ITALIC('o', "italic", "i", "italic"),
|
||||
UNDERLINE('n', "underlined", "u", "underline"),
|
||||
STRIKETHROUGH('s', "strikethrough", "s", "strike", "strikethrough"),
|
||||
OBFUSCATE('k', "obfuscated", "obfuscate");
|
||||
|
||||
final char bytecode;
|
||||
final String jsonKey;
|
||||
final String[] tags;
|
||||
|
||||
FormatType(char bytecode, String jsonKey, String... tags) {
|
||||
this.bytecode = bytecode;
|
||||
this.jsonKey = jsonKey;
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
@Override
|
||||
public char getNativeFormattingCode() {
|
||||
return bytecode;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
enum FormatCloseTag implements Tag {
|
||||
BOLD_END(FormatType.BOLD),
|
||||
ITALIC_END(FormatType.ITALIC),
|
||||
UNDERLINE_END(FormatType.UNDERLINE),
|
||||
STRIKETHROUGH_END(FormatType.STRIKETHROUGH),
|
||||
OBFUSCATE_END(FormatType.OBFUSCATE);
|
||||
|
||||
/**
|
||||
* Formatting that is stopped at this point
|
||||
*/
|
||||
final FormatType closes;
|
||||
private final String[] tags;
|
||||
|
||||
FormatCloseTag(FormatType openingTag) {
|
||||
this.closes = openingTag;
|
||||
|
||||
// Auto-generate close tags
|
||||
tags = new String[closes.tags.length];
|
||||
for(int i = 0; i < tags.length; i++) {
|
||||
tags[i] = END_TAG_INDICATOR+closes.tags[i];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
enum ControlTag implements Tag {
|
||||
BREAK("break"),
|
||||
ESCAPE("esc"),
|
||||
RESET("reset");
|
||||
|
||||
private final String[] tags;
|
||||
|
||||
ControlTag(String... tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Types of clicking
|
||||
*/
|
||||
enum ClickType implements InteractiveMessageTag {
|
||||
LINK("open_url", "link"),
|
||||
COMMAND("run_command", "command"),
|
||||
SUGGEST("suggest_command", "suggest");
|
||||
|
||||
private final String jsonKey;
|
||||
private final String[] tags;
|
||||
|
||||
ClickType(String jsonKey, String... tags) {
|
||||
this.jsonKey = jsonKey;
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getTags() {
|
||||
return tags;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getJsonKey() {
|
||||
return jsonKey;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
enum HoverType implements InteractiveMessageTag {
|
||||
HOVER;
|
||||
|
||||
@Override
|
||||
public String[] getTags() {
|
||||
return new String[]{"hover"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getJsonKey() {
|
||||
return "show_text";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,191 @@
|
||||
package me.wiefferink.areashop.messages;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
public class LanguageManager {
|
||||
private AreaShop plugin = null;
|
||||
private String languages[] = {"EN", "NL", "FR", "DE", "NO", "RU"};
|
||||
private Map<String, List<String>> currentLanguage, defaultLanguage;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param plugin The AreaShop plugin
|
||||
*/
|
||||
public LanguageManager(AreaShop plugin) {
|
||||
this.plugin = plugin;
|
||||
startup();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the default language files and open the current and backup language file
|
||||
*/
|
||||
public void startup() {
|
||||
this.saveDefaults();
|
||||
currentLanguage = loadLanguage(plugin.getConfig().getString("language"));
|
||||
defaultLanguage = loadLanguage(languages[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the default language files if not already present
|
||||
*/
|
||||
public void saveDefaults() {
|
||||
// Create the language folder if it not exists
|
||||
File langFolder;
|
||||
langFolder = new File(plugin.getDataFolder()+File.separator+AreaShop.languageFolder);
|
||||
if(!langFolder.exists()) {
|
||||
if(!langFolder.mkdirs()) {
|
||||
AreaShop.warn("Could not create language directory: "+langFolder.getAbsolutePath());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Create the language files, overwrites if a file already exists
|
||||
// Overriding is necessary because otherwise with an update the new lang files would not be used
|
||||
File langFile;
|
||||
for(String language : languages) {
|
||||
langFile = new File(plugin.getDataFolder()+File.separator+AreaShop.languageFolder+File.separator+language+".yml");
|
||||
try(
|
||||
InputStream input = plugin.getResource(AreaShop.languageFolder+"/"+language+".yml");
|
||||
OutputStream output = new FileOutputStream(langFile)
|
||||
) {
|
||||
if(input == null) {
|
||||
AreaShop.warn("Could not save default language to the '"+AreaShop.languageFolder+"' folder: "+language+".yml");
|
||||
continue;
|
||||
}
|
||||
int read;
|
||||
byte[] bytes = new byte[1024];
|
||||
while((read = input.read(bytes)) != -1) {
|
||||
output.write(bytes, 0, read);
|
||||
}
|
||||
input.close();
|
||||
output.close();
|
||||
} catch(IOException e) {
|
||||
AreaShop.warn("Something went wrong saving a default language file: "+langFile.getPath());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the specified language
|
||||
* @param key The language to load
|
||||
* @return Map with the messages loaded from the file
|
||||
*/
|
||||
public Map<String, List<String>> loadLanguage(String key) {
|
||||
return loadLanguage(key, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the specified language
|
||||
* @param key The language to load
|
||||
* @param convert try conversion or not
|
||||
* @return Map with the messages loaded from the file
|
||||
*/
|
||||
private Map<String, List<String>> loadLanguage(String key, boolean convert) {
|
||||
Map<String, List<String>> result = new HashMap<>();
|
||||
|
||||
// Load the strings
|
||||
boolean isTransifexFile = false;
|
||||
File file = new File(plugin.getDataFolder()+File.separator+AreaShop.languageFolder+File.separator+key+".yml");
|
||||
try(
|
||||
InputStreamReader reader = new InputStreamReader(new FileInputStream(file), Charsets.UTF_8)
|
||||
) {
|
||||
YamlConfiguration ymlFile = YamlConfiguration.loadConfiguration(reader);
|
||||
// Detect empty language files, happens when the YAML parser prints an exception (it does return an empty YamlConfiguration though)
|
||||
if(ymlFile.getKeys(false).isEmpty()) {
|
||||
AreaShop.warn("Language file "+key+".yml has zero messages.");
|
||||
return result;
|
||||
}
|
||||
// Detect language files downloaded from Transifex and convert them
|
||||
if(ymlFile.getKeys(false).size() == 1) {
|
||||
for(String languageKey : ymlFile.getKeys(false)) {
|
||||
if(ymlFile.isConfigurationSection(languageKey)) {
|
||||
isTransifexFile = convert;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Retrieve the messages from the YAML file and create the result
|
||||
if(!isTransifexFile) {
|
||||
for(String messageKey : ymlFile.getKeys(false)) {
|
||||
if(ymlFile.isList(messageKey)) {
|
||||
result.put(messageKey, new ArrayList<>(ymlFile.getStringList(messageKey)));
|
||||
} else {
|
||||
result.put(messageKey, new ArrayList<>(Collections.singletonList(ymlFile.getString(messageKey))));
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch(IOException e) {
|
||||
AreaShop.warn("Could not load set language file: "+file.getAbsolutePath());
|
||||
}
|
||||
|
||||
if(isTransifexFile) {
|
||||
if(!Transifex.convertFrom(file)) {
|
||||
AreaShop.warn("Failed to convert "+file.getName()+" from the Transifex layout to the AreaShop layout, check the errors above");
|
||||
}
|
||||
return loadLanguage(key, false);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the message for a certain key, without doing any processing
|
||||
* @param key The key of the message to get
|
||||
* @return The message as a list of strings
|
||||
*/
|
||||
public List<String> getRawMessage(String key) {
|
||||
List<String> message;
|
||||
if(key.equalsIgnoreCase(Message.CHATLANGUAGEVARIABLE)) {
|
||||
message = plugin.getChatPrefix();
|
||||
} else if(currentLanguage.containsKey(key)) {
|
||||
message = currentLanguage.get(key);
|
||||
} else {
|
||||
message = defaultLanguage.get(key);
|
||||
}
|
||||
if(message == null) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return new ArrayList<>(message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,407 @@
|
||||
package me.wiefferink.areashop.messages;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.regions.GeneralRegion;
|
||||
import org.apache.commons.lang.exception.ExceptionUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class Message {
|
||||
|
||||
public static final String VARIABLESTART = "%";
|
||||
public static final String VARIABLEEND = "%";
|
||||
public static final String LANGUAGEVARIABLE = "lang:";
|
||||
public static final String CHATLANGUAGEVARIABLE = "prefix";
|
||||
public static final int REPLACEMENTLIMIT = 50; // Maximum number of replacement rounds (the replaced value can have variables again)
|
||||
public static final int MAXIMUMJSONLENGTH = 30000; // Limit of the client is 32767 for the complete message
|
||||
private static boolean fancyWorks = true;
|
||||
|
||||
private List<String> message;
|
||||
private Object[] replacements;
|
||||
private String key = null;
|
||||
|
||||
/**
|
||||
* Internal use only
|
||||
*/
|
||||
private Message() {
|
||||
message = new ArrayList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Empty message object
|
||||
* @return this
|
||||
*/
|
||||
public static Message none() {
|
||||
return new Message();
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a message from a language key
|
||||
* @param key The key of the message to use
|
||||
* @return this
|
||||
*/
|
||||
public static Message fromKey(String key) {
|
||||
return new Message().setMessageFromKey(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a message from a string
|
||||
* @param message The message to use
|
||||
* @return this
|
||||
*/
|
||||
public static Message fromString(String message) {
|
||||
return new Message().setMessage(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a message from a string list
|
||||
* @param message The message to use
|
||||
* @return this
|
||||
*/
|
||||
public static Message fromList(List<String> message) {
|
||||
return new Message().setMessage(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message with all replacements done
|
||||
* @return Message as a list
|
||||
*/
|
||||
public List<String> get() {
|
||||
executeReplacements();
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message with all replacements done
|
||||
* @param limit the limit to hold to
|
||||
* @return Message as a list
|
||||
*/
|
||||
private List<String> get(Limit limit) {
|
||||
if(limit.reached()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
executeReplacements(limit);
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the raw message without replacing anything
|
||||
* @return The message
|
||||
*/
|
||||
public List<String> getRaw() {
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a plain string for the message (for example for using in the console)
|
||||
* @return The message as simple string
|
||||
*/
|
||||
public String getPlain() {
|
||||
executeReplacements();
|
||||
return FancyMessageFormat.convertToConsole(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the default prefix to the message
|
||||
* @param doIt true if the prefix should be added, otherwise false
|
||||
* @return this
|
||||
*/
|
||||
public Message prefix(boolean doIt) {
|
||||
if(doIt) {
|
||||
message.add(0, VARIABLESTART+LANGUAGEVARIABLE+CHATLANGUAGEVARIABLE+VARIABLEEND);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Message prefix() {
|
||||
return prefix(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the replacements to apply to the message
|
||||
* @param replacements The replacements to apply
|
||||
* - GeneralRegion: All region replacements are applied
|
||||
* - Message: Message is inserted
|
||||
* - other: index tag is replaced, like %0%
|
||||
* @return this
|
||||
*/
|
||||
public Message replacements(Object... replacements) {
|
||||
this.replacements = replacements;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append lines to the message
|
||||
* @param lines The lines to append
|
||||
* @return this
|
||||
*/
|
||||
public Message append(List<String> lines) {
|
||||
message.addAll(lines);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append a message to this message
|
||||
* @param message The message to append
|
||||
* @return this
|
||||
*/
|
||||
public Message append(Message message) {
|
||||
return append(message.get());
|
||||
}
|
||||
|
||||
/**
|
||||
* Append lines to the message
|
||||
* @param line The line to append
|
||||
* @return this
|
||||
*/
|
||||
public Message append(String line) {
|
||||
message.add(line);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send the message to a target
|
||||
* @param target The target to send the message to (Player, CommandSender, Logger)
|
||||
* @return this
|
||||
*/
|
||||
public Message send(Object target) {
|
||||
if(message == null || message.size() == 0 || (message.size() == 1 && message.get(0).length() == 0) || target == null) {
|
||||
return this;
|
||||
}
|
||||
executeReplacements();
|
||||
if(target instanceof Player) {
|
||||
boolean sendPlain = true;
|
||||
if(AreaShop.getInstance().getConfig().getBoolean("useFancyMessages") && fancyWorks) {
|
||||
try {
|
||||
String jsonString = FancyMessageFormat.convertToJSON(message);
|
||||
if(jsonString.length() > MAXIMUMJSONLENGTH) {
|
||||
AreaShop.getInstance().getLogger().severe("Message with key "+key+" could not be send, results in a JSON string that is too big to send to the client, start of the message: "+Utils.getMessageStart(this, 100));
|
||||
return this;
|
||||
}
|
||||
boolean result = Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "tellraw "+((Player)target).getName()+" "+jsonString);
|
||||
sendPlain = !result;
|
||||
fancyWorks = result;
|
||||
} catch(Exception e) {
|
||||
fancyWorks = false;
|
||||
AreaShop.getInstance().getLogger().warning("Sending fancy message did not work, falling back to plain messages. Message key: "+key);
|
||||
AreaShop.debug(ExceptionUtils.getStackTrace(e));
|
||||
}
|
||||
}
|
||||
if(sendPlain) { // Fancy messages disabled or broken
|
||||
((Player)target).sendMessage(FancyMessageFormat.convertToConsole(message));
|
||||
}
|
||||
} else {
|
||||
String plainMessage = FancyMessageFormat.convertToConsole(message);
|
||||
if(!AreaShop.getInstance().getConfig().getBoolean("useColorsInConsole")) {
|
||||
plainMessage = ChatColor.stripColor(plainMessage);
|
||||
}
|
||||
if(target instanceof CommandSender) {
|
||||
((CommandSender)target).sendMessage(plainMessage);
|
||||
} else if(target instanceof Logger) {
|
||||
((Logger)target).info(plainMessage);
|
||||
} else {
|
||||
AreaShop.getInstance().getLogger().warning("Could not send message, target is wrong: "+plainMessage);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
// INTERNAL METHODS
|
||||
|
||||
/**
|
||||
* Set the internal message
|
||||
* @param message The message to set
|
||||
* @return this
|
||||
*/
|
||||
private Message setMessage(List<String> message) {
|
||||
this.message = message;
|
||||
if(this.message == null) {
|
||||
this.message = new ArrayList<>();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the internal message with a key
|
||||
* @param key The message key to get the message for
|
||||
* @return this
|
||||
*/
|
||||
private Message setMessageFromKey(String key) {
|
||||
this.key = key;
|
||||
return this.setMessage(AreaShop.getInstance().getLanguageManager().getRawMessage(key));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the internal message with a string
|
||||
* @param message The message to set
|
||||
* @return this
|
||||
*/
|
||||
private Message setMessage(String message) {
|
||||
List<String> list = new ArrayList<>();
|
||||
list.add(message);
|
||||
return this.setMessage(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply all replacements to the message
|
||||
*/
|
||||
private void executeReplacements() {
|
||||
executeReplacements(new Limit(REPLACEMENTLIMIT, this));
|
||||
}
|
||||
|
||||
private void executeReplacements(Limit limit) {
|
||||
// Replace variables until they are all gone, or when the limit is reached
|
||||
Pattern variable = Pattern.compile(Pattern.quote(VARIABLESTART)+"[a-zA-Z]+"+Pattern.quote(VARIABLEEND));
|
||||
|
||||
try {
|
||||
boolean shouldReplace = true;
|
||||
while(shouldReplace) {
|
||||
List<String> original = new ArrayList<>(message);
|
||||
|
||||
limit.left--;
|
||||
if(limit.reached()) {
|
||||
if(!limit.notified) {
|
||||
limit.notified = true;
|
||||
AreaShop.getInstance().getLogger().severe("Reached replacement limit, probably has replacements loops, problematic message key: "+limit.message.key+", first characters of the message: "+Utils.getMessageStart(limit.message, 100));
|
||||
}
|
||||
break;
|
||||
}
|
||||
replaceArgumentVariables(limit);
|
||||
replaceLanguageVariables(limit);
|
||||
|
||||
shouldReplace = !message.equals(original);
|
||||
}
|
||||
} catch(StackOverflowError e) {
|
||||
limit.left = 0;
|
||||
limit.notified = true;
|
||||
AreaShop.getInstance().getLogger().severe("Too many recursive replacements for message with key: "+limit.message.key+" (probably includes itself as replacement), start of the message: "+Utils.getMessageStart(limit.message, 100));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace argument variables in a message
|
||||
* The arguments to apply as replacements:
|
||||
* - If it is a GeneralRegion the replacements of the region will be applied
|
||||
* - Else the parameter will replace its number surrounded with VARIABLESTART and VARIABLEEND
|
||||
*/
|
||||
private void replaceArgumentVariables(Limit limit) {
|
||||
if(message == null || message.size() == 0 || replacements == null || limit.reached()) {
|
||||
return;
|
||||
}
|
||||
boolean result = false;
|
||||
for(int i = 0; i < message.size(); i++) {
|
||||
int number = 0;
|
||||
for(Object param : replacements) {
|
||||
if(param != null) {
|
||||
if(param instanceof GeneralRegion) {
|
||||
message.set(i, ((GeneralRegion)param).applyAllReplacements(message.get(i)));
|
||||
} else if(param instanceof Message) {
|
||||
Pattern variables = Pattern.compile(Pattern.quote(VARIABLESTART)+number+Pattern.quote(VARIABLEEND));
|
||||
Matcher matches = variables.matcher(message.get(i));
|
||||
if(matches.find()) { // Only replaces one occurance of the variable, others will be done next round
|
||||
int startDiff = message.size()-i;
|
||||
List<String> insertMessage = ((Message)param).get(limit);
|
||||
if(limit.reached()) {
|
||||
return;
|
||||
}
|
||||
FancyMessageFormat.insertMessage(message, insertMessage, i, matches.start(), matches.end());
|
||||
// Skip to end of insert
|
||||
i = message.size()-startDiff;
|
||||
}
|
||||
number++;
|
||||
} else {
|
||||
message.set(i, message.get(i).replace(VARIABLESTART+number+VARIABLEEND, param.toString()));
|
||||
number++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace all language variables in a message
|
||||
*/
|
||||
private void replaceLanguageVariables(Limit limit) {
|
||||
if(message == null || message.size() == 0 || limit.reached()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Pattern variables = Pattern.compile(
|
||||
Pattern.quote(VARIABLESTART)+
|
||||
Pattern.quote(LANGUAGEVARIABLE)+"[a-zA-Z-]+"+ // Language key
|
||||
"(\\|(.*?\\|)+)?"+ // Optional message arguments
|
||||
Pattern.quote(VARIABLEEND)
|
||||
);
|
||||
|
||||
for(int i = 0; i < message.size(); i++) {
|
||||
Matcher matches = variables.matcher(message.get(i));
|
||||
if(matches.find()) {
|
||||
String variable = matches.group();
|
||||
String key;
|
||||
Object[] arguments = null;
|
||||
if(variable.contains("|")) {
|
||||
key = variable.substring(6, variable.indexOf("|"));
|
||||
arguments = variable.substring(variable.indexOf("|")+1, variable.length()-1).split("\\|");
|
||||
} else {
|
||||
key = variable.substring(6, variable.length()-1);
|
||||
}
|
||||
Message insert = Message.fromKey(key);
|
||||
if(arguments != null) {
|
||||
insert.replacements(arguments);
|
||||
}
|
||||
|
||||
// Insert message
|
||||
int startDiff = message.size()-i;
|
||||
List<String> insertMessage = insert.get(limit);
|
||||
if(limit.reached()) {
|
||||
return;
|
||||
}
|
||||
FancyMessageFormat.insertMessage(message, insertMessage, i, matches.start(), matches.end());
|
||||
// Skip to end of insert
|
||||
i = message.size()-startDiff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Message(key:"+key+", message:"+message+")";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Class to store a limit
|
||||
*/
|
||||
private class Limit {
|
||||
public int left = 0;
|
||||
public boolean notified = false;
|
||||
public Message message;
|
||||
|
||||
/**
|
||||
* Set the initial limit
|
||||
* @param count The limit to use
|
||||
*/
|
||||
public Limit(int count, Message message) {
|
||||
left = count;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the limit is reached
|
||||
* @return true if the limit is reached, otherwise false
|
||||
*/
|
||||
public boolean reached() {
|
||||
return left <= 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
package me.wiefferink.areashop.messages;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang.exception.ExceptionUtils;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
public class Transifex {
|
||||
public static boolean convertFrom(File inputFile) {
|
||||
if(inputFile == null || !inputFile.exists() || !inputFile.isFile()) {
|
||||
warn("Could not convert Transifix file, it does not exist");
|
||||
return false;
|
||||
}
|
||||
AreaShop.debug("Transifex conversion of", inputFile.getAbsolutePath());
|
||||
|
||||
File newFile = new File(inputFile.getAbsolutePath()+".new");
|
||||
try(
|
||||
BufferedReader reader = new BufferedReader(new FileReader(inputFile));
|
||||
BufferedWriter writer = new BufferedWriter(new FileWriter(newFile))
|
||||
) {
|
||||
// Create target file
|
||||
newFile.createNewFile();
|
||||
|
||||
// Add translation strings
|
||||
String line = reader.readLine();
|
||||
boolean first = true;
|
||||
String lastLineStart = null;
|
||||
while(line != null) {
|
||||
// Skip line with the language on it
|
||||
if(first) {
|
||||
first = false;
|
||||
line = reader.readLine();
|
||||
continue;
|
||||
}
|
||||
// Skip comment lines (normally there are none)
|
||||
if(line.startsWith("#")) {
|
||||
line = reader.readLine();
|
||||
continue;
|
||||
}
|
||||
// Strip whitespace at the front
|
||||
if(line.length() > 2) {
|
||||
line = line.substring(2);
|
||||
}
|
||||
// Add empty lines between messages of a different type (the part before - decides the type)
|
||||
if(lastLineStart != null && !line.trim().isEmpty() && !line.startsWith(lastLineStart) && !line.trim().startsWith("-")) {
|
||||
writer.newLine();
|
||||
}
|
||||
// Write line to the new file
|
||||
if(!line.trim().isEmpty()) {
|
||||
// Detect special fancyformat lines
|
||||
if(line.contains("\\n")) {
|
||||
String[] specials = line.split("\\\\n");
|
||||
//print("Contains newline: "+line+", split into "+specials.length+" parts");
|
||||
// Write identifier
|
||||
writer.write(specials[0].substring(0, specials[0].indexOf(":")+1));
|
||||
writer.newLine();
|
||||
// Strip identifier from first part
|
||||
specials[0] = specials[0].substring(specials[0].indexOf(":")+3);
|
||||
// Write special lines
|
||||
for(String special : specials) {
|
||||
writer.write(" - \"");
|
||||
if(special.startsWith("\\t")) {
|
||||
special = special.substring(2);
|
||||
writer.write(" ");
|
||||
}
|
||||
writer.write(special);
|
||||
if(!special.endsWith("\"")) {
|
||||
writer.write("\"");
|
||||
}
|
||||
writer.newLine();
|
||||
}
|
||||
} else {
|
||||
// Simply copy the line
|
||||
writer.write(line);
|
||||
writer.newLine();
|
||||
}
|
||||
}
|
||||
// Update last line start
|
||||
String[] splittedLine = line.split("-");
|
||||
if(splittedLine.length > 0 && !line.trim().isEmpty()) {
|
||||
lastLineStart = splittedLine[0];
|
||||
}
|
||||
line = reader.readLine();
|
||||
}
|
||||
} catch(IOException e) {
|
||||
warn("Could not convert Transifix file:", ExceptionUtils.getStackTrace(e));
|
||||
newFile.delete();
|
||||
return false;
|
||||
}
|
||||
|
||||
// Move current file to .old, move new file to original location
|
||||
File oldFile = new File(inputFile.getAbsolutePath()+".transifex");
|
||||
if(oldFile.exists() && oldFile.isFile()) {
|
||||
if(!oldFile.delete()) {
|
||||
warn("Could not remove existing old file:", oldFile.getAbsolutePath());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(!inputFile.renameTo(oldFile)) {
|
||||
warn("Could not move input file to .old, from", inputFile.getAbsolutePath(), "to", oldFile.getAbsolutePath());
|
||||
return false;
|
||||
}
|
||||
if(!newFile.renameTo(inputFile)) {
|
||||
warn("Could not move new file to original file location, from", newFile.getAbsolutePath(), "to", inputFile.getAbsolutePath());
|
||||
oldFile.renameTo(inputFile); // Try to recover original file
|
||||
return false;
|
||||
}
|
||||
AreaShop.info("Converted "+inputFile.getName()+" from the Transifex layout to the AreaShop layout, original saved in "+oldFile.getName());
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Print a warning to the console
|
||||
* @param message The message to print
|
||||
*/
|
||||
private static void warn(String... message) {
|
||||
AreaShop.warn("[Transifex language file conversion]", StringUtils.join(message, " "));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,576 @@
|
||||
package me.wiefferink.areashop.regions;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.events.ask.BuyingRegionEvent;
|
||||
import me.wiefferink.areashop.events.ask.ResellingRegionEvent;
|
||||
import me.wiefferink.areashop.events.ask.SellingRegionEvent;
|
||||
import me.wiefferink.areashop.events.notify.BoughtRegionEvent;
|
||||
import me.wiefferink.areashop.events.notify.ResoldRegionEvent;
|
||||
import me.wiefferink.areashop.events.notify.SoldRegionEvent;
|
||||
import net.milkbowl.vault.economy.EconomyResponse;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.UUID;
|
||||
|
||||
public class BuyRegion extends GeneralRegion {
|
||||
|
||||
public BuyRegion(AreaShop plugin, YamlConfiguration config) {
|
||||
super(plugin, config);
|
||||
}
|
||||
|
||||
public BuyRegion(AreaShop plugin, String name, World world) {
|
||||
super(plugin, name, world);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RegionType getType() {
|
||||
return RegionType.BUY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RegionState getState() {
|
||||
if(isSold() && isInResellingMode()) {
|
||||
return RegionState.RESELL;
|
||||
} else if(isSold() && !isInResellingMode()) {
|
||||
return RegionState.SOLD;
|
||||
} else {
|
||||
return RegionState.FORSALE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the UUID of the owner of this region
|
||||
* @return The UUID of the owner of this region
|
||||
*/
|
||||
public UUID getBuyer() {
|
||||
String buyer = config.getString("buy.buyer");
|
||||
if(buyer != null) {
|
||||
try {
|
||||
return UUID.fromString(buyer);
|
||||
} catch(IllegalArgumentException e) {
|
||||
// Incorrect UUID
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a player is the buyer of this region
|
||||
* @param player Player to check
|
||||
* @return true if this player owns this region, otherwise false
|
||||
*/
|
||||
public boolean isBuyer(Player player) {
|
||||
return player != null && isBuyer(player.getUniqueId());
|
||||
}
|
||||
public boolean isBuyer(UUID player) {
|
||||
UUID buyer = getBuyer();
|
||||
return !(buyer == null || player == null) && buyer.equals(player);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the buyer of this region
|
||||
* @param buyer The UUID of the player that should be set as buyer
|
||||
*/
|
||||
public void setBuyer(UUID buyer) {
|
||||
if(buyer == null) {
|
||||
setSetting("buy.buyer", null);
|
||||
setSetting("buy.buyerName", null);
|
||||
} else {
|
||||
setSetting("buy.buyer", buyer.toString());
|
||||
setSetting("buy.buyerName", Utils.toName(buyer));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the name of the player that owns this region
|
||||
* @return The name of the player that owns this region, if unavailable by UUID it will return the old cached name, if that is unavailable it will return <UNKNOWN>
|
||||
*/
|
||||
public String getPlayerName() {
|
||||
String result = Utils.toName(getBuyer());
|
||||
if(result == null || result.isEmpty()) {
|
||||
result = getStringSetting("buy.buyerName");
|
||||
if(result == null || result.isEmpty()) {
|
||||
result = "<UNKNOWN>";
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the region is sold
|
||||
* @return true if the region is sold, otherwise false
|
||||
*/
|
||||
public boolean isSold() {
|
||||
return getBuyer() != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the region is being resold
|
||||
* @return true if the region is available for reselling, otherwise false
|
||||
*/
|
||||
public boolean isInResellingMode() {
|
||||
return config.getBoolean("buy.resellMode");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the price of the region
|
||||
* @return The price of the region
|
||||
*/
|
||||
public double getPrice() {
|
||||
return getDoubleSetting("buy.price");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the resell price of this region
|
||||
* @return The resell price if isInResellingMode(), otherwise 0.0
|
||||
*/
|
||||
public double getResellPrice() {
|
||||
return config.getDouble("buy.resellPrice");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the formatted string of the price (includes prefix and suffix)
|
||||
* @return The formatted string of the price
|
||||
*/
|
||||
public String getFormattedPrice() {
|
||||
return Utils.formatCurrency(getPrice());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the formatted string of the resellprice (includes prefix and suffix)
|
||||
* @return The formatted string of the resellprice
|
||||
*/
|
||||
public String getFormattedResellPrice() {
|
||||
return Utils.formatCurrency(getResellPrice());
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the price of the region
|
||||
* @param price The price to set this region to
|
||||
*/
|
||||
public void setPrice(double price) {
|
||||
setSetting("buy.price", price);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the price so that the price will be taken from a group or the default.yml file
|
||||
*/
|
||||
public void removePrice() {
|
||||
setSetting("buy.price", null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the region into resell mode with the given price
|
||||
* @param price The price this region should be put up for sale
|
||||
*/
|
||||
public void enableReselling(double price) {
|
||||
setSetting("buy.resellMode", true);
|
||||
setSetting("buy.resellPrice", price);
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop this region from being in resell mode
|
||||
*/
|
||||
public void disableReselling() {
|
||||
setSetting("buy.resellMode", null);
|
||||
setSetting("buy.resellPrice", null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the moneyBack percentage
|
||||
* @return The % of money the player will get back when selling
|
||||
*/
|
||||
public double getMoneyBackPercentage() {
|
||||
return getDoubleSetting("buy.moneyBack");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the amount of money that should be paid to the player when selling the region
|
||||
* @return The amount of money the player should get back
|
||||
*/
|
||||
public double getMoneyBackAmount() {
|
||||
return getPrice() * (getMoneyBackPercentage() / 100.0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the formatted string of the amount of the moneyBack amount
|
||||
* @return String with currency symbols and proper fractional part
|
||||
*/
|
||||
public String getFormattedMoneyBackAmount() {
|
||||
return Utils.formatCurrency(getMoneyBackAmount());
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, Object> getSpecificReplacements() {
|
||||
// Fill the replacements map with things specific to a BuyRegion
|
||||
HashMap<String, Object> result = new HashMap<>();
|
||||
result.put(AreaShop.tagPrice, getFormattedPrice());
|
||||
result.put(AreaShop.tagRawPrice, getPrice());
|
||||
result.put(AreaShop.tagPlayerName, getPlayerName());
|
||||
result.put(AreaShop.tagPlayerUUID, getBuyer());
|
||||
result.put(AreaShop.tagResellPrice, getFormattedResellPrice());
|
||||
result.put(AreaShop.tagRawResellPrice, getResellPrice());
|
||||
result.put(AreaShop.tagMoneyBackAmount, getFormattedMoneyBackAmount());
|
||||
result.put(AreaShop.tagRawMoneyBackAmount, getMoneyBackAmount());
|
||||
double moneyBackPercent = getMoneyBackPercentage();
|
||||
if((moneyBackPercent%1.0) == 0.0) {
|
||||
result.put(AreaShop.tagMoneyBackPercentage, (int)moneyBackPercent);
|
||||
} else {
|
||||
result.put(AreaShop.tagMoneyBackPercentage, moneyBackPercent);
|
||||
}
|
||||
result.put(AreaShop.tagMaxInactiveTime, this.getFormattedInactiveTimeUntilSell());
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Minutes until automatic unrent when player is offline
|
||||
* @return The number of milliseconds until the region is unrented while player is offline
|
||||
*/
|
||||
public long getInactiveTimeUntilSell() {
|
||||
return Utils.getDurationFromMinutesOrStringInput(getStringSetting("buy.inactiveTimeUntilSell"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a human readable string indicating how long the player can be offline until automatic unrent
|
||||
* @return String indicating the inactive time until unrent
|
||||
*/
|
||||
public String getFormattedInactiveTimeUntilSell() {
|
||||
return Utils.millisToHumanFormat(getInactiveTimeUntilSell());
|
||||
}
|
||||
|
||||
/**
|
||||
* Buy a region
|
||||
* @param player The player that wants to buy the region
|
||||
* @return true if it succeeded and false if not
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean buy(Player player) {
|
||||
// Check if the player has permission
|
||||
if(player.hasPermission("areashop.buy")) {
|
||||
if(plugin.getEconomy() == null) {
|
||||
message(player, "general-noEconomy");
|
||||
return false;
|
||||
}
|
||||
if(isInResellingMode()) {
|
||||
if(!player.hasPermission("areashop.buyresell")) {
|
||||
message(player, "buy-noPermissionResell");
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if(!player.hasPermission("areashop.buynormal")) {
|
||||
message(player, "buy-noPermissionNoResell");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(getWorld() == null) {
|
||||
message(player, "general-noWorld");
|
||||
return false;
|
||||
}
|
||||
if(getRegion() == null) {
|
||||
message(player, "general-noRegion");
|
||||
return false;
|
||||
}
|
||||
if(!isSold() || (isInResellingMode() && !isBuyer(player))) {
|
||||
boolean isResell = isInResellingMode();
|
||||
// Check if the players needs to be in the world or region for buying
|
||||
if(restrictedToRegion() && (!player.getWorld().getName().equals(getWorldName())
|
||||
|| !getRegion().contains(player.getLocation().getBlockX(), player.getLocation().getBlockY(), player.getLocation().getBlockZ()))) {
|
||||
message(player, "buy-restrictedToRegion");
|
||||
return false;
|
||||
}
|
||||
if(restrictedToWorld() && !player.getWorld().getName().equals(getWorldName())) {
|
||||
message(player, "buy-restrictedToWorld", player.getWorld().getName());
|
||||
return false;
|
||||
}
|
||||
// Check region limits
|
||||
LimitResult limitResult = this.limitsAllow(RegionType.BUY, player);
|
||||
AreaShop.debug("LimitResult: " + limitResult.toString());
|
||||
if(!limitResult.actionAllowed()) {
|
||||
if(limitResult.getLimitingFactor() == LimitType.TOTAL) {
|
||||
message(player, "total-maximum", limitResult.getMaximum(), limitResult.getCurrent(), limitResult.getLimitingGroup());
|
||||
return false;
|
||||
}
|
||||
if(limitResult.getLimitingFactor() == LimitType.BUYS) {
|
||||
message(player, "buy-maximum", limitResult.getMaximum(), limitResult.getCurrent(), limitResult.getLimitingGroup());
|
||||
return false;
|
||||
}
|
||||
// Should not be reached, but is safe like this
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if the player has enough money
|
||||
if((!isResell && plugin.getEconomy().has(player, getWorldName(), getPrice())) || (isResell && plugin.getEconomy().has(player, getWorldName(), getResellPrice()))) {
|
||||
UUID oldOwner = getBuyer();
|
||||
if(isResell && oldOwner != null) {
|
||||
// Broadcast and check event
|
||||
ResellingRegionEvent event = new ResellingRegionEvent(this, player);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if(event.isCancelled()) {
|
||||
message(player, "general-cancelled", event.getReason());
|
||||
return false;
|
||||
}
|
||||
|
||||
getFriendsFeature().clearFriends();
|
||||
double resellPrice = getResellPrice();
|
||||
// Transfer the money to the previous owner
|
||||
EconomyResponse r = plugin.getEconomy().withdrawPlayer(player, getWorldName(), getResellPrice());
|
||||
if(!r.transactionSuccess()) {
|
||||
message(player, "buy-payError");
|
||||
AreaShop.debug("Something went wrong with getting money from " + player.getName() + " while buying " + getName() + ": " + r.errorMessage);
|
||||
return false;
|
||||
}
|
||||
r = null;
|
||||
OfflinePlayer oldOwnerPlayer = Bukkit.getOfflinePlayer(oldOwner);
|
||||
String oldOwnerName = getPlayerName();
|
||||
if(oldOwnerPlayer != null && oldOwnerPlayer.getName() != null) {
|
||||
r = plugin.getEconomy().depositPlayer(oldOwnerPlayer, getWorldName(), getResellPrice());
|
||||
oldOwnerName = oldOwnerPlayer.getName();
|
||||
} else if (oldOwnerName != null) {
|
||||
r = plugin.getEconomy().depositPlayer(oldOwnerName, getWorldName(), getResellPrice());
|
||||
}
|
||||
if(r == null || !r.transactionSuccess()) {
|
||||
AreaShop.warn("Something went wrong with paying '"+oldOwnerName+"' "+getFormattedPrice()+" for his resell of region "+getName()+" to "+player.getName());
|
||||
}
|
||||
// Resell is done, disable that now
|
||||
disableReselling();
|
||||
// Run commands
|
||||
this.runEventCommands(RegionEvent.RESELL, true);
|
||||
// Set the owner
|
||||
setBuyer(player.getUniqueId());
|
||||
updateLastActiveTime();
|
||||
|
||||
// Update everything
|
||||
handleSchematicEvent(RegionEvent.RESELL);
|
||||
|
||||
// Notify about updates
|
||||
this.notifyAndUpdate(new ResoldRegionEvent(this, oldOwner));
|
||||
|
||||
// Send message to the player
|
||||
message(player, "buy-successResale", oldOwnerName);
|
||||
Player seller = Bukkit.getPlayer(oldOwner);
|
||||
if(seller != null) {
|
||||
message(seller, "buy-successSeller", resellPrice);
|
||||
}
|
||||
// Run commands
|
||||
this.runEventCommands(RegionEvent.RESELL, false);
|
||||
} else {
|
||||
// Broadcast and check event
|
||||
BuyingRegionEvent event = new BuyingRegionEvent(this, player);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if(event.isCancelled()) {
|
||||
message(player, "general-cancelled", event.getReason());
|
||||
return false;
|
||||
}
|
||||
|
||||
// Substract the money from the players balance
|
||||
EconomyResponse r = plugin.getEconomy().withdrawPlayer(player, getWorldName(), getPrice());
|
||||
if(!r.transactionSuccess()) {
|
||||
message(player, "buy-payError");
|
||||
return false;
|
||||
}
|
||||
// Optionally give money to the landlord
|
||||
OfflinePlayer landlordPlayer = null;
|
||||
if(getLandlord() != null) {
|
||||
landlordPlayer = Bukkit.getOfflinePlayer(getLandlord());
|
||||
}
|
||||
String landlordName = getLandlordName();
|
||||
if(landlordName != null) {
|
||||
if(landlordPlayer != null && landlordPlayer.getName() != null) {
|
||||
r = plugin.getEconomy().depositPlayer(landlordPlayer, getWorldName(), getPrice());
|
||||
} else {
|
||||
r = plugin.getEconomy().depositPlayer(landlordName, getWorldName(), getPrice());
|
||||
}
|
||||
if(r != null && !r.transactionSuccess()) {
|
||||
AreaShop.warn("Something went wrong with paying '"+landlordName+"' "+getFormattedPrice()+" for his sell of region "+getName()+" to "+player.getName());
|
||||
}
|
||||
}
|
||||
|
||||
// Run commands
|
||||
this.runEventCommands(RegionEvent.BOUGHT, true);
|
||||
// Set the owner
|
||||
setBuyer(player.getUniqueId());
|
||||
updateLastActiveTime();
|
||||
|
||||
// Notify about updates
|
||||
this.notifyAndUpdate(new BoughtRegionEvent(this));
|
||||
|
||||
// Update everything
|
||||
handleSchematicEvent(RegionEvent.BOUGHT);
|
||||
|
||||
// Send message to the player
|
||||
message(player, "buy-succes");
|
||||
// Run commands
|
||||
this.runEventCommands(RegionEvent.BOUGHT, false);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
// Player has not enough money
|
||||
if(isResell) {
|
||||
message(player, "buy-lowMoneyResell", Utils.formatCurrency(plugin.getEconomy().getBalance(player, getWorldName())));
|
||||
} else {
|
||||
message(player, "buy-lowMoney", Utils.formatCurrency(plugin.getEconomy().getBalance(player, getWorldName())));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(isBuyer(player)) {
|
||||
message(player, "buy-yours");
|
||||
} else {
|
||||
message(player, "buy-someoneElse");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
message(player, "buy-noPermission");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sell a buyed region, get part of the money back
|
||||
* @param giveMoneyBack true if the player should be given money back, otherwise false
|
||||
* @param executor CommandSender to receive a message when the sell fails, or null
|
||||
* @return true if the region has been sold, otherwise false
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean sell(boolean giveMoneyBack, CommandSender executor) {
|
||||
boolean own = executor != null && executor instanceof Player && this.isBuyer((Player)executor);
|
||||
if(executor != null) {
|
||||
if(!executor.hasPermission("areashop.sell") && !own) {
|
||||
message(executor, "sell-noPermissionOther");
|
||||
return false;
|
||||
}
|
||||
if(!executor.hasPermission("areashop.sell") && !executor.hasPermission("areashop.sellown") && own) {
|
||||
message(executor, "sell-noPermission");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(plugin.getEconomy() == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Broadcast and check event
|
||||
SellingRegionEvent event = new SellingRegionEvent(this);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if(event.isCancelled()) {
|
||||
message(executor, "general-cancelled", event.getReason());
|
||||
return false;
|
||||
}
|
||||
|
||||
// Run commands
|
||||
this.runEventCommands(RegionEvent.SOLD, true);
|
||||
|
||||
disableReselling();
|
||||
// Give part of the buying price back
|
||||
double moneyBack = getMoneyBackAmount();
|
||||
if(moneyBack > 0 && giveMoneyBack) {
|
||||
boolean noPayBack = false;
|
||||
OfflinePlayer landlordPlayer = null;
|
||||
if(getLandlord() != null) {
|
||||
landlordPlayer = Bukkit.getOfflinePlayer(getLandlord());
|
||||
}
|
||||
String landlordName = getLandlordName();
|
||||
EconomyResponse r;
|
||||
if(landlordName != null) {
|
||||
if(landlordPlayer != null && landlordPlayer.getName() != null) {
|
||||
r = plugin.getEconomy().withdrawPlayer(landlordPlayer, getWorldName(), moneyBack);
|
||||
} else {
|
||||
r = plugin.getEconomy().withdrawPlayer(landlordName, getWorldName(), moneyBack);
|
||||
}
|
||||
if(r == null || !r.transactionSuccess()) {
|
||||
noPayBack = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Give back the money
|
||||
OfflinePlayer player = Bukkit.getOfflinePlayer(getBuyer());
|
||||
if(player != null && !noPayBack) {
|
||||
EconomyResponse response = null;
|
||||
boolean error = false;
|
||||
try {
|
||||
if(player.getName() != null) {
|
||||
response = plugin.getEconomy().depositPlayer(player, getWorldName(), moneyBack);
|
||||
} else if(getPlayerName() != null) {
|
||||
response = plugin.getEconomy().depositPlayer(getPlayerName(), getWorldName(), moneyBack);
|
||||
}
|
||||
} catch(Exception e) {
|
||||
error = true;
|
||||
}
|
||||
if(error || response == null || !response.transactionSuccess()) {
|
||||
AreaShop.warn("Something went wrong with paying back money to "+getPlayerName()+" while selling region "+getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
message(executor, "sell-sold");
|
||||
|
||||
// Remove friends and the owner
|
||||
getFriendsFeature().clearFriends();
|
||||
UUID oldBuyer = getBuyer();
|
||||
setBuyer(null);
|
||||
removeLastActiveTime();
|
||||
|
||||
// Notify about updates
|
||||
this.notifyAndUpdate(new SoldRegionEvent(this, oldBuyer, Math.max(moneyBack, 0)));
|
||||
|
||||
// Update everything
|
||||
handleSchematicEvent(RegionEvent.SOLD);
|
||||
|
||||
// Run commands
|
||||
this.runEventCommands(RegionEvent.SOLD, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkInactive() {
|
||||
if(isDeleted() || !isSold()) {
|
||||
return false;
|
||||
}
|
||||
long inactiveSetting = getInactiveTimeUntilSell();
|
||||
OfflinePlayer player = Bukkit.getOfflinePlayer(getBuyer());
|
||||
if(inactiveSetting <= 0 || player.isOp()) {
|
||||
return false;
|
||||
}
|
||||
long lastPlayed = getLastActiveTime();
|
||||
//AreaShop.debug("currentTime=" + Calendar.getInstance().getTimeInMillis() + ", getLastPlayed()=" + lastPlayed + ", timeInactive=" + (Calendar.getInstance().getTimeInMillis()-player.getLastPlayed()) + ", inactiveSetting=" + inactiveSetting);
|
||||
if(Calendar.getInstance().getTimeInMillis() > (lastPlayed + inactiveSetting)) {
|
||||
AreaShop.info("Region "+getName()+" unrented because of inactivity for player "+getPlayerName());
|
||||
AreaShop.debug("currentTime=" + Calendar.getInstance().getTimeInMillis() + ", getLastPlayed()=" + lastPlayed + ", timeInactive=" + (Calendar.getInstance().getTimeInMillis()-player.getLastPlayed()) + ", inactiveSetting=" + inactiveSetting);
|
||||
return this.sell(true, null);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
+171
-151
@@ -1,151 +1,171 @@
|
||||
package nl.evolutioncoding.AreaShop.regions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import nl.evolutioncoding.AreaShop.AreaShop;
|
||||
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
|
||||
public class RegionGroup {
|
||||
|
||||
private AreaShop plugin;
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* Constructor, used when creating new groups or restoring them from groups.yml at server boot
|
||||
* @param plugin The AreaShop plugin
|
||||
* @param name Name of the group, has to be unique
|
||||
*/
|
||||
public RegionGroup(AreaShop plugin, String name) {
|
||||
this.plugin = plugin;
|
||||
this.name = name;
|
||||
setSetting("name", name);
|
||||
// Delete duplicates
|
||||
List<String> members = getMembers();
|
||||
List<String> newMembers = new ArrayList<String>();
|
||||
while(!members.isEmpty()) {
|
||||
String member = members.remove(0);
|
||||
// If the region has been deleted also clean it from the group
|
||||
if(plugin.getFileManager().getRegion(member) != null) {
|
||||
newMembers.add(member);
|
||||
}
|
||||
while(members.contains(member)) {
|
||||
members.remove(member);
|
||||
}
|
||||
}
|
||||
if(newMembers.size() != members.size()) {
|
||||
setSetting("regions", newMembers);
|
||||
save();
|
||||
}
|
||||
if(getMembers().size() == 0) {
|
||||
plugin.getFileManager().removeGroup(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a member to a group
|
||||
* @param region The region to add to the group (GeneralRegion or a subclass of it)
|
||||
* @return true if the region was not already added, otherwise false
|
||||
*/
|
||||
public boolean addMember(GeneralRegion region) {
|
||||
List<String> members = getMembers();
|
||||
if(members.contains(region.getLowerCaseName())) {
|
||||
return false;
|
||||
} else {
|
||||
members.add(region.getName());
|
||||
setSetting("regions", members);
|
||||
save();
|
||||
region.updateSigns();
|
||||
region.updateRegionFlags();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a member from the group
|
||||
* @param region The region to remove
|
||||
* @return true if the region was in the group before, otherwise false
|
||||
*/
|
||||
public boolean removeMember(GeneralRegion region) {
|
||||
List<String> members = getMembers();
|
||||
boolean result = isMember(region);
|
||||
members.remove(region.getName());
|
||||
if(members.isEmpty()) {
|
||||
plugin.getFileManager().removeGroup(this);
|
||||
} else {
|
||||
setSetting("regions", members);
|
||||
}
|
||||
save();
|
||||
region.updateSigns();
|
||||
region.updateRegionFlags();
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all members of the group
|
||||
* @return A list with the names of all members of the group
|
||||
*/
|
||||
public List<String> getMembers() {
|
||||
if(getSettings() == null || getSettings().getStringList("regions") == null) {
|
||||
return new ArrayList<String>();
|
||||
}
|
||||
return getSettings().getStringList("regions");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the name of the group
|
||||
* @return The name of the group
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
/**
|
||||
* Get the lowercase name of the group (used for getting the config etc)
|
||||
* @return The name of the group in lowercase
|
||||
*/
|
||||
public String getLowerCaseName() {
|
||||
return getName().toLowerCase();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a region is member of the group
|
||||
* @param region Region to check
|
||||
* @return true if the region is in the group, otherwise false
|
||||
*/
|
||||
public boolean isMember(GeneralRegion region) {
|
||||
return getMembers().contains(region.getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the priority of the group (higher overwrites)
|
||||
* @return The priority of the group
|
||||
*/
|
||||
public int getPriority() {
|
||||
return getSettings().getInt("priority");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the configurationsection with the settings of this group
|
||||
* @return The ConfigurationSection with the settings of the group
|
||||
*/
|
||||
public ConfigurationSection getSettings() {
|
||||
return plugin.getFileManager().getGroupSettings(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a setting of this group
|
||||
* @param path The path to set
|
||||
* @param setting The value to set
|
||||
*/
|
||||
public void setSetting(String path, Object setting) {
|
||||
plugin.getFileManager().setGroupSetting(this, path, setting);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the group to disk (currently saves all groups because they are all in 1 file)
|
||||
*/
|
||||
public void save() {
|
||||
plugin.getFileManager().saveGroups();
|
||||
}
|
||||
}
|
||||
package me.wiefferink.areashop.regions;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class RegionGroup {
|
||||
|
||||
private AreaShop plugin;
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* Constructor, used when creating new groups or restoring them from groups.yml at server boot
|
||||
* @param plugin The AreaShop plugin
|
||||
* @param name Name of the group, has to be unique
|
||||
*/
|
||||
public RegionGroup(AreaShop plugin, String name) {
|
||||
this.plugin = plugin;
|
||||
this.name = name;
|
||||
setSetting("name", name);
|
||||
// Delete duplicates
|
||||
List<String> members = getMembers();
|
||||
int previousCount = members.size();
|
||||
List<String> newMembers = new ArrayList<>();
|
||||
while(!members.isEmpty()) {
|
||||
String member = members.remove(0);
|
||||
// If the region has been deleted also clean it from the group
|
||||
if(plugin.getFileManager().getRegion(member) != null) {
|
||||
newMembers.add(member);
|
||||
}
|
||||
while(members.contains(member)) {
|
||||
members.remove(member);
|
||||
}
|
||||
}
|
||||
if(newMembers.size() != previousCount) {
|
||||
setSetting("regions", newMembers);
|
||||
AreaShop.debug("group save required because of changed member size");
|
||||
saveRequired();
|
||||
}
|
||||
if(getMembers().size() == 0) {
|
||||
plugin.getFileManager().removeGroup(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a member to a group
|
||||
* @param region The region to add to the group (GeneralRegion or a subclass of it)
|
||||
* @return true if the region was not already added, otherwise false
|
||||
*/
|
||||
public boolean addMember(GeneralRegion region) {
|
||||
List<String> members = getMembers();
|
||||
if(members.contains(region.getLowerCaseName())) {
|
||||
return false;
|
||||
} else {
|
||||
members.add(region.getName());
|
||||
setSetting("regions", members);
|
||||
this.saveRequired();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a member from the group
|
||||
* @param region The region to remove
|
||||
* @return true if the region was in the group before, otherwise false
|
||||
*/
|
||||
public boolean removeMember(GeneralRegion region) {
|
||||
List<String> members = getMembers();
|
||||
boolean result = isMember(region);
|
||||
members.remove(region.getName());
|
||||
if(members.isEmpty()) {
|
||||
plugin.getFileManager().removeGroup(this);
|
||||
} else {
|
||||
setSetting("regions", members);
|
||||
}
|
||||
if(result) {
|
||||
this.saveRequired();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all members of the group
|
||||
* @return A list with the names of all members of the group
|
||||
*/
|
||||
public List<String> getMembers() {
|
||||
if(getSettings() == null || getSettings().getStringList("regions") == null) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return getSettings().getStringList("regions");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all members of the group as GeneralRegions
|
||||
* @return A Set with all group members
|
||||
*/
|
||||
public Set<GeneralRegion> getMemberRegions() {
|
||||
Set<GeneralRegion> result = new HashSet<>();
|
||||
for(String name : getMembers()) {
|
||||
result.add(plugin.getFileManager().getRegion(name));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the name of the group
|
||||
* @return The name of the group
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
/**
|
||||
* Get the lowercase name of the group (used for getting the config etc)
|
||||
* @return The name of the group in lowercase
|
||||
*/
|
||||
public String getLowerCaseName() {
|
||||
return getName().toLowerCase();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a region is member of the group
|
||||
* @param region Region to check
|
||||
* @return true if the region is in the group, otherwise false
|
||||
*/
|
||||
public boolean isMember(GeneralRegion region) {
|
||||
return getMembers().contains(region.getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the priority of the group (higher overwrites)
|
||||
* @return The priority of the group
|
||||
*/
|
||||
public int getPriority() {
|
||||
return getSettings().getInt("priority");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the configurationsection with the settings of this group
|
||||
* @return The ConfigurationSection with the settings of the group
|
||||
*/
|
||||
public ConfigurationSection getSettings() {
|
||||
return plugin.getFileManager().getGroupSettings(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a setting of this group
|
||||
* @param path The path to set
|
||||
* @param setting The value to set
|
||||
*/
|
||||
public void setSetting(String path, Object setting) {
|
||||
plugin.getFileManager().setGroupSetting(this, path, setting);
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates this file needs to be saved, will actually get saved later by a task
|
||||
*/
|
||||
public void saveRequired() {
|
||||
plugin.getFileManager().saveGroupsIsRequired();
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the groups to disk now, normally saveRequired() is preferred because of performance
|
||||
*/
|
||||
public void saveNow() {
|
||||
plugin.getFileManager().saveGroupsNow();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,717 @@
|
||||
package me.wiefferink.areashop.regions;
|
||||
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
import me.wiefferink.areashop.Utils;
|
||||
import me.wiefferink.areashop.events.ask.RentingRegionEvent;
|
||||
import me.wiefferink.areashop.events.ask.UnrentingRegionEvent;
|
||||
import me.wiefferink.areashop.events.notify.RentedRegionEvent;
|
||||
import me.wiefferink.areashop.events.notify.UnrentedRegionEvent;
|
||||
import net.milkbowl.vault.economy.EconomyResponse;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.UUID;
|
||||
|
||||
import static me.wiefferink.areashop.Utils.millisToHumanFormat;
|
||||
|
||||
public class RentRegion extends GeneralRegion {
|
||||
private long warningsDoneUntil = Calendar.getInstance().getTimeInMillis();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param plugin The areashop plugin
|
||||
* @param config All settings of this region
|
||||
*/
|
||||
public RentRegion(AreaShop plugin, YamlConfiguration config) {
|
||||
super(plugin, config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new RentRegion
|
||||
* @param plugin The AreaShop plugin
|
||||
* @param name The name of the region (correct casing)
|
||||
* @param world The world of the WorldGuard region
|
||||
*/
|
||||
public RentRegion(AreaShop plugin, String name, World world) {
|
||||
super(plugin, name, world);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RegionType getType() {
|
||||
return RegionType.RENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RegionState getState() {
|
||||
if(isRented()) {
|
||||
return RegionState.RENTED;
|
||||
} else {
|
||||
return RegionState.FORRENT;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the UUID of the player renting the region
|
||||
* @return The UUID of the renter
|
||||
*/
|
||||
public UUID getRenter() {
|
||||
String renter = config.getString("rent.renter");
|
||||
if(renter != null) {
|
||||
try {
|
||||
return UUID.fromString(renter);
|
||||
} catch(IllegalArgumentException e) {
|
||||
// Incorrect UUID
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a player is the renter of this region
|
||||
* @param player Player to check
|
||||
* @return true if this player rents this region, otherwise false
|
||||
*/
|
||||
public boolean isRenter(Player player) {
|
||||
return player != null && isRenter(player.getUniqueId());
|
||||
}
|
||||
public boolean isRenter(UUID player) {
|
||||
UUID renter = getRenter();
|
||||
return !(player == null || renter == null) && renter.equals(player);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the renter of this region
|
||||
* @param renter The UUID of the player that should be set as the renter
|
||||
*/
|
||||
public void setRenter(UUID renter) {
|
||||
if(renter == null) {
|
||||
setSetting("rent.renter", null);
|
||||
setSetting("rent.renterName", null);
|
||||
} else {
|
||||
setSetting("rent.renter", renter.toString());
|
||||
setSetting("rent.renterName", Utils.toName(renter));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the max number of extends of this region
|
||||
* @return -1 if infinite otherwise the maximum number
|
||||
*/
|
||||
public int getMaxExtends() {
|
||||
return getIntegerSetting("rent.maxExtends");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get how many times the rent has already been extended
|
||||
* @return The number of times extended
|
||||
*/
|
||||
public int getTimesExtended() {
|
||||
return config.getInt("rent.timesExtended");
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the number of times the region has been extended
|
||||
* @param times The number of times the region has been extended
|
||||
*/
|
||||
public void setTimesExtended(int times) {
|
||||
if(times < 0) {
|
||||
setSetting("rent.timesExtended", null);
|
||||
} else {
|
||||
setSetting("rent.timesExtended", times);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, Object> getSpecificReplacements() {
|
||||
// Fill the replacements map with things specific to a RentRegion
|
||||
HashMap<String, Object> result = new HashMap<>();
|
||||
result.put(AreaShop.tagPrice, getFormattedPrice());
|
||||
result.put(AreaShop.tagRawPrice, getPrice());
|
||||
result.put(AreaShop.tagDuration, getDurationString());
|
||||
result.put(AreaShop.tagPlayerName, getPlayerName());
|
||||
result.put(AreaShop.tagPlayerUUID, getRenter());
|
||||
SimpleDateFormat date = new SimpleDateFormat(plugin.getConfig().getString("timeFormatChat"));
|
||||
String dateString = date.format(new Date(getRentedUntil()));
|
||||
result.put(AreaShop.tagRentedUntil, dateString);
|
||||
date = new SimpleDateFormat(plugin.getConfig().getString("timeFormatSign"));
|
||||
dateString = date.format(new Date(getRentedUntil()));
|
||||
result.put(AreaShop.tagRentedUntilShort, dateString);
|
||||
result.put(AreaShop.tagTimeLeft, getTimeLeftString());
|
||||
result.put(AreaShop.tagMoneyBackAmount, getFormattedMoneyBackAmount());
|
||||
result.put(AreaShop.tagRawMoneyBackAmount, getMoneyBackAmount());
|
||||
double moneyBackPercent = getMoneyBackPercentage();
|
||||
if((moneyBackPercent%1.0) == 0.0) {
|
||||
result.put(AreaShop.tagMoneyBackPercentage, (int)moneyBackPercent);
|
||||
} else {
|
||||
result.put(AreaShop.tagMoneyBackPercentage, moneyBackPercent);
|
||||
}
|
||||
result.put(AreaShop.tagMaxExtends, this.getMaxExtends());
|
||||
result.put(AreaShop.tagExtendsLeft, getMaxExtends() - getTimesExtended());
|
||||
result.put(AreaShop.tagMaxRentTime, millisToHumanFormat(getMaxRentTime()));
|
||||
result.put(AreaShop.tagMaxInactiveTime, this.getFormattedInactiveTimeUntilUnrent());
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the region is rented
|
||||
* @return true if the region is rented, otherwise false
|
||||
*/
|
||||
public boolean isRented() {
|
||||
return getRenter() != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the name of the player renting this region
|
||||
* @return Name of the player renting this region, if unavailable by UUID it will return the old cached name, if that is unavailable it will return <UNKNOWN>
|
||||
*/
|
||||
public String getPlayerName() {
|
||||
String result = Utils.toName(getRenter());
|
||||
if(result == null || result.isEmpty()) {
|
||||
result = config.getString("rent.renterName");
|
||||
if(result == null || result.isEmpty()) {
|
||||
result = "<UNKNOWN>";
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the time until this region is rented (time from 1970 epoch)
|
||||
* @return The epoch time until which this region is rented
|
||||
*/
|
||||
public long getRentedUntil() {
|
||||
return getLongSetting("rent.rentedUntil");
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the time until the region is rented (milliseconds from 1970, system time)
|
||||
* @param rentedUntil The time until the region is rented
|
||||
*/
|
||||
public void setRentedUntil(Long rentedUntil) {
|
||||
if(rentedUntil == null) {
|
||||
setSetting("rent.rentedUntil", null);
|
||||
} else {
|
||||
setSetting("rent.rentedUntil", rentedUntil);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the price of the region
|
||||
* @return The price of the region
|
||||
*/
|
||||
public double getPrice() {
|
||||
return getDoubleSetting("rent.price");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the formatted string of the price (includes prefix and suffix)
|
||||
* @return The formatted string of the price
|
||||
*/
|
||||
public String getFormattedPrice() {
|
||||
return Utils.formatCurrency(getPrice());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the duration of 1 rent period
|
||||
* @return The duration in milliseconds of 1 rent period
|
||||
*/
|
||||
public long getDuration() {
|
||||
return Utils.durationStringToLong(getDurationString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the duration string, includes 'number indentifier'
|
||||
* @return The duration string
|
||||
*/
|
||||
public String getDurationString() {
|
||||
return getStringSetting("rent.duration");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the time that is left on the region
|
||||
* @return The time left on the region
|
||||
*/
|
||||
public long getTimeLeft() {
|
||||
if(isRented()) {
|
||||
return this.getRentedUntil() - Calendar.getInstance().getTimeInMillis();
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a formatted string indicating the rent time that is left
|
||||
* @return Time left on the rent, for example '29 days', '3 months', '1 second'
|
||||
*/
|
||||
public String getTimeLeftString() {
|
||||
return Utils.millisToHumanFormat(getTimeLeft());
|
||||
}
|
||||
|
||||
/**
|
||||
* Minutes until automatic unrent when player is offline
|
||||
* @return The number of milliseconds until the region is unrented while player is offline
|
||||
*/
|
||||
public long getInactiveTimeUntilUnrent() {
|
||||
return Utils.getDurationFromMinutesOrStringInput(getStringSetting("rent.inactiveTimeUntilUnrent"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a human readable string indicating how long the player can be offline until automatic unrent
|
||||
* @return String indicating the inactive time until unrent
|
||||
*/
|
||||
public String getFormattedInactiveTimeUntilUnrent() {
|
||||
return Utils.millisToHumanFormat(getInactiveTimeUntilUnrent());
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the price of the region
|
||||
* @param price The price of the region
|
||||
*/
|
||||
public void setPrice(double price) {
|
||||
setSetting("rent.price", price);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the price so that the price will be taken from a group or the default.yml file
|
||||
*/
|
||||
public void removePrice() {
|
||||
setSetting("rent.price", null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the duration of the rent
|
||||
* @param duration The duration of the rent (as specified on the documentation pages)
|
||||
*/
|
||||
public void setDuration(String duration) {
|
||||
setSetting("rent.duration", duration);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the moneyBack percentage
|
||||
* @return The % of money the player will get back when unrenting
|
||||
*/
|
||||
public double getMoneyBackPercentage() {
|
||||
return getDoubleSetting("rent.moneyBack");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the amount of money that should be paid to the player when unrenting the region
|
||||
* @return The amount of money the player should get back
|
||||
*/
|
||||
public double getMoneyBackAmount() {
|
||||
Long currentTime = Calendar.getInstance().getTimeInMillis();
|
||||
Double timeLeft = (double) ((getRentedUntil() - currentTime));
|
||||
double percentage = (getMoneyBackPercentage()) / 100.0;
|
||||
Double timePeriod = (double) (getDuration());
|
||||
double periods = timeLeft / timePeriod;
|
||||
return periods * getPrice() * percentage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the formatted string of the amount of the moneyBack amount
|
||||
* @return String with currency symbols and proper fractional part
|
||||
*/
|
||||
public String getFormattedMoneyBackAmount() {
|
||||
return Utils.formatCurrency(getMoneyBackAmount());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the maximum time the player can rent the region in advance (milliseconds)
|
||||
* @return The maximum rent time in milliseconds
|
||||
*/
|
||||
public long getMaxRentTime() {
|
||||
return Utils.getDurationFromMinutesOrStringInput(getStringSetting("rent.maxRentTime"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the rent should expire
|
||||
* @return true if the rent has expired and has been unrented, false otherwise
|
||||
*/
|
||||
public boolean checkExpiration() {
|
||||
long now = Calendar.getInstance().getTimeInMillis();
|
||||
if(!isDeleted() && isRented() && now > getRentedUntil()) {
|
||||
// Send message to the player if online
|
||||
Player player = Bukkit.getPlayer(getRenter());
|
||||
if(unRent(false, player)) {
|
||||
if(player != null) {
|
||||
message(player, "unrent-expired");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send the expiration warnings from the selected profile which is specified in the config
|
||||
* Sends all warnings since previous call until (now + normal delay), delay can be found in the config as well
|
||||
*/
|
||||
public void sendExpirationWarnings() {
|
||||
// send from warningsDoneUntil to current+delay
|
||||
if(isDeleted() || !isRented()) {
|
||||
return;
|
||||
}
|
||||
Player player = Bukkit.getPlayer(getRenter());
|
||||
long sendUntil = Calendar.getInstance().getTimeInMillis()+(plugin.getConfig().getInt("expireWarning.delay")*60*1000);
|
||||
// loop through warning defined in the config for the profile that is set for this region
|
||||
String configPath = "expirationWarningProfiles."+getStringSetting("rent.expirationWarningProfile");
|
||||
ConfigurationSection section = plugin.getConfig().getConfigurationSection(configPath);
|
||||
if(section == null) {
|
||||
return;
|
||||
}
|
||||
for(String timeBefore : section.getKeys(false)) {
|
||||
long timeBeforeParsed = Utils.durationStringToLong(timeBefore);
|
||||
if(timeBeforeParsed <= 0) {
|
||||
return;
|
||||
}
|
||||
long checkTime = getRentedUntil()-timeBeforeParsed;
|
||||
|
||||
if(checkTime > warningsDoneUntil && checkTime <= sendUntil) {
|
||||
if(plugin.getConfig().getBoolean(configPath+"."+timeBefore+".warnPlayer") && player != null) {
|
||||
message(player, "rent-expireWarning");
|
||||
}
|
||||
this.runCommands(Bukkit.getConsoleSender(), plugin.getConfig().getStringList(configPath+"."+timeBefore+".commands"));
|
||||
}
|
||||
}
|
||||
warningsDoneUntil = sendUntil;
|
||||
}
|
||||
|
||||
/**
|
||||
* Rent a region
|
||||
* @param player The player that wants to rent the region
|
||||
* @return true if it succeeded and false if not
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean rent(Player player) {
|
||||
if(plugin.getEconomy() == null) {
|
||||
message(player, "general-noEconomy");
|
||||
return false;
|
||||
}
|
||||
//Check if the player has permission
|
||||
if(player.hasPermission("areashop.rent")) {
|
||||
if(getWorld() == null) {
|
||||
message(player, "general-noWorld");
|
||||
return false;
|
||||
}
|
||||
if(getRegion() == null) {
|
||||
message(player, "general-noRegion");
|
||||
return false;
|
||||
}
|
||||
boolean extend = false;
|
||||
if(getRenter() != null && player.getUniqueId().equals(getRenter())) {
|
||||
extend = true;
|
||||
}
|
||||
// Check if the region is available for renting or if the player wants to extend the rent
|
||||
if(!isRented() || extend) {
|
||||
// Check if the players needs to be in the world or region for buying
|
||||
if(restrictedToRegion() && (!player.getWorld().getName().equals(getWorldName())
|
||||
|| !getRegion().contains(player.getLocation().getBlockX(), player.getLocation().getBlockY(), player.getLocation().getBlockZ()))) {
|
||||
message(player, "rent-restrictedToRegion");
|
||||
return false;
|
||||
}
|
||||
if(restrictedToWorld() && !player.getWorld().getName().equals(getWorldName())) {
|
||||
message(player, "rent-restrictedToWorld", player.getWorld().getName());
|
||||
return false;
|
||||
}
|
||||
// Check region limits if this is not extending
|
||||
if(!(extend && config.getBoolean("allowRegionExtendsWhenAboveLimits"))) {
|
||||
|
||||
LimitResult limitResult;
|
||||
if(extend) {
|
||||
limitResult = this.limitsAllow(RegionType.RENT, player, true);
|
||||
} else {
|
||||
limitResult = this.limitsAllow(RegionType.RENT, player);
|
||||
}
|
||||
AreaShop.debug("LimitResult: " + limitResult.toString());
|
||||
if(!limitResult.actionAllowed()) {
|
||||
if(limitResult.getLimitingFactor() == LimitType.TOTAL) {
|
||||
message(player, "total-maximum", limitResult.getMaximum(), limitResult.getCurrent(), limitResult.getLimitingGroup());
|
||||
return false;
|
||||
}
|
||||
if(limitResult.getLimitingFactor() == LimitType.RENTS) {
|
||||
message(player, "rent-maximum", limitResult.getMaximum(), limitResult.getCurrent(), limitResult.getLimitingGroup());
|
||||
return false;
|
||||
}
|
||||
if(limitResult.getLimitingFactor() == LimitType.EXTEND) {
|
||||
message(player, "rent-maximumExtend", limitResult.getMaximum(), limitResult.getCurrent() + 1, limitResult.getLimitingGroup());
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the player can still extend this rent
|
||||
if(extend && !player.hasPermission("areashop.rentextendbypass")) {
|
||||
if(getMaxExtends() >= 0 && getTimesExtended() >= getMaxExtends()) {
|
||||
message(player, "rent-maxExtends");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if there is enough time left before hitting maxRentTime
|
||||
boolean extendToMax = false;
|
||||
double price = getPrice();
|
||||
long timeNow = Calendar.getInstance().getTimeInMillis();
|
||||
long timeRented = 0;
|
||||
long maxRentTime = getMaxRentTime();
|
||||
if(isRented()) {
|
||||
timeRented = getRentedUntil() - timeNow;
|
||||
}
|
||||
if((timeRented + getDuration()) > (maxRentTime)
|
||||
&& !player.hasPermission("areashop.renttimebypass")
|
||||
&& maxRentTime != -1) {
|
||||
// Extend to the maximum instead of adding a full period
|
||||
if(getBooleanSetting("rent.extendToFullWhenAboveMaxRentTime")) {
|
||||
if(timeRented >= maxRentTime) {
|
||||
message(player, "rent-alreadyAtFull");
|
||||
return false;
|
||||
} else {
|
||||
long toRentPart = maxRentTime - timeRented;
|
||||
extendToMax = true;
|
||||
price = ((double)toRentPart)/getDuration()*price;
|
||||
}
|
||||
} else {
|
||||
message(player, "rent-maxRentTime");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(plugin.getEconomy().has(player, getWorldName(), price)) {
|
||||
// Broadcast and check event
|
||||
RentingRegionEvent event = new RentingRegionEvent(this, player, extend);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if(event.isCancelled()) {
|
||||
message(player, "general-cancelled", event.getReason());
|
||||
return false;
|
||||
}
|
||||
|
||||
// Substract the money from the players balance
|
||||
EconomyResponse r = plugin.getEconomy().withdrawPlayer(player, getWorldName(), price);
|
||||
if(!r.transactionSuccess()) {
|
||||
message(player, "rent-payError");
|
||||
AreaShop.debug("Something went wrong with getting money from " + player.getName() + " while renting " + getName() + ": " + r.errorMessage);
|
||||
return false;
|
||||
}
|
||||
// Optionally give money to the landlord
|
||||
OfflinePlayer landlordPlayer = null;
|
||||
if(getLandlord() != null) {
|
||||
landlordPlayer = Bukkit.getOfflinePlayer(getLandlord());
|
||||
}
|
||||
String landlordName = getLandlordName();
|
||||
if(landlordName != null) {
|
||||
if(landlordPlayer != null && landlordPlayer.getName() != null) {
|
||||
r = plugin.getEconomy().depositPlayer(landlordPlayer, getWorldName(), price);
|
||||
} else {
|
||||
r = plugin.getEconomy().depositPlayer(landlordName, getWorldName(), price);
|
||||
}
|
||||
if(r == null || !r.transactionSuccess()) {
|
||||
AreaShop.warn("Something went wrong with paying '"+landlordName+"' "+Utils.formatCurrency(price)+" for his rent of region "+getName()+" to "+player.getName());
|
||||
}
|
||||
}
|
||||
|
||||
if(!extend) {
|
||||
// Run commands
|
||||
runEventCommands(RegionEvent.RENTED, true);
|
||||
} else {
|
||||
// Run commands
|
||||
runEventCommands(RegionEvent.EXTENDED, true);
|
||||
}
|
||||
|
||||
// Get the time until the region will be rented
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
if(extendToMax) {
|
||||
calendar.setTimeInMillis(calendar.getTimeInMillis() + getMaxRentTime());
|
||||
} else if(extend) {
|
||||
calendar.setTimeInMillis(getRentedUntil()+getDuration());
|
||||
} else {
|
||||
calendar.setTimeInMillis(calendar.getTimeInMillis() + getDuration());
|
||||
}
|
||||
|
||||
// Add values to the rent and send it to FileManager
|
||||
setRentedUntil(calendar.getTimeInMillis());
|
||||
setRenter(player.getUniqueId());
|
||||
updateLastActiveTime();
|
||||
|
||||
// Fire schematic event and updated times extended
|
||||
if(!extend) {
|
||||
this.handleSchematicEvent(RegionEvent.RENTED);
|
||||
setTimesExtended(0);
|
||||
} else {
|
||||
setTimesExtended(getTimesExtended() + 1);
|
||||
}
|
||||
|
||||
// Notify about updates
|
||||
this.notifyAndUpdate(new RentedRegionEvent(this, extend));
|
||||
|
||||
// Send message to the player
|
||||
if(extendToMax) {
|
||||
message(player, "rent-extendedToMax");
|
||||
} else if(extend) {
|
||||
message(player, "rent-extended");
|
||||
} else {
|
||||
message(player, "rent-rented");
|
||||
}
|
||||
if(!extend) {
|
||||
// Run commands
|
||||
this.runEventCommands(RegionEvent.RENTED, false);
|
||||
} else {
|
||||
// Run commands
|
||||
this.runEventCommands(RegionEvent.EXTENDED, false);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
// Player has not enough money
|
||||
if(extend) {
|
||||
message(player, "rent-lowMoneyExtend", Utils.formatCurrency(plugin.getEconomy().getBalance(player, getWorldName())));
|
||||
} else {
|
||||
message(player, "rent-lowMoneyRent", Utils.formatCurrency(plugin.getEconomy().getBalance(player, getWorldName())));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
message(player, "rent-someoneElse");
|
||||
}
|
||||
} else {
|
||||
message(player, "rent-noPermission");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unrent a region, reset to unrented
|
||||
* @param giveMoneyBack true if money should be given back to the player, false otherwise
|
||||
* @param executor The CommandSender that should get the cancelled message if there is any, or null
|
||||
* @return true if unrenting succeeded, othwerwise false
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean unRent(boolean giveMoneyBack, CommandSender executor) {
|
||||
boolean own = executor != null && executor instanceof Player && this.isRenter((Player)executor);
|
||||
if(executor != null) {
|
||||
if(!executor.hasPermission("areashop.unrent") && !own) {
|
||||
message(executor, "unrent-noPermissionOther");
|
||||
return false;
|
||||
}
|
||||
if(!executor.hasPermission("areashop.unrent") && !executor.hasPermission("areashop.unrentown") && own) {
|
||||
message(executor, "unrent-noPermission");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(plugin.getEconomy() == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Broadcast and check event
|
||||
UnrentingRegionEvent event = new UnrentingRegionEvent(this);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if(event.isCancelled()) {
|
||||
message(executor, "general-cancelled", event.getReason());
|
||||
return false;
|
||||
}
|
||||
|
||||
// Run commands
|
||||
this.runEventCommands(RegionEvent.UNRENTED, true);
|
||||
double moneyBack = getMoneyBackAmount();
|
||||
if(moneyBack > 0 && giveMoneyBack) {
|
||||
boolean noPayBack = false;
|
||||
OfflinePlayer landlordPlayer = null;
|
||||
if(getLandlord() != null) {
|
||||
landlordPlayer = Bukkit.getOfflinePlayer(getLandlord());
|
||||
}
|
||||
String landlordName = getLandlordName();
|
||||
EconomyResponse r;
|
||||
if(landlordName != null) {
|
||||
if(landlordPlayer != null && landlordPlayer.getName() != null) {
|
||||
r = plugin.getEconomy().withdrawPlayer(landlordPlayer, getWorldName(), moneyBack);
|
||||
} else {
|
||||
r = plugin.getEconomy().withdrawPlayer(landlordName, getWorldName(), moneyBack);
|
||||
}
|
||||
if(r == null || !r.transactionSuccess()) {
|
||||
noPayBack = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Give back the money
|
||||
OfflinePlayer player = Bukkit.getOfflinePlayer(getRenter());
|
||||
if(player != null && !noPayBack) {
|
||||
r = null;
|
||||
boolean error = false;
|
||||
try {
|
||||
if(player.getName() != null) {
|
||||
r = plugin.getEconomy().depositPlayer(player, getWorldName(), moneyBack);
|
||||
} else if(getPlayerName() != null) {
|
||||
r = plugin.getEconomy().depositPlayer(getPlayerName(), getWorldName(), moneyBack);
|
||||
}
|
||||
} catch(Exception e) {
|
||||
error = true;
|
||||
}
|
||||
if(error || r == null || !r.transactionSuccess()) {
|
||||
AreaShop.warn("Something went wrong with paying back to "+getPlayerName()+" money while unrenting region "+getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update the signs and region flags
|
||||
handleSchematicEvent(RegionEvent.UNRENTED);
|
||||
|
||||
// Send messages
|
||||
message(executor, "unrent-unrented");
|
||||
|
||||
// Remove friends, the owner and renteduntil values
|
||||
getFriendsFeature().clearFriends();
|
||||
UUID oldRenter = getRenter();
|
||||
setRenter(null);
|
||||
setRentedUntil(null);
|
||||
setTimesExtended(-1);
|
||||
removeLastActiveTime();
|
||||
|
||||
// Notify about updates
|
||||
this.notifyAndUpdate(new UnrentedRegionEvent(this, oldRenter, Math.max(0, moneyBack)));
|
||||
|
||||
// Run commands
|
||||
this.runEventCommands(RegionEvent.UNRENTED, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkInactive() {
|
||||
if(isDeleted() || !isRented()) {
|
||||
return false;
|
||||
}
|
||||
long inactiveSetting = getInactiveTimeUntilUnrent();
|
||||
OfflinePlayer player = Bukkit.getOfflinePlayer(getRenter());
|
||||
if(inactiveSetting <= 0 || player.isOp()) {
|
||||
return false;
|
||||
}
|
||||
long lastPlayed = getLastActiveTime();
|
||||
//AreaShop.debug("currentTime=" + Calendar.getInstance().getTimeInMillis() + ", getLastPlayed()=" + lastPlayed + ", timeInactive=" + (Calendar.getInstance().getTimeInMillis()-player.getLastPlayed()) + ", inactiveSetting=" + inactiveSetting);
|
||||
if(Calendar.getInstance().getTimeInMillis() > (lastPlayed + inactiveSetting)) {
|
||||
AreaShop.info("Region "+getName()+" unrented because of inactivity for player "+getPlayerName());
|
||||
AreaShop.debug("currentTime=" + Calendar.getInstance().getTimeInMillis() + ", getLastPlayed()=" + lastPlayed + ", timeInactive=" + (Calendar.getInstance().getTimeInMillis()-player.getLastPlayed()) + ", inactiveSetting=" + inactiveSetting);
|
||||
return this.unRent(true, null);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,346 @@
|
||||
# ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
|
||||
# ║ config.yml file of the AreaShop plugin created by NLThijs48, Github can be found at https://github.com/NLthijs48/AreaShop. ║
|
||||
# ║ This file contains options to change the working of the plugin, the profiles defined here can be used in default.yml. ║
|
||||
# ║ More information and tutorials can be found on the wiki: https://github.com/NLthijs48/AreaShop/wiki ║
|
||||
# ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
|
||||
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ GENERAL: Options that influence the global state of the plugin │
|
||||
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
## Chatprefix used for all messages in the chat, also changes the greeting messages.
|
||||
chatPrefix:
|
||||
- '[darkgreen][AreaShop][reset]'
|
||||
- ' hover: AreaShop region management plugin'
|
||||
- ' hover: %lang:action|Click to check the available commands|%'
|
||||
- ' command: /areashop help'
|
||||
- ' '
|
||||
## The language file that should be used, check the 'lang' folder for build-in languages (use the filename without .yml here).
|
||||
## More information can be found here: https://github.com/NLthijs48/AreaShop/wiki/Language-support.
|
||||
language: EN
|
||||
## The tags that need to be written on the first line of a sign to use it with AreaShop.
|
||||
signTags:
|
||||
## Add a rental region.
|
||||
rent: '[asrent]'
|
||||
## Add a buy region.
|
||||
buy: '[asbuy]'
|
||||
## Add a sign to an existing region.
|
||||
add: '[as]'
|
||||
|
||||
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ NUMBERS: Options to change the display of prices. │
|
||||
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
## The characters displayed before a price.
|
||||
moneyCharacter: '$'
|
||||
## The characters displayed after a price.
|
||||
moneyCharacterAfter: ''
|
||||
## How many numbers behind the dot should be shown (2 will make numbers like '8.55', '9.01', '5.20').
|
||||
fractionalNumbers: 2
|
||||
## Set this to true if you want to hide '.0' for a number like '15.0' ('4.50' will still stay '4.50').
|
||||
hideEmptyFractionalPart: true
|
||||
## Use metric suffixes if the price is above this number (use 1.00M instead of 1000000.00 etc.), use -1 to disable.
|
||||
## Indications are used as defined on: http://en.wikipedia.org/wiki/Metric_prefix, implemented from 'k' to 'Y'.
|
||||
metricSuffixesAbove: 1000000.0
|
||||
## The character(s) to use as decimal mark.
|
||||
decimalMark: '.'
|
||||
|
||||
|
||||
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ RENTING: Options that apply to all rent regions. │
|
||||
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
## Timeformat to use on the signs, default is like '30-06 14:52', US format: 'MM-dd KK:mm a'.
|
||||
## Search for 'java SimpleDateFormat' for more options and documentation.
|
||||
timeFormatSign: 'dd-MM HH:mm'
|
||||
## Timeformat used in the chat, default is like '30 june 2014 14:52', US format: 'MMMMMMMMMMMMMMMMM dd yyyy KK:mm a'.
|
||||
## Search for 'java SimpleDateFormat' for more options and documentation.
|
||||
timeFormatChat: 'dd MMMMMMMMMMMMMMMMM yyyy HH:mm'
|
||||
## Time indicators, used for specifing time periods (for example rent duration).
|
||||
seconds: [s, sec, secs, second, seconds]
|
||||
minutes: [m, min, mins, minute, minutes]
|
||||
hours: [h, hour, hours]
|
||||
days: [d, day, days]
|
||||
weeks: [w, week, weeks]
|
||||
months: [M, month, months]
|
||||
years: [y, year, years]
|
||||
|
||||
|
||||
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ PERMISSION GROUPS: Assigned by giving players certain permissions. │
|
||||
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
## Configure the max total regions, max rent regions and max buy regions with different groups (-1 is unlimited).
|
||||
## Assign a group to players by giving them the permission 'areashop.limits.<group>'.
|
||||
## Every player already has the group 'default', OPs bypass the limits because of the 'areashop.limitbypass' permission.
|
||||
## All the groups applied to the player will be checked and only if they all allow an extra region it will be allowed.
|
||||
## More information like limits for regions of a certain group or in a certain word can be found here:
|
||||
## https://github.com/NLthijs48/AreaShop/wiki/Limitgroups-information-and-examples.
|
||||
limitGroups:
|
||||
default:
|
||||
total: 1
|
||||
rents: 1
|
||||
buys: 1
|
||||
|
||||
|
||||
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ PROFILES: Assigned in general (default.yml), for a group (groups.yml) or individually (<region>.yml) │
|
||||
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
## The idea of profiles is that you can make different variations of them, and then assign the different variations to
|
||||
## subsets of regions (by assigning a profile to a region group, or an individual region).
|
||||
|
||||
## Determines the layout and functions of the signs linked to regions.
|
||||
## Set 'general.signProfile' in default.yml, groups or individual regions to set the profile.
|
||||
## The following sections can be added for performing certain commands when the sign is clicked:
|
||||
## rightClickPlayer, rightClickConsole, shiftRightClickPlayer, shiftRightClickConsole,
|
||||
## leftClickPlayer, leftClickConsole, shiftLeftClickPlayer, shiftLeftClickConsole.
|
||||
## Sections with 'Player' at the end will be run by the player that clicks the sign and 'Console' ones from the console.
|
||||
signProfiles:
|
||||
default:
|
||||
forrent:
|
||||
line1: '&2&l[For Rent]'
|
||||
line2: '%region%'
|
||||
line3: '%duration%'
|
||||
line4: '%price%'
|
||||
rightClickPlayer:
|
||||
- 'areashop rent %region%'
|
||||
#- 'areashop message %clicker% %lang:confirm-rent|%region%|%' # Alternative to first ask for confirmation
|
||||
leftClickPlayer:
|
||||
- 'areashop info region %region%'
|
||||
rented:
|
||||
line1: '&4&l[Rented]'
|
||||
line2: '%region%'
|
||||
line3: '%player%'
|
||||
line4: '%untilshort%'
|
||||
rightClickPlayer:
|
||||
- 'areashop rent %region%'
|
||||
#- 'areashop message %clicker% %lang:confirm-extend|%region%|%' # Alternative to first ask for confirmation
|
||||
leftClickPlayer:
|
||||
- 'areashop info region %region%'
|
||||
shiftRightClickPlayer:
|
||||
- 'areashop message %clicker% %lang:confirm-unrent|%region%|%'
|
||||
forsale:
|
||||
line1: '&2&l[For Sale]'
|
||||
line2: '%region%'
|
||||
line3: '%price%'
|
||||
line4:
|
||||
rightClickPlayer:
|
||||
- 'areashop buy %region%'
|
||||
#- 'areashop message %clicker% %lang:confirm-buy|%region%|%' # Alternative to first ask for confirmation
|
||||
leftClickPlayer:
|
||||
- 'areashop info region %region%'
|
||||
resell:
|
||||
line1: '&9&l[Resale]'
|
||||
line2: '%region%'
|
||||
line3: '%resellprice%'
|
||||
line4: '&8%player%'
|
||||
rightClickPlayer:
|
||||
- 'areashop buy %region%'
|
||||
#- 'areashop message %clicker% %lang:confirm-buy|%region%|%' # Alternative to first ask for confirmation
|
||||
leftClickPlayer:
|
||||
- 'areashop info region %region%'
|
||||
shiftRightClickPlayer:
|
||||
- 'areashop stopresell %region%'
|
||||
sold:
|
||||
line1: '&4&l[Sold]'
|
||||
line2: '%region%'
|
||||
line3: '%player%'
|
||||
line4:
|
||||
rightClickPlayer:
|
||||
- 'areashop buy %region%'
|
||||
leftClickPlayer:
|
||||
- 'areashop info region %region%'
|
||||
shiftRightClickPlayer:
|
||||
- 'areashop message %clicker% %lang:confirm-sell|%region%|%'
|
||||
|
||||
## Flag profiles specify which flags to set on the WorldGuard regions depending on their state.
|
||||
## All normal region flags as present in WorldGuard can be used, and also members, owners, priority and parent.
|
||||
## The members and owners flag normally take a list of UUID's separated by a comma, adding by name is possible with 'n:<name>'.
|
||||
## You can add groups by using 'g:<groupname>', so an example woul be: '%uuid%, %friendsuuid%, g:vip, n:coolGuy'.
|
||||
## For allow/deny flags like 'entry' and 'exit' you can set the group setting by using 'g:<scope>', <scope> is one of the following:
|
||||
## members, non_members, owners, non_owners, all. Example, only members can enter the region:
|
||||
## entry: 'deny g:non_members'
|
||||
## '' will remove the flag from the region.
|
||||
flagProfiles:
|
||||
default:
|
||||
ALL: # Flags to apply for all states
|
||||
priority: 10
|
||||
members: ''
|
||||
interact: 'deny g:non_members' # Only allow region members/owners to use things in the region (chests, furnace, animals, etc.)
|
||||
forrent:
|
||||
greeting: '%lang:prefix%%lang:greeting-forrent%'
|
||||
rented:
|
||||
members: '%uuid%, %friendsuuid%'
|
||||
greeting: '%lang:prefix%%lang:greeting-rented%'
|
||||
forsale:
|
||||
greeting: '%lang:prefix%%lang:greeting-forsale%'
|
||||
sold:
|
||||
members: '%uuid%, %friendsuuid%'
|
||||
greeting: '%lang:prefix%%lang:greeting-bought%'
|
||||
resale:
|
||||
members: '%uuid%, %friendsuuid%'
|
||||
greeting: '%lang:prefix%%lang:greeting-resale%'
|
||||
|
||||
## Run commands when an event happens.
|
||||
## Commands at a 'before' section will execute before the region details are changed in the AreaShop system
|
||||
## and before any other actions occurred (setting the owner, saving/loading schematics, etc.),
|
||||
## the 'after' commands will be run when all changes are done.
|
||||
## You can add a list of commands to 'before' and 'after'.
|
||||
eventCommandProfiles:
|
||||
default:
|
||||
created:
|
||||
before:
|
||||
after:
|
||||
## - "say An AreaShop region has been created: %region%"
|
||||
deleted:
|
||||
before:
|
||||
after:
|
||||
rented:
|
||||
before:
|
||||
after:
|
||||
extended:
|
||||
before:
|
||||
after:
|
||||
unrented:
|
||||
before:
|
||||
after:
|
||||
bought:
|
||||
before:
|
||||
after:
|
||||
sold:
|
||||
before:
|
||||
after:
|
||||
resell:
|
||||
before:
|
||||
after:
|
||||
|
||||
## For the following events you can specify if you want to restore or save the region to a schematic.
|
||||
## After 'save:' or 'restore:' you enter the name of the file to restore from/to.
|
||||
## The limit 'maximumBlocks' applies to restoring/saving schematics, be sure your region size is below the limit.
|
||||
## More information can be found here: https://github.com/NLthijs48/AreaShop/wiki/Region-blocks-save-restore.
|
||||
schematicProfiles:
|
||||
default:
|
||||
created:
|
||||
save: '%type%-%region%'
|
||||
restore: ''
|
||||
deleted:
|
||||
save: ''
|
||||
restore: '%type%-%region%'
|
||||
rented:
|
||||
save: ''
|
||||
restore: ''
|
||||
unrented:
|
||||
save: ''
|
||||
restore: '%type%-%region%'
|
||||
bought:
|
||||
save: ''
|
||||
restore: ''
|
||||
sold:
|
||||
save: ''
|
||||
restore: '%type%-%region%'
|
||||
resell:
|
||||
save: ''
|
||||
restore: ''
|
||||
|
||||
## Profiles that specify what happens when their rental region almost runs out.
|
||||
## Time identifiers specify how much time before the rent is actually over the player should be notified.
|
||||
## When warnPlayer is set to true a message will be send that is specified in the language file.
|
||||
## All commands in the list below 'commands:' will execute together with the warning, all normal variables can be used.
|
||||
expirationWarningProfiles:
|
||||
default:
|
||||
"1 day":
|
||||
warnPlayer: true
|
||||
commands:
|
||||
## - "say %region% is about to expire for %player%: %timeleft% left"
|
||||
"1 hour":
|
||||
warnPlayer: true
|
||||
commands:
|
||||
"5 minutes":
|
||||
warnPlayer: true
|
||||
commands:
|
||||
|
||||
|
||||
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ ADVANCED AND DEBUG: Specific options to tweak the plugin precisely and check if it functions correctly. │
|
||||
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
## Blacklist of region names that cannot be added to AreaShop for renting or buying. Regular expressions can be used, search
|
||||
## for 'java regex pattern' to find documentation about how to use it.
|
||||
## Example: Blocking all regions that have a name like 'house_1', 'house_2', etc. would be done with 'house_\d+'.
|
||||
## The '\d' represents the numerical digits 0-9, the + symbol represents 1 or more times repeated.
|
||||
## This means it would also block 'house_123' and 'house_000456'. It will not block 'ahouse_1' or 'house_'.
|
||||
blacklist:
|
||||
- '__global__'
|
||||
## Minimum length of the numbers that are suffixed for region names generated by the '/as stack' command.
|
||||
## When having this at 3 it will generate names like this: 'region-001', 'region-014', 'region-4567'.
|
||||
stackRegionNumberLength: 3
|
||||
# Allow/disallow adding players that did not visit the server yet as friend of a region.
|
||||
addFriendNotExistingPlayers: false
|
||||
## Enable sending stats to http://mcstats.org/ (Metrics plugin).
|
||||
## This information will give me an indication about how much the plugin is used and encourages me to continue development.
|
||||
sendStats: true
|
||||
## If enabled it will check for updates when loading the plugin, it will never download files, it will only notify about it
|
||||
## A message will be printed in the console when an update is available and OPs will be notified when joining the server.
|
||||
checkForUpdates: true
|
||||
## Use colors when sending messages to console and log files.
|
||||
useColorsInConsole: false
|
||||
## Use tellraw style messages
|
||||
useFancyMessages: true
|
||||
## Update all region flags and signs after starting the plugin (uses the 'regionsPerTick' setting from the 'update' section).
|
||||
## This ensures that changes to the config are directly visible after restarting the server.
|
||||
updateRegionsOnStartup: true
|
||||
## Enables / disables debug messages in the console, could be useful to figure out where errors come from.
|
||||
debug: false
|
||||
## Version of the config, do not change!
|
||||
version: ${project.version}
|
||||
## Maximum number of blocks to save to or restore from a .schemetic file.
|
||||
maximumBlocks: 1000000
|
||||
## Maximum number of locations the teleport function should check to find a safe spot.
|
||||
maximumTries: 50000
|
||||
|
||||
|
||||
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ VARIABLES: Variables that can be used in messages and settings where a region is available. │
|
||||
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
## If a tag has no value (for example %player% when the region is not rented/bought) then the tag will not get replaced.
|
||||
## %region% The region name (with correct capitalization).
|
||||
## %player% The name of the player that rents/buys the region (with correct capitalization).
|
||||
## %uuid% The UUID of the player that rents/buys the region.
|
||||
## %friends% The names of friends added to this region separated by ', '.
|
||||
## %friendsuuid% The UUID's of friends added to this region separated by ', '.
|
||||
## $landlord$ The name of the landlord.
|
||||
## %landlorduuid% The UUID of the landlord.
|
||||
## %price% The price of the region formatted with the configured characters before and after the number.
|
||||
## %rawprice% The price without formatting, like '10.0' or '7.77'.
|
||||
## %duration% The duration of a rent region, for example '1 d', '4 minutes' or '2 years'.
|
||||
## %world% The name of the world that the region is in.
|
||||
## %type% The type of the region, 'rent' or 'buy'.
|
||||
## %until% The end time of a rent formatted as configured with 'timeFormatChat'.
|
||||
## %untilshort% The end time of a rent formatted as configured with 'timeFormatSign'.
|
||||
## %width% The width of the region (number of blocks on the x-axis).
|
||||
## %depth% The depth of the region (number of blocks on the z-axis).
|
||||
## %height% The height of the region (number of blocks on the y-axis).
|
||||
## %timeleft% The time left on the rent (uses the unit of time that fits best, minutes used from 121 seconds till 120 minutes).
|
||||
## %clicker% The name of the player that clicked the sign (only to be used in the signProfiles section).
|
||||
## %resellprice% The price of a region when it is in resell mode.
|
||||
## %rawresellprice% The resellprice without formatting.
|
||||
## %moneyback% The amount of money the player will get back when unrenting/selling the region (formatted with currency layout).
|
||||
## %rawmoneyback% The moneyback without formatting.
|
||||
## %moneybackpercent% The percentage of the price the player will get back when unrenting the region.
|
||||
## %maxextends% The maximum number of extends a player can do on the region.
|
||||
## %extendsleft% The number of extends that are left (maxextends - timesextended).
|
||||
## %maxrenttime% The maximum time you can rent a region in advance (human readable).
|
||||
## %inactivetime% The maximum time a player may be inactive before unrent/sell (human readable).
|
||||
## %year% The current year.
|
||||
## %month% The current month in the year.
|
||||
## %day% The current day in the month.
|
||||
## %hour% The current hour in the day (0-23).
|
||||
## %minute% The current minute of the hour.
|
||||
## %second% The current second of the minute.
|
||||
## %millisecond% The current millisecond of the second.
|
||||
## %epoch% The number of milliseconds since January 1, 1970 (Unix Epoch).
|
||||
## %tpx% The exact x coordinate of the location that the teleport is set to
|
||||
## %tpy% The exact y coordinate of the location that the teleport is set to
|
||||
## %tpz% The exact z coordinate of the location that the teleport is set to
|
||||
## %tpblockx% The rounded x coordinate of the location that the teleport is set to
|
||||
## %tpblocky% The rounded y coordinate of the location that the teleport is set to
|
||||
## %tpblockz% The rounded z coordinate of the location that the teleport is set to
|
||||
## %tppitch% The exact pitch of the teleport location
|
||||
## %tppitchround% The rounded pitch of the teleport location
|
||||
## %tpyaw% The exact yaw of the teleport location
|
||||
## %tpyawround% The rounded yaw of the teleport location
|
||||
## %tpworld% The world name of the teleport location
|
||||
@@ -0,0 +1,78 @@
|
||||
# ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
|
||||
# ║ default.yml file of the AreaShop plugin created by NLThijs48, Github can be found at https://github.com/NLthijs48/AreaShop.║
|
||||
# ║ All settings below are default settings and can be overridden by group settings or individual region settings. ║
|
||||
# ║ More information and tutorials can be found on the wiki: https://github.com/NLthijs48/AreaShop/wiki ║
|
||||
# ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
|
||||
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ GENERAL: Options for all regions. │
|
||||
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
general:
|
||||
## Set to true to enable saving/restoring for regions as specified in the profile below, which is specified in the config.
|
||||
enableRestore: false
|
||||
## The schematic profile from the 'schematicProfiles' section in the config.
|
||||
schematicProfile: 'default'
|
||||
## The event commands profile from the 'eventCommandProfiles' section in the config.
|
||||
eventCommandProfile: 'default'
|
||||
## The profile for the format of the sign from the 'signProfiles' section in the config.
|
||||
signProfile: 'default'
|
||||
## The profile for the WorldGuard flags from the 'flagProfiles' section in the config.
|
||||
flagProfile: 'default'
|
||||
## The y location within the region to start searching for safe teleport spots (x and z will be in the middle of the region).
|
||||
## Possible values: bottom, middle, top, integer.
|
||||
teleportLocationY: bottom
|
||||
## If true the teleportation algorithm only allows telportation to inside the region, otherwise it will expand
|
||||
## a cube from the starting point to check for safe spots (then it could end outside of the region).
|
||||
teleportIntoRegion: true
|
||||
## Same as above, but then for when you teleport to the sign of a region instead of the region itself.
|
||||
teleportToSignIntoRegion: false
|
||||
## Set where the '/as find' command should teleport the player to, set to true for the first sign of the region and set to
|
||||
## false to teleport to the location set by '/as settp' or the default location (if not set).
|
||||
findTeleportToSign: true
|
||||
## Restricts the '/as buy' and '/as rent' commands to the world of the region.
|
||||
restrictedToWorld: false
|
||||
## Restricts the '/as buy' and '/as rent' commands to the region itself (player needs to be inside).
|
||||
restrictedToRegion: false
|
||||
## The UUID of the landlord, this player will receive all money from rents/buys (but not reselling with '/as resell').
|
||||
landlord: ''
|
||||
## Name of the landlord, if the landlord UUID setting is not provided then the name will be used instead
|
||||
landlordName: ''
|
||||
|
||||
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ RENT: Options for rent regions. │
|
||||
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
rent:
|
||||
## The default price of a rental region.
|
||||
price: 1000
|
||||
## The default duration of a rental region, you can find all time indicators in config.yml below the RENTING header.
|
||||
duration: '1 day'
|
||||
## The percentage of the rent price you get back if you unrent the region (price of time left will be multiplied by this/100).
|
||||
moneyBack: 100
|
||||
## Maximum number of extends a player can do (-1 for infinite, 0 for no extending), if they are at this number then
|
||||
## they are force to let their rent run out (and can rent it again at that point).
|
||||
maxExtends: -1
|
||||
## The Maximum time they can have the region rented in advance (use times like '1 day' etc, or 'unlimited' for no limit).
|
||||
## This can prevent players from renting their region for a year, and to ensure they periodically have to extend their rent.
|
||||
maxRentTime: 'unlimited'
|
||||
## Automatically unrent the region after the specified time between the last login time of the renter and the current time.
|
||||
## Use times like '1 day' etc, or 'disabled' for never.
|
||||
inactiveTimeUntilUnrent: 'disabled'
|
||||
## If a region of a player has less then this time left when he joins the server he will get a notice about his region.
|
||||
## Use '' to disable.
|
||||
warningOnLoginTime: '1 day'
|
||||
## The profile for the expiration warnings from the 'expirationWarningProfiles' section in the config.
|
||||
expirationWarningProfile: 'default'
|
||||
## If renting the region would go above 'maxRentTIme', then extend to the maximum instead of cancelling the rent.
|
||||
extendToFullWhenAboveMaxRentTime: true
|
||||
|
||||
|
||||
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ BUY: Options for buy regions. │
|
||||
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
buy:
|
||||
## The default price of a buy region.
|
||||
price: 1000
|
||||
## The percentage of the price you get back if you sell the region.
|
||||
moneyBack: 100
|
||||
## Automatically sell the region after the specified number of minutes between the last login time of the buyer and the current time
|
||||
## Use times like '1 day' etc, or 'disabled' for never.
|
||||
inactiveTimeUntilSell: 'disabled'
|
||||
@@ -0,0 +1,50 @@
|
||||
# ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
|
||||
# ║ hiddenConfig.yml file of the AreaShop plugin created by NLThijs48. ║
|
||||
# ║ Options in this file are available in config.yml, but are not shown by default there. ║
|
||||
# ║ The options in these file are either very advanced, or not useful for the majority of users. ║
|
||||
# ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
|
||||
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ TIMERS: Settings to define how often scheduled tasks run. │
|
||||
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
## Setting the 'delay' setting to 0 or lower will prevent the taks from runnning.
|
||||
## The 'delay' settings are specified using a number followed by one of the identifiers as defined in config.yml.
|
||||
## The 'regionsPerTick' settings are to configure how fast something goes, lower value is less lag, but slower updates.
|
||||
## There are 20 ticks in 1 second, so if you set 'regionPerTick' to 5, then 5*20=100 regions per second will be updated.
|
||||
|
||||
## Timings for saving files that need saving.
|
||||
saving:
|
||||
delay: '10 minutes'
|
||||
regionsPerTick: 1
|
||||
## Timings for rent expiration checking.
|
||||
expiration:
|
||||
delay: '59 seconds'
|
||||
regionsPerTick: 5
|
||||
## Timings for expiration warning to online players.
|
||||
expireWarning:
|
||||
delay: '5 minutes'
|
||||
regionsPerTick: 5
|
||||
## Timings for updating signs and region flags ('/as reload' or after '/as groupadd' or '/as groupdel').
|
||||
update:
|
||||
regionsPerTick: 5
|
||||
## Time between checking if any regions need to be unrented because the player was not online for the specified time period.
|
||||
inactive:
|
||||
delay: '15 minutes'
|
||||
regionsPerTick: 5
|
||||
## Timings for the periodic updating of signs (for timeleft tags etc).
|
||||
signs:
|
||||
delay: '60 seconds'
|
||||
regionsPerTick: 3
|
||||
## Number of regions per tick to check when a player joins to see if his name changed for regions he owned (updates the regions when changed).
|
||||
nameupdate:
|
||||
regionsPerTick: 10
|
||||
## Timings for adding regions to AreaShop ('/as stack').
|
||||
adding:
|
||||
regionsPerTick: 2
|
||||
|
||||
|
||||
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ OTHER: All other settings. │
|
||||
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
## Allow or disallow extending a rental region when the player is above his limits enforced by the 'limitGroups' section below.
|
||||
## false will ensure a player will eventually lose his region when he has no access anymore.
|
||||
allowRegionExtendsWhenAboveLimits: false
|
||||
@@ -0,0 +1,541 @@
|
||||
# ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
|
||||
# ║ Language file of the AreaShop plugin created by NLThijs48, Github can be found at https://github.com/NLthijs48/AreaShop ║
|
||||
# ║ Language: German, Version: V2.3.2, Percentage translated: 96% ║
|
||||
# ║ This file will be overwritten at each startup/reload of the plugin, if you want to change anything then do the following: ║
|
||||
# ║ 1: Make a copy of this file ║
|
||||
# ║ 2: Rename it to <servername>.yml (don't use a language code as filename, could otherwise be overwritten in future updates) ║
|
||||
# ║ 3: Change the 'language' setting in config.yml to '<servername>', do not include '.yml' ║
|
||||
# ║ 4: Change the strings in the new file to your liking and save the file ║
|
||||
# ║ 5: Use '/as reload' or reload/restart your server to see the changes ║
|
||||
# ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
|
||||
button: "[bold]<%0%>[/bold]"
|
||||
|
||||
command:
|
||||
- "[bold]%0%[/bold]"
|
||||
- " hover: %lang:action|Benutze %1%|%"
|
||||
- " command: %1%"
|
||||
|
||||
helpCommand:
|
||||
- "[gold]%0% [gray]-[reset]"
|
||||
- " hover: %lang:action|Benutze %0%|%"
|
||||
- " command: %0%"
|
||||
|
||||
region: "%lang:tRegion|%region%|%"
|
||||
|
||||
tRegion:
|
||||
- "[bold]%0%[/bold]"
|
||||
- " hover: Region %0%"
|
||||
- " hover: %lang:action|Region information|%"
|
||||
- " command: /areashop info region %0%"
|
||||
|
||||
player: "%lang:tPlayer|%player%|%"
|
||||
|
||||
tPlayer:
|
||||
- "[bold]%0%[/bold]"
|
||||
- " hover: Spieler %0%"
|
||||
- " hover: %lang:action|Regionen von%0%|%"
|
||||
- " command: /areashop info player %0%"
|
||||
|
||||
landlord:
|
||||
- "[bold]%landlord%[/bold]"
|
||||
- " hover: Vermieter %landlord%"
|
||||
- " hover: %lang:action|Regionen von %landlord%|%"
|
||||
- " command: /areashop info player %landlord%"
|
||||
|
||||
total-maximum: "Du kannst nicht mehr als %0% Region(en) mieten/kaufen (Du hast bereits %1% in Gruppe '%2%')."
|
||||
|
||||
general-notReady: "AreaShop ist noch nicht vollständig geladen, bitte warten."
|
||||
general-noWorld: "Du kannst das nicht machen, die Welt von %lang:region% ist derzeit nicht verfügbar (Welt '%world%')."
|
||||
general-noRegion: "Du kannst das nicht machen, die WorldGuard Region ist derzeit nicht verfügbar (region %lang:region%)."
|
||||
general-noEconomy: "AreaShop kann kein (korrekt) installiertes Economy-Plugin finden, bitte informiere den Serverinhaber darüber."
|
||||
general-cancelled: "%0%"
|
||||
|
||||
cmd-notValid: "Der Befehl ist ungültig, nutze '/as help' für weitere Informationen."
|
||||
cmd-onlyByPlayer: "Dieser Befehl kann nur von einem Spieler benutzt werden."
|
||||
cmd-weOnlyByPlayer: "Eine WorldEdit-Selektion kann nur von einem Spieler gewählt werden, gib die Region als extra Argument an."
|
||||
cmd-noSelection: "Du hast mit WorldEdit nichts markiert."
|
||||
cmd-noRegionsFound: "In deiner Selektion wurden keine in AreaShop registrierten Regionen gefunden."
|
||||
cmd-noWERegionsFound: "Es wurden keine WorldEdit-Regionen gefunden, die sich mit deiner Selektion überschneiden."
|
||||
cmd-notRegistered: "Die angegebene Region ist in AreaShop nicht verfügbar: %0%."
|
||||
cmd-noRegionsAtLocation: "Keine Regionen an deiner Position gefunden, gib die Region als Argument an."
|
||||
cmd-moreRegionsAtLocation: "Mehr als eine Region wurde an deiner Position gefunden, gib die Region als Argument an."
|
||||
cmd-automaticRegionOnlyByPlayer: "Die Automatische Auswahl einer Region ist nur für Spieler möglich, gib die Region als Argument an."
|
||||
|
||||
help-header: "Hilfeseite mit Befehlen, die du ausführen kannst."
|
||||
help-noPermission: "Du hast keine Permissions, um diese Hilfeseite anzuzeigen."
|
||||
help-alias: "Befehlsaliase: /areashop, /as."
|
||||
help-help: "%lang:helpCommand|/as help|% Zeigt diese HilfeSeite.."
|
||||
help-info: "%lang:helpCommand|/as info|% Zeigt Infos über aktuelle Regionen."
|
||||
help-rent: "%lang:helpCommand|/as rent|% Miete eine Region oder verlängere deine derzeitige Miete."
|
||||
help-buy: "%lang:helpCommand|/as buy|% Kaufe eine Region."
|
||||
help-unrent: "%lang:helpCommand|/as unrent|% Breche eine Miete für eine Region ab."
|
||||
help-sell: "%lang:helpCommand|/as sell|% Verkaufe eine Region."
|
||||
help-reload: "%lang:helpCommand|/as reload|% Lade alle Dateien sowie Regionen neu."
|
||||
help-setrestore: "%lang:helpCommand|/as setrestore|% Aktiviere das Zurücksetzen und wähle ein Profil."
|
||||
help-setprice: "%lang:helpCommand|/as setprice|% Ändere die Preis einer Region."
|
||||
help-setduration: "%lang:helpCommand|/as setduration|% Ändere die Dauer einer gemieteten Region."
|
||||
help-teleport: "%lang:helpCommand|/as tp|% Teleportiere zu einer kauf- oder mietbaren Region."
|
||||
help-setteleport: "%lang:helpCommand|/as settp|% Setze die Teleport Position von einer Region."
|
||||
help-find: "%lang:helpCommand|/as find|% Finde eine kauf- oder mietbare Region."
|
||||
help-groupadd: "%lang:helpCommand|/as groupadd|% Füge eine Region zu einer Gruppe hinzu."
|
||||
help-groupdel: "%lang:helpCommand|/as groupdel|% Lösche eine Region von einer Gruppe."
|
||||
help-grouplist: "%lang:helpCommand|/as grouplist|% Liste alle Gruppen auf, welche derzeit Registriert sind."
|
||||
help-groupinfo: "%lang:helpCommand|/as groupinfo|% Zeigt Informationen über eine Gruppe an."
|
||||
help-schemevent: "%lang:helpCommand|/as schemevent|% Löst ein Schematic Event für eine Region aus."
|
||||
help-add: "%lang:helpCommand|/as add|% Registriere eine Region zum mieten oder kaufen."
|
||||
help-del: "%lang:helpCommand|/as del|% Lösche eine registrierte Region von AreaShop"
|
||||
help-addsign: "%lang:helpCommand|/as addsign|% Füge ein Schild zu einer existierenden Region hinzu."
|
||||
help-delsign: "%lang:helpCommand|/as delsign|% Lösche das Schild auf das du Schaust."
|
||||
help-me: "%lang:helpCommand|/as me|% Liste alle Regionen, welche zu besitzt auf, sowie deren Ablaufdatum."
|
||||
help-setowner: "%lang:helpCommand|/as setowner|% Setze den Besitzer einer Region oder verlängere die Miete."
|
||||
help-resell: "%lang:helpCommand|/as resell|% Setzt eine Tegion in den resell Modus."
|
||||
help-stopResell: "%lang:helpCommand|/as stopresell|% Setzt eine Region zurück in den Verkauft Modus."
|
||||
help-addFriend: "%lang:helpCommand|/as addfriend|% Fügt einen Freund zu einer Region hinzu."
|
||||
help-delFriend: "%lang:helpCommand|/as delfriend|% Löscht einen Freund von einer Region."
|
||||
help-linksigns: "%lang:helpCommand|/as linksigns|% Benutze Massenschild Verlinkungs Modus."
|
||||
help-stack: "%lang:helpCommand|/as stack|% Erstelle mehrere Regionen und füge sie hinzu."
|
||||
help-setlandlord: "%lang:helpCommand|/as setlandlord|% Setzt den Vermieter einer Region."
|
||||
|
||||
rent-help: "/as rent [Region], Wenn kein Regionsname angegeben wird, wird die Region genutzt, in der du dich gerade befindest."
|
||||
rent-noPermission: "Du bist nicht berechtigt, diese Region zu mieten."
|
||||
rent-maximum: "Du kannst nicht mehr als %0% Region(en) mieten (Du hast bereits %1% in Gruppe '%2%')."
|
||||
rent-maximumExtend: "Du kannst diese Miete nicht verlängern weil du mehr als %0% Region(en) hast. (Du hast bereits %1% in Gruppe '%2%')."
|
||||
rent-payError: "Die Bezahlung hat nicht funktioniert. Bitte versuche es später noch einmal."
|
||||
rent-rented: "Du hast die Region %lang:region% gemietet bis zum %until%. Du kannst deine Mieter verlängern, in dem du auf das Schild klickst, oder du /as rent eingibts."
|
||||
rent-extended: "Du hast Deine Miete von %lang:region% bis zum %until% verlängert."
|
||||
rent-extendedToMax: "Du hast Deine Miete von %lang:region% bis zum %until% verlängert. (Das ist die maximal zulässige Mietdauer von %maxrenttime%)."
|
||||
rent-lowMoneyExtend: "Du hast nicht genug Geld um die Miete zu verlängern. (Du hast %0% und benötigst %price%)."
|
||||
rent-lowMoneyRent: "Du hast nicht genug Geld um die Region %lang:region% zu mieten. (Du hast %0% und benötigst %price%)."
|
||||
rent-someoneElse: "Die Region %lang:region% ist bereits vermietet."
|
||||
rent-notRentable: "Diese Region ist nicht mietbar."
|
||||
rent-maxExtends: "Du kannst diese Miete nicht weiter verlängern. (Zulässig sind %maxextends% Verlängerungen). Nachdem die Miete abgelaufen ist, kannst du die Region %lang:region% erneut mieten."
|
||||
rent-maxRentTime: "Du kannst die Region%lang:region% nicht noch mehr im Voraus mieten. Die maximale Zeit beträgt %maxrenttime% und du hast diese Region im Moment für %timeleft% gemietet."
|
||||
rent-restrictedToWorld: "Du musst dich in der Welt '%world%' befinden, um die Region %lang:region% mieten zu können (Du befindest Dich in der Welt '%0%')."
|
||||
rent-restrictedToRegion: "Du musst innerhalb der Region %lang:region% sein, um diese mieten zu können."
|
||||
rent-expireWarning: "Deine Region %lang:region% hat %timeleft% übrig. Beachte, dass du sie rechtzeitig verlängerst, wenn du sie behalten willst."
|
||||
rent-alreadyAtFull: "Die Region %lang:region% ist bereits auf oder über der maximalen Mietzeit, Du kannst diese noch nicht verlängern."
|
||||
|
||||
buy-help: "/as buy [Regionname], Wenn kein Regionsname angegeben wird, wird die Region genutzt, in der du dich gerade befindest."
|
||||
buy-noPermission: "Du bist nicht berechtigt, eine Region zu kaufen."
|
||||
buy-noPermissionResell: "Du hast keine Berechtigung eine Region im Weiterverkaufs-Modus zu kaufen."
|
||||
buy-noPermissionNoResell: "Du hast keine Berechtigung um eine Region zu kaufen, die nicht im Weiterverkaufs-Modus ist."
|
||||
buy-notBuyable: "Die Region %lang:region% ist nicht zum Kaufen verfügbar."
|
||||
buy-maximum: "Du kannst nicht mehr als %0% Region(en) erwerben (Du hast bereits %1% in Gruppe '%2%')."
|
||||
buy-payError: "Die Bezahlung hat nicht funktioniert. Bitte versuche es später noch einmal."
|
||||
buy-succes: "Du hast %lang:region% erfolgreich gekauft."
|
||||
buy-successResale: "Du hast %lang:region% erfolgreich von %lang:tPlayer|%0%|% gekauft."
|
||||
buy-successSeller: "Deine Region %lang:region% wurde an %lang:player% für %0% verkauft."
|
||||
buy-lowMoney: "Du hast nicht genug Geld um die Region %lang:region% zu kaufen. (Du hast %0% und benötigst %price%)."
|
||||
buy-lowMoneyResell: "Du hast nicht genug Geld um die Region %lang:region% zu kaufen. (Du hast %0% und benötigst %resellprice%)."
|
||||
buy-yours: "Du besitzt die Region %lang:region% bereits."
|
||||
buy-someoneElse: "Jemand anderes hat die Region %lang:region% bereits gekauft."
|
||||
buy-restrictedToWorld: "Du musst Dich in der Welt '%world%' befinden, um die Region %lang:region% kaufen zu können. (Du befindest Dich in der Welt '%0%')."
|
||||
buy-restrictedToRegion: "Du musst innerhalb der Region %lang:region% sein, um diese kaufen zu können."
|
||||
|
||||
unrent-help: "/as unrent [Region], Wenn kein Regionsname angegeben wird, wird die Region genutzt, in der Du Dich gerade befindest."
|
||||
unrent-noPermission: "Du bist nicht berechtigt, den Mietvertrag zu kündigen."
|
||||
unrent-noPermissionOther: "Du bist nicht berechtigt, den Mietvertrag einer anderen Region zu kündigen."
|
||||
unrent-notRegistered: "Die Region kann nicht entmietet werden, weil sie nicht für Vermietungen registriert ist."
|
||||
unrent-notRented: "Die Region kann nicht entmietet werden, weil sie nicht gemietet ist."
|
||||
unrent-unrented: "Die Region %lang:region% ist nun nicht mehr an %lang:player% vermietet."
|
||||
unrent-expired: "Deine Miete von %lang:region% ist abgelaufen."
|
||||
|
||||
sell-help: "/as sell [Region], Wenn kein Regionsname angegeben wird, wird die Region genutzt, in der Du dich gerade befindest."
|
||||
sell-notRegistered: "Die Region kann nicht verkauft werden, da sie nicht für den Verkauf registriert ist."
|
||||
sell-notBought: "Die Region kann nicht verkauft werden, da sie keinen Eigentümer hat."
|
||||
sell-sold: "Die Region %lang:region% von %lang:player% wurde verkauft."
|
||||
sell-noPermission: "Du bist nicht berechtigt, diese Region zu verkaufen."
|
||||
sell-noPermissionOther: "Du bist nicht berechtigt, eine Region zu verkaufen."
|
||||
|
||||
reload-reloading: "Alle Dateien wurden neu geladen, nun werden alle Mieten überprüft und alle Regionen aktualisiert."
|
||||
reload-updateStart: "[gray]Aktualisiere %0% Regionen mit %1% Regionen pro Sekunde."
|
||||
reload-updateComplete: "[gray]Regionen erfolgreich aktualisiert."
|
||||
reload-noPermission: "Du hast keine Berechtigungen um die Konfigurationsdateien neu zu laden."
|
||||
reload-updateCommandChanged: "'/as updaterents' und '/as updatebuys' wurden entfernt, bitte benutze '/as reload' um die Regionen neu zu laden."
|
||||
|
||||
info-help:
|
||||
- "/as info[break]"
|
||||
- "%lang:command|all|/as info all|%"
|
||||
- "%lang:command|rented|/as info rented|% [Gruppe] [Seite]"
|
||||
- "%lang:command|forrent|/as info forrent|% [Gruppe] [Seite]"
|
||||
- "%lang:command|sold|/as info sold|% [Gruppe] [Seite]"
|
||||
- "%lang:command|forsale|/as info forsale|% [Gruppe] [Seite]"
|
||||
- "%lang:command|reselling|/as info reselling|% [Gruppe] [Seite]"
|
||||
- "%lang:command|nogroup|/as info nogroup|% [Seite]"
|
||||
- "%lang:command|region|/as info region|% [Region]"
|
||||
info-noPermission: "Du hast keine Berechtigung, Informationen über Regionen zu erhalten."
|
||||
info-allHeader: "Alle Regionen%0%:"
|
||||
info-rentedHeader: "Gemietete Regionen%0%:"
|
||||
info-forrentHeader: "Mietbare Regionen%0%:"
|
||||
info-forsaleHeader: "Kaufbare Regionen%0%:"
|
||||
info-soldHeader: "Verkaufte Regionen%0%:"
|
||||
info-resellingHeader: "Weiterverkaufbare Regionen%0%:"
|
||||
info-nogroupHeader: "Regionen ohne Gruppe%0%:"
|
||||
info-limitedToGroup: " (begrenzt auf Gruppe %0%)"
|
||||
info-nogroupNone: "Es gibt keine Regionen ohne Gruppe."
|
||||
info-noFiltergroup: "Gruppe '%0%' existiert nicht und kann deshalb nicht genutzt werden um die Ergebnisse zu limitieren."
|
||||
info-noRegions: "Es wurden keine Regionen gefunden."
|
||||
info-wrongPage: "%0% ist keine korrekte Seitenzahl."
|
||||
info-pageNoPrevious:
|
||||
- " [darkgray][bold]◄Vorherige[/bold] "
|
||||
- " hover: Das ist bereits die erste Seite."
|
||||
info-pageNoNext:
|
||||
- " [darkgray][bold]Nächste►[/bold]"
|
||||
- " hover: Das ist bereits die letzte Seite."
|
||||
info-playerHelp: "/as info player <Spielername>."
|
||||
info-playerRents: "Gemietete Regionen von %lang:tPlayer|%0%|%: [gray]%1%"
|
||||
info-playerNoRents: "%lang:tPlayer|%0%|% hat bisher keine Region(en) gemietet."
|
||||
info-playerBuys: "Gekaufte Regionen von %lang:tPlayer|%0%|%: [gray]%1%."
|
||||
info-playerNoBuys: "%lang:tPlayer|%0%|% hat bisher keine Region(en) gekauft."
|
||||
info-regionHelp: "/as info region [Region], Wenn kein Regionsname angegeben wird, wird die Region genutzt, in der du dich gerade befindest."
|
||||
info-regionHeaderRent: "[darkgreen]Informationen über %lang:region%:"
|
||||
info-regionHeaderBuy: "[darkgreen]Informationen über %lang:region%:"
|
||||
info-regionRented: "[darkgreen][bold]►[reset] Gemietet von %lang:player% bis: [gray]%until%."
|
||||
info-regionBought: "[darkgreen][bold]►[reset] Gekauft von %lang:player%."
|
||||
info-regionReselling: "[darkgreen][bold]►[reset] Gekauft von %lang:player%, derzeit Weiterverkauf."
|
||||
info-regionExtending:
|
||||
- "[darkgreen][bold]►[reset] "
|
||||
- "[bold]Verlängern für[/bold]"
|
||||
- " hover: Miete verlängern für %region%"
|
||||
- " hover: mit %duration% für %price%"
|
||||
- " hover: %lang:action|Mieter Verlängern für %region%|%"
|
||||
- " command: /areashop rent %region%"
|
||||
- ": [gray]%price% für %duration%."
|
||||
info-regionCanBeRented:
|
||||
- "[darkgreen][bold]►[reset] "
|
||||
- "[bold]Mieten für[/bold]"
|
||||
- " hover: Miete %region% für %price% für %duration%"
|
||||
- " hover: %lang:action|Miete %region%|%"
|
||||
- " command: /areashop rent %region%"
|
||||
- ": [gray]%price% für %duration%."
|
||||
info-regionCanBeBought:
|
||||
- "[darkgreen][bold]►[reset] "
|
||||
- "[bold]Kaufen für[/bold]"
|
||||
- " hover: Kaufe %region% für %price%"
|
||||
- " hover: %lang:action|Kaufe %region%|%"
|
||||
- " command: /areashop buy %region%"
|
||||
- ": [gray]%price%."
|
||||
info-regionReselPrice: "[darkgreen][bold]►[reset] Weiterverkaufspreis: [gray]%resellprice% (Du kannst es von %lang:player% kaufen)."
|
||||
info-regionFriends: "[darkgreen][bold]►[reset] Hinzugefügte Freunde: [gray]%0%."
|
||||
info-friend: "%lang:tPlayer|%0%|%"
|
||||
info-friendRemove:
|
||||
- "%lang:info-friend|%0%|%"
|
||||
- "[red]✕[gray]"
|
||||
- " hover: Region %region%"
|
||||
- " hover: %lang:action|Lösche %0% als Freund|%"
|
||||
- " command: /areashop delfriend %0% %region%"
|
||||
info-regionMoneyBackBuy: "[darkgreen][bold]►[reset] Verkaufpreis: [gray]%moneyback% (%moneybackpercent%% des Kaufpreises)."
|
||||
info-regionMoneyBackBuyClick:
|
||||
- "[darkgreen][bold]►[reset] "
|
||||
- "[bold]Verkaufsrückzahlung[/bold]"
|
||||
- " hover: Verkaufe %region% und bekomme %moneyback% zurück"
|
||||
- " hover: %lang:action|Verkaufe %region%|%"
|
||||
- " command: /areashop sell %region%"
|
||||
- ": [gray]%moneyback% (%moneybackpercent%% des Kaufpreises)."
|
||||
info-regionMoneyBackRent: "[darkgreen][bold]►[reset] Rückzahlung bei Mietkündigung: [gray]%moneyback% (%moneybackpercent%% der verbleibenden Zeit)."
|
||||
info-regionMoneyBackRentClick:
|
||||
- "[darkgreen][bold]►[reset] "
|
||||
- "[bold]Mietrückzahlung[/bold]"
|
||||
- " hover: Mietabbruch %region% und bekomme %moneyback% zurück"
|
||||
- " hover: %lang:action|Mietabbruch %region%|%"
|
||||
- " command: /areashop unrent %region%"
|
||||
- ": [gray]%moneyback% (%moneybackpercent%% der verbleibenden Zeit)."
|
||||
info-regionMaxExtends: "[darkgreen][bold]►[reset] Maximale Anzahl an Mietverlängerungen: [gray]%maxextends% mal."
|
||||
info-regionNoExtending: "[darkgreen][bold]►[reset] Miete kann nicht verlängert werden."
|
||||
info-regionExtendsLeft: "[darkgreen][bold]►[reset] Verbleibende Mietverlängerungen: [gray]%extendsleft% von %maxextends% mal."
|
||||
info-regionMaxRentTime: "[darkgreen][bold]►[reset] Miete im Voraus: [gray]Maximal %maxrenttime%."
|
||||
info-prefix: "[darkgreen][bold]►[reset] "
|
||||
info-regionTeleport:
|
||||
- "[bold]Gehe zu der Region[/bold]"
|
||||
- " hover: %lang:action|Teleportiere zu %region%|%"
|
||||
- " command: /areashop tp %region%"
|
||||
info-setRegionTeleport:
|
||||
- "[bold]Setze den Teleport Punkt[/bold]"
|
||||
- " hover: %region%"
|
||||
- " hover: %lang:action|Setze den Teleport Punkt|%"
|
||||
- " command: /areashop settp %region%"
|
||||
info-regionSigns: "[darkgreen][bold]►[reset] Verbundene Schilder: [gray]%0%."
|
||||
info-regionSignLocation: "[gray](%0%, %1%, %2%, %3%)[reset]"
|
||||
info-regionGroups: "[darkgreen][bold]►[reset] Zugewiesene Gruppen: [gray]%0%."
|
||||
info-regionInactiveUnrent: "[darkgreen][bold]►[reset] Automatische Mietkündigung nach: [gray]%inactivetime% Inaktivität des Spielers."
|
||||
info-regionInactiveSell: "[darkgreen][bold]►[reset] Automatischer Verkauf nach: [gray]%inactivetime% Inaktivität des Spielers."
|
||||
info-regionRestrictedRegionRent: "[darkgreen][bold]►[reset] Du musst dich in der Region %lang:region% befinden, um sie mieten zu können."
|
||||
info-regionRestrictedWorldRent: "[darkgreen][bold]►[reset] Du musst in der Welt '%world%' sein, um die Region %lang:region% mieten zu können."
|
||||
info-regionRestrictedRegionBuy: "[darkgreen][bold]►[reset] Du musst dich in der Region %lang:region% befinden, um sie kaufen zu können."
|
||||
info-regionRestrictedWorldBuy: "[darkgreen][bold]►[reset] Du musst in der Welt '%world%' sein, um die Region %lang:region% kaufen zu können."
|
||||
info-regionRestoringRent: "[darkgreen][bold]►[reset] Die Wiederherstellung ist aktiviert [gray](Region wird bei Mietkündigung zurückgesetzt)%0%."
|
||||
info-regionRestoringBuy: "[darkgreen][bold]►[reset] Die Wiederherstellung ist aktiviert. [gray](Region wird beim Verkauf zurückgesetzt)%0%."
|
||||
info-regionRestoringProfile: " (profile: %0%)"
|
||||
info-regionLandlord: "[darkgreen][bold]►[reset] Vermieter: [gray]%lang:landlord% (Erhält das Geld)."
|
||||
info-regionNotExisting: "Die angegebene Region ist nicht registriert: %0%."
|
||||
|
||||
setrestore-help: "/as setrestore <Region> <true|false|general> [Profil]."
|
||||
setrestore-noPermission: "Du bist nicht berechtigt, die Wiederherstellungs-Einstellungen zu verändern."
|
||||
setrestore-notRegistered: "Die angegebene Region ist nicht registriert: %0%."
|
||||
setrestore-invalidSetting: "'%0%' ist kein gültiger Status, kann true sein, false oder general."
|
||||
setrestore-success: "Wiederherstellungs-Einstellungen von %lang:region% erfolgreich zu '%0%' geändert."
|
||||
setrestore-successProfile: "Wiederherstellungs-Einstellungen von %lang:region% erfolgreich zu '%0%' geändert und das Profil zu '%1%' geändert."
|
||||
|
||||
setprice-noPermission: "Du bist nicht berechtigt, den Preis einer Region zu ändern."
|
||||
setprice-help: "/as setprice <Preis> [Region], Wenn kein Regionsname angegeben wird, wird die Region genutzt, in der du dich gerade befindest."
|
||||
setprice-notRegistered: "Die angegebene Region ist nicht registriert: %0%."
|
||||
setprice-wrongPrice: "'%0%' ist kein gültiger Preis."
|
||||
setprice-successRent: "Der Preis der Region %lang:region% änderte sich zu %price% per %duration%."
|
||||
setprice-successBuy: "Der Preis der Region %lang:region% wurde zu %price% geändert."
|
||||
setprice-successRemoved: "Der Preis der Region %lang:region% wurde entfernt, ab jetzt wird der Preis einer Gruppe oder der default.yml-Datei benutzt. Neuer Preis: %price%."
|
||||
setprice-noLandlord: "Du hast keine Rechte um den Preis zu ändern, da du nicht der Vermieter der Region %lang:region% bist."
|
||||
|
||||
setduration-noPermission: "Du hast keine Berechtigung, die Mietdauer zu verändern."
|
||||
setduration-help: "/as setduration <Anzahl> <Zeiteinheit> [Region], wählt automatisch die Region, in der du dich gerade befindest, wenn nichts angegeben wird."
|
||||
setduration-notRegistered: "%0% ist nicht als mietbar registriert."
|
||||
setduration-wrongAmount: "'%0%' ist keine gültige Anzahl, gib eine ganze Zahl an."
|
||||
setduration-wrongFormat: "'%0%' ist kein gültiges Zeitformat, schau in der Doku auf Bukkit nach."
|
||||
setduration-success: "Dauer von Region %lang:region% zu '%duration%' geändert."
|
||||
setduration-noLandlord: "Du hast keine Rechte um die Dauer der Miete zu ändern, da du nicht der Vermieter der Region %lang:region% bist."
|
||||
setduration-successRemoved: "Die Mietdauer der Region %lang:region% wurde entfernt, es wird nun die Dauer von einer Gruppe oder der default.yml Datei benutzt. Neue Mietdauer: %duration%."
|
||||
|
||||
setup-noRegion: "Du hast in der zweiten Zeile keine Region angegeben."
|
||||
setup-alreadyRentSign: "Die angegebene Region ist bereits in AreaShop als eine Miet-Region eingefügt, du kannst Schilder zu der Region mit [as] in der ersten Zeile hinzufügen, oder '/as addsign' verwenden."
|
||||
setup-alreadyBuySign: "Die angegebene Region ist bereits in AreaShop als eine Kauf-Region eingefügt, du kannst Schilder zu der Region mit [as] in der ersten Zeile hinzufügen, oder '/as addsign' verwenden."
|
||||
setup-noDuration: "Du hast nicht angegeben, wie lange eine Region mietbar ist. Bitte trage dies in die dritte Zeile ein."
|
||||
setup-wrongDuration: "Die angegebene Zeit liegt nicht in einem korrekten Format vor. Beispiel: 1 Tag."
|
||||
setup-noPrice: "Du hast in der vierten Zeile noch keinen Preis angegeben."
|
||||
setup-wrongPrice: "Du hast den Preis nicht korrekt angegeben, bitte nutze dafür ausschließlich Zahlen."
|
||||
setup-rentSuccess: "Die Vermietung der Region %lang:region% ist erfolgreich erstellt worden."
|
||||
setup-buySuccess: "Das Kaufen der Region %lang:region% ist erfolgreich erstellt worden."
|
||||
setup-noPermissionRent: "Du hast keine Berechtigungen um mietbare Regionen aufzusetzen."
|
||||
setup-noPermissionBuy: "Du hast keine Berechtigungen um kaufbare Regionen aufzusetzen."
|
||||
setup-couldNotDetect: "Mehrere Regionen mit der selben Priorität und/oder Eltern/Kind-Verhältnis gefunden, bitte gib die gewünschte Region in der zweiten Zeile an (zwei der gefundenen Regionen: %lang:tRegion|%0%|% und %lang:tRegion|%1%|%)."
|
||||
setup-blacklisted: "%0% ist auf der Blacklist und kann nicht in AreaShop eingefügt werden."
|
||||
setup-noPermission: "Du kannst die Region '%0%' nicht hinzufügen, da du weder Besitzer noch Mitglied der Region bist oder keine Rechte dazu hast."
|
||||
|
||||
destroy-noPermissionRent: "Du hast keine Berechtigungen um eine mietbare Region zu deregistrieren. "
|
||||
destroy-noPermissionBuy: "Du hast keine Berechtigungen um eine kaufbare Region zu deregistrieren. "
|
||||
destroy-successRent: "%lang:region% erfolgreich als mietbare Region abgemeldet."
|
||||
destroy-successBuy: "%lang:region% erfolgreich als kaufbare Region abgemeldet."
|
||||
|
||||
teleport-help: "/as tp <Region> [Schild]."
|
||||
teleport-noRentOrBuy: "Die angegebene Region ist nicht registriert: %0%."
|
||||
teleport-noPermission: "Du hast keine Rechte um dich zu dieser Region zu teleportieren."
|
||||
teleport-noPermissionOther: "Du bist nicht berechtigt, dich zu einer Region zu teleportieren, welche du nicht besitzt."
|
||||
teleport-noPermissionSign: "Du hast keine Rechte um dich zu diesem Schild in deiner Region zu teleportieren."
|
||||
teleport-noPermissionOtherSign: "Du fehlt die Berechtigung, dich zu Schildern von Regionen, die du nicht besitzt, zu teleportieren."
|
||||
teleport-noPermissionFriend: "Du hast keine Berechtigungen zu Regionen zu teleporten, in denen du als Freund hinzugefügt worden bist."
|
||||
teleport-noPermissionFriendSign: "Du hast keine Berechtigungen um zu dem Schild einer Region zu teleporten, in denen du als Freund hinzugefügt worden bist."
|
||||
teleport-success: "Du wurdest zu %lang:region% teleportiert."
|
||||
teleport-successSign: "Du wurdest zum Schild von %lang:region% teleportiert."
|
||||
teleport-noSafe: "Keine sichere Position in %lang:region% gefunden, kein Boden vorhanden oder maximale Anzahl an Versuchen erreicht (%0%/%1%)."
|
||||
teleport-blocked: "Du kannst dich nicht teleportieren, weil sich die Position außerhalb der Region befindet und du dich nur in die Region teleportieren kannst."
|
||||
teleport-changedToSign: "Du hast nur Rechte um zum Schild der Region zu teleportieren und nicht um in die Region zu teleportieren. Teleportiere zum Schild."
|
||||
teleport-changedToNoSign: "Es ist kein Schild zum teleportieren verfügbar, versuche stattdessen in die Region zu teleportieren."
|
||||
|
||||
setteleport-help: "/as settp [Region] [reset], Wenn kein Regionsname angegeben wird, wird die Region genutzt, in der du dich gerade befindest."
|
||||
setteleport-noPermission: "Du bist nicht berechtigt, einen Teleport-Punkt zu setzen."
|
||||
setteleport-noPermissionOther: "Dir fehlt die Berechtigung die Teleportposition für eine Region, du du nicht besitzt, festzulegen."
|
||||
setteleport-noRentOrBuy: "Die angegebene Region ist nicht registriert: %0%."
|
||||
setteleport-success: "Teleport-Punkt von %lang:region% erfolgreich gesetzt."
|
||||
setteleport-notInside: "Der Teleportpunkt muss sich innerhalb einer Region befinden."
|
||||
setteleport-reset: "Teleport-Punkt von %lang:region% erfolgreich zurückgesetzt."
|
||||
|
||||
find-help: "/as find <buy|rent> [maximaler Preis] [Gruppe]."
|
||||
find-noPermission: "Du hast keine Berechtigungen nach Regionen zu suchen und zu ihnen zu teleporten."
|
||||
find-success: "%0% Region gefunden: %lang:region%, bei Suche nach max. Preis in Höhe deines Guthabens: %1%%2%."
|
||||
find-successMax: "%0% Region gefunden: %lang:region%,, bei Suche nach max. Preis in Höhe von %1%%2%."
|
||||
find-wrongMaxPrice: "Der angegebene Maximal-Preis ist kein korrekter Betrag: %0%."
|
||||
find-wrongGroup: "Die angegebene Gruppe existiert nicht: %0%."
|
||||
find-noneFound: "Keine %0% Region gefunden bei Suche nach max. Preis in Höhe deines Guthabens: %1%%2%."
|
||||
find-noneFoundMax: "Keine %0% Region gefunden bei Suche nach max. Preis in Höhe von %1%%2%."
|
||||
find-onlyInGroup: ", nur nach Regionen in der Gruppe %0% suchen."
|
||||
|
||||
groupadd-help: "/as groupadd <Gruppe> [Region], Wenn kein Regionsname angegeben wird, werden alle Regionen deiner WorldEdit-Markierung einbezogen."
|
||||
groupadd-noPermission: "Du bist nicht berechtigt Regionen zu Gruppen hinzuzufügen."
|
||||
groupadd-success: "Region %lang:region% wurde zur Gruppe '%0%' hinzugefügt. Diese Gruppe hat nun %1% Mitglied(er)."
|
||||
groupadd-failed: "Region %lang:region% ist bereits Mitglied der Gruppe '%0%';."
|
||||
groupadd-weSuccess: "Zu Gruppe %0% hinzugefügt: [gray]%1%."
|
||||
groupadd-weFailed: "Ist bereits in Gruppe %0%: [gray]%1%."
|
||||
|
||||
groupdel-help: "/as groupdel <Gruppe> [Region], Wenn kein Regionsname angegeben wird, werden alle Regionen deiner WorldEdit-Markierung einbezogen."
|
||||
groupdel-noPermission: "Du bist nicht berechtigt, Regionen aus Gruppen zu entfernen."
|
||||
groupdel-success: "Region %lang:region% ist aus Gruppe '%0%' entfernt worden. Diese Gruppe hat nun %1% Mitglied(er)."
|
||||
groupdel-failed: "Region %lang:region% gehört nicht zur Gruppe '%0%'."
|
||||
groupdel-weSuccess: "Entfernt aus Gruppe %0%: [gray]%1%."
|
||||
groupdel-weFailed: "Ist nicht länger in Gruppe %0%: [gray]%1%."
|
||||
|
||||
grouplist-noPermission: "Du bist nicht berechtigt, die eingetragenen Gruppen abzurufen."
|
||||
grouplist-noGroups: "Momentan sind keine Gruppen vorhanden."
|
||||
grouplist-success: "Folgende Gruppen sind vorhanden: [gray]%0%."
|
||||
|
||||
groupinfo-help: "/as groupinfo <Gruppe>."
|
||||
groupinfo-noPermission: "Du bist nicht berechtigt, Informationen über eine Gruppe abzurufen."
|
||||
groupinfo-noGroup: "Es ist keine Gruppe mit dem Namen '%0%' vorhanden, bitte benutze zum Anzeigen der verfügbaren Gruppen /as grouplist."
|
||||
groupinfo-members: "Die folgenden Regionen gehören zur Gruppe %0%: [gray]%1%."
|
||||
groupinfo-noMembers: "Gruppe %0% hat keine Mitglieder."
|
||||
|
||||
schemevent-help: "/as schemevent <Region> <created|deleted|rented|unrented|bought|sold>."
|
||||
schemevent-wrongEvent: "Das angegebene Event '%0%' existiert nicht, bitte benutze eines der folgenden: [gray]%1%."
|
||||
schemevent-success: "'%0%'-Event wurde erfolgreich für Region %lang:region% ausgelöst."
|
||||
schemevent-noPermission: "Du bist nicht berechtigt, Schematic-Events auszuführen."
|
||||
|
||||
add-help: "/as add <rent|buy> [Region] [Welt]."
|
||||
add-noPermission: "Du bist nicht berechtigt, eine Region in AreaShop hinzuzufügen."
|
||||
add-success: "Hinzugefügt als %0%: [gray]%1%."
|
||||
add-failed: "Bereits eingetragen: [gray]%0%."
|
||||
add-blacklisted: "Auf der Blacklist: [gray]%0%."
|
||||
add-specifyWorld: "Bei Verwendung der Konsole bitte Welt der Region eintragen."
|
||||
add-incorrectWorld: "Welt '%0%' nicht gefunden, versuche es bitte noch einmal (Groß- und Kleinschreibung beachten)."
|
||||
add-noRegion: "WorldGuard Region '%0%' existiert nicht in dieser Welt."
|
||||
add-noPermissionRegions: "Keine Rechte zum hinzufügen: [gray]%0%."
|
||||
add-noPermissionOwnerMember: "[gray]Entweder bist du weder Mitglied noch Besitzer der Region oder hast keine Rechte um deine Regionen hinzuzufügen."
|
||||
|
||||
del-noPermission: "Du bist nicht berechtigt, Regionen zu entfernen."
|
||||
del-success: "Entfernte Region(en): [gray]%0%."
|
||||
del-failed: "Keine Berechtigung zum Entfernen oder nicht eingetragen: [gray]%0%."
|
||||
|
||||
addsign-help: "/as addsign [Region] [Profil]."
|
||||
addsign-noSign: "Du schaust gerade nicht auf ein Schild."
|
||||
addsign-noRegions: "Keine Region(en) um das Schild herum gefunden."
|
||||
addsign-couldNotDetect: "Mehrere Regionen um das Schild herum gefunden, bitte gewünschte Region als Argument angeben (zwei der gefundenen Regionen: %lang:tRegion|%0%|% und %lang:tRegion|%1%|%)."
|
||||
addsign-couldNotDetectSign: "Mehrere Regionen um das Schild herum gefunden, bitte gewünschte Region in die zweite Zeile eintragen (zwei der gefundenen Regionen: %lang:tRegion|%0%|% und %lang:tRegion|%1%|%)."
|
||||
addsign-wrongProfile: "Das eingetragene Profil existiert nicht. Bitte benutze eines der folgenden (überprüfe config): [gray]%0%."
|
||||
addsign-profile:
|
||||
- "[bold]%0%[/bold]"
|
||||
- " hover: Schildprofil %0%"
|
||||
- " hover: %lang:action|Nutze dieses Profil|%"
|
||||
- " command: /areashop linksigns %0%"
|
||||
addsign-success: "Das Schild wurde hinzugefügt zu %lang:region%."
|
||||
addsign-successProfile: "Das Schild wurde zu %lang:region% mit dem Profil %0% hinzugefügt."
|
||||
addsign-alreadyRegistered: "Dieses Schild ist bereits für die Region %lang:region% registriert."
|
||||
addsign-noPermission: "Du bist nicht berechtigt, ein Schild hinzuzufügen."
|
||||
|
||||
delsign-noSign: "Du schaust gerade nicht auf ein Schild."
|
||||
delsign-noPermission: "Du bist nicht berechtigt, ein Schild zu entfernen."
|
||||
delsign-noRegion: "Dieses Schild gehört zu keiner in AreaShop eingetragenen Region."
|
||||
delsign-success: "Das Schild wurde von der Region %lang:region% entfernt."
|
||||
|
||||
me-noPermission: "Dir fehlt die Berechtigung einzusehen, welche Regionen du besitzt."
|
||||
me-header: "Regionen von %lang:tPlayer|%0%|%:"
|
||||
me-notAPlayer: "Du bist kein Spieler, darum können dir keine Regionen gehören."
|
||||
me-buyLine: "[darkgreen][bold]►[reset] %lang:region%."
|
||||
me-nothing: "%lang:tPlayer|%0%|% hat keine gemieteten oder gekaufen Regionen und wurde nicht als Freund zu einem hinzugefügt."
|
||||
me-noPlayer: "%0% konnte nicht gefunden werden, möglicherweise war er nie auf diesem Server."
|
||||
|
||||
setowner-help: "/as setowner <Spieler> [Region], wenn kein Regionsname angegeben wird, wird die Region genutzt, in der du dich gerade befindest."
|
||||
setowner-noPermission: "Dir fehlt die Berechtigung den Besitzer einer Region festzulegen."
|
||||
setowner-noPermissionRent: "Dir fehlt die Berechtigung den Mieter einer Region festzulegen."
|
||||
setowner-noPermissionBuy: "Dir fehlt die Berechtigung den Eigentümer einer Region festzulegen."
|
||||
setowner-notRegistered: "Die angegebene Region ist nicht registriert, Besitzer kann nicht festgelegt werden."
|
||||
setowner-noPlayer: "Die UUID des Spielers %0% konnte nicht gefunden werden."
|
||||
setowner-succesRent: "Besitzer von %lang:region% erfolgreich geändert zu %lang:player%, gemietet bis %until% (%timeleft% verbleibend)."
|
||||
setowner-succesRentExtend: "%lang:player% ist bereits Besitzer, Miete verlängert um '%duration%', nun gemietet bis %until% (%timeleft% verbleibend)."
|
||||
setowner-succesBuy: "Besitzer von %lang:region% erfolgreich geändert zu %lang:player%."
|
||||
|
||||
resell-help: "/as resell <Preis> [Region], wählt automatisch die Region, in der du dich befindest, wenn nicht angegeben."
|
||||
resell-wrongPrice: "'%0%' ist keine gültige Preisangabe."
|
||||
resell-notRegistered: "Die angegebene Region ist nicht registriert: %0%."
|
||||
resell-notBought: "Du kannst %lang:region% nicht weiterverkaufen, weil sie noch nicht erworben wurde."
|
||||
resell-success: "Weiterverkauf für %lang:region% erfolgreich aktiviert. Preis: %resellprice%."
|
||||
resell-noPermission: "Du hast keine Berechtigung, deine Region weiterzuverkaufen."
|
||||
resell-noPermissionOther: "Du hast keine Berechtigung, den Weiterverkauf von Regionen zu aktivieren."
|
||||
|
||||
stopresell-help: "/as stopresell [Region], wählt automatisch die Region, in der du dich befindest, wenn nicht angegeben."
|
||||
stopresell-notRegistered: "Die angegebene Region ist nicht registriert: %0%."
|
||||
stopresell-notResell: "Du kannst den Weiterverkauf von %lang:region% nicht stoppen, weil sie bisher nicht weiterverkauft werden soll."
|
||||
stopresell-success: "Weiterverkauf von %lang:region% wurde erfolgreich gestoppt."
|
||||
stopresell-noPermission: "Du hast keine Berechtigung, den Weiterverkauf deiner Region zu stoppen."
|
||||
stopresell-noPermissionOther: "Du hast keine Berechtigung, den Weiterverkauf einer Region zu stoppen."
|
||||
|
||||
addfriend-help: "/as addfriend <Spieler> [Region], wählt automatisch die Region, in der du dich befindest, wenn nicht angegeben."
|
||||
addfriend-noPermissionOther: "Du hast keine Berechtigung, Freunde zu deiner Region hinzuzufügen."
|
||||
addfriend-noPermission: "Du hast keine Berechtigung, Spieler zu einer Region hinzuzufügen."
|
||||
addfriend-successOther: "%lang:tPlayer|%0%|% wurde als Freund zur Region %lang:region% hinzugefügt."
|
||||
addfriend-success: "%lang:tPlayer|%0%|% wurde als Freund zu deiner Region %lang:region% hinzugefügt."
|
||||
addfriend-alreadyAdded: "%lang:tPlayer|%0%|% wurde bereits als Freund zu der Region %lang:region% hinzugefügt."
|
||||
addfriend-self: "Den Besitzer der Region als Freund hinzuzufügen wäre sinnlos."
|
||||
addfriend-noOwner: "Du kannst keine Freunde zu einer Region ohne Besitzer hinzufügen."
|
||||
addfriend-notVisited: "Du kannst %0% nicht hinzufügen, weil dieser Spieler noch nie auf dem Server war."
|
||||
|
||||
delfriend-help: "/as delfriend <Spieler> [Region], wählt automatisch die Region, in der du dich befindest, wenn nicht angegeben."
|
||||
delfriend-noPermissionOther: "Du hast keine Berechtigung, Freunde von Regionen zu entfernen, die dir nicht gehören."
|
||||
delfriend-noPermission: "Du hast keine Berechtigung, Freunde von deinen Regionen zu entfernen."
|
||||
delfriend-successOther: "%lang:tPlayer|%0%|% wurde als Freund der Region %lang:region% entfernt."
|
||||
delfriend-success: "%lang:tPlayer|%0%|% wurde als Freund Deiner Region %lang:region% entfernt."
|
||||
delfriend-noOwner: "Du kannst keine Freunde von einer Region ohne Besitzer entfernen."
|
||||
|
||||
linksigns-multipleRegions: "Mehrere Regionen gefunden: [gray]%0%."
|
||||
linksigns-multipleRegionsAdvice: "Bitte klicke nochmal oder benutze '/as linksigns' um aufzuhören."
|
||||
linksigns-noRegions: "Keine AreaShop Regionen in Cursorrichtung gefunden, bitte stell sicher, dass die Region in AreaShop registriert ist. [gray](Maximale Reichweite 100 Blöcke)"
|
||||
linksigns-regionFound: "Region %lang:region% wurde gefunden, mach einen Linksklick auf ein Schild um die Region mit dem Schild zu verbinden."
|
||||
linksigns-signFound: "Schild gefunden bei (%0%, %1%, %2%), mach einen Rechtsklick auf eine Region um das Schild zu verbinden."
|
||||
linksigns-noSign: "Kein Schild in Cursorrichtung gefunden, bitte stell sicher, dass du eine direkte Sicht auf ein Schild hast und klicke erneut [gray](Maximale Reichweite 100 Blöcke)."
|
||||
linksigns-alreadyRegistered: "Dieses Schild ist bereits auf die Region %lang:region% registriert, klicke erneut um ein anderes Schild zu wählen."
|
||||
linksigns-first: "Du bist nun im Schilderverbindungsmodus."
|
||||
linksigns-next: "[gray]Linksklicke um ein Schild zu wählen, Rechtsklicke um eine Region zu wählen. Benutze /as linksigns um aufzuhören."
|
||||
linksigns-noPermission: "Du hast keine Berechtigungen um den Schilder-Massenverbindungsmodus zu benutzen."
|
||||
linksigns-stopped: "Schilder-Verbindungsmodus verlassen."
|
||||
|
||||
stack-help:
|
||||
- "/as stack <Menge> <Abstand> <Name> <rent|buy> [Gruppe]."
|
||||
- "[gray]<Menge> Nummer der Regionen, die erstellt werden."
|
||||
- "[gray]<Abstand> Block-Abstand zwischen den Regionen."
|
||||
- "[gray]<Name> Namen der Regionen (Nummer wird dahinter sein)."
|
||||
- "[gray]<rent|buy> Macht die Regionen zu kauf- oder Mietregionen"
|
||||
- "[gray][Gruppe] Eine Gruppe, die zu den erstellten Regionen hinzugefügt wird."
|
||||
- "Die Regionen werden in deiner Blickrichtung erstellt."
|
||||
stack-accepted: "Erstelle %0% %1% Regionen mit %2% Blöcken Abstand, Namen beginnend mit %3% und einer Zahl dahinter. %4%"
|
||||
stack-addToGroup: "Gruppe '%0%' wird zu den erstellten Regionen hinzugefügt."
|
||||
stack-noPermission: "Du hast keine Berechtigungen um Regionen massenweise in AreaShop zu erstellen und hinzuzufügen."
|
||||
stack-wrongAmount: "'%0%' ist keine korrekte Anzahl von Regionen."
|
||||
stack-wrongGap: "'%0%' ist keine korrekte Nummer von Blöcken für den Abstand, der zwischen den Regionen sein soll."
|
||||
stack-noSelection: "Du hast keine Auswahl, die angibt, wo die erste Region erstellt werden soll."
|
||||
stack-addStart: "[gray]Füge %0% Regionen mit %1% Regionen pro Sekunde hinzu."
|
||||
stack-addComplete: "[gray]Regionen erfolgreich hinzugefügt."
|
||||
stack-unclearDirection: "Bitte gucke nur nach Norden, Osten, Süden oder Westen. Du guckst im Moment nach %0%."
|
||||
|
||||
setlandlord-help: "/as setlandlord <Spieler> [Region], die Region in der du stehst wird verwendet, wenn keine angegeben wird."
|
||||
setlandlord-noPermission: "Du hast keine Rechte um den Vermieter einer Region zu setzen."
|
||||
setlandlord-success: "%lang:landlord% wurde erfolgreich als Vermieter der Region %lang:region% gesetzt."
|
||||
|
||||
message-help: "/as message <Spieler> <Nachricht...>"
|
||||
message-noPermission: "Du hast keine Berechtigung AreaShop Nachrichten zu senden."
|
||||
message-notOnline: "%0% ist nicht online."
|
||||
|
||||
confirm-rent:
|
||||
- "%lang:prefix%Bist du sicher, dass du %lang:tRegion|%0%|% mieten willst?"
|
||||
- "[darkgreen][bold]►[reset] %lang:button|Klick zum mieten %0%|%"
|
||||
- "hover: %lang:action|Rent %0%|%"
|
||||
- "command: /areashop rent %0%"
|
||||
confirm-extend:
|
||||
- "%lang:prefix%Bist du sicher, dass du %lang:tRegion|%0%|% verlängern willst?"
|
||||
- "[darkgreen][bold]►[reset] %lang:button|Click to extend %0%|%"
|
||||
- "hover: %lang:action|Verlängern %0%|%"
|
||||
- "command: /areashop rent %0%"
|
||||
confirm-unrent:
|
||||
- "%lang:prefix%Bist du sicher, dass du %lang:tRegion|%0%|% nicht länger mieten möchtest?"
|
||||
- "[darkgreen][bold]►[reset] %lang:button|Klick zum auflösen %0%|%"
|
||||
- "hover: %lang:action|Mietvertrag auslösen %0%|%"
|
||||
- "command: /areashop unrent %0%"
|
||||
confirm-buy:
|
||||
- "%lang:prefix%Bist du sicher, dass du %lang:tRegion|%0%|% kaufen willst?"
|
||||
- "[darkgreen][bold]►[reset] %lang:button|Klick zum kaufen %0%|%"
|
||||
- "hover: %lang:action|Kaufen %0%|%"
|
||||
- "command: /areashop buy %0%"
|
||||
confirm-sell:
|
||||
- "%lang:prefix%Bist du sicher, dass du %lang:tRegion|%0%|% verkaufen willst?[break]"
|
||||
- "[darkgreen][bold]►[reset] %lang:button|Klick zum verkaufen %0%|%"
|
||||
- " hover: %lang:action|Verkaufen %0%|%"
|
||||
- " command: /areashop sell %0%"
|
||||
|
||||
timeleft-years: "%0% Jahre"
|
||||
timeleft-months: "%0% Monate"
|
||||
timeleft-days: "%0% Tage"
|
||||
timeleft-hours: "%0% Stunden"
|
||||
timeleft-minutes: "%0% Minuten"
|
||||
timeleft-second: "%0% Sekunde"
|
||||
timeleft-seconds: "%0% Sekunden"
|
||||
timeleft-ended: "abgelaufen"
|
||||
|
||||
greeting-forrent: "%region% kann gemietet werden für %price% je %duration%."
|
||||
greeting-rented: "%region% ist vermietet an %player% bis %until%."
|
||||
greeting-forsale: "%region% kann gekauft werden für %price%."
|
||||
greeting-bought: "%region% ist Eigentum von %player%."
|
||||
greeting-resale: "%region% kann %player% für %resaleprice% abgekauft werden."
|
||||
@@ -0,0 +1,576 @@
|
||||
# ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
|
||||
# ║ Language file of the AreaShop plugin created by NLThijs48, Github can be found at https://github.com/NLthijs48/AreaShop ║
|
||||
# ║ Language: English, Version: V2.3.2, Percentage translated: 100% (source), author: NLThijs48 ║
|
||||
# ║ This file will be overwritten at each startup/reload of the plugin, if you want to change anything then do the following: ║
|
||||
# ║ 1: Make a copy of this file ║
|
||||
# ║ 2: Rename it to <servername>.yml (don't use a language code as filename, could otherwise be overwritten in future updates) ║
|
||||
# ║ 3: Change the 'language' setting in config.yml to '<servername>', do not include '.yml' ║
|
||||
# ║ 4: Change the strings in the new file to your liking and save the file ║
|
||||
# ║ 5: Use '/as reload' or reload/restart your server to see the changes ║
|
||||
# ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
|
||||
action: "[gold][bold]<%0%>[/bold]"
|
||||
|
||||
button: "[bold]<%0%>[/bold]"
|
||||
|
||||
command:
|
||||
- "[bold]%0%[/bold]"
|
||||
- " hover: %lang:action|Use %1%|%"
|
||||
- " command: %1%"
|
||||
|
||||
helpCommand:
|
||||
- "[gold]%0% [gray]-[reset]"
|
||||
- " hover: %lang:action|Use %0%|%"
|
||||
- " command: %0%"
|
||||
|
||||
region: "%lang:tRegion|%region%|%"
|
||||
|
||||
tRegion:
|
||||
- "[bold]%0%[/bold]"
|
||||
- " hover: Region %0%"
|
||||
- " hover: %lang:action|Region information|%"
|
||||
- " command: /areashop info region %0%"
|
||||
|
||||
player: "%lang:tPlayer|%player%|%"
|
||||
|
||||
tPlayer:
|
||||
- "[bold]%0%[/bold]"
|
||||
- " hover: Player %0%"
|
||||
- " hover: %lang:action|Regions of %0%|%"
|
||||
- " command: /areashop info player %0%"
|
||||
|
||||
landlord:
|
||||
- "[bold]%landlord%[/bold]"
|
||||
- " hover: Landlord %landlord%"
|
||||
- " hover: %lang:action|Regions of %landlord%|%"
|
||||
- " command: /areashop info player %landlord%"
|
||||
|
||||
total-maximum: "You can't rent and buy more than %0% region(s) in total (you already have %1% in group '%2%')."
|
||||
|
||||
general-notReady: "AreaShop has not fully loaded yet, please wait."
|
||||
general-noWorld: "You cannot do that, the world of %lang:region% is currently unavailable (world '%world%')."
|
||||
general-noRegion: "You cannot do that, the WorldGuard region is currently unavailable (region %lang:region%)."
|
||||
general-noEconomy: "There is no Economy plugin installed or it is not setup correctly, notify the server owner about this."
|
||||
general-cancelled: "%0%"
|
||||
|
||||
cmd-notValid: "That command is not valid, use '/as help' for info."
|
||||
cmd-onlyByPlayer: "This command can only be run by a player."
|
||||
cmd-weOnlyByPlayer: "Using a WorldEdit selection is only possible as a player, specify the region name as extra argument."
|
||||
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: "The specified region is not available in AreaShop: %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."
|
||||
|
||||
help-header: "Help page, commands that you can execute."
|
||||
help-noPermission: "You do not have permission to view the help page."
|
||||
help-alias: "Command aliases: /areashop, /as."
|
||||
help-help: "%lang:helpCommand|/as help|% Shows this help page."
|
||||
help-info: "%lang:helpCommand|/as info|% Get info about current regions."
|
||||
help-rent: "%lang:helpCommand|/as rent|% Rent a region or extend your current rent."
|
||||
help-buy: "%lang:helpCommand|/as buy|% Buy a region."
|
||||
help-unrent: "%lang:helpCommand|/as unrent|% Unrent a region."
|
||||
help-sell: "%lang:helpCommand|/as sell|% Sell a region."
|
||||
help-reload: "%lang:helpCommand|/as reload|% Reload all files and update the regions."
|
||||
help-setrestore: "%lang:helpCommand|/as setrestore|% Set restoring on/off and choose profile."
|
||||
help-setprice: "%lang:helpCommand|/as setprice|% Change the price of a region."
|
||||
help-setduration: "%lang:helpCommand|/as setduration|% Change the duration of a rent region."
|
||||
help-teleport: "%lang:helpCommand|/as tp|% Teleport to a rent/buy region."
|
||||
help-setteleport: "%lang:helpCommand|/as settp|% Set teleport position for a region."
|
||||
help-find: "%lang:helpCommand|/as find|% Find an empty buy or rent."
|
||||
help-groupadd: "%lang:helpCommand|/as groupadd|% Add a region to a group."
|
||||
help-groupdel: "%lang:helpCommand|/as groupdel|% Delete a region from a group."
|
||||
help-grouplist: "%lang:helpCommand|/as grouplist|% Display all groups currently registered."
|
||||
help-groupinfo: "%lang:helpCommand|/as groupinfo|% Display information about a group."
|
||||
help-schemevent: "%lang:helpCommand|/as schemevent|% Trigger a schematic event for a region."
|
||||
help-add: "%lang:helpCommand|/as add|% Register a region as rent or buy."
|
||||
help-del: "%lang:helpCommand|/as del|% Delete a registered region from AreaShop."
|
||||
help-addsign: "%lang:helpCommand|/as addsign|% Add a sign to an existing region."
|
||||
help-delsign: "%lang:helpCommand|/as delsign|% Delete the sign you are looking at."
|
||||
help-me: "%lang:helpCommand|/as me|% Check which regions you have (+expiration)."
|
||||
help-setowner: "%lang:helpCommand|/as setowner|% Set region owner or extend the rent."
|
||||
help-resell: "%lang:helpCommand|/as resell|% Put a region into resell mode."
|
||||
help-stopResell: "%lang:helpCommand|/as stopresell|% Put a region back into sold mode."
|
||||
help-addFriend: "%lang:helpCommand|/as addfriend|% Add a friend to a region."
|
||||
help-delFriend: "%lang:helpCommand|/as delfriend|% Delete a friend from a region."
|
||||
help-linksigns: "%lang:helpCommand|/as linksigns|% Use bulk sign linking mode."
|
||||
help-stack: "%lang:helpCommand|/as stack|% Create multiple regions and add them."
|
||||
help-setlandlord: "%lang:helpCommand|/as setlandlord|% Set the landlord of a region."
|
||||
|
||||
rent-help: "/as rent [region], the region you stand in will be used if not specified."
|
||||
rent-noPermission: "You don't have permission to rent a region."
|
||||
rent-maximum: "You can't rent more than %0% region(s) (you already have %1% in group '%2%')."
|
||||
rent-maximumExtend: "You can't extend this rent because you have more than %0% region(s) (you already have %1% in group '%2%')."
|
||||
rent-payError: "Something went wrong with paying, try again later."
|
||||
rent-rented: "You rented %lang:region% until %until%, you can extend your rent by rightclicking the sign again or using /as rent."
|
||||
rent-extended: "You extended your rent of %lang:region% until %until%."
|
||||
rent-extendedToMax: "You extended your rent of %lang:region% until %until% (which is the maximum rental time of %maxrenttime%)."
|
||||
rent-lowMoneyExtend: "You don't have enough money to extend the rent (you have %0% and you need %price%)."
|
||||
rent-lowMoneyRent: "You don't have enough money to rent %lang:region% (you have %0% and you need %price%)."
|
||||
rent-someoneElse: "Someone else already rented %lang:region%."
|
||||
rent-notRentable: "That region is not available for renting."
|
||||
rent-maxExtends: "You cannot extend this rent anymore (the maximum is %maxextends% times), however after the rent is over you can rent %lang:region% again."
|
||||
rent-maxRentTime: "You cannot rent %lang:region% more time in advance, the maximum time is %maxrenttime% and you have currently rented it for %timeleft%."
|
||||
rent-restrictedToWorld: "You need to be in the '%world%' world to rent %lang:region% (you are in '%0%')."
|
||||
rent-restrictedToRegion: "You need to be inside %lang:region% to rent it."
|
||||
rent-expireWarning: "Your region %lang:region% has %timeleft% left, be sure to extend it if you want to keep it."
|
||||
rent-alreadyAtFull: "%lang:region% is already at or above the maximum rental time, you cannot extend it yet."
|
||||
|
||||
buy-help: "/as buy [region], the region you stand in will be used if not specified."
|
||||
buy-noPermission: "You don't have permission to buy a region."
|
||||
buy-noPermissionResell: "You don't have permission to buy a region in resell mode."
|
||||
buy-noPermissionNoResell: "You don't have permission to buy a region that is not in resell mode."
|
||||
buy-notBuyable: "Region %lang:region% is not available for buying."
|
||||
buy-maximum: "You can't buy more than %0% region(s) (you already have %1% in group '%2%')."
|
||||
buy-payError: "Something went wrong with paying, try again later."
|
||||
buy-succes: "You successfully bought %lang:region%."
|
||||
buy-successResale: "You successfully bought %lang:region% from %lang:tPlayer|%0%|%."
|
||||
buy-successSeller: "Your region %lang:region% has been sold to %lang:player% for %0%."
|
||||
buy-lowMoney: "You don't have enough money to buy %lang:region% (you have %0% and you need %price%)."
|
||||
buy-lowMoneyResell: "You don't have enough money to buy %lang:region% (you have %0% and you need %resellprice%)."
|
||||
buy-yours: "You already own %lang:region%."
|
||||
buy-someoneElse: "Someone else already bought %lang:region%."
|
||||
buy-restrictedToWorld: "You need to be in the '%world%' world to buy %lang:region% (you are in '%0%')."
|
||||
buy-restrictedToRegion: "You need to be inside %lang:region% to buy it."
|
||||
|
||||
unrent-help: "/as unrent [region], 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 unrented because it is not registered for renting."
|
||||
unrent-notRented: "The region can't be unrented because it is not rented."
|
||||
unrent-unrented: "%lang:region% of %lang:player% has been unrented."
|
||||
unrent-expired: "Your rent of %lang:region% has expired."
|
||||
|
||||
sell-help: "/as sell [region], the region you stand in will be used if not specified."
|
||||
sell-notRegistered: "The region can't be sold because it is not registered for buying."
|
||||
sell-notBought: "The region can't be sold because it is not someone's property."
|
||||
sell-sold: "%lang:region% of %lang:player% has been sold."
|
||||
sell-noPermission: "You don't have permission to sell a region."
|
||||
sell-noPermissionOther: "You don't have permission to sell another region."
|
||||
|
||||
reload-reloading: "Reloaded all files, now checking rents and updating regions."
|
||||
reload-updateStart: "[gray]Updating %0% regions at %1% per second."
|
||||
reload-updateComplete: "[gray]Updating regions complete."
|
||||
reload-noPermission: "You don't have permission to reload the config files."
|
||||
reload-updateCommandChanged: "'/as updaterents' and '/as updatebuys' have been removed, '/as reload' will also update the regions now so use that command instead."
|
||||
|
||||
info-help:
|
||||
- "/as info[break]"
|
||||
- " %lang:command|all|/as info all|%[break]"
|
||||
- " %lang:command|rented|/as info rented|% [group] [page][break]"
|
||||
- " %lang:command|forrent|/as info forrent|% [group] [page][break]"
|
||||
- " %lang:command|sold|/as info sold|% [group] [page][break]"
|
||||
- " %lang:command|forsale|/as info forsale|% [group] [page][break]"
|
||||
- " %lang:command|reselling|/as info reselling|% [group] [page][break]"
|
||||
- " %lang:command|nogroup|/as info nogroup [page]|%"
|
||||
- " %lang:command|region|/as info region|% [region][break]"
|
||||
info-noPermission: "You don't have permission to get information about regions."
|
||||
info-allHeader: "All regions%0%:"
|
||||
info-rentedHeader: "Rented regions%0%:"
|
||||
info-forrentHeader: "For rent regions%0%:"
|
||||
info-forsaleHeader: "For sale regions%0%:"
|
||||
info-soldHeader: "Sold regions%0%:"
|
||||
info-resellingHeader: "Reselling regions%0%:"
|
||||
info-nogroupHeader: "Regions without group%0%:"
|
||||
info-limitedToGroup: " (limited to group %0%)"
|
||||
info-nogroupNone: "There are no regions without a group."
|
||||
info-noFiltergroup: "Group '%0%' does not exist and therefore cannot be used to limit the results."
|
||||
info-noRegions: "No regions have been found."
|
||||
info-wrongPage: "%0% is not a correct page number."
|
||||
info-entryForrent: "[darkgreen][bold]►[reset] %lang:region%: [gray]For rent for %price% per %duration%."
|
||||
info-entryRented: "[darkgreen][bold]►[reset] %lang:region%: [gray]Rented to %lang:player%."
|
||||
info-entryForsale: "[darkgreen][bold]►[reset] %lang:region%: [gray]For sale for %price%."
|
||||
info-entrySold: "[darkgreen][bold]►[reset] %lang:region%: [gray]Sold to %lang:player%."
|
||||
info-entryReselling: "[darkgreen][bold]►[reset] %lang:region%: [gray]Sold to %lang:player% (reselling)."
|
||||
info-pageStatus:
|
||||
- "[gold]Page %0%/%1%"
|
||||
info-pagePrevious:
|
||||
- " [gold][bold]◄Previous[/bold] "
|
||||
- " hover: %lang:action|Show previous page|%"
|
||||
- " command: %0%"
|
||||
info-pageNoPrevious:
|
||||
- " [darkgray][bold]◄Previous[/bold] "
|
||||
- " hover: This is already the first page"
|
||||
info-pageNext:
|
||||
- " [gold][bold]Next►[/bold]"
|
||||
- " hover: %lang:action|Show next page|%"
|
||||
- " command: %0%"
|
||||
info-pageNoNext:
|
||||
- " [darkgray][bold]Next►[/bold]"
|
||||
- " hover: This is already the last page"
|
||||
info-playerHelp: "/as info player <name>."
|
||||
info-playerRents: "Regions rented by %lang:tPlayer|%0%|%: [gray]%1%"
|
||||
info-playerNoRents: "%lang:tPlayer|%0%|% has not rented a region."
|
||||
info-playerBuys: "Regions bought by %lang:tPlayer|%0%|%: [gray]%1%."
|
||||
info-playerNoBuys: "%lang:tPlayer|%0%|% has not bought a region."
|
||||
info-regionHelp: "/as info region [name], the region you stand in will be used if not specified."
|
||||
info-regionHeaderRent: "[darkgreen]Information about %lang:region%:"
|
||||
info-regionHeaderBuy: "[darkgreen]Information about %lang:region%:"
|
||||
info-regionFooterRent: ""
|
||||
info-regionFooterBuy: ""
|
||||
info-regionRented: "[darkgreen][bold]►[reset] Rented by %lang:player% until: [gray]%until%."
|
||||
info-regionBought: "[darkgreen][bold]►[reset] Bought by %lang:player%."
|
||||
info-regionReselling: "[darkgreen][bold]►[reset] Bought by %lang:player%, currently reselling."
|
||||
info-regionExtending:
|
||||
- "[darkgreen][bold]►[reset] "
|
||||
- "[bold]Extend for[/bold]"
|
||||
- " hover: Extend rent of %region%"
|
||||
- " hover: with %duration% for %price%"
|
||||
- " hover: %lang:action|Extend rent of %region%|%"
|
||||
- " command: /areashop rent %region%"
|
||||
- ": [gray]%price% per %duration%."
|
||||
info-regionCanBeRented:
|
||||
- "[darkgreen][bold]►[reset] "
|
||||
- "[bold]Rent for[/bold]"
|
||||
- " hover: Rent %region% for %price% per %duration%"
|
||||
- " hover: %lang:action|Rent %region%|%"
|
||||
- " command: /areashop rent %region%"
|
||||
- ": [gray]%price% per %duration%."
|
||||
info-regionCanBeBought:
|
||||
- "[darkgreen][bold]►[reset] "
|
||||
- "[bold]Buy for[/bold]"
|
||||
- " hover: Buy %region% for %price%"
|
||||
- " hover: %lang:action|Buy %region%|%"
|
||||
- " command: /areashop buy %region%"
|
||||
- ": [gray]%price%."
|
||||
info-regionReselPrice: "[darkgreen][bold]►[reset] Resell price: [gray]%resellprice% (you can buy it from %lang:player%)."
|
||||
info-regionFriends: "[darkgreen][bold]►[reset] Added friends: [gray]%0%."
|
||||
info-friend: "%lang:tPlayer|%0%|%"
|
||||
info-friendRemove:
|
||||
- "%lang:info-friend|%0%|%"
|
||||
- "[red]✕[gray]"
|
||||
- " hover: Region %region%"
|
||||
- " hover: %lang:action|Remove %0% as friend|%"
|
||||
- " command: /areashop delfriend %0% %region%"
|
||||
info-regionMoneyBackBuy:
|
||||
- "[darkgreen][bold]►[reset] Selling payback: [gray]%moneyback% (%moneybackpercent%% of the price)."
|
||||
info-regionMoneyBackBuyClick:
|
||||
- "[darkgreen][bold]►[reset] "
|
||||
- "[bold]Selling payback[/bold]"
|
||||
- " hover: Sell %region% and get back %moneyback%"
|
||||
- " hover: %lang:action|Sell %region%|%"
|
||||
- " command: /areashop sell %region%"
|
||||
- ": [gray]%moneyback% (%moneybackpercent%% of the price)."
|
||||
info-regionMoneyBackRent:
|
||||
- "[darkgreen][bold]►[reset] Unrenting payback: [gray]%moneyback% (%moneybackpercent%% of the remaining time)."
|
||||
info-regionMoneyBackRentClick:
|
||||
- "[darkgreen][bold]►[reset] "
|
||||
- "[bold]Unrenting payback[/bold]"
|
||||
- " hover: Unrent %region% and get back %moneyback%"
|
||||
- " hover: %lang:action|Unrent %region%|%"
|
||||
- " command: /areashop unrent %region%"
|
||||
- ": [gray]%moneyback% (%moneybackpercent%% of the remaining time)."
|
||||
info-regionMaxExtends: "[darkgreen][bold]►[reset] Maximum number of extensions: [gray]%maxextends% time(s)."
|
||||
info-regionNoExtending: "[darkgreen][bold]►[reset] Rent cannot be extended."
|
||||
info-regionExtendsLeft: "[darkgreen][bold]►[reset] Extensions left: [gray]%extendsleft% time(s) out of %maxextends%."
|
||||
info-regionMaxRentTime: "[darkgreen][bold]►[reset] In advance renting: [gray]%maxrenttime% at maximum."
|
||||
info-prefix: "[darkgreen][bold]►[reset] "
|
||||
info-regionTeleport:
|
||||
- "[bold]Go to the region[/bold]"
|
||||
- " hover: %lang:action|Teleport to %region%|%"
|
||||
- " command: /areashop tp %region%"
|
||||
info-setRegionTeleport:
|
||||
- "[bold]set teleport location[/bold]"
|
||||
- " hover: %region%"
|
||||
- " hover: %lang:action|Set teleport location|%"
|
||||
- " command: /areashop settp %region%"
|
||||
info-regionSigns: "[darkgreen][bold]►[reset] Connected signs: [gray]%0%."
|
||||
info-regionSignLocation: "[gray](%0%, %1%, %2%, %3%)[reset]"
|
||||
info-regionGroups: "[darkgreen][bold]►[reset] Assigned groups: [gray]%0%."
|
||||
info-regionInactiveUnrent: "[darkgreen][bold]►[reset] Auto unrent after: [gray]%inactivetime% of inactivity by the player."
|
||||
info-regionInactiveSell: "[darkgreen][bold]►[reset] Auto sell after: [gray]%inactivetime% of inactivity by the player."
|
||||
info-regionRestrictedRegionRent: "[darkgreen][bold]►[reset] You must be inside %lang:region% to rent it."
|
||||
info-regionRestrictedWorldRent: "[darkgreen][bold]►[reset] You need to be inside world '%world%' to rent %lang:region%."
|
||||
info-regionRestrictedRegionBuy: "[darkgreen][bold]►[reset] You must be inside %lang:region% to buy it."
|
||||
info-regionRestrictedWorldBuy: "[darkgreen][bold]►[reset] You need to be inside world '%world%' to buy %lang:region%."
|
||||
info-regionRestoringRent: "[darkgreen][bold]►[reset] Restoring is enabled [gray](region will reset at unrent)%0%."
|
||||
info-regionRestoringBuy: "[darkgreen][bold]►[reset] Restoring is enabled [gray](region will reset at sell)%0%."
|
||||
info-regionRestoringProfile: " (profile: %0%)"
|
||||
info-regionLandlord: "[darkgreen][bold]►[reset] Landlord: [gray]%lang:landlord% (receives the money)."
|
||||
info-regionNotExisting: "The specified region is not registered: %0%."
|
||||
|
||||
setrestore-help: "/as setrestore <region> <true|false|general> [profile]."
|
||||
setrestore-noPermission: "You don't have permission to change the restore settings."
|
||||
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 %lang:region% to '%0%'."
|
||||
setrestore-successProfile: "Successfully set the restore setting of %lang:region% to '%0%' and the profile to '%1%'."
|
||||
|
||||
setprice-noPermission: "You don't have permission to change the price of a region."
|
||||
setprice-help: "/as setprice <price> [region], the region you stand in will be used if not specified."
|
||||
setprice-notRegistered: "The specified region is not registered: %0%."
|
||||
setprice-wrongPrice: "'%0%' is not a valid price."
|
||||
setprice-successRent: "Price of region %lang:region% changed to %price% per %duration%."
|
||||
setprice-successBuy: "Price of region %lang:region% changed to %price%."
|
||||
setprice-successRemoved: "Price of %lang:region% has been removed, it will now use the price from a group or the default.yml file, new price: %price%."
|
||||
setprice-noLandlord: "You don't have permission to change the price because you are not the landlord of %lang:region%."
|
||||
|
||||
setduration-noPermission: "You don't have permission to change the duration of a rent."
|
||||
setduration-help: "/as setduration <amount> <identifier> [region], the region you stand in will be used if not specified."
|
||||
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 %lang:region% changed to '%duration%'."
|
||||
setduration-noLandlord: "You don't have permission to change the duration because you are not the landlord of %lang:region%."
|
||||
setduration-successRemoved: "Duration of %lang:region% has been removed, it will now use the duration from a group or the default.yml file, new duration: %duration%."
|
||||
|
||||
setup-noRegion: "You did not specify a region on the second line."
|
||||
setup-alreadyRentSign: "The region you specified is already added to AreaShop as a rent region, add signs with [as] on the first line or '/as addsign'."
|
||||
setup-alreadyBuySign: "The region you specified is already added to AreaShop as a buy region, add signs with [as] on the first line or '/as addsign'."
|
||||
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 numbers only."
|
||||
setup-rentSuccess: "Renting of region %lang:region% is setup correctly."
|
||||
setup-buySuccess: "Buying of region %lang:region% is setup correctly."
|
||||
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: %lang:tRegion|%0%|% and %lang:tRegion|%1%|%)."
|
||||
setup-blacklisted: "%0% is on the blacklist and cannot be added to AreaShop."
|
||||
setup-noPermission: "You cannot add the region '%0%', you are not an owner/member or don't have the permission for it."
|
||||
|
||||
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: "%lang:region% successfully deregistered as rental region."
|
||||
destroy-successBuy: "%lang:region% successfully deregistered as buy region."
|
||||
|
||||
teleport-help: "/as tp <region> [sign]."
|
||||
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 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 %lang:region%."
|
||||
teleport-successSign: "You teleported to the sign of %lang:region%."
|
||||
teleport-noSafe: "No safe position found in %lang:region%, no spots in the region left or maximum tries exceeded (%0%/%1%)."
|
||||
teleport-blocked: "You can't teleport because the position is outside the region, and you are forced to teleport inside."
|
||||
teleport-changedToSign: "You only have permission to teleport to the sign and not inside the region, teleporting to sign."
|
||||
teleport-changedToNoSign: "No sign available to teleport to, trying to teleport inside the region instead."
|
||||
|
||||
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: "The specified region is not registered: %0%."
|
||||
setteleport-success: "Teleport location of %lang:region% set."
|
||||
setteleport-notInside: "The location has to be inside the region."
|
||||
setteleport-reset: "Teleport location of %lang:region% has been reset."
|
||||
|
||||
find-help: "/as find <buy|rent> [maxprice] [group]."
|
||||
find-noPermission: "You don't have permission to search regions and teleport to them."
|
||||
find-success: "Found a %0% region: %lang:region%, while searching with a max price of your balance: %1%%2%."
|
||||
find-successMax: "Found a %0% region: %lang:region%, while searching with a max price of %1%%2%."
|
||||
find-wrongMaxPrice: "The specified maximum price is not a correct number: %0%."
|
||||
find-wrongGroup: "The specified group does not exist: %0%."
|
||||
find-noneFound: "No %0% region found while searching with a max price of your balance: %1%%2%."
|
||||
find-noneFoundMax: "No %0% region found while searching with a max price of %1%%2%."
|
||||
find-onlyInGroup: ", only searched for regions in group: %0%."
|
||||
|
||||
groupadd-help: "/as groupadd <group> [region], if no region specified all regions from your WorldEdit selection are used."
|
||||
groupadd-noPermission: "You don't have permission to add regions to groups."
|
||||
groupadd-success: "Region %lang:region% has been added to group '%0%', this group now has %1% member(s)."
|
||||
groupadd-failed: "Region %lang:region% is already a member of group '%0%'."
|
||||
groupadd-weSuccess: "Added to group %0%: [gray]%1%."
|
||||
groupadd-weFailed: "Were already in group %0%: [gray]%1%."
|
||||
|
||||
groupdel-help: "/as groupdel <group> [region], if no region specified all regions from your WorldEdit selection are used."
|
||||
groupdel-noPermission: "You don't have permission to remove regions from groups."
|
||||
groupdel-success: "Region %lang:region% has been removed from group '%0%', this group now has %1% member(s)."
|
||||
groupdel-failed: "Region %lang:region% is not a member of group '%0%'."
|
||||
groupdel-weSuccess: "Removed from group %0%: [gray]%1%."
|
||||
groupdel-weFailed: "Were not in group %0% anyway: [gray]%1%."
|
||||
|
||||
grouplist-noPermission: "You don't have permission to display the registered groups."
|
||||
grouplist-noGroups: "There are currently no groups registered."
|
||||
grouplist-success: "The following groups are registered: [gray]%0%."
|
||||
|
||||
groupinfo-help: "/as groupinfo <group>."
|
||||
groupinfo-noPermission: "You don't have permission to display information about a group."
|
||||
groupinfo-noGroup: "There is no group registered with the name '%0%', use /as grouplist to check groups."
|
||||
groupinfo-members: "The following regions are member of group %0%: [gray]%1%."
|
||||
groupinfo-noMembers: "Group %0% does not have any members."
|
||||
|
||||
schemevent-help: "/as schemevent <region> <created|deleted|rented|unrented|bought|sold>."
|
||||
schemevent-wrongEvent: "The specified event '%0%' does not exist, use one of the following: [gray]%1%."
|
||||
schemevent-success: "Event '%0%' has successfully been triggered for region %lang:region%."
|
||||
schemevent-noPermission: "You don't have permission to trigger schematic events."
|
||||
|
||||
add-help: "/as add <rent|buy> [region] [world]."
|
||||
add-noPermission: "You don't have permission to add a region to AreaShop."
|
||||
add-success: "Added as %0%: [gray]%1%."
|
||||
add-failed: "Already registered: [gray]%0%."
|
||||
add-blacklisted: "On the blacklist: [gray]%0%."
|
||||
add-specifyWorld: "Specify the world of the region when using from console."
|
||||
add-incorrectWorld: "World '%0%' not found, try again (case-sensitive)."
|
||||
add-noRegion: "WorldGuard region '%0%' does not exist in this world."
|
||||
add-noPermissionRegions: "No permission to add: [gray]%0%."
|
||||
add-noPermissionOwnerMember: "[gray]You either are not a member/owner of these regions or have no permission to add your regions."
|
||||
|
||||
del-noPermission: "You don't have permission to remove regions."
|
||||
del-success: "Removed regions: [gray]%0%."
|
||||
del-failed: "No permission to remove or not registered: [gray]%0%."
|
||||
|
||||
addsign-help: "/as addsign [region] [profile]."
|
||||
addsign-noSign: "You are not looking at a sign."
|
||||
addsign-noRegions: "No region found around the sign position."
|
||||
addsign-couldNotDetect: "Found multiple regions around the sign, specify region as extra argument (2 of the regions that were found: %lang:tRegion|%0%|% and %lang:tRegion|%1%|%)."
|
||||
addsign-couldNotDetectSign: "Found multiple regions around the sign, specify region on the second line (2 of the regions that were found: %lang:tRegion|%0%|% and %lang:tRegion|%1%|%)."
|
||||
addsign-wrongProfile: "The specified profile does not exist, use one of the following (check config): [gray]%0%."
|
||||
addsign-profile:
|
||||
- "[bold]%0%[/bold]"
|
||||
- " hover: Signprofile %0%"
|
||||
- " hover: %lang:action|Use this profile|%"
|
||||
- " command: /areashop linksigns %0%"
|
||||
addsign-success: "The sign has been added to %lang:region%."
|
||||
addsign-successProfile: "The sign has been added to %lang:region% with profile %0%."
|
||||
addsign-alreadyRegistered: "That sign is already registered for region %lang:region%."
|
||||
addsign-noPermission: "You don't have permission to add a sign."
|
||||
|
||||
delsign-noSign: "You are not looking at a sign."
|
||||
delsign-noPermission: "You don't have permission to delete a sign."
|
||||
delsign-noRegion: "That sign does not belong to an AreaShop region."
|
||||
delsign-success: "The sign has been removed from region %lang:region%."
|
||||
|
||||
me-noPermission: "You don't have permission to check which regions you have."
|
||||
me-header: "Regions of %lang:tPlayer|%0%|%:"
|
||||
me-notAPlayer: "You are not a player so you can't have any regions."
|
||||
me-rentLine:
|
||||
- "[darkgreen][bold]►[reset] %lang:region% [gray]("
|
||||
- "%timeleft% left"
|
||||
- " hover: until %until%"
|
||||
- ")."
|
||||
me-buyLine: "[darkgreen][bold]►[reset] %lang:region%."
|
||||
me-friendLine:
|
||||
- "[darkgreen][bold]►[reset] %lang:region% [gray]("
|
||||
- "owned by %lang:player%"
|
||||
- " hover: You are added as friend"
|
||||
- ")."
|
||||
me-nothing: "%lang:tPlayer|%0%|% has not rented or bought regions and is not added as friend to one."
|
||||
me-noPlayer: "%0% cannot be found, probably never joined the server."
|
||||
me-clickHint: "[gray][italic]Click a region name to see details."
|
||||
|
||||
setowner-help: "/as setowner <player> [region], the region you stand in will be used if not specified."
|
||||
setowner-noPermission: "You don't have permission to set the owner of a region."
|
||||
setowner-noPermissionRent: "You don't have permission to set the owner of rent regions."
|
||||
setowner-noPermissionBuy: "You don't have permission to set the owner of buy regions."
|
||||
setowner-notRegistered: "The specified region is not registered, owner cannot be set."
|
||||
setowner-noPlayer: "Could not get the UUID of the specified player: %0%."
|
||||
setowner-succesRent: "Owner of %lang:region% successfully changed to %lang:player%, rented until %until% (%timeleft% left)."
|
||||
setowner-succesRentExtend: "Owner was already %lang:player%, rent extended with '%duration%', now rented until %until% (%timeleft% left)."
|
||||
setowner-succesBuy: "Owner of %lang:region% successfully changed to %lang:player%."
|
||||
|
||||
resell-help: "/as resell <price> [region], the region you stand in will be used if not specified."
|
||||
resell-wrongPrice: "'%0%' is not a valid price."
|
||||
resell-notRegistered: "The specified region is not registered: %0%."
|
||||
resell-notBought: "You can't resell %lang:region% because it is not sold yet."
|
||||
resell-success: "%lang:region% is successfully put into reselling mode for %resellprice%."
|
||||
resell-noPermission: "You don't have permission to set your region in reselling mode."
|
||||
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: "The specified region is not registered: %0%."
|
||||
stopresell-notResell: "You can't stop reselling %lang:region% because it is not in resell mode."
|
||||
stopresell-success: "%lang:region% is successfully put back into sold mode."
|
||||
stopresell-noPermission: "You don't have permission to set your region back to sold mode."
|
||||
stopresell-noPermissionOther: "You don't have permission to set regions back to sold mode."
|
||||
|
||||
addfriend-help: "/as addfriend <player> [region], the region you stand in will be used if not specified."
|
||||
addfriend-noPermissionOther: "You don't have permission to add friends to regions that are not yours."
|
||||
addfriend-noPermission: "You don't have permission to add friends to your region."
|
||||
addfriend-successOther: "%lang:tPlayer|%0%|% has been added as friend to region %lang:region%."
|
||||
addfriend-success: "%lang:tPlayer|%0%|% has been added as friend to your region %lang:region%."
|
||||
addfriend-alreadyAdded: "%lang:tPlayer|%0%|% is already added as friend to %lang:region%."
|
||||
addfriend-self: "Adding the owner of the region as friend would be pointless."
|
||||
addfriend-noOwner: "You cannot add friends to a region without owner."
|
||||
addfriend-notVisited: "You cannot add %0% because he did not visit the server yet."
|
||||
|
||||
delfriend-help: "/as delfriend <player> [region], the region you stand in will be used if not specified."
|
||||
delfriend-noPermissionOther: "You don't have permission to delete friends from regions that are not yours."
|
||||
delfriend-noPermission: "You don't have permission to delete friends from your region."
|
||||
delfriend-successOther: "%lang:tPlayer|%0%|% has been deleted as friend from region %lang:region%."
|
||||
delfriend-success: "%lang:tPlayer|%0%|% has been deleted as friend from your region %lang:region%."
|
||||
delfriend-notAdded: "%lang:tPlayer|%0%|% is not added as friend to %lang:region%."
|
||||
delfriend-noOwner: "You cannot remove friends from a region without owner."
|
||||
|
||||
linksigns-multipleRegions: "Found multiple regions: [gray]%0%."
|
||||
linksigns-multipleRegionsAdvice: "Click another time to try again or use '/as linksigns' to stop."
|
||||
linksigns-noRegions: "No AreaShop regions found in the direction of your cursor, make sure the region is added to AreaShop [gray](maximum range 100 blocks)."
|
||||
linksigns-regionFound: "Region %lang:region% has been found, now point to a sign and leftclick to link it."
|
||||
linksigns-signFound: "Found a sign at (%0%, %1%, %2%), now point towards a region and rightclick to link it"
|
||||
linksigns-noSign: "No sign found in the direction of your cursor, make sure you have a direct sight to a sign and click again [gray](maximum range 100 blocks)."
|
||||
linksigns-alreadyRegistered: "That sign is already registered for region %lang:region%, click again to select another sign."
|
||||
linksigns-first: "You have entered sign linking mode."
|
||||
linksigns-next: "[gray]Leftclick to select a sign, rightclick to select a region, use /as linksigns to stop."
|
||||
linksigns-noPermission: "You don't have permission to enter bulk sign linking mode."
|
||||
linksigns-stopped: "Exited sign linking mode."
|
||||
|
||||
stack-help:
|
||||
- "/as stack <amount> <gap> <name> <rent|buy> [group].[break]"
|
||||
- " [gray]<amount> Number of regions that will be created.[break]"
|
||||
- " [gray]<gap> Blocks distance between the regions.[break]"
|
||||
- " [gray]<name> Name of the regions (number will be behind it).[break]"
|
||||
- " [gray]<rent|buy> Make then rent or buy regions.[break]"
|
||||
- " [gray][group] A group to add the created regions to.[break]"
|
||||
- " [gray]The regions will be created in the direction you are facing."
|
||||
stack-accepted: "Starting to create %0% %1% regions with %2% blocks in between, names start with %3% and have a number behind them.%4%"
|
||||
stack-addToGroup: " Created regions will be added to the group '%0%'."
|
||||
stack-noPermission: "You don't have permission to create and add regions to AreaShop in bulk."
|
||||
stack-wrongAmount: "'%0%' is not a correct amount of regions."
|
||||
stack-wrongGap: "'%0%' is not a correct number for the number of blocks gap between regions."
|
||||
stack-noSelection: "You don't have a selection that indicates where the first region should be created."
|
||||
stack-addStart: "[gray]Adding %0% regions at %1% per second."
|
||||
stack-addComplete: "[gray]Adding regions complete."
|
||||
stack-unclearDirection: "Please look clearly in the north, east, south or west direction, currently detected %0%."
|
||||
|
||||
setlandlord-help: "/as setlandlord <player> [region], the region you stand in will be used if not specified."
|
||||
setlandlord-noPermission: "You don't have permission to set the landlord for a region."
|
||||
setlandlord-success: "%lang:landlord% has successfully been set as landlord of %lang:region%."
|
||||
|
||||
message-help: "/as message <player> <message...>"
|
||||
message-noPermission: "You do not have permission to send AreaShop messages."
|
||||
message-notOnline: "%0% is not online."
|
||||
|
||||
confirm-rent:
|
||||
- "%lang:prefix%Are you sure you want to rent %lang:tRegion|%0%|%?[break]"
|
||||
- "[darkgreen][bold]►[reset] %lang:button|Click to rent %0%|%"
|
||||
- " hover: %lang:action|Rent %0%|%"
|
||||
- " command: /areashop rent %0%"
|
||||
confirm-extend:
|
||||
- "%lang:prefix%Are you sure you want to extend %lang:tRegion|%0%|%?[break]"
|
||||
- "[darkgreen][bold]►[reset] %lang:button|Click to extend %0%|%"
|
||||
- " hover: %lang:action|Extend %0%|%"
|
||||
- " command: /areashop rent %0%"
|
||||
confirm-unrent:
|
||||
- "%lang:prefix%Are you sure you want to stop renting %lang:tRegion|%0%|%?[break]"
|
||||
- "[darkgreen][bold]►[reset] %lang:button|Click to stop renting %0%|%"
|
||||
- " hover: %lang:action|Stop renting %0%|%"
|
||||
- " command: /areashop unrent %0%"
|
||||
confirm-buy:
|
||||
- "%lang:prefix%Are you sure you want to buy %lang:tRegion|%0%|%?[break]"
|
||||
- "[darkgreen][bold]►[reset] %lang:button|Click to buy %0%|%"
|
||||
- " hover: %lang:action|Buy %0%|%"
|
||||
- " command: /areashop buy %0%"
|
||||
confirm-sell:
|
||||
- "%lang:prefix%Are you sure you want to sell %lang:tRegion|%0%|%?[break]"
|
||||
- "[darkgreen][bold]►[reset] %lang:button|Click to sell %0%|%"
|
||||
- " hover: %lang:action|Sell %0%|%"
|
||||
- " command: /areashop sell %0%"
|
||||
|
||||
timeleft-years: "%0% years"
|
||||
timeleft-months: "%0% months"
|
||||
timeleft-days: "%0% days"
|
||||
timeleft-hours: "%0% hours"
|
||||
timeleft-minutes: "%0% minutes"
|
||||
timeleft-second: "%0% second"
|
||||
timeleft-seconds: "%0% seconds"
|
||||
timeleft-ended: "Expired"
|
||||
|
||||
greeting-forrent: "%region% can be rented for %price% per %duration%."
|
||||
greeting-rented: "%region% is rented by %player% until %until%."
|
||||
greeting-forsale: "%region% can be bought for %price%."
|
||||
greeting-bought: "%region% is bought by %player%."
|
||||
greeting-resale: "%region% can be bought for %resaleprice% from %player%."
|
||||
|
||||
update-playerNotify: "[darkgreen]Update from AreaShop V%0% to %1% available, get the latest version at https://github.com/NLthijs48/AreaShop/releases."
|
||||
@@ -0,0 +1,541 @@
|
||||
# ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
|
||||
# ║ Language file of the AreaShop plugin created by NLThijs48, Github can be found at https://github.com/NLthijs48/AreaShop ║
|
||||
# ║ Language: French, Version: V2.3.2, Percentage translated: 96% ║
|
||||
# ║ This file will be overwritten at each startup/reload of the plugin, if you want to change anything then do the following: ║
|
||||
# ║ 1: Make a copy of this file ║
|
||||
# ║ 2: Rename it to <servername>.yml (don't use a language code as filename, could otherwise be overwritten in future updates) ║
|
||||
# ║ 3: Change the 'language' setting in config.yml to '<servername>', do not include '.yml' ║
|
||||
# ║ 4: Change the strings in the new file to your liking and save the file ║
|
||||
# ║ 5: Use '/as reload' or reload/restart your server to see the changes ║
|
||||
# ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
|
||||
button: "[bold]<%0%>[/bold]"
|
||||
|
||||
command:
|
||||
- "[bold]%0%[/bold]"
|
||||
- " hover: %lang:action|Utilise %1%|%"
|
||||
- " command: %1%"
|
||||
|
||||
helpCommand:
|
||||
- "[gold]%0% [gray]-[reset]"
|
||||
- " hover: %lang:action|Utilise%0%|%"
|
||||
- " command: %0%"
|
||||
|
||||
region: "%lang:tRegion|%region%|%"
|
||||
|
||||
tRegion:
|
||||
- "[bold]%0%[/bold]"
|
||||
- " hover: Région %0%"
|
||||
- " hover: %lang:action|Région information|%"
|
||||
- " command: /areashop info region %0%"
|
||||
|
||||
player: "%lang:tPlayer|%player%|%"
|
||||
|
||||
tPlayer:
|
||||
- "[bold]%0%[/bold]"
|
||||
- " hover: Joueur %0%"
|
||||
- " hover: %lang:action|Régions de %0%|%"
|
||||
- " command: /areashop info player %0%"
|
||||
|
||||
landlord:
|
||||
- "[bold]%landlord%[/bold]"
|
||||
- " hover: Bailleur%landlord%"
|
||||
- " hover: %lang:action|Région de %landlord%|%"
|
||||
- " command: /areashop info player %landlord%"
|
||||
|
||||
total-maximum: "Vous ne pouvez pas louer ou acheter plus de %0% région(s) au total (vous possédez déjà %1% dans le groupe '%2%')."
|
||||
|
||||
general-notReady: "AreaShop n'est pas totalement chargé, merci d'attendre."
|
||||
general-noWorld: "Vous ne pouvez pas faire ceci, le monde de %lang:region% n'est en ce moment pas disponible (monde '%world%')."
|
||||
general-noRegion: "Vous ne pouvez pas faire ceci, la région WorldGuard n'est pour le moment pas disponible (région %lang:region%)."
|
||||
general-noEconomy: "Il n'y a pas de plugin d'économie sur votre serveur, ou bien qu'il n'est pas correctement installé. Merci de prévenir l'opérateur du serveur dès que possible."
|
||||
general-cancelled: "%0%"
|
||||
|
||||
cmd-notValid: "Cette commande est incorrecte, utilisez '/as help' pour plus de détails."
|
||||
cmd-onlyByPlayer: "Cette commande ne peut être utilisée que par un joueur."
|
||||
cmd-weOnlyByPlayer: "Utiliser une sélection WorldEdit n'est possible qu'en tant que joueur. Spécifiez le nom de la région en argument supplémentaire."
|
||||
cmd-noSelection: "Vous n'avez pas de séléction WorldEdit."
|
||||
cmd-noRegionsFound: "Aucune région enregistrée dans AreaShop n'a été trouvée dans votre séléction."
|
||||
cmd-noWERegionsFound: "Aucune région WorldEdit croisant votre séléction n'a été trouvée."
|
||||
cmd-notRegistered: "La région spécifiée n'est pas disponible dans AreaShop: %0%."
|
||||
cmd-noRegionsAtLocation: "Aucune région trouvée à votre emplacement, spécifiez la région comme un argument."
|
||||
cmd-moreRegionsAtLocation: "Plus d'une région ont été trouvées à votre emplacement, spécifiez la région comme un argument."
|
||||
cmd-automaticRegionOnlyByPlayer: "Déterminer la région automatiquement est disponible uniquement pour les joueurs, spécifiez la région comme un argument."
|
||||
|
||||
help-header: "Page d'aide, commandes que vous pouvez exécuter."
|
||||
help-noPermission: "Vous ne pouvez pas voir la page d'aide."
|
||||
help-alias: "Alias des commandes : /areashop, /as"
|
||||
help-help: "%lang:helpCommand|/as help|% Montre cette page d'aide."
|
||||
help-info: "%lang:helpCommand|/as info|% Obtenir les informations sur les régions actuelles."
|
||||
help-rent: "%lang:helpCommand|/as rent|% Louer une région, ou prolonger la location actuelle."
|
||||
help-buy: "%lang:helpCommand|/as buy|% Acheter une région."
|
||||
help-unrent: "%lang:helpCommand|/as unrent|% Ne plus louer une région."
|
||||
help-sell: "%lang:helpCommand|/as sell|% Vendre une région."
|
||||
help-reload: "%lang:helpCommand|/as reload|% Reloader tout les fichiers et régions."
|
||||
help-setrestore: "%lang:helpCommand|/as setrestore|% Active/Désactive la restauration et choix du profil."
|
||||
help-setprice: "%lang:helpCommand|/as setprice|% Changer le prix d'une région."
|
||||
help-setduration: "%lang:helpCommand|/as setduration|% Changer le temps de location d'une région."
|
||||
help-teleport: "%lang:helpCommand|/as tp|% Se téléporter à une région vendue/louée."
|
||||
help-setteleport: "%lang:helpCommand|/as settp|% Définir le point de téléportation d'une région."
|
||||
help-find: "%lang:helpCommand|/as find|% Trouver une région à vendre/louer vide."
|
||||
help-groupadd: "%lang:helpCommand|/as groupadd|% Ajouter une région à un groupe."
|
||||
help-groupdel: "%lang:helpCommand|/as groupdel|% Supprimer une région d'un groupe."
|
||||
help-grouplist: "%lang:helpCommand|/as grouplist|% Afficher tout les groupes."
|
||||
help-groupinfo: "%lang:helpCommand|/as groupinfo|% Afficher des informations sur un groupe."
|
||||
help-schemevent: "%lang:helpCommand|/as schemevent|% Déclenche un événement schématique d'une région."
|
||||
help-add: "%lang:helpCommand|/as add|% Enregistrer une région à la vente ou à la location."
|
||||
help-del: "%lang:helpCommand|/as del|% Supprimer une région enregistrée par AreaShop."
|
||||
help-addsign: "%lang:helpCommand|/as addsign|% Ajouter un panneau à une région existante."
|
||||
help-delsign: "%lang:helpCommand|/as delsign|% Supprimer le panneau que vous regardez."
|
||||
help-me: "%lang:helpCommand|/as me|% Voir les régions que vous possédez (et le temps restant)."
|
||||
help-setowner: "%lang:helpCommand|/as setowner|% Change le propriétaire d'une région ou allonge le temps de location."
|
||||
help-resell: "%lang:helpCommand|/as resell|% Mettre une région en revente."
|
||||
help-stopResell: "%lang:helpCommand|/as stopresell|% Ne plus revendre votre région."
|
||||
help-addFriend: "%lang:helpCommand|/as addfriend|% Ajouter un ami à votre région."
|
||||
help-delFriend: "%lang:helpCommand|/as delfriend|% Supprimer un ami de votre région."
|
||||
help-linksigns: "%lang:helpCommand|/as linksigns|% Utilisez le mode de liaison de panneau."
|
||||
help-stack: "%lang:helpCommand|/as stack|% Créez plusieurs régions et ajoutez les."
|
||||
help-setlandlord: "%lang:helpCommand|/as setlandlord|% Définir le bailleur d'une région"
|
||||
|
||||
rent-help: "/as rent [region], Si non spécifiée, cible la région dans laquelle vous vous trouvez."
|
||||
rent-noPermission: "Vous n'avez pas la permission de louer une région."
|
||||
rent-maximum: "Vous ne pouvez pas louer plus de %0% région(s) au total (vous possédez déjà %1% dans le groupe '%2%')."
|
||||
rent-maximumExtend: "Vous ne pouvez pas allonger cette location car vous avez plus de %0% région(s) (Vous avez déjà %1% dans le groupe '%2%')."
|
||||
rent-payError: "Une erreur durant le paiement s'est produite. Essayez de nouveau plus tard."
|
||||
rent-rented: "Vous louez %lang:region% jusqu'à %until%, vous pouvez étendre la location en fesant un clic droit sur le panneau ou avec la commande /as rent."
|
||||
rent-extended: "Vous avez prolongé votre location de %lang:region% jusqu'au %until%."
|
||||
rent-extendedToMax: "Vous avez allongé votre location de %lang:region% jusqu'au %until% (qui est la durée maximum de location de %maxrenttime%)."
|
||||
rent-lowMoneyExtend: "Vous n'avez pas assez d'argent pour allongé votre location (Vous avez %0% et vous avez besoin de %price%)."
|
||||
rent-lowMoneyRent: "Vous n'avez pas assez d'argent pour louer %lang:region% (Vous avez %0% et vous avez besoin de %price%)."
|
||||
rent-someoneElse: "Quelqu'un d'autre loue déjà %lang:region%."
|
||||
rent-notRentable: "Cette région n'est pas disponible à la location."
|
||||
rent-maxExtends: "Vous ne pouvez plus allongé cette location (le maximum est de %maxextends% fois), mais après que la prochaine location soit terminé, vous pourrez louer %lang:region% à nouveau."
|
||||
rent-maxRentTime: "Vous ne pouvez pas louer %lang:region% plus longtemps à l'avance, le maximum est de %maxrenttime% et vous avez déjà loué pour %timeleft%."
|
||||
rent-restrictedToWorld: "Vous devez être dans le monde '%world%' pour louer %lang:region% (vous êtes dans '%0%')."
|
||||
rent-restrictedToRegion: "Vous devez être à l'intérieur de %lang:region% pour pouvoir la louer."
|
||||
rent-expireWarning: "Votre région %lang:region% n'a plus que %timeleft% de temps de location, soyez sûr d'allonger ce temps de location si vous voulez la conserver."
|
||||
rent-alreadyAtFull: "%lang:region% a déjà atteint ou a dépassé le temps maximum de location, vous ne pouvez pas encore l'étendre la location."
|
||||
|
||||
buy-help: "/as buy [region], Si non spécifiée, cible la région dans laquelle vous vous trouvez."
|
||||
buy-noPermission: "Vous n'avez pas la permission d'acheter une région."
|
||||
buy-noPermissionResell: "Vous n'avez pas la permission d'acheter une région dans le mode revente."
|
||||
buy-noPermissionNoResell: "Vous n'avez pas la permission d'acheter une région qui n'est pas dans le mode revente."
|
||||
buy-notBuyable: "La région %lang:region% n'est pas disponible à l'achat."
|
||||
buy-maximum: "Vous ne pouvez pas acheter plus de %0% région(s) au total (vous possédez déjà %1% dans le groupe '%2%')."
|
||||
buy-payError: "Une erreur durant le paiement s'est produite. Essayez de nouveau plus tard."
|
||||
buy-succes: "Vous avez acheté la région %lang:region%."
|
||||
buy-successResale: "Vous avez racheté la région %lang:region% qui appartenait à %lang:tPlayer|%0%|%."
|
||||
buy-successSeller: "Votre région %lang:region% a été vendue à %lang:player% pour %0%."
|
||||
buy-lowMoney: "Vous n'avez pas assez d'argent pour acheter %lang:region% (vous possédez %0% et devez payer %price%)."
|
||||
buy-lowMoneyResell: "Vous n'avez pas assez d'argent pour acheter %lang:region% (vous possédez %0% et devez payer %resellprice%)."
|
||||
buy-yours: "Vous avez déjà acheté %lang:region%."
|
||||
buy-someoneElse: "Quelqu'un a déjà acheté %lang:region%."
|
||||
buy-restrictedToWorld: "Vous devez être dans le monde '%world%' pour acheter %lang:region% (vous êtes dans '%0%')."
|
||||
buy-restrictedToRegion: "Vous devez être dans %lang:region% pour pouvoir l'acheter."
|
||||
|
||||
unrent-help: "/as unrent [region], Si non spécifiée, cible la région dans laquelle vous vous trouvez."
|
||||
unrent-noPermission: "Vous n'avez pas la permission de dé-louer une région."
|
||||
unrent-noPermissionOther: "Vous n'avez pas la permission de dé-louer une autre région."
|
||||
unrent-notRegistered: "La région ne peut pas ne plus être louée car elle n'est pas enregistrée comme une région que l'on peut louer."
|
||||
unrent-notRented: "La région ne peut pas ne plus être louée car elle n'est pas enregistrée comme actuellement louée."
|
||||
unrent-unrented: "Vous avez rompu la location de %lang:region% de %lang:player%."
|
||||
unrent-expired: "Votre location de %lang:region% a expiré."
|
||||
|
||||
sell-help: "/as sell [region], Si non spécifiée, cible la région dans laquelle vous vous trouvez."
|
||||
sell-notRegistered: "La région ne peut pas être vendue car son statut n'est pas \"à vendre\"."
|
||||
sell-notBought: "La région ne peut pas être vendue car ce n'est pas la propriété de quelqu'un."
|
||||
sell-sold: " %lang:player% a vendu la région %lang:region%"
|
||||
sell-noPermission: "Vous n'avez pas la permission de vendre une région."
|
||||
sell-noPermissionOther: "Vous n'avez pas la permission de vendre une autre région."
|
||||
|
||||
reload-reloading: "Fichiers rechargés, vérification des locations et des mises à jour des régions."
|
||||
reload-updateStart: "[gray]Met à jour %0% régions, %1% par seconde."
|
||||
reload-updateComplete: "[gray]Mise à jour des régions terminée."
|
||||
reload-noPermission: "Vous n'avez pas la permission de recharger les fichiers."
|
||||
reload-updateCommandChanged: "'/as updaterents' et '/as updatebuys' ont été supprimées, '/as reload' est la commande à utiliser pour mettre à jour les régions."
|
||||
|
||||
info-help:
|
||||
- "/as info[break]"
|
||||
- " %lang:command|all|/as info all|%[break]"
|
||||
- " %lang:command|rented|/as info rented|% [group] [page][break]"
|
||||
- " %lang:command|forrent|/as info forrent|% [group] [page][break]"
|
||||
- " %lang:command|sold|/as info sold|% [group] [page][break]"
|
||||
- " %lang:command|forsale|/as info forsale|% [group] [page][break]"
|
||||
- " %lang:command|reselling|/as info reselling|% [group] [page][break]"
|
||||
- " %lang:command|nogroup|/as info nogroup [page]|%"
|
||||
- " %lang:command|region|/as info region|% [region][break]"
|
||||
info-noPermission: "Vous n'avez pas la permission d'avoir des informations à propos des régions."
|
||||
info-allHeader: "Toutes les régions%0%:"
|
||||
info-rentedHeader: "Les régions louées%0%:"
|
||||
info-forrentHeader: "Les régions à louer%0%:"
|
||||
info-forsaleHeader: "Les régions à vendre%0%:"
|
||||
info-soldHeader: "Les régions vendues%0%:"
|
||||
info-resellingHeader: "Les régions en revente%0%:"
|
||||
info-nogroupHeader: "Les régions sans groupe%0%:"
|
||||
info-limitedToGroup: " (limité au groupe %0%)"
|
||||
info-nogroupNone: "Il n'y a pas de région sans groupe."
|
||||
info-noFiltergroup: "Le groupe '%0%' n'existe pas ou ne peut donc pas être utilisé pour limiter les résultats."
|
||||
info-noRegions: "Aucune région trouvée."
|
||||
info-wrongPage: "%0% n'est pas un numéro de page correct."
|
||||
info-pageNoPrevious:
|
||||
- " [darkgray][bold]◄Précédent[/bold] "
|
||||
- " hover: C'est déjà la premier page"
|
||||
info-pageNoNext:
|
||||
- " [darkgray][bold]Suivaznt►[/bold]"
|
||||
- " hover: C'est déjà la dernière page"
|
||||
info-playerHelp: "/as info player <name>"
|
||||
info-playerRents: "Régions louée par %lang:tPlayer|%0%|%: [gray]%1%"
|
||||
info-playerNoRents: "%lang:tPlayer|%0%|% n'a de régions louées."
|
||||
info-playerBuys: "Régions achetées par %lang:tPlayer|%0%|%: [gray]%1%"
|
||||
info-playerNoBuys: "%lang:tPlayer|%0%|% n'a pas acheté de régions."
|
||||
info-regionHelp: "/as info region [name], Si non spécifiée, cible la région dans laquelle vous vous trouvez."
|
||||
info-regionHeaderRent: "[darkgreen]Informations à propos de %lang:region%:"
|
||||
info-regionHeaderBuy: "[darkgreen]Informations à propos de %lang:region%:"
|
||||
info-regionRented: "[darkgreen][bold]►[reset] Louée par %lang:player% jusqu'à: [gray]%until%."
|
||||
info-regionBought: "[darkgreen][bold]►[reset] Achetée par %lang:player%."
|
||||
info-regionReselling: "[darkgreen][bold]►[reset] Achetée par %lang:player%, actuellement en revente."
|
||||
info-regionExtending:
|
||||
- "[darkgreen][bold]►[reset] "
|
||||
- "[bold]Etendre pour[/bold]"
|
||||
- " hover: Etendre votre location de %region%"
|
||||
- " hover: pour %duration% coutant %price%"
|
||||
- " hover: %lang:action|Etendre votre location de %region%|%"
|
||||
- " command: /areashop rent %region%"
|
||||
- ": [gray]%price% pour %duration%."
|
||||
info-regionCanBeRented:
|
||||
- "[darkgreen][bold]►[reset] "
|
||||
- "[bold]Louer pour[/bold]"
|
||||
- " hover: Louer %region% pour %price% pour %duration%"
|
||||
- " hover: %lang:action|Rent %region%|%"
|
||||
- " command: /areashop rent %region%"
|
||||
- ": [gray]%price% pour %duration%."
|
||||
info-regionCanBeBought:
|
||||
- "[darkgreen][bold]►[reset] "
|
||||
- "[bold]Prix d'achat[/bold]"
|
||||
- " hover: Acheter%region% pour %price%"
|
||||
- " hover: %lang:action|Acheter %region%|%"
|
||||
- " command: /areashop buy %region%"
|
||||
- ": [gray]%price%."
|
||||
info-regionReselPrice: "[darkgreen][bold]►[reset] Prix de revente : [gray]%resellprice% (vous pouvez l'acheter à %player%)."
|
||||
info-regionFriends: "[darkgreen][bold]►[reset] Ami(s) ajouté(s) : [gray]%0%."
|
||||
info-friend: "%lang:tPlayer|%0%|%"
|
||||
info-friendRemove:
|
||||
- "%lang:info-friend|%0%|%"
|
||||
- "[red]✕[gray]"
|
||||
- " hover: Région %region%"
|
||||
- " hover: %lang:action|retirer %0% comme ami|%"
|
||||
- " command: /areashop delfriend %0% %region%"
|
||||
info-regionMoneyBackBuy: "[darkgreen][bold]►[reset] Prix de revente : [gray]%moneyback% (%moneybackpercent%% du prix)"
|
||||
info-regionMoneyBackBuyClick:
|
||||
- "[darkgreen][bold]►[reset] "
|
||||
- "[bold]Retour sur investissement de la vente[/bold]"
|
||||
- " hover: Vendez %region% et recupérer %moneyback% de retour sur investissement"
|
||||
- " hover: %lang:action|Vendre %region%|%"
|
||||
- " command: /areashop sell %region%"
|
||||
- ": [gray]%moneyback% (%moneybackpercent%% du prix)."
|
||||
info-regionMoneyBackRent: "[darkgreen][bold]►[reset] Remboursement de location : [gray]%moneyback% (%moneybackpercent%% du temps restant)"
|
||||
info-regionMoneyBackRentClick:
|
||||
- "[darkgreen][bold]►[reset] "
|
||||
- "[bold]Prorata du loyer remboursé[/bold]"
|
||||
- " hover: Cesser la location %region% et récupérer %moneyback%"
|
||||
- " hover: %lang:action|Cesser la location%region%|%"
|
||||
- " command: /areashop unrent %region%"
|
||||
- ": [gray]%moneyback% (%moneybackpercent%% du temps restant)."
|
||||
info-regionMaxExtends: "[darkgreen][bold]►[reset] Nombre maximum de région : [gray]%maxextends% fois."
|
||||
info-regionNoExtending: "[darkgreen][bold]►[reset] La location ne peut être allongée."
|
||||
info-regionExtendsLeft: "[darkgreen][bold]►[reset] Extensions restantes : [gray]%extendsleft% fois sur %maxextends%."
|
||||
info-regionMaxRentTime: "[darkgreen][bold]►[reset] Location à l'avance : [gray]%maxrenttime% au maximum"
|
||||
info-prefix: "[darkgreen][bold]►[reset] "
|
||||
info-regionTeleport:
|
||||
- "[bold]Aller à la région[/bold]"
|
||||
- " hover: %lang:action|Se téleporter à %region%|%"
|
||||
- " command: /areashop tp %region%"
|
||||
info-setRegionTeleport:
|
||||
- "[bold]Définir la position de téléportation[/bold]"
|
||||
- " hover: %region%"
|
||||
- " hover: %lang:action|Définir la position de téléportation|%"
|
||||
- " command: /areashop settp %region%"
|
||||
info-regionSigns: "[darkgreen][bold]►[reset] Pancartes connectées: [gray]%0%."
|
||||
info-regionSignLocation: "[gray](%0%, %1%, %2%, %3%)[reset]"
|
||||
info-regionGroups: "[darkgreen][bold]►[reset] Assigné aux groupes: [gray]%0%."
|
||||
info-regionInactiveUnrent: "[darkgreen][bold]►[reset] Fin de le location automatique après : [gray]%inactivetime% de temps d'inactivité du joueur"
|
||||
info-regionInactiveSell: "[darkgreen][bold]►[reset] Revente automatique après : [gray]%inactivetime% de temps d'inactivité du joueur"
|
||||
info-regionRestrictedRegionRent: "[darkgreen][bold]►[reset] Vous devez être à l'intérieur de %lang:region% pour la louer."
|
||||
info-regionRestrictedWorldRent: "[darkgreen][bold]►[reset] Vous devez à l'intérieur du monde '%world%' pour louer %lang:region%."
|
||||
info-regionRestrictedRegionBuy: "[darkgreen][bold]►[reset] Vous devez être à l'intérieur de %lang:region% pour l'acheter."
|
||||
info-regionRestrictedWorldBuy: "[darkgreen][bold]►[reset] Vous devez à l'intérieur du monde '%world%' pour acheter %lang:region%."
|
||||
info-regionRestoringRent: "[darkgreen][bold]►[reset] La restauration est activée [gray](la région sera remise à zéro a la fin de la location)%0%"
|
||||
info-regionRestoringBuy: "[darkgreen][bold]►[reset] La restauration est activée [gray](la région sera remise à zéro a la fin de la location)%0%"
|
||||
info-regionRestoringProfile: "(Profil : %0%)"
|
||||
info-regionLandlord: "[darkgreen][bold]►[reset] Bailleur : [gray]%lang:landlord% (reçoit l'argent)."
|
||||
info-regionNotExisting: "La région spécifiée n'est pas enregistrée : %0%."
|
||||
|
||||
setrestore-help: "/as setrestore <region> <true|false|general> [profile]"
|
||||
setrestore-noPermission: "Vous n'avez pas la permission de restaurer les paramètres."
|
||||
setrestore-notRegistered: "La région spécifiée n'est pas enregistrée : %0%."
|
||||
setrestore-invalidSetting: "'%0%' est invalide. Doit être true, false ou general."
|
||||
setrestore-success: "Paramètre de restauration défini de %lang:region% à '%0%' avec succès."
|
||||
setrestore-successProfile: "Paramètre de restauration défini de %lang:region% à %0% et le profil à '%1%' avec succès."
|
||||
|
||||
setprice-noPermission: "Vous n'avez pas la permission de changer le prix d'une région."
|
||||
setprice-help: "/as setprice <price> [region], Si non spécifiée, cible la région dans laquelle vous vous trouvez."
|
||||
setprice-notRegistered: "La région spécifiée n'est pas enregistrée : %0%."
|
||||
setprice-wrongPrice: "'%0%' n'est pas un prix valide."
|
||||
setprice-successRent: "Le prix de la région %lang:region% à changé pour %price% par %duration%."
|
||||
setprice-successBuy: "Le prix de la région %lang:region% a changé pour %price%"
|
||||
setprice-successRemoved: "Le prix de la %lang:region% a été supprimé, maintenant celle-ci utilisera le prix du group ou du fichier default.yml, nouveau prix: %price%."
|
||||
setprice-noLandlord: "Vous n'avez pas la permission de changer le prix car vous n'êtes pas le bailleur de la région %lang:region%."
|
||||
|
||||
setduration-noPermission: "Vous n'avez pas la permission de changer le temps d'une location."
|
||||
setduration-help: "/as setduration <amount> <identifier> [region], la région dans laquelle vous vous trouvez sera utilisée si vous ne précisez pas quelle région doit être utilisée."
|
||||
setduration-notRegistered: "%0% n'est pas enregistrée dans les régions à louer."
|
||||
setduration-wrongAmount: "'%0%' n'est pas un montant valide, utilisez un nombre entier."
|
||||
setduration-wrongFormat: "'%0%' n'est pas un format de temps valide, regardez la documentation de Bukkit."
|
||||
setduration-success: "Durée de location de la région %lang:region% changé à %duration%."
|
||||
setduration-noLandlord: "Vous n'avez pas la permission de changer la durée car vous n'êtes pas le bailleur de la région %lang:region%."
|
||||
setduration-successRemoved: "La durée de location de %lang:region% a été supprimé, maintenant celle-ci utilisera le durée de location du group ou du fichier default.yml, nouvelle durée de location : %duration%."
|
||||
|
||||
setup-noRegion: "Vous n'avez pas spécifié de région à la seconde ligne."
|
||||
setup-alreadyRentSign: "La région que vous avez spécifiée a déjà été ajoutée à AreaShop en tant qu'une région louable, ajoutez un panneau avec [as] sur le première ligne ou tapez '/as addsign'."
|
||||
setup-alreadyBuySign: "La région que vous avez spécifiée a déjà été ajoutée à AreaShop en tant qu'une région achetable, ajoutez un panneau avec [as] sur le première ligne ou tapez '/as addsign'."
|
||||
setup-noDuration: "A la troisième ligne, vous n'avez pas spécifié la durée de location de la région."
|
||||
setup-wrongDuration: "Le temps spécifié n'est pas au bon format. Exemple : 1 day."
|
||||
setup-noPrice: "A la quatrième ligne, vous n'avez pas spécifié le prix."
|
||||
setup-wrongPrice: "Le prix spécifié n'est pas correct, n'utilisez que des chiffres s'il vous plaît."
|
||||
setup-rentSuccess: "La location de la région %lang:region% est correctement configurée."
|
||||
setup-buySuccess: "La vente de la région %lang:region% est correctement configurée."
|
||||
setup-noPermissionRent: "Vous n'avez pas la permission de définir des région louables."
|
||||
setup-noPermissionBuy: "Vous n'avez pas la permission de définir des régions achetables."
|
||||
setup-couldNotDetect: "Multiples régions trouvées avec la même priorité et/ou étant de même nature : parent ou enfant. Spécifiez-en une sur la deuxième ligne. (2 des régions trouvées: %lang:tRegion|%0%|% et %lang:tRegion|%1%|%)."
|
||||
setup-blacklisted: "%0% est sur la blacklist et ne peut pas être ajouté à AreaShop."
|
||||
setup-noPermission: "Vous ne pouvez pas ajouter la région '%0%', vous n'êtes pas un propriétaire / membre ou n'avez pas permission pour celle-ci."
|
||||
|
||||
destroy-noPermissionRent: "Vous n'avez pas la permission de dés-enregistrer des régions louables. "
|
||||
destroy-noPermissionBuy: "Vous n'avez pas la permission de dés-enregistrer des régions achetables."
|
||||
destroy-successRent: "%lang:region% a bien été dés-enregistrée des régions louables."
|
||||
destroy-successBuy: "%lang:region% a bien été dés-enregistrée des régions achetables."
|
||||
|
||||
teleport-help: "/as tp <region> [sign]"
|
||||
teleport-noRentOrBuy: "La région spécifiée n'est pas enregistrée : %0%."
|
||||
teleport-noPermission: "Vous n'avez pas la permission de vous téléporter à votre région."
|
||||
teleport-noPermissionOther: "Vous n'avez pas la permission de vous téléporter à une région qui ne vous appartient pas."
|
||||
teleport-noPermissionSign: "Vous n'avez pas la permission de vous téléporter à la pancarte de votre région."
|
||||
teleport-noPermissionOtherSign: "Vous n'avez pas la permission de vous téléporter aux pancartes des régions que vous ne possédez pas."
|
||||
teleport-noPermissionFriend: "Vous n'avez pas la permission de vous téléporter vers les régions sur lesquelles vous êtes ajoutés en tant qu'ami."
|
||||
teleport-noPermissionFriendSign: "Vous n'avez pas la permission de vous téléporter vers le panneau des régions sur lesquelles vous êtes ajoutés en tant qu'ami."
|
||||
teleport-success: "Vous avez été téléporté vers %lang:region%"
|
||||
teleport-successSign: "Vous avez été téléporté vers le panneau de %lang:region%"
|
||||
teleport-noSafe: "Aucune position sécurisée trouvée dans la région '%lang:region%'. Pas de point restant, ou tentatives maximales dépassées (%0%/%1%)."
|
||||
teleport-blocked: "Vous ne pouvez pas vous téléporter car la position est en dehors de la région, et vous êtes obligés de vous téléporter à l'intérieur."
|
||||
teleport-changedToSign: "Vous n'avez seulement la permission de vous téléporter à la pancarte et non dans la région, téléportation vers la pancarte."
|
||||
teleport-changedToNoSign: "Aucune pancarte disponible pour être téléporter. Essayer de vous téléporter dans la région."
|
||||
|
||||
setteleport-help: "/as settp [region] [reset], Si non spécifiée, cible la région dans laquelle vous vous trouvez."
|
||||
setteleport-noPermission: "Vous n'avez pas la permission de définir un point de téléportation."
|
||||
setteleport-noPermissionOther: "Vous n'avez pas la permission de définir l'emplacement de téléportation d'une région que vous ne possédez pas."
|
||||
setteleport-noRentOrBuy: "La région spécifiée n'est pas enregistrée : %0%."
|
||||
setteleport-success: "Le point de téléportation de %lang:region% a été défini."
|
||||
setteleport-notInside: "Le lieu doit se trouver dans votre région."
|
||||
setteleport-reset: "Le point de téléportation de %lang:region% a été réinitialisé."
|
||||
|
||||
find-help: "/as find <buy|rent> [prix maximum] [group]"
|
||||
find-noPermission: "Vous n'avez pas la permission de rechercher des régions et de vous y téléporter."
|
||||
find-success: "Une région %0% trouvée : %lang:region%, en recherchant avec un prix maximum de: %1%%2%."
|
||||
find-successMax: "%0% region trouvé : %lang:region%, tout en recherchant avec un prix maximum de %1%%2%."
|
||||
find-wrongMaxPrice: "Le prix maximum n'est pas un nombre valide : %0%."
|
||||
find-wrongGroup: "Le groupe spécifié n'existe pas : %0%."
|
||||
find-noneFound: "Aucune région %0% trouvée ayant pour un prix maximum : %1%%2%."
|
||||
find-noneFoundMax: "Aucune région %0% trouvée en cherchant à un prix maximum de %1%%2%."
|
||||
find-onlyInGroup: ", recherche de régions uniquement dans le groupe: %0%."
|
||||
|
||||
groupadd-help: "/as groupadd <group> [region], Si non spécifiée, cible la région dans laquelle vous vous trouvez."
|
||||
groupadd-noPermission: "Vous n'avez pas la permission d'ajouter des régions aux groupes."
|
||||
groupadd-success: "La région %lang:region% a été ajoutée au groupe '%0%'. Ce groupe a maintenant %1% membre(s)."
|
||||
groupadd-failed: "La région %lang:region% est déjà membre du groupe '%0%'."
|
||||
groupadd-weSuccess: "Ajouté au groupe %0% : [gray]%1%."
|
||||
groupadd-weFailed: "Nous étions déjà dans le groupe %0% : [gray]%1%."
|
||||
|
||||
groupdel-help: "/as groupdel <group> [region], Si non spécifiée, cible la région dans laquelle vous vous trouvez."
|
||||
groupdel-noPermission: "Vous n'avez pas la permission de supprimer des régions depuis les groupes."
|
||||
groupdel-success: "La région %lang:region% a été supprimée du groupe '%0%', ce groupe a maintenant %1% membre(s)."
|
||||
groupdel-failed: "La région %lang:region% n'est pas membre du groupe '%0%'."
|
||||
groupdel-weSuccess: "Supprimée du groupe %0% : [gray]%1%."
|
||||
groupdel-weFailed: "Nous ne sommes de toute façon pas dans le groupe %0% : [gray]%1%."
|
||||
|
||||
grouplist-noPermission: "Vous n'avez pas l'autorisation d'afficher les groupes enregistrés."
|
||||
grouplist-noGroups: "Il n'y a actuellement aucun groupe enregistré."
|
||||
grouplist-success: "Les groupes suivants sont enregistrés: [gray]%0%."
|
||||
|
||||
groupinfo-help: "/as groupinfo <group>"
|
||||
groupinfo-noPermission: "Vous n'avez pas la permission d'afficher des informations sur un groupe."
|
||||
groupinfo-noGroup: "Il n'y a pas de groupe enregistré sous le nom '%0%', utilisez /as grouplist pour vérifier les groupes."
|
||||
groupinfo-members: "Les régions suivantes sont membres du groupe %0% : [gray]%1%."
|
||||
groupinfo-noMembers: "Le groupe %0% ne possède aucun membre."
|
||||
|
||||
schemevent-help: "/as schemevent <region> <created|deleted|rented|unrented|bought|sold>"
|
||||
schemevent-wrongEvent: "L'évent spécifié '%0%' n'existe pas, utilisez un des suivants: [gray]%1%."
|
||||
schemevent-success: "L’événement '%0%' a été activé dans la région %lang:region%."
|
||||
schemevent-noPermission: "Vous n'avez pas la permission de déclencher des événements schématiques."
|
||||
|
||||
add-help: "/as add <rent|buy> [region] [world]"
|
||||
add-noPermission: "Vous n'avez pas la permission d'ajouter une région à AreaShop."
|
||||
add-success: "Ajoutée comme %0% : [gray]%1%."
|
||||
add-failed: "Déjà enregistré: [gray]%0%."
|
||||
add-blacklisted: "Dans la liste noir: [gray]%0%."
|
||||
add-specifyWorld: "Spécifiez le monde de la région lors de l'utilisation de la console."
|
||||
add-incorrectWorld: "Le monde '%0%' est introuvable, essayez de nouveau (attention à la casse)."
|
||||
add-noRegion: "La région WorldGuard '%0%' n'existe pas dans ce monde."
|
||||
add-noPermissionRegions: "Pas de permission à ajouter: [gray]%0%."
|
||||
add-noPermissionOwnerMember: "[gray]Soit vous n'êtes pas membre / propriétaire de cette région ou n'avez pas la permission d'ajouter vos régions."
|
||||
|
||||
del-noPermission: "Vous n'avez pas la permission de supprimer des régions."
|
||||
del-success: "Régions supprimées: [gray]%0%."
|
||||
del-failed: "Vous n'avez pas la permission, ou vous n’être pas enregistré: [gray]%0%."
|
||||
|
||||
addsign-help: "/as addsign [region] [profile]"
|
||||
addsign-noSign: "Vous ne regardez pas de panneau."
|
||||
addsign-noRegions: "Aucune région trouvée autour du panneau."
|
||||
addsign-couldNotDetect: "Plusieurs régions ont été trouvées à proximité du panneau. Spécifiez la région en argument supplémentaire (2 des régions trouvées: %lang:tRegion|%0%|% et %lang:tRegion|%1%|%)."
|
||||
addsign-couldNotDetectSign: "Plusieurs régions ont été trouvées à proximité du panneau. Spécifiez la région à la deuxième ligne (2 des régions trouvées: %lang:tRegion|%0%|% et %lang:tRegion|%1%|%)."
|
||||
addsign-wrongProfile: "Le profil spécifié n'existe pas, utilisez l'un de la liste suivante (Vérifiez la config): [gray]%0%."
|
||||
addsign-profile:
|
||||
- "[bold]%0%[/bold]"
|
||||
- " hover: Connexion profil %0%"
|
||||
- " hover: %lang:action|Utiliser ce profil|%"
|
||||
- " command: /areashop linksigns %0%"
|
||||
addsign-success: "Le panneau a été ajouté à %lang:region%."
|
||||
addsign-successProfile: "Le panneau a été ajouté à %lang:region%. avec le profile %0%."
|
||||
addsign-alreadyRegistered: "Ce panneau est déjà enregistré pour la région %lang:region%."
|
||||
addsign-noPermission: "Vous n'avez pas la permission d'ajouter un panneau."
|
||||
|
||||
delsign-noSign: "Vous ne regardez pas un panneau."
|
||||
delsign-noPermission: "Vous n'avez pas la permission de supprimer un panneau."
|
||||
delsign-noRegion: "Ce signe n'appartient pas à une région AreaShop."
|
||||
delsign-success: "Le panneau à été retiré de la région %lang:region%."
|
||||
|
||||
me-noPermission: "Vous n'avez pas la permission de voir quelle(s) région(s) vous possédez."
|
||||
me-header: "Régions de %lang:tPlayer|%0%|%:"
|
||||
me-notAPlayer: "Vous n'êtes pas un joueur. Vous ne pouvez donc pas avoir de régions."
|
||||
me-buyLine: "[darkgreen][bold]►[reset] %lang:region%."
|
||||
me-nothing: "%lang:tPlayer|%0%|% n'a pas loué ou acheté de régions et n'a pas été ajouté comme ami dans l'un entre eux."
|
||||
me-noPlayer: "%0% n'a pas été trouvé, il ne s'est peut être jamais connecté sur le serveur."
|
||||
|
||||
setowner-help: "/as setowner <joueur> [region], la région dans laquelle vous vous trouvez sera utilisée si vous ne spécifiez pas de région."
|
||||
setowner-noPermission: "Vous n'avez pas la permission de définir le propriétaire d'une région."
|
||||
setowner-noPermissionRent: "Vous n'avez pas la permission de définir le propriétaire de régions à louer."
|
||||
setowner-noPermissionBuy: "Vous n'avez pas la permission de définir le propriétaire de régions à acheter."
|
||||
setowner-notRegistered: "La région n'est pas enregistrée, le propriétaire ne peut être défini."
|
||||
setowner-noPlayer: "UUID du joueur introuvable : %0%."
|
||||
setowner-succesRent: "Propriétaire de la région %lang:region% modifié avec succès. Elle appartient maintenant à %lang:player% et est louée jusqu'au %until% (%timeleft% restant)."
|
||||
setowner-succesRentExtend: "Le propriétaire était déjà %lang:player%, location prolongée de '%duration%', maintenant louée jusqu'au %until% (%timeleft% restant%)."
|
||||
setowner-succesBuy: "Propriétaire de la région %lang:region% changé avec succès. Elle appartient maintenant à %lang:player%."
|
||||
|
||||
resell-help: "/as resell <prix> <région>, la région dans laquelle vous vous trouvez sera utilisée si vous ne spécifiez pas de région."
|
||||
resell-wrongPrice: "'%0%' n'est pas un prix valide."
|
||||
resell-notRegistered: "La région spécifiée n'est pas enregistrée : %0%."
|
||||
resell-notBought: "Vous ne pouvez pas revendre %lang:region% car elle n'est pas achetée pour le moment."
|
||||
resell-success: "%lang:region% a été mise en revente avec succès pour un prix de %resellprice%."
|
||||
resell-noPermission: "Vous n'avez pas la permission de mettre votre région en revente."
|
||||
resell-noPermissionOther: "Vous n'avez pas la permission de mettre des régions en revente."
|
||||
|
||||
stopresell-help: "/as stropresell [région], la région où vous vous trouvez sera utilisée si vous ne spécifiez pas de région."
|
||||
stopresell-notRegistered: "La région spécifiée n'est pas enregistrée : %0%."
|
||||
stopresell-notResell: "Vous ne pouvez pas stopper la revente %lang:region% car elle n'est pas en mode revente."
|
||||
stopresell-success: "%lang:region% n'est plus en revente."
|
||||
stopresell-noPermission: "Vous n'avez pas la permission de retirer votre région de la vente."
|
||||
stopresell-noPermissionOther: "Vous n'avez pas la permission de retirer les régions de la vente."
|
||||
|
||||
addfriend-help: "/as addfriend <joueur> [region], la région dans laquelle vous vous trouvez sera utilisée si vous ne spécifiez pas de région."
|
||||
addfriend-noPermissionOther: "Vous n'avez pas la permission d'ajouter des gens en amis dans une région qui n'est pas la vôtre."
|
||||
addfriend-noPermission: "Vous n'avez pas la permission d'ajouter en amis des gens à votre région."
|
||||
addfriend-successOther: "%lang:tPlayer|%0%|% a été ajouté comme ami sur la région %lang:region%."
|
||||
addfriend-success: "%lang:tPlayer|%0%|% a été ajouté comme ami sur votre région %lang:region%."
|
||||
addfriend-alreadyAdded: "%lang:tPlayer|%0%|% est déjà ajouté comme ami avec %lang:region%."
|
||||
addfriend-self: "Ajouter le propriétaire de la région en ami n'aurait aucune utilité."
|
||||
addfriend-noOwner: "Vous ne pouvez pas ajouter d'amis à une région sans propriétaire."
|
||||
addfriend-notVisited: "Vous ne pouvez pas ajouter %0% car il n'est jamais venu sur le serveur."
|
||||
|
||||
delfriend-help: "/as delfriend <joueur> [région], la région dans laquelle vous vous trouvez sera utilisée si vous ne spécifiez pas de région."
|
||||
delfriend-noPermissionOther: "Vous n'avez pas la permission de supprimer des amis à une région n'étant pas la vôtre."
|
||||
delfriend-noPermission: "Vous n'avez pas la permission de supprimer des amis de votre région."
|
||||
delfriend-successOther: "%lang:tPlayer|%0%|% a été supprimé comme ami de la région %lang:region%."
|
||||
delfriend-success: "%lang:tPlayer|%0%|% a été supprimé comme ami de votre région %lang:region%."
|
||||
delfriend-noOwner: "Vous ne pouvez pas supprimer les amis d'une région sans propriétaire."
|
||||
|
||||
linksigns-multipleRegions: "Plusieurs régions trouvées : [gray]%0%."
|
||||
linksigns-multipleRegionsAdvice: "Cliquez plus tard pour réessayer ou utilisez '/as linksigns' pour arrêter."
|
||||
linksigns-noRegions: "Aucune région AreaShop trouvée dans la direction de votre curseur, soyez sûr que la région est bien ajoutée à AreaShop [gray](portée maximale de 100 blocs)."
|
||||
linksigns-regionFound: "La région %lang:region% a été trouvée, maintenant montrer un panneau et faites un clic gauche sur celui-ci."
|
||||
linksigns-signFound: "Un panneau a été trouvé à (%0%, %1%, %2%), maintenant montrez une région et faites un clic droit pour la lier."
|
||||
linksigns-noSign: "Aucune panneau trouvé dans la direction de votre curseur, soyez sûr que vous regardez directement la panneau et re-cliquez[gray](portée maximale de 100 blocs)."
|
||||
linksigns-alreadyRegistered: "Ce panneau est déjà enregistré avec la région %lang:region%, cliquez encore pour sélectionner un autre panneau."
|
||||
linksigns-first: "Vous êtes entré dans le mode de liaison d'un panneau."
|
||||
linksigns-next: "[gray]Faites un clic gauche pour sélectionner un panneau, un clic droit pour sélectionner une région et utilisez /as linksigns pour arrêter le mode."
|
||||
linksigns-noPermission: "Vous n'avez pas la permission de rentrer dans le mode de liaison d'un panneau."
|
||||
linksigns-stopped: "Vous êtes sorti du mode de liaison d'un panneau."
|
||||
|
||||
stack-help:
|
||||
- "/as stack <montant> <écart> <nom> <rent|buy> [groupe].[break]"
|
||||
- "⇥[gray<montant> Nombre de régions qui sera créé.[break]"
|
||||
- "⇥[gray]<écart> Distance en blocs entre les régions.[break]"
|
||||
- "⇥[gray]<nom> Nom des régions (un nombre sera ajouté à la fin[break]"
|
||||
- "⇥[gray]<rent|buy> Définir comme location (rent) ou achat (but).[break]"
|
||||
- "⇥[gray][groupe] Un groupe pour ajouter les régions créées..[break]"
|
||||
- "⇥[gray]Les régions seront créés dans la direction que vous faites face."
|
||||
stack-accepted: "Commence à créer %0% %1% régions avec %2% blocs entre chacune, dont les noms commencent avec %3% et ont un chiffre derrière. %4%"
|
||||
stack-addToGroup: "Les régions créées ont été ajoutées au groupe '%0%'."
|
||||
stack-noPermission: "Vous n'avez pas la permission de créer et d'ajouter des régions à AreaShop en vrac."
|
||||
stack-wrongAmount: "'%0%' n'est pas une quantité correcte de régions."
|
||||
stack-wrongGap: "'%0%' n'est pas un nombre correct pour le nombre de blocs séparant deux régions."
|
||||
stack-noSelection: "Vous n'avez pas de sélection qui indique où doit se trouver la première région créée."
|
||||
stack-addStart: "[gray]Ajout de %0% régions, %1% par seconde."
|
||||
stack-addComplete: "[gray]Ajout de régions terminé."
|
||||
stack-unclearDirection: "Merci de regarder clairement le Nord, l'Est, le Sud ou l'Ouest, actuellement détectée %0%."
|
||||
|
||||
setlandlord-help: "/as setlandlord <joueur> [région], la région où vous êtes sera utilisé si non spécifié."
|
||||
setlandlord-noPermission: "Vous n'avez pas la permission de définir le bailleur d'une région."
|
||||
setlandlord-success: "%lang:landlord% a bien été défini comme bailleur de %lang:region%.."
|
||||
|
||||
message-help: "/as message <joueur> <message...>"
|
||||
message-noPermission: "Vous n'avez pas la permission d'envoyer des messages AreaShop."
|
||||
message-notOnline: "%0% n'est pas connecté."
|
||||
|
||||
confirm-rent:
|
||||
- "%lang:prefix%Êtes-vous sur de vouloir louer %lang:tRegion|%0%|%?[break]"
|
||||
- "[darkgreen][bold]►[reset] %lang:button|Cliquez ici pour louer %0%|%"
|
||||
- " hover: %lang:action|Louer%0%|%"
|
||||
- " command: /areashop rent %0%"
|
||||
confirm-extend:
|
||||
- "%lang:prefix%Êtes-vous sur de vouloir prolonger la location %lang:tRegion|%0%|%?[break]"
|
||||
- "[darkgreen][bold]►[reset] %lang:button|Cliquez ici pour prolonger la location%0%|%"
|
||||
- " hover: %lang:action|Prolonger la location%0%|%"
|
||||
- " command: /areashop rent %0%"
|
||||
confirm-unrent:
|
||||
- "%lang:prefix%Êtes-vous sur de vouloir arrêter la location %lang:tRegion|%0%|%?[break]"
|
||||
- "[darkgreen][bold]►[reset] %lang:button|Cliquez ici pour arrêter la location%0%|%"
|
||||
- " hover: %lang:action|Arrêter la location%0%|%"
|
||||
- " command: /areashop unrent %0%"
|
||||
confirm-buy:
|
||||
- "%lang:prefix%Êtes-vous sur de vouloir acheter %lang:tRegion|%0%|%?[break]"
|
||||
- "[darkgreen][bold]►[reset] %lang:button|Cliquez ici pour acheter %0%|%"
|
||||
- " hover: %lang:action|Acheter%0%|%"
|
||||
- " command: /areashop buy%0%"
|
||||
confirm-sell:
|
||||
- "%lang:prefix%Êtes-vous sur de vouloir vendre %lang:tRegion|%0%|%?[break]"
|
||||
- "[darkgreen][bold]►[reset] %lang:button|Cliquez ici pour vendre %0%|%"
|
||||
- " hover: %lang:action|Vendre%0%|%"
|
||||
- " command: /areashop sell %0%"
|
||||
|
||||
timeleft-years: "%0% années"
|
||||
timeleft-months: "%0% mois"
|
||||
timeleft-days: "%0% jours"
|
||||
timeleft-hours: "%0% heures"
|
||||
timeleft-minutes: "%0% minutes"
|
||||
timeleft-second: "%0% seconde"
|
||||
timeleft-seconds: "%0% secondes"
|
||||
timeleft-ended: "Expiré"
|
||||
|
||||
greeting-forrent: "La région '%region%' peut être louée pour %price% pour une durée de %duration%."
|
||||
greeting-rented: "La région '%region%' est louée par %player% jusqu'au %until%."
|
||||
greeting-forsale: "La région '%region%' peut être achetée pour %price%."
|
||||
greeting-bought: "La région '%region%' est la propriété de %player%."
|
||||
greeting-resale: "La région '%region%' peut être achetée pour %resaleprice% à %player%."
|
||||
@@ -0,0 +1,569 @@
|
||||
# ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
|
||||
# ║ Language file of the AreaShop plugin created by NLThijs48, Github can be found at https://github.com/NLthijs48/AreaShop ║
|
||||
# ║ Language: Dutch, Version: V2.3.2, Percentage translated: 100% ║
|
||||
# ║ This file will be overwritten at each startup/reload of the plugin, if you want to change anything then do the following: ║
|
||||
# ║ 1: Make a copy of this file ║
|
||||
# ║ 2: Rename it to <servername>.yml (don't use a language code as filename, could otherwise be overwritten in future updates) ║
|
||||
# ║ 3: Change the 'language' setting in config.yml to '<servername>', do not include '.yml' ║
|
||||
# ║ 4: Change the strings in the new file to your liking and save the file ║
|
||||
# ║ 5: Use '/as reload' or reload/restart your server to see the changes ║
|
||||
# ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
|
||||
action: "[gold][bold]<%0%>[/bold]"
|
||||
|
||||
button: "[bold]<%0%>[/bold]"
|
||||
|
||||
command:
|
||||
- "[bold]%0%[/bold]"
|
||||
- " hover: %lang:action|Gebruik %1%|%"
|
||||
- " command: %1%"
|
||||
|
||||
helpCommand:
|
||||
- "[gold]%0% [gray]-[reset]"
|
||||
- " hover: %lang:action|Gebruik %0%|%"
|
||||
- " command: %0%"
|
||||
|
||||
region: "%lang:tRegion|%region%|%"
|
||||
|
||||
tRegion:
|
||||
- "[bold]%0%[/bold]"
|
||||
- " hover: Gebied %0%"
|
||||
- " hover: %lang:action|Gebied informatie|%"
|
||||
- " command: /areashop info region %0%"
|
||||
|
||||
player: "%lang:tPlayer|%player%|%"
|
||||
|
||||
tPlayer:
|
||||
- "[bold]%0%[/bold]"
|
||||
- " hover: Speler %0%"
|
||||
- " hover: %lang:action|Gebieden van %0%|%"
|
||||
- " command: /areashop info player %0%"
|
||||
|
||||
landlord:
|
||||
- "[bold]%landlord%[/bold]"
|
||||
- " hover: Landeigenaar %landlord%"
|
||||
- " hover: %lang:action|Gebieden van %landlord%|%"
|
||||
- " command: /areashop info player %landlord%"
|
||||
|
||||
total-maximum: "Je kunt niet meer dan %0% gebied(en) kopen en huren in totaal (je hebt er al %1% in groep '%2%')."
|
||||
|
||||
general-notReady: "AreaShop is not niet volledig geladen, even geduld."
|
||||
general-noWorld: "Je kunt deze actie niet uitvoeren, de wereld van %lang:region% is niet beschikbaar (wereld '%0%')."
|
||||
general-noRegion: "Je kunt deze actie niet uitvoeren, het WorldGuard gebied is niet beschikbaar (gebied %lang:region%)."
|
||||
general-noEconomy: "Er is geen Economy plugin geïnstalleerd of deze is incorrect opgezet, stel de server eigenaar hiervan op de hoogte."
|
||||
general-cancelled: "%0%"
|
||||
|
||||
cmd-notValid: "Dat commando is niet geldig , gebruik '/as help' voor informatie."
|
||||
cmd-onlyByPlayer: "Dit commando kan alleen door een speler uitgevoert worden."
|
||||
cmd-weOnlyByPlayer: "Gebruikmaken van een WorldEdit selectie is alleen mogelijk als speler, geef de naam van het gebied mee als extra argument."
|
||||
cmd-noSelection: "Je hebt geen WorldEdit selectie."
|
||||
cmd-noRegionsFound: "Er zijn geen gebieden in je selectie gevonden die geregistreerd staan in AreaShop."
|
||||
cmd-noWERegionsFound: "Er zijn geen WorldEdit gebieden gevonden die zich in je selectie bevinden."
|
||||
cmd-notRegistered: "Het aangegeven gebied is niet geregistreerd in AreaShop: %0%."
|
||||
cmd-noRegionsAtLocation: "Geen gebieden gevonden op je lokatie, geef het gebied mee als argument."
|
||||
cmd-moreRegionsAtLocation: "Meerdere gebieden gevonden op je lokatie, geef het gebied mee als argument."
|
||||
cmd-automaticRegionOnlyByPlayer: "Automatisch bepalen van het gebied is alleen mogelijk voor spelers, geef het gebied mee als argument."
|
||||
|
||||
help-header: "Help pagina, commando's die jij kunt uitvoeren."
|
||||
help-noPermission: "Je hebt geen toestemming om de help pagina te bekijken."
|
||||
help-alias: "Commando aliassen: /areashop, /as."
|
||||
help-help: "%lang:helpCommand|/as help|% Laat deze help pagina zien."
|
||||
help-info: "%lang:helpCommand|/as info|% Vraag informatie over gebieden op."
|
||||
help-rent: "%lang:helpCommand|/as rent|% Huur een gebied of verleng de huur."
|
||||
help-buy: "%lang:helpCommand|/as buy|% Koop een gebied."
|
||||
help-unrent: "%lang:helpCommand|/as unrent|% Stop de huur van een gebied."
|
||||
help-sell: "%lang:helpCommand|/as sell|% Verkoop een gebied."
|
||||
help-reload: "%lang:helpCommand|/as reload|% Herlaad bestanden en update gebieden."
|
||||
help-setrestore: "%lang:helpCommand|/as setrestore|% Schakel herstellen in/uit en kies het profiel."
|
||||
help-setprice: "%lang:helpCommand|/as setprice|% Verander de prijs van een gebied."
|
||||
help-setduration: "%lang:helpCommand|/as setduration|% Verander de huurtijd van een region."
|
||||
help-teleport: "%lang:helpCommand|/as tp|% Teleporteer naar koop/huur gebieden."
|
||||
help-setteleport: "%lang:helpCommand|/as settp|% Stel een teleporteer plek in."
|
||||
help-find: "%lang:helpCommand|/as find|% Zoek een leeg huur of koop gebied."
|
||||
help-groupadd: "%lang:helpCommand|/as groupadd|% Voeg een gebied toe aan een groep."
|
||||
help-groupdel: "%lang:helpCommand|/as groupdel|% Verwijder een gebied uit een groep."
|
||||
help-grouplist: "%lang:helpCommand|/as grouplist|% Laat een lijst met groepen zien."
|
||||
help-groupinfo: "%lang:helpCommand|/as groupinfo|% Laat informatie over een groep zien."
|
||||
help-schemevent: "%lang:helpCommand|/as schemevent|% Voer een schematic gebeurtenis uit."
|
||||
help-add: "%lang:helpCommand|/as add|% Registreer een huur of koop gebied."
|
||||
help-del: "%lang:helpCommand|/as del|% Verwijder een geregistreerd gebied."
|
||||
help-addsign: "%lang:helpCommand|/as addsign|% Voeg een bordje toe aan een bestaand gebied."
|
||||
help-delsign: "%lang:helpCommand|/as delsign|% Verwijder het bord waar je naar kijkt."
|
||||
help-me: "%lang:helpCommand|/as me|% Bekijk welke gebieden je hebt (+aflooptijd)."
|
||||
help-setowner: "%lang:helpCommand|/as setowner|% Stel gebied eigenaar in of verleng de huur."
|
||||
help-resell: "%lang:helpCommand|/as resell|% Zet een gebied in doorverkoop modus."
|
||||
help-stopResell: "%lang:helpCommand|/as stopresell|% Stop het herverkopen van een gebied."
|
||||
help-addFriend: "%lang:helpCommand|/as addfriend|% Voeg een vriend toe aan een gebied."
|
||||
help-delFriend: "%lang:helpCommand|/as delfriend|% Verwijder een vriend van een gebied."
|
||||
help-linksigns: "%lang:helpCommand|/as linksigns|% Gebruik massa bord koppelen mode."
|
||||
help-stack: "%lang:helpCommand|/as stack|% Creer meerdere gebieden en voeg ze toe."
|
||||
help-setlandlord: "%lang:helpCommand|/as setlandlord|% Creer meerdere gebieden en voeg ze toe."
|
||||
|
||||
rent-help: "/as rent [region], het gebied waarin je staat zal worden gebruikt als je het niet aangeeft."
|
||||
rent-noPermission: "Je hebt geen toestemming om een gebied te huren."
|
||||
rent-maximum: "Je kunt niet meer dan %0% gebied(en) huren (je hebt er al %1% in groep '%2%')."
|
||||
rent-maximumExtend: "Je kunt dit gebied niet meer verlengen omdat je meer dan %0% gebied(en) bezit (je hebt er al %1% in groep '%2%')."
|
||||
rent-payError: "Er is iets mis gegaan met betalen, probeer het later opnieuw."
|
||||
rent-rented: "Je hebt je huur van %lang:region% verlengt tot %until%, je kunt je huur verlengen door het rechtsklikken van het bord of /as rent."
|
||||
rent-extended: "Je hebt je huur van %lang:region% verlengt tot %until%."
|
||||
rent-extendedToMax: "Je hebt je huur van %lang:region% verlengt tot %until% (dit is de maximale huurtijd van %maxrenttime%)."
|
||||
rent-lowMoneyExtend: "Je hebt niet genoeg geld om het gebied te huren (je hebt %0% van de %price%)."
|
||||
rent-lowMoneyRent: "Je hebt niet genoeg geld om %lang:region% te kopen (je hebt %0% van de %price%)."
|
||||
rent-someoneElse: "Iemand anders heeft %lang:region% al gehuurd."
|
||||
rent-notRentable: "Dat gebied is niet beschikbaar om te huren."
|
||||
rent-maxExtends: "Je kunt de huur niet meer verlengen (het maximum is %maxextends% keer), je kunt echter wel %lang:region% opnieuw huren als het afgelopen is."
|
||||
rent-maxRentTime: "Je kunt %lang:region% niet meer tijd van tevoren huren, de maximum tijd is %maxrenttime% en je hebt het al voor %timeleft% gehuurt."
|
||||
rent-restrictedToWorld: "Je moet in de wereld '%world%' zijn om %lang:region% te kopen (je ben in '%0%')."
|
||||
rent-restrictedToRegion: "Je moet in %lang:region% staan om hem te huren."
|
||||
rent-expireWarning: "Je gebied %lang:region% heeft nog %timeleft% over, verleng het als je het wilt houden.."
|
||||
rent-alreadyAtFull: "%lang:region% is al verhuurd voor de maximale tijd, je kunt hem niet verlengen."
|
||||
|
||||
buy-help: "/as buy [region], het gebied waarin je staat word gebruikt als je het niet aangeeft."
|
||||
buy-noPermission: "Je hebt geen toestemming om een gebied te kopen."
|
||||
buy-noPermissionResell: "Je hebt geen toestemming om een koop gebied in doorverkoop mode te kopen."
|
||||
buy-noPermissionNoResell: "Je hebt geen toestemming om een koop gebied die niet in doorverkoop mode staat te kopen."
|
||||
buy-notBuyable: "Gebied %lang:region% is niet beschikbaar om te kopen."
|
||||
buy-maximum: "Je kunt niet meer dan %0% gebied(en) kopen (je hebt er al %1% in de groep '%2%')."
|
||||
buy-payError: "Er is iets mis gegaan met betalen, probeer het later opnieuw."
|
||||
buy-succes: "Je hebt %lang:region% succesvol gekocht."
|
||||
buy-successResale: "Je hebt %lang:region% succesvol gekocht van %lang:tPlayer|%0%|%."
|
||||
buy-successSeller: "Je gebied %lang:region% is verkocht aan %lang:player% voor %0%."
|
||||
buy-lowMoney: "Je hebt niet genoeg geld om %lang:region% te kopen (je hebt %0% van de %price%)."
|
||||
buy-lowMoneyResell: "Je hebt niet genoeg geld om %lang:region% te kopen (je hebt %0% van de %resellprice%)."
|
||||
buy-yours: "Je bent al in bezit van %lang:region%."
|
||||
buy-someoneElse: "Iemand anders is al in bezit van %lang:region%."
|
||||
buy-restrictedToWorld: "Je moet in de wereld '%world%' zijn om %lang:region% te kopen (je ben in '%0%')."
|
||||
buy-restrictedToRegion: "Je moet in %lang:region% staan om hem te kopen."
|
||||
|
||||
unrent-help: "/as unrent [region], het gebied waarin je staat zal worden gebruikt als je deze niet aangeeft."
|
||||
unrent-noPermission: "Je hebt geen toestemming om te stoppen met huren."
|
||||
unrent-noPermissionOther: "Je hebt geen toestemming om iemand anders huur te stoppen."
|
||||
unrent-notRegistered: "De huur kan niet gestopt worden want het gebied is niet geregistreerd om te huren."
|
||||
unrent-notRented: "De huur kan niet gestopt worden want het gebied is niet gehuurd."
|
||||
unrent-unrented: "De huur van %lang:region% van %lang:player% is gestopt."
|
||||
unrent-expired: "Je huur van %lang:region% is afgelopen."
|
||||
|
||||
sell-help: "/as sell [region], het gebied waarin je staat zal worden gebruikt als je deze niet aangeeft."
|
||||
sell-notRegistered: "Het gebied kan niet verkocht worden want het staat niet geregistreerd om te kopen."
|
||||
sell-notBought: "Het gebied kan niet verkocht worden want het is niet gekocht."
|
||||
sell-sold: "%lang:region% is verkocht voor %lang:player%."
|
||||
sell-noPermission: "Je hebt geen toestemming om een gebied te verkopen."
|
||||
sell-noPermissionOther: "Je hebt geen toestemming om een gebied van iemand anders te verkopen."
|
||||
|
||||
reload-reloading: "Alle bestanden zijn herladen, gebieden aan het checken en updaten."
|
||||
reload-updateStart: "[gray]%0% gebieden aan het updaten met %1% per seconde."
|
||||
reload-updateComplete: "[gray]Updaten van gebieden compleet."
|
||||
reload-noPermission: "Je hebt geen toestemming om configuratiebestanden te herladen."
|
||||
reload-updateCommandChanged: "'/as updaterents' en '/as updatebuys' zijn verwijderd, '/as reload' updated nu ook de gebieden, gebruik dus dat commando."
|
||||
|
||||
info-help:
|
||||
- "/as info[break]"
|
||||
- " %lang:command|all|/as info all|%[break]"
|
||||
- " %lang:command|rented|/as info rented|% [group] [page][break]"
|
||||
- " %lang:command|forrent|/as info forrent|% [group] [page][break]"
|
||||
- " %lang:command|sold|/as info sold|% [group] [page][break]"
|
||||
- " %lang:command|forsale|/as info forsale|% [group] [page][break]"
|
||||
- " %lang:command|reselling|/as info reselling|% [group] [page][break]"
|
||||
- " %lang:command|nogroup|/as info nogroup [page]|%"
|
||||
- " %lang:command|region|/as info region|% [region][break]"
|
||||
info-noPermission: "Je hebt geen toestemming om informatie over gebieden te bekijken."
|
||||
info-allHeader: "Alle gebieden%0%:"
|
||||
info-rentedHeader: "Verhuurde gebieden%0%:"
|
||||
info-forrentHeader: "Gebieden te huur%0%:"
|
||||
info-forsaleHeader: "Gebieden te koop%0%:"
|
||||
info-soldHeader: "Verkochte gebieden%0%:"
|
||||
info-resellingHeader: "Gebieden aan het doorverkopen%0%:"
|
||||
info-nogroupHeader: "Gebieden zonder groep%0%:"
|
||||
info-limitedToGroup: "(beperkt tot groep %0%)"
|
||||
info-nogroupNone: "Er zijn geen gebieden zonder groep."
|
||||
info-noFiltergroup: "Groep '%0%' bestaat niet en kan daardoor niet gebruikt worden om de resultaten te limiteren."
|
||||
info-noRegions: "Er zijn geen gebieden gevonden."
|
||||
info-wrongPage: "%0% is geen correct pagina nummer."
|
||||
info-entryForrent: "[darkgreen][bold]►[reset] %lang:region%: [gray]Te huur voor %price% per %duration%."
|
||||
info-entryRented: "[darkgreen][bold]►[reset] %lang:region%: [gray]Verhuurd aan %lang:player%."
|
||||
info-entryForsale: "[darkgreen][bold]►[reset] %lang:region%: [gray]Te koop voor %price%."
|
||||
info-entrySold: "[darkgreen][bold]►[reset] %lang:region%: [gray]Verkocht aan %lang:player%."
|
||||
info-entryReselling: "[darkgreen][bold]►[reset] %lang:region%: [gray]Verkocht aan %lang:player% (aan het doorverkopen)."
|
||||
info-pageStatus: "[gold]Pagina %0%/%1%"
|
||||
info-pagePrevious:
|
||||
- " [gold][bold]◄Vorige[/bold] "
|
||||
- " hover: %lang:action|Laat de vorige pagina zien|%"
|
||||
- " command: %0%"
|
||||
info-pageNoPrevious:
|
||||
- " [darkgray][bold]◄Vorige[/bold] "
|
||||
- " hover: Dit is al de eerste pagina"
|
||||
info-pageNext:
|
||||
- " [gold][bold]Volgende►[/bold]"
|
||||
- " hover: %lang:action|Laat de volgende pagina zien|%"
|
||||
- " command: %0%"
|
||||
info-pageNoNext:
|
||||
- " [darkgray][bold]Volgende►[/bold]"
|
||||
- " hover: Dit is al de laatste pagina"
|
||||
info-playerHelp: "/as info player <naam>."
|
||||
info-playerRents: "Gebieden gehuurd door %lang:tPlayer|%0%|%: [gray]%1%."
|
||||
info-playerNoRents: "%lang:tPlayer|%0%|% heeft geen gebieden gehuurd."
|
||||
info-playerBuys: "Gebieden gekocht door %lang:tPlayer|%0%|%: [gray]%1%."
|
||||
info-playerNoBuys: "%lang:tPlayer|%0%|% heeft geen gebieden gekocht."
|
||||
info-regionHelp: "/as info region <naam>."
|
||||
info-regionHeaderRent: "[darkgreen]Informatie over %lang:region%:"
|
||||
info-regionHeaderBuy: "[darkgreen]Informatie over %lang:region%:"
|
||||
info-regionRented: "[darkgreen][bold]►[reset] Gehuurd door %lang:player% tot: [gray]%until%."
|
||||
info-regionBought: "[darkgreen][bold]►[reset] Gekocht door %lang:player%."
|
||||
info-regionReselling: "[darkgreen][bold]►[reset] Gekocht door %lang:player%, aan het doorverkopen."
|
||||
info-regionExtending:
|
||||
- "[darkgreen][bold]►[reset] "
|
||||
- "[bold]Verleng voor[/bold]"
|
||||
- " hover: Verleng huur van %region%"
|
||||
- " hover: met %duration% voor %price%"
|
||||
- " hover: %lang:action|Verleng de huur van %region%|%"
|
||||
- " command: /areashop rent %region%"
|
||||
- ": [gray]%price% per %duration%."
|
||||
info-regionCanBeRented:
|
||||
- "[darkgreen][bold]►[reset] "
|
||||
- "[bold]Huur voor[/bold]"
|
||||
- " hover: Huur %region% voor %price% per %duration%"
|
||||
- " hover: %lang:action|Huur %region%|%"
|
||||
- " command: /areashop rent %region%"
|
||||
- ": [gray]%price% per %duration%."
|
||||
info-regionCanBeBought:
|
||||
- "[darkgreen][bold]►[reset] "
|
||||
- "[bold]Koop voor[/bold]"
|
||||
- " hover: Koop %region% voor %price%"
|
||||
- " hover: %lang:action|Koop %region%|%"
|
||||
- " command: /areashop buy %region%"
|
||||
- ": [gray]%price%."
|
||||
info-regionReselPrice: "[darkgreen][bold]►[reset] Doorverkoop prijs: [gray]%resellprice% (je kunt het kopen van %lang:player%)."
|
||||
info-regionFriends: "[darkgreen][bold]►[reset] Toegevoegde vrienden: [gray]%0%."
|
||||
info-friend: "%lang:tPlayer|%0%|%"
|
||||
info-friendRemove:
|
||||
- "%lang:info-friend|%0%|%"
|
||||
- "[red]✕[gray]"
|
||||
- " hover: Gebied %region%"
|
||||
- " hover: %lang:action|Verwijder %0% as friend|%"
|
||||
- " command: /areashop delfriend %0% %region%"
|
||||
info-regionMoneyBackBuy: "[darkgreen][bold]►[reset] Verkoop terugbetaling: [gray]%moneyback% (%moneybackpercent%% van de prijs)."
|
||||
info-regionMoneyBackBuyClick:
|
||||
- "[darkgreen][bold]►[reset] "
|
||||
- "[bold]Verkoop terugbetaling[/bold]"
|
||||
- " hover: Verkoop %region% en krijg %moneyback% terug"
|
||||
- " hover: %lang:action|Verkoop %region%|%"
|
||||
- " command: /areashop sell %region%"
|
||||
- ": [gray]%moneyback% (%moneybackpercent%% van de prijs)."
|
||||
info-regionMoneyBackRent: "[darkgreen][bold]►[reset] Stop met huren terugbetaling: [gray]%moneyback% (%moneybackpercent%% van de overgebleven tijd)."
|
||||
info-regionMoneyBackRentClick:
|
||||
- "[darkgreen][bold]►[reset] "
|
||||
- "[bold]Stop met huren terugbetaling[/bold]"
|
||||
- " hover: Stop met huren van %region% en krijg %moneyback% terug"
|
||||
- " hover: %lang:action|Stop met huren van %region%|%"
|
||||
- " command: /areashop unrent %region%"
|
||||
- ": [gray]%moneyback% (%moneybackpercent%% van de overgebleven tijd)."
|
||||
info-regionMaxExtends: "[darkgreen][bold]►[reset] Maximaal keer verlengen: [gray]%maxextends% keer."
|
||||
info-regionNoExtending: "[darkgreen][bold]►[reset] Huur kan niet verlengt worden."
|
||||
info-regionExtendsLeft: "[darkgreen][bold]►[reset] Verlengingen over: [gray]%extendsleft% keer van de %maxextends%."
|
||||
info-regionMaxRentTime: "[darkgreen][bold]►[reset] Huurtijd: [gray]maximaal %maxrenttime%."
|
||||
info-prefix: "[darkgreen][bold]►[reset] "
|
||||
info-regionTeleport:
|
||||
- "[bold]Ga naar het gebied[/bold]"
|
||||
- " hover: %lang:action|Ga naar %region%|%"
|
||||
- " command: /areashop tp %region%"
|
||||
info-setRegionTeleport:
|
||||
- "[bold]stel teleporteer locatie in[/bold]"
|
||||
- " hover: %region%"
|
||||
- " hover: %lang:action|Stel teleporteer locatie in|%"
|
||||
- " command: /areashop settp %region%"
|
||||
info-regionSigns: "[darkgreen][bold]►[reset] Verbonden borden: [gray]%0%."
|
||||
info-regionSignLocation: "[gray](%0%, %1%, %2%, %3%)[reset]"
|
||||
info-regionGroups: "[darkgreen][bold]►[reset] Toegewezen groepen: [gray]%0%."
|
||||
info-regionInactiveUnrent: "[darkgreen][bold]►[reset] Automatische huurstop na: [gray]Inactiviteit van %inactivetime% door de speler."
|
||||
info-regionInactiveSell: "[darkgreen][bold]►[reset] Automatische verkoop na: [gray]Inactiviteit van %inactivetime% door de spler."
|
||||
info-regionRestrictedRegionRent: "[darkgreen][bold]►[reset] Je moet in %lang:region% staan om deze te huren."
|
||||
info-regionRestrictedWorldRent: "[darkgreen][bold]►[reset] je moet in de wereld '%world%' zijn om %lang:region% te huren."
|
||||
info-regionRestrictedRegionBuy: "[darkgreen][bold]►[reset] Je moet in %lang:region% staan om deze te kopen."
|
||||
info-regionRestrictedWorldBuy: "[darkgreen][bold]►[reset] Je moet in de wereld '%world%' staan om %lang:region% te kopen."
|
||||
info-regionRestoringRent: "[darkgreen][bold]►[reset] Herstellen is ingeschakeld [gray](gebied zal resetten bij een huurstop)%0%."
|
||||
info-regionRestoringBuy: "[darkgreen][bold]►[reset] Herstellen is ingeschakeld [gray](gebied zal resetten bij verkoop)%0%."
|
||||
info-regionRestoringProfile: " (profiel: %0%)"
|
||||
info-regionLandlord: "[darkgreen][bold]►[reset] Landeigenaar: [gray]%lang:landlord% (krijgt het geld)."
|
||||
info-regionNotExisting: "Het aangegeven gebied is niet geregistreerd: %0%."
|
||||
|
||||
setrestore-help: "/as setrestore <gebied> <true|false|general> [profiel]."
|
||||
setrestore-noPermission: "Je hebt geen toestemming om de herstel opties te veranderen."
|
||||
setrestore-notRegistered: "Het aangegeven gebied is niet geregistreerd: %0%."
|
||||
setrestore-invalidSetting: "'%0%' is geen geldige staat, gebruik true, false of general."
|
||||
setrestore-success: "Herstel optie van %lang:region% succesvol gezet naar '%0%'."
|
||||
setrestore-successProfile: "Herstel optie van %lang:region% succesvol gezet naar '%0%' en het profiel naar '%1%'."
|
||||
|
||||
setprice-noPermission: "Je hebt geen toestemming om de prijs van een gebied te veranderen."
|
||||
setprice-help: "/as setprice <prijs> [gebied], het gebied waarin je staat zal worden gebruikt als je deze niet aangeeft."
|
||||
setprice-notRegistered: "Het aangegeven gebied is niet geregistreerd: %0%."
|
||||
setprice-wrongPrice: "'%0%' is geen geldige prijs."
|
||||
setprice-successRent: "Prijs van gebied %lang:region% is veranderd naar %price% per %duration%."
|
||||
setprice-successBuy: "De prijs van het gebied %lang:region% is veranderd naar %price%."
|
||||
setprice-successRemoved: "Prijs van %lang:region% is verwijderd, hij zal nu de prijs van de groep of default.yml file gebruiken, nieuwe prijs: %price%."
|
||||
setprice-noLandlord: "Je hebt geen toestemming om de prijs te veranderen omdat je niet de landeigenaar bent van %lang:region%."
|
||||
|
||||
setduration-noPermission: "Je hebt geen toestemming om de duur van het huur gebied aan te passen."
|
||||
setduration-help: "/as setduration <aantal> <identificator> [gebied], het gebied waarin je staat zal worden gebruikt als je niets aangeeft."
|
||||
setduration-notRegistered: "%0% is niet geregistreerd voor verhuur."
|
||||
setduration-wrongAmount: "'%0%' is geen geldig aantal, gebruik een geheel nummer."
|
||||
setduration-wrongFormat: "'%0%' is geen goed tijdsformaat, bekijk de documentatie op Bukkit."
|
||||
setduration-success: "Looptijd van gebeid %lang:region% veranderd naar '%duration%'."
|
||||
setduration-noLandlord: "Je hebt geen toestemming om de tijdsduur te veranderen omdat je niet de landeigenaar bent van %lang:region%."
|
||||
setduration-successRemoved: "Tijdsduur van %lang:region% is verwijderd, hij zal nu de tijdsduur van een group of default.yml gebruiken, nieuwe tijdsduur: %duration%."
|
||||
|
||||
setup-noRegion: "Je hebt geen gebied aangegeven op de tweede regel."
|
||||
setup-alreadyRentSign: "Het aangegeven gebied is al toegevoegd als huur gebied aan AreaShop, voeg een bord toe met [as] op de eerste regel of met '/as addsign'."
|
||||
setup-alreadyBuySign: "Het aangegeven gebied is al toegevoegd als koop gebied aan AreaShop, voeg een bord toe met [as] op de eerste regel of met '/as addsign'."
|
||||
setup-noDuration: "Je hebt geen tijdsduur voor het huren aangegeven, zet dit op de derde regel."
|
||||
setup-wrongDuration: "De aangegeven tijdsduur is niet in het correcte formaat, voorbeeld: 1 dag."
|
||||
setup-noPrice: "Je hebt geen prijs aangegeven op de vierde regel."
|
||||
setup-wrongPrice: "Je hebt de prijs niet goed aangegeven, gebruik alleen nummers."
|
||||
setup-rentSuccess: "Huren van gebied %lang:region% is goed opgezet."
|
||||
setup-buySuccess: "Kopen van gebied %lang:region% is goed opgezet."
|
||||
setup-noPermissionRent: "Je hebt geen toestemming om huur gebieden op te zetten."
|
||||
setup-noPermissionBuy: "Je hebt geen toestemming om koop gebieden op te zetten."
|
||||
setup-couldNotDetect: "Meerdere gebieden gevonden op de lokatie van het bord, geef het gebied aan op de tweede regel (2 van de gevonden gebieden: %lang:tRegion|%0%|% en %lang:tRegion|%1%|%)."
|
||||
setup-blacklisted: "%0% staat op de blacklist en kan niet toegevoegd worden aan AreaShop."
|
||||
setup-noPermission: "Je kunt de region '%0%' niet toevoegen, je bent geen owner/member of hebt geen toestemming."
|
||||
|
||||
destroy-noPermissionRent: "Je hebt geen toestemming om huur gebieden te verwijderen."
|
||||
destroy-noPermissionBuy: "Je hebt geen toestemming om koop gebieden te verwijderen."
|
||||
destroy-successRent: "%lang:region% succesvol verwijderd als huur gebied."
|
||||
destroy-successBuy: "%lang:region% succesvol verwijderd als koop gebied."
|
||||
|
||||
teleport-help: "/as tp <gebied> <aantal> <soort>."
|
||||
teleport-noRentOrBuy: "Het aangegeven gebied is niet geregistreerd: %0%."
|
||||
teleport-noPermission: "Je hebt geen toestemming om naar je gebied te teleporteren."
|
||||
teleport-noPermissionOther: "Je hebt geen toestemming om te teleporteren naar een gebied dat niet van jou is."
|
||||
teleport-noPermissionSign: "Je hebt geen toestemming om naar het bordje van je gebied te teleporteren."
|
||||
teleport-noPermissionOtherSign: "Je hebt geen toestemming om naar bordjes te teleporteren van gebieden die niet van jou zijn."
|
||||
teleport-noPermissionFriend: "Je hebt geen toestemming om te teleporteren naar gebieden waar je als vriend bent toegevoegd."
|
||||
teleport-noPermissionFriendSign: "Je hebt geen toestemming om te teleporteren naar het bord van gebieden waar je als vriend bent toegevoegd."
|
||||
teleport-success: "Je bent geteleporteerd naar %lang:region%."
|
||||
teleport-successSign: "Je bent geteleporteerd naar het bord van %lang:region%."
|
||||
teleport-noSafe: "Geen veilige plek gevonden in gebied %lang:region%, geen blokken over in het gebied of het maximum aantal pogingen overschreden (%0%%1%)."
|
||||
teleport-blocked: "Je kunt niet teleporteren omdat de positie buiten het gebied ligt en je geforceerd word erbinnen te teleporteren."
|
||||
teleport-changedToSign: "Je hebt alleen toestemming om te teleporteren naar het bord en niet binnen de region, teleporteren naar het bord."
|
||||
teleport-changedToNoSign: "Er is geen bord beschikbaar om naar te teleporteren, proberen om naar het gebied te teleporteren."
|
||||
|
||||
setteleport-help: "/as settp [gebied] [reset], het gebied waar je in staat zal worden gebruikt als je deze niet aangeeft."
|
||||
setteleport-noPermission: "Je hebt geen toestemming om de teleporteer lokatie in te stellen."
|
||||
setteleport-noPermissionOther: "Je hebt geen toestemming om de teleporteer lokatie in te stellen voor een gebied dat niet van jou is."
|
||||
setteleport-noRentOrBuy: "Het aangegeven gebied is niet geregistreerd: %0%."
|
||||
setteleport-success: "Teleporteer lokatie van %lang:region% ingestelt."
|
||||
setteleport-notInside: "De lokatie moet zich binnen het gebied bevinden."
|
||||
setteleport-reset: "Teleporteer lokatie van %lang:region% is gereset."
|
||||
|
||||
find-help: "/as find <buy|rent> [maxprijs] [groep]."
|
||||
find-noPermission: "Je hebt geen toestemming om te zoeken naar gebieden en naar deze te teleporteren."
|
||||
find-success: "Een %0% gebied is gevonden: %lang:region%, bij het zoeken met een maximale prijs gelijk aan je saldo: %1%%2%."
|
||||
find-successMax: "Een %0% gebied is gevonden: %lang:region%, bij het zoeken met een maximale prijs van %1%%2%."
|
||||
find-wrongMaxPrice: "De aangegeven maximum prijs is geen correct nummer: %0%."
|
||||
find-wrongGroup: "De aangegeven groep bestaat niet: %0%."
|
||||
find-noneFound: "Geen %0% gebied gevonden bij het zoeken met een maximale prijs gelijk aan je saldo: %1%%2%."
|
||||
find-noneFoundMax: "Geen %0% gebied gevonden bij het zoeken met een maximale prijs van %1%%2%."
|
||||
find-onlyInGroup: ", alleen gebieden gezocht in de groep: %0%."
|
||||
|
||||
groupadd-help: "/as groupadd <groep> [gebied], als er geen gebied is aangegeven dan worden alle gebieden in je WorldEdit selectie gebruikt."
|
||||
groupadd-noPermission: "Je hebt geen toestemming om gebieden toe te voegen aan groepen."
|
||||
groupadd-success: "Gebied %lang:region% is toegevoegd aan groep '%0%', deze group heeft nu %1% leden."
|
||||
groupadd-failed: "Gebied %lang:region% is al toegevoegd aan groep '%0%'."
|
||||
groupadd-weSuccess: "Toegevoegd aan groep %0%: [gray]%1%."
|
||||
groupadd-weFailed: "Waren al toegevoegd aan groep %0%: [gray]%1%."
|
||||
|
||||
groupdel-help: "/as groupdel <groep> [gebied], als er geen gebied is aangegeven worden alle gebieden in je WorldEdit selectie gebruikt."
|
||||
groupdel-noPermission: "Je hebt geen toestemming om gebieden van groepen te verwijderen."
|
||||
groupdel-success: "Gebied %lang:region% is verwijderd van groep '%0%', deze groep heeft nu %1% leden."
|
||||
groupdel-failed: "Gebied %lang:region% is geen lid van groep '%0%'."
|
||||
groupdel-weSuccess: "Verwijderd van groep %0%: [gray]%1%."
|
||||
groupdel-weFailed: "Waren al niet in de groep %0%: [gray]%1%."
|
||||
|
||||
grouplist-noPermission: "Je hebt geen toestemming om de geregistreerde groepen te bekijken."
|
||||
grouplist-noGroups: "Er zijn geen groepen aangemaakt."
|
||||
grouplist-success: "De volgende groepen zijn geregistreerd: [gray]%0%."
|
||||
|
||||
groupinfo-help: "/as groupinfo <groep>."
|
||||
groupinfo-noPermission: "Je hebt geen toestemming voor het bekijken van informatie over een groep."
|
||||
groupinfo-noGroup: "Er is geen groep geregistreerd met de naam '%0%', gebruik /as grouplist om de lijst te bekijken."
|
||||
groupinfo-members: "De volgende gebieden zijn leden van de groep %0%: [gray]%1%."
|
||||
groupinfo-noMembers: "Groep %0% heeft geen leden."
|
||||
|
||||
schemevent-help: "/as schemevent <gebied> <created|deleted|rented|unrented|bought|sold>."
|
||||
schemevent-wrongEvent: "Het aangegeven event '%0%' bestaat niet, gebruik een van de volgende: [gray]%1%."
|
||||
schemevent-success: "Event '%0%' succesvol getriggerd voor gebied %lang:region%."
|
||||
schemevent-noPermission: "Je hebt geen toestemming om events te triggeren."
|
||||
|
||||
add-help: "/as add <rent|buy> [gebied] [wereld]."
|
||||
add-noPermission: "Je hebt geen toestemming om een gebied toe te voegen aan AreaShop."
|
||||
add-success: "Toegevoegd als %0%: [gray]%1%."
|
||||
add-failed: "Al geregistreerd: [gray]%0%."
|
||||
add-blacklisted: "Op de blacklist: [gray]%0%."
|
||||
add-specifyWorld: "Geef de wereld van het gebied aan als je het commando vanuit de console gebruikt."
|
||||
add-incorrectWorld: "Wereld '%0%' niet gevonden, probeer opnieuw (hoofdlettergevoelig)."
|
||||
add-noRegion: "WorldGuard gebied '%0%' bestaat niet in deze wereld."
|
||||
add-noPermissionRegions: "Geen toestemming om toe te voegen: [gray]%0%."
|
||||
add-noPermissionOwnerMember: "[gray]Je bent geen member/owner van deze gebieden of hebt geen toestemming om je gebieden toe te voegen."
|
||||
|
||||
del-noPermission: "Je hebt geen toestemming om gebieden te verwijderen."
|
||||
del-success: "Verwijderde gebieden: [gray]%0%."
|
||||
del-failed: "Geen toestemming om te verwijderen of niet geregistreerd: [gray]%0%."
|
||||
|
||||
addsign-help: "/as addsign [gebied] [profiel]."
|
||||
addsign-noSign: "Je kijkt niet naar een bord."
|
||||
addsign-noRegions: "Geen gebied gevonden op de lokatie van het bord."
|
||||
addsign-couldNotDetect: "Meerdere gebieden gevonden op de lokatie van het bord, geef het gebied mee als extra argument (2 van de gevonden gebieden: %lang:tRegion|%0%|% en %lang:tRegion|%1%|%)."
|
||||
addsign-couldNotDetectSign: "Meerdere gebieden gevonden op de lokatie van het bord, geef het gebied aan op de tweede regel (2 van de gevonden gebieden: %lang:tRegion|%0%|% en %lang:tRegion|%1%|%)."
|
||||
addsign-wrongProfile: "Het aangegeven profiel bestaat niet, gebruik een van de volgende (check de config): [gray]%0%."
|
||||
addsign-profile:
|
||||
- "[bold]%0%[/bold]"
|
||||
- " hover: Bord profiel %0%"
|
||||
- " hover: %lang:action|Gebruik dit profiel|%"
|
||||
- " command: /areashop linksigns %0%"
|
||||
addsign-success: "Het bord is toegevoegd aan %lang:region%."
|
||||
addsign-successProfile: "Het bord is toegevoegd aan %lang:region% met profiel %0%."
|
||||
addsign-alreadyRegistered: "Dat bord is al geregistreerd voor gebied %lang:region%."
|
||||
addsign-noPermission: "Je hebt geen toestemming om een bord toe te voegen."
|
||||
|
||||
delsign-noSign: "Je kijkt niet naar een bord."
|
||||
delsign-noPermission: "Je hebt geen toestemming om een bord te verwijderen."
|
||||
delsign-noRegion: "Dat bord hoort niet bij een AreaShop gebied."
|
||||
delsign-success: "Het bord is verwijderd van gebied %lang:region%."
|
||||
|
||||
me-noPermission: "Je hebt geen toestemming om te zien welke gebieden je hebt."
|
||||
me-header: "Gebieden van %lang:tPlayer|%0%|%:"
|
||||
me-notAPlayer: "Je bent geen speler dus je kunt geen gebieden hebben."
|
||||
me-rentLine:
|
||||
- "[darkgreen][bold]►[reset] %lang:region% [gray]("
|
||||
- "%timeleft% over"
|
||||
- " hover: tot %until%"
|
||||
- ")."
|
||||
me-buyLine: "[darkgreen][bold]►[reset] %lang:region%."
|
||||
me-friendLine:
|
||||
- "[darkgreen][bold]►[reset] %lang:region% [gray]("
|
||||
- "%lang:player% is eigenaar"
|
||||
- " hover: Je bent toegevoegd als vriend"
|
||||
- ")."
|
||||
me-nothing: "%lang:tPlayer|%0%|% heeft geen gebieden gekocht of gehuurd en is niet als vriend toegevoegd bij gebieden."
|
||||
me-noPlayer: "%0% kan niet gevonden worden, is waarschijnlijk nooit op de server geweest."
|
||||
me-clickHint: "[gray][italic]Klik op een naam van een gebied voor details."
|
||||
|
||||
setowner-help: "/as setowner <speler> [gebied], het gebied waar je in staat zal worden gebruikt als je deze niet aangeeft."
|
||||
setowner-noPermission: "Je hebt geen toestemming om de eigenaar van een gebied in te stellen."
|
||||
setowner-noPermissionRent: "Je hebt geen toestemming om de eigenaar van huur gebieden in te stellen."
|
||||
setowner-noPermissionBuy: "Je hebt geen toestemming om de eigenaar van koop gebieden in te stellen."
|
||||
setowner-notRegistered: "Het aangegeven gebied is niet geregistreerd, eigenaar kan niet worden ingesteld."
|
||||
setowner-noPlayer: "De UUID van de aangegeven speler kon niet worden gevonden: %0%."
|
||||
setowner-succesRent: "Eigenaar van %lang:region% succesvol veranderd naar %lang:player%, gehuurt tot %until% (%timeleft% over)."
|
||||
setowner-succesRentExtend: "Eigenaar was al %lang:player%, huur verlengt met '%duration%', nu gehuurd tot %until% (%timeleft% over)."
|
||||
setowner-succesBuy: "Eigenaar van %lang:region% succesvol veranderd naar %lang:player%."
|
||||
|
||||
resell-help: "/as resell <prijs> [gebied], het gebied waarin je staat zal worden gebruikt als je deze niet aangeeft."
|
||||
resell-wrongPrice: "'%0%' is geen geldige prijs."
|
||||
resell-notRegistered: "Het aangegeven gebied is niet geregistreerd: %0%."
|
||||
resell-notBought: "Je kunt %lang:region% niet doorverkopen want dit gebied is nog niet verkocht."
|
||||
resell-success: "%lang:region% is succesvol in doorverkoop mode gezet voor %resellprice%."
|
||||
resell-noPermission: "Je hebt geen toestemming om je gebied in doorverkoop mode te zetten."
|
||||
resell-noPermissionOther: "Je hebt geen toestemming om gebieden in doorverkoop mode te zetten."
|
||||
|
||||
stopresell-help: "/as stopresell [gebied], het gebied waarin je staat zal worden gebruikt als je deze niet aangeeft."
|
||||
stopresell-notRegistered: "Het aangegeven gebied is niet geregistreerd: %0%."
|
||||
stopresell-notResell: "Je kunt niet stoppen met doorverkopen van %lang:region% want hij staat niet in doorverkoop mode."
|
||||
stopresell-success: "%lang:region% is succesvol terug gezet in verkocht mode."
|
||||
stopresell-noPermission: "Je hebt geen toestemming om je gebied terug te zetten in verkocht mode."
|
||||
stopresell-noPermissionOther: "Je hebt geen toestemming om een gebied terug te zetten in verkocht mode."
|
||||
|
||||
addfriend-help: "/as addfriend <speler> [gebied], het gebied waar je in staat zal worden gebruikt als je deze niet aangeeft."
|
||||
addfriend-noPermissionOther: "Je hebt geen toestemming om vrienden toe te voegen aan gebieden die niet van jou zijn."
|
||||
addfriend-noPermission: "Je hebt geen toestemming om vrienden toe te voegen aan je gebied."
|
||||
addfriend-successOther: "%lang:tPlayer|%0%|% is toegevoegd als vriend bij gebied %lang:region%."
|
||||
addfriend-success: "%lang:tPlayer|%0%|% is toegevoegd als vriend bij je gebied %lang:region%."
|
||||
addfriend-alreadyAdded: "%lang:tPlayer|%0%|% is al toegevoegd als vriend voor %lang:region%."
|
||||
addfriend-self: "Het toevoegen van de eigenaar van het gebied als vriend zou nutteloos zijn."
|
||||
addfriend-noOwner: "Je kunt geen vrienden toevoegen aan een gebied zonder eigenaar."
|
||||
addfriend-notVisited: "Je kunt %0% niet toevoegen omdat hij de server nog niet heeft bezocht."
|
||||
|
||||
delfriend-help: "/as delfriend <speler> [gebied], het gebied waar je in staat zal worden gebruikt als je deze niet aangeeft."
|
||||
delfriend-noPermissionOther: "Je hebt geen toestemming om vrienden te verwijderen van gebieden die niet van jou zijn."
|
||||
delfriend-noPermission: "Je hebt geen toestemming om vrienden te verwijderen van je gebied."
|
||||
delfriend-successOther: "%lang:tPlayer|%0%|% is verwijderd als vriend van %lang:region%."
|
||||
delfriend-success: "%lang:tPlayer|%0%|% is verwijderd als vriend van je gebied %lang:region%."
|
||||
delfriend-notAdded: "%lang:tPlayer|%0%|% is niet toegevoegd als vriend voor %lang:region%."
|
||||
delfriend-noOwner: "Je kunt geen vrienden verwijderen van een gebied zonder eigenaar."
|
||||
|
||||
linksigns-multipleRegions: "Meerdere gebieden gevonden: [gray]%0%."
|
||||
linksigns-multipleRegionsAdvice: "Klik nog een keer om het opnieuw te proberen of gebruik '/as linksigns' om te stoppen."
|
||||
linksigns-noRegions: "Geen AreaShop gebieden gevonden in de richting van je cursor, controleer of het gebied is toegevoegd aan AreaShop [gray](maximaal bereik 100 blokken)."
|
||||
linksigns-regionFound: "Gebied %lang:region% is gevonden, wijs nu naar een bord en linksklik om het te koppelen."
|
||||
linksigns-signFound: "Bord gevonden op (%0%, %1%, %2%), wijs nu naar een gebied en rechtsklik om het te koppelen."
|
||||
linksigns-noSign: "Geen bord gevonden in de richting van je cursor, controleer of je direct zicht hebt op een bord en klik opnieuw [gray](maximaal bereik 100 blokken)."
|
||||
linksigns-alreadyRegistered: "Dat bord is al gekoppelt aan gebied %lang:region%, klik opnieuw om een ander bord te selecteren."
|
||||
linksigns-first: "Je bent in bord-koppel modus gegaan."
|
||||
linksigns-next: "[gray]Linksklik om een bord te selecteren, rechtsklik om een gebied te selecteren, gebruik '/as linksigns' om te stoppen."
|
||||
linksigns-noPermission: "Je hebt geen toestemming om massa bord-koppel modus te gebruiken."
|
||||
linksigns-stopped: "Je bent gestopt met bord-koppel modus."
|
||||
|
||||
stack-help:
|
||||
- "/as stack <aantal> <afstand> <naam> <rent|buy> [groep].[break]"
|
||||
- " [gray]<aantal> Het aantal gebieden dat word gemaakt.[break]"
|
||||
- " [gray]<afstand> Blokken afstand tussen de gebieden.[break]"
|
||||
- " [gray]<naam> Naam van de gebieden (komt een nummber achter).[break]"
|
||||
- " [gray]<rent|buy> Maak ze huur of koop gebieden.[break]"
|
||||
- " [gray][groep] Groep waaraan de gebieden worden toegevoegd.[break]"
|
||||
- " [gray]De gebieden zullen worden gemaakt in de richting waarnaar je kijkt."
|
||||
stack-accepted: "Begonnen met %0% %1% gebieden maken met %2% blokken ruimte ertussen, namen beginnen met %3% en hebben een nummer erachter.%4%"
|
||||
stack-addToGroup: " Gemaakte gebieden zullen worden toegevoegd aan de groep '%0%'."
|
||||
stack-noPermission: "Je hebt geen toestemming om in grote aantallen gebieden toe te voegen aan AreaShop."
|
||||
stack-wrongAmount: "'%0%' is geen goed aantal gebieden."
|
||||
stack-wrongGap: "'%0%' is geen correct getal voor het aantal blokken ruimte tussen gebieden."
|
||||
stack-noSelection: "Je hebt geen selectie die aangeeft waar het eerste gebied word gemaakt."
|
||||
stack-addStart: "[gray]%0% gebieden aan het toevoegen met %1% per seconde."
|
||||
stack-addComplete: "[gray]Toevoegen van gebieden voltooid."
|
||||
stack-unclearDirection: "Kijk precies in het noorden, oosten, zuiden of westen, op dit moment gedetecteert: %0%."
|
||||
|
||||
setlandlord-help: "/as setlandlord <speler> [gebied], het gebied waar je in staat zal worden gebruikt als niet aangegeven."
|
||||
setlandlord-noPermission: "Je hebt geen toestemming om de landeigenaar in te stellen voor een gebied."
|
||||
setlandlord-success: "%lang:landlord% is succesvol ingesteld als landeigenaar voor %lang:region%."
|
||||
|
||||
message-help: "/as message <speler> <bericht...>"
|
||||
message-noPermission: "Je hebt geen toestemming om AreaShop berichten te sturen."
|
||||
message-notOnline: "%0% is niet online."
|
||||
|
||||
confirm-rent:
|
||||
- "%lang:prefix%Weet je zeker dat je %lang:tRegion|%0%|% wilt huren?[break]"
|
||||
- "[darkgreen][bold]►[reset] %lang:button|Klik om %0% te huren|%"
|
||||
- " hover: %lang:action|Huur %0%|%"
|
||||
- " command: /areashop rent %0%"
|
||||
confirm-extend:
|
||||
- "%lang:prefix%Weet je zeker dat je de huur van %lang:tRegion|%0%|% wilt verlengen?[break]"
|
||||
- "[darkgreen][bold]►[reset] %lang:button|Klik om %0% te verlengen|%"
|
||||
- " hover: %lang:action|Verleng %0%|%"
|
||||
- " command: /areashop rent %0%"
|
||||
confirm-unrent:
|
||||
- "%lang:prefix%Weet je zeker dat je de huur van %lang:tRegion|%0%|% wilt stoppen?[break]"
|
||||
- "[darkgreen][bold]►[reset] %lang:button|Stop de huur van %0%|%"
|
||||
- " hover: %lang:action|Stop de huur van %0%|%"
|
||||
- " command: /areashop unrent %0%"
|
||||
confirm-buy:
|
||||
- "%lang:prefix%Weet je zeker dat je %lang:tRegion|%0%|% wilt kopen?[break]"
|
||||
- "[darkgreen][bold]►[reset] %lang:button|Klik om %0% te kopen|%"
|
||||
- " hover: %lang:action|Koop %0%|%"
|
||||
- " command: /areashop buy %0%"
|
||||
confirm-sell:
|
||||
- "%lang:prefix%Weet je zeker dat je %lang:tRegion|%0%|% wilt verkopen?[break]"
|
||||
- "[darkgreen][bold]►[reset] %lang:button|Klik om %0% te verkopen|%"
|
||||
- " hover: %lang:action|Verkoop %0%|%"
|
||||
- " command: /areashop sell %0%"
|
||||
|
||||
timeleft-years: "%0% jaren"
|
||||
timeleft-months: "%0% maanden"
|
||||
timeleft-days: "%0% dagen"
|
||||
timeleft-hours: "%0% uren"
|
||||
timeleft-minutes: "%0% minuten"
|
||||
timeleft-second: "%0% seconde"
|
||||
timeleft-seconds: "%0% seconden"
|
||||
timeleft-ended: "Verlopen"
|
||||
|
||||
greeting-forrent: "%region% kan worden gehuurd voor %price% per %duration%."
|
||||
greeting-rented: "%region% is gehuurd door %player% tot %until%."
|
||||
greeting-forsale: "%region% kan worden gekocht voor %price%."
|
||||
greeting-bought: "%region% is gekocht door %player%."
|
||||
greeting-resale: "%region% kan worden gekocht voor %resaleprice% van %player%."
|
||||
@@ -0,0 +1,542 @@
|
||||
# ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
|
||||
# ║ Language file of the AreaShop plugin created by NLThijs48, Github can be found at https://github.com/NLthijs48/AreaShop ║
|
||||
# ║ Language: Norwegian, Version: V2.3.2, Percentage translated: 96% ║
|
||||
# ║ This file will be overwritten at each startup/reload of the plugin, if you want to change anything then do the following: ║
|
||||
# ║ 1: Make a copy of this file ║
|
||||
# ║ 2: Rename it to <servername>.yml (don't use a language code as filename, could otherwise be overwritten in future updates) ║
|
||||
# ║ 3: Change the 'language' setting in config.yml to '<servername>', do not include '.yml' ║
|
||||
# ║ 4: Change the strings in the new file to your liking and save the file ║
|
||||
# ║ 5: Use '/as reload' or reload/restart your server to see the changes ║
|
||||
# ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
|
||||
button: "[bold]<%0%>[/bold]"
|
||||
|
||||
command:
|
||||
- "[bold]%0%[/bold]"
|
||||
- " hover: %lang:action|Bruk %1%|%"
|
||||
- " kommando: %1%"
|
||||
|
||||
helpCommand:
|
||||
- "[gold]%0% [gray]-[reset]"
|
||||
- " hover: %lang:action|Bruk %0%|%"
|
||||
- " kommando: %0%"
|
||||
|
||||
region: "%lang:tRegion|%region%|%"
|
||||
|
||||
tRegion:
|
||||
- "[bold]%0%[/bold]"
|
||||
- " hover: Region %0%"
|
||||
- " hover: %lang:action|Region informasjon|%"
|
||||
- " kommando: /areashop info region %0%"
|
||||
|
||||
player: "%lang:tPlayer|%player%|%"
|
||||
|
||||
tPlayer:
|
||||
- "[bold]%0%[/bold]"
|
||||
- " hover: Spiller %0%"
|
||||
- " hover: %lang:action|Regioner til %0%|%"
|
||||
- " kommando: /areashop info player %0%"
|
||||
|
||||
landlord:
|
||||
- "[bold]%landlord%[/bold]"
|
||||
- " hover: Grunneier %landlord%"
|
||||
- " hover: %lang:action|Regioner til %landlord%|%"
|
||||
- " kommando: /areashop info player %landlord%"
|
||||
|
||||
total-maximum: "Du kan ikke leie og kjøpe mer enn %0% region(er) totalt (du har allerede %1% i gruppe '%2%')."
|
||||
|
||||
general-notReady: "AreaShop har ikke lastet ferdig ennå, vennligst vent."
|
||||
general-noWorld: "Du kan ikke gjøre det, verdenen %lang:region% er for øyeblikket utilgjengelig (world '%world%')."
|
||||
general-noRegion: "Du kan ikke gjøre det, WorldGuard regionen er for øyeblikket utilgjengelig. (region %lang:region%)."
|
||||
general-noEconomy: "Det er ikke noen økonomi plugin installert eller satt opp riktig, si ifra til server eieren om dette."
|
||||
general-cancelled: "%0%"
|
||||
|
||||
cmd-notValid: "Den kommandoen er ikke gyldig, bruk '/as help' for informasjon."
|
||||
cmd-onlyByPlayer: "Denne kommandoen kan bare brukes av en spiller."
|
||||
cmd-weOnlyByPlayer: "Du kan bare bruke en WorldEdit markering som en spiller, spesifiser region navnet som et ekstra argument."
|
||||
cmd-noSelection: "Du har ikke laget en WorldEdit markering."
|
||||
cmd-noRegionsFound: "Ingen regioner som er registrert i AreaShop er funnet i din markering."
|
||||
cmd-noWERegionsFound: "Ingen WorldEdit regioner som overlapper din markering er funnet."
|
||||
cmd-notRegistered: "Den spesifiserte regionen er ikke tilgjengelig i AreaShop: %0%."
|
||||
cmd-noRegionsAtLocation: "Ingen regioner er funnet på din plassering, spesifiser region navnet som et argument."
|
||||
cmd-moreRegionsAtLocation: "Mer enn en region er funnet på din plassering, spesifiser region navnet som et argument."
|
||||
cmd-automaticRegionOnlyByPlayer: "Automatisk valg av region er bare mulig for spillere, spesifiser region navnet som som et argument."
|
||||
|
||||
help-header: "Informasjons side, kommandoer som du kan bruke."
|
||||
help-noPermission: "Du har ikke rettigheter til å vise siden med hjelp."
|
||||
help-alias: "Kommando aliaser: /areashop, /as."
|
||||
help-help: "%lang:helpCommand|/as help|% Viser siden med hjelp."
|
||||
help-info: "%lang:helpCommand|/as info|% Få informasjon om gjeldende regioner."
|
||||
help-rent: "%lang:helpCommand|/as rent|% Lei en region eller utvid din gjeldende leie."
|
||||
help-buy: "%lang:helpCommand|/as buy|% Kjøp en region."
|
||||
help-unrent: "%lang:helpCommand|/as unrent|% Stopp leie av en region."
|
||||
help-sell: "%lang:helpCommand|/as sell|% Selg en region."
|
||||
help-reload: "%lang:helpCommand|/as reload|% Last inn filer på nytt og oppdater regionene."
|
||||
help-setrestore: "%lang:helpCommand|/as setrestore|% Skru på gjenoppretting og velg en profil."
|
||||
help-setprice: "%lang:helpCommand|/as setprice|% Endre prisen på en region."
|
||||
help-setduration: "%lang:helpCommand|/as setduration|% Endre leie tiden til en region."
|
||||
help-teleport: "%lang:helpCommand|/as tp|% Teleporter til en kjøpe/leie region."
|
||||
help-setteleport: "%lang:helpCommand|/as settp|% Sett teleporterings plass for en region."
|
||||
help-find: "%lang:helpCommand|/as find|% Finn en ledig kjøp eller leie region."
|
||||
help-groupadd: "%lang:helpCommand|/as groupadd|% Legg til en region til en gruppe."
|
||||
help-groupdel: "%lang:helpCommand|/as groupdel|% Fjern en region fra en gruppe."
|
||||
help-grouplist: "%lang:helpCommand|/as grouplist|% Vis alle grupper som er registrert."
|
||||
help-groupinfo: "%lang:helpCommand|/as groupinfo|% Vis informasjon om en gruppe."
|
||||
help-schemevent: "%lang:helpCommand|/as schemevent|% Aktiver et schematic event for en region."
|
||||
help-add: "%lang:helpCommand|/as add|% Registrer en region som leie eller kjøpe."
|
||||
help-del: "%lang:helpCommand|/as del|% Fjern en registrert region fra AreaShop."
|
||||
help-addsign: "%lang:helpCommand|/as addsign|% Legg til et skilt for en eksisterende region."
|
||||
help-delsign: "%lang:helpCommand|/as delsign|% Fjern skiltet du ser på."
|
||||
help-me: "%lang:helpCommand|/as me|% Sjekk hvilke regioner du har (+utløpstid)."
|
||||
help-setowner: "%lang:helpCommand|/as setowner|% Sett noen som eier av regionen eller utvid leietiden."
|
||||
help-resell: "%lang:helpCommand|/as resell|% Sett en region i videresalgs modus."
|
||||
help-stopResell: "%lang:helpCommand|/as stopresell|% Sett en region tilbake i solgt modus."
|
||||
help-addFriend: "%lang:helpCommand|/as addfriend|% Legg til en venn i en region."
|
||||
help-delFriend: "%lang:helpCommand|/as delfriend|% Fjern en venn fra en region."
|
||||
help-linksigns: "%lang:helpCommand|/as linksigns|% Use bulk sign linking mode."
|
||||
help-stack: "%lang:helpCommand|/as stack|% Lag flere regioner og legg dem til."
|
||||
help-setlandlord: "%lang:helpCommand|/as setlandlord|% Sett grunneier av en region."
|
||||
|
||||
rent-help: "/as rent [region], regionen du står i vil bli brukt hvis ikke spesifisert."
|
||||
rent-noPermission: "Du har ikke rettigheter til å leie en region."
|
||||
rent-maximum: "Du kan ikke leie mer enn %0% region(er) (du har allerede %1% i gruppe '%2%')."
|
||||
rent-maximumExtend: "Du kan ikke utvide denne leien fordi du har mer enn %0% region(er) (Du har allerede %1% i gruppe '%2%')."
|
||||
rent-payError: "Noe gikk galt med din betaling, prøv igjen senere."
|
||||
rent-rented: "Du leide %lang:region% frem til %until%, du kan utvide din leie ved å høyreklikke på skiltet igjen eller bruke /as rent."
|
||||
rent-extended: "Du utvidet din leie av %lang:region% frem til %until%."
|
||||
rent-extendedToMax: "Du har utvidet din leie av %lang:region% frem til %until% (som er den maksimale leietiden av %maxrenttime%)."
|
||||
rent-lowMoneyExtend: "Du har ikke nok penger til å utvide leien (du har %0% og du trenger %price%)."
|
||||
rent-lowMoneyRent: "Du har ikke nok penger til å leie (du har %0% og du trenger %price%)."
|
||||
rent-someoneElse: "Noen har allerede leid %lang:region%."
|
||||
rent-notRentable: "Den regionen er ikke mulig å leie."
|
||||
rent-maxExtends: "Du kan ikke utvide leien mer (maksimum er %maxextends% ganger) men, når leien er over kan du leie %lang:region% igjen."
|
||||
rent-maxRentTime: "Du kan ikke øke leietid av %lang:region% mer tid fremover, den maksimale tiden er %maxrenttime% og du har leid den for %timeleft%."
|
||||
rent-restrictedToWorld: "Du må være i '%world%' verden for å leie %lang:region% (du er i '%0%')."
|
||||
rent-restrictedToRegion: "Du må være på innsiden av %lang:region% for å leie den."
|
||||
rent-expireWarning: "Din region %lang:region% har %timeleft% igjen, husk å utvide leien om du vil beholde den."
|
||||
rent-alreadyAtFull: "%lang:region% er allerede ved eller over den maksimale leietiden, du kan ikke utvide mer ennå."
|
||||
|
||||
buy-help: "/as buy [region], regionen du står i vil bli brukt hvis ikke spesifisert."
|
||||
buy-noPermission: "Du har ikke rettigheter til å kjøpe en region."
|
||||
buy-noPermissionResell: "Du har ikke rettigheter til å kjøpe en region i videresalgs modus."
|
||||
buy-noPermissionNoResell: "Du har ikke rettigheter til å kjøpe en region som ikke er i videresalgs modus."
|
||||
buy-notBuyable: "Region %lang:region% er ikke tilgjengelig for salg."
|
||||
buy-maximum: "Du kan ikke kjøpe mer enn %0% region(er) (du har allerede %1% i gruppe '%2%')."
|
||||
buy-payError: "Noe gikk galt med din betaling, prøv igjen senere."
|
||||
buy-succes: "Du var vellykket i ditt kjøp av %lang:region%."
|
||||
buy-successResale: "Du var vellykket i ditt kjøp av %lang:region% fra %lang:tPlayer|%0%|%."
|
||||
buy-successSeller: "Din region %lang:region% har blitt solgt til %lang:player% for %0%."
|
||||
buy-lowMoney: "Du har ikke nok penger til å kjøpe %lang:region% (du har %0% og du trenger %price%)."
|
||||
buy-lowMoneyResell: "Du har ikke nok penger til å kjøpe %lang:region% (du har %0% og du trenger %resellprice%)."
|
||||
buy-yours: "Du eier allerede %lang:region%."
|
||||
buy-someoneElse: "Noen andre har kjøpt %lang:region%."
|
||||
buy-restrictedToWorld: "Du må være i '%world%' verden for å kjøpe %lang:region% (du er i '%0%')."
|
||||
buy-restrictedToRegion: "Du må være på innsiden av %lang:region% for å kjøpe den."
|
||||
|
||||
unrent-help: "/as unrent [region], regionen du står i vil bli bruk om ikke spesifisert."
|
||||
unrent-noPermission: "Du har ikke rettigheter til å stoppe leie på en region."
|
||||
unrent-noPermissionOther: "Du har ikke rettigheter til å stoppe leie på en annen region."
|
||||
unrent-notRegistered: "Denne regionen kan det ikke bli avsluttet leie på fordi den er ikke registrert for leie."
|
||||
unrent-notRented: "Denne regionen kan det ikke bli avsluttet leie på fordi den er ikke leid."
|
||||
unrent-unrented: "%lang:region% sin leie av %lang:player% har blitt avsluttet."
|
||||
unrent-expired: "Din leie av %lang:region% har gått ut."
|
||||
|
||||
sell-help: "/as sell [region], regionen du står i vil bli brukt hvis ikke spesifisert."
|
||||
sell-notRegistered: "Denne regionen kan ikke bli solgt fordi den er ikke registrert for salg."
|
||||
sell-notBought: "Denne regionen kan ikke bli solgt fordi den er ikke noen sin eiendom."
|
||||
sell-sold: "%lang:region% til %lang:player% har blitt solgt."
|
||||
sell-noPermission: "Du har ikke rettigheter til å selge en region."
|
||||
sell-noPermissionOther: "Du har ikke rettigheter til å selge en annen region."
|
||||
|
||||
reload-reloading: "Lastet inn alle filer på nytt, sjekker leie og oppdaterer regioner."
|
||||
reload-updateStart: "[gray]Oppdaterer %0% regioner på %1% per sekund."
|
||||
reload-updateComplete: "[gray]Oppdatering av regioner ferdig."
|
||||
reload-noPermission: "Du har ikke rettigheter til å laste inn konfigurasjonen på nytt."
|
||||
reload-updateCommandChanged: "'/as updaterents' og '/as updatebuys' har blitt fjernet, '/as reload' vil også oppdatere regioner så bruk den kommandoen fremover."
|
||||
|
||||
info-help:
|
||||
- "/as info[break]"
|
||||
- " %lang:command|all|/as info all|%[break]"
|
||||
- " %lang:command|rented|/as info rented|% [group] [page][break]"
|
||||
- " %lang:command|forrent|/as info forrent|% [group] [page][break]"
|
||||
- " %lang:command|sold|/as info sold|% [group] [page][break]"
|
||||
- " %lang:command|forsale|/as info forsale|% [group] [page][break]"
|
||||
- " %lang:command|reselling|/as info reselling|% [group] [page][break]"
|
||||
- " %lang:command|nogroup|/as info nogroup [page]|%"
|
||||
- " %lang:command|region|/as info region|% [region][break]"
|
||||
info-noPermission: "Du har ikke rettigheter til å få informasjon om regioner."
|
||||
info-allHeader: "Alle regioner%0%:"
|
||||
info-rentedHeader: "Leide regioner%0%:"
|
||||
info-forrentHeader: "Regioner til leie%0%:"
|
||||
info-forsaleHeader: "Regioner til salgs%0%:"
|
||||
info-soldHeader: "Solgte regioner%0%:"
|
||||
info-resellingHeader: "Regioner til videresalg%0%:"
|
||||
info-nogroupHeader: "Regioner uten gruppe%0%:"
|
||||
info-limitedToGroup: " (begrenset til gruppe %0%)"
|
||||
info-nogroupNone: "Det er ingen regioner uten en gruppe."
|
||||
info-noFiltergroup: "Gruppe '%0%' eksiterer ikke og kan derfor ikke bli brukt til å begrense resultatene."
|
||||
info-noRegions: "Ingen regioner har blitt funnet."
|
||||
info-wrongPage: "%0% er ikke et riktig side nummer."
|
||||
info-pageNoPrevious:
|
||||
- " [darkgray][bold]◄Forrige[/bold] "
|
||||
- " hover: Dette er første side"
|
||||
info-pageNoNext:
|
||||
- " [darkgray][bold]Neste►[/bold]"
|
||||
- " hover: Dette er siste side"
|
||||
info-playerHelp: "/as info player <navn>."
|
||||
info-playerRents: "Regioner leid av %lang:tPlayer|%0%|%: [gray]%1%"
|
||||
info-playerNoRents: "%lang:tPlayer|%0%|% har ikke leid en region."
|
||||
info-playerBuys: "Regioner kjøpt av %lang:tPlayer|%0%|%: [gray]%1%."
|
||||
info-playerNoBuys: "%lang:tPlayer|%0%|% har ikke kjøpt en region."
|
||||
info-regionHelp: "/as info region [navn], den regionen du står i vil bli bruk om ikke spesifisert."
|
||||
info-regionHeaderRent: "[darkgreen]Informasjon om %lang:region%:"
|
||||
info-regionHeaderBuy: "[darkgreen]Informasjon om %lang:region%:"
|
||||
info-regionRented: "[darkgreen][bold]►[reset] Utleid til %lang:player% frem til: [gray]%until%."
|
||||
info-regionBought: "[darkgreen][bold]►[reset] Kjøpt av %lang:player%."
|
||||
info-regionReselling: "[darkgreen][bold]►[reset] Kjøpt av %lang:player%, for øyeblikket videreselges."
|
||||
info-regionExtending:
|
||||
- "[darkgreen][bold]►[reset] "
|
||||
- "[bold]Forleng for[/bold]"
|
||||
- " hover: Forleng leie av %region%"
|
||||
- " hover: med %duration% for %price%"
|
||||
- " hover: %lang:action|Extend rent of %region%|%"
|
||||
- " kommando: /areashop rent %region%"
|
||||
- ": [gray]%price% per %duration%."
|
||||
info-regionCanBeRented:
|
||||
- "[darkgreen][bold]►[reset] "
|
||||
- "[bold]Lei for[/bold]"
|
||||
- " hover: Lei %region% for %price% per %duration%"
|
||||
- " hover: %lang:action|Rent %region%|%"
|
||||
- " kommando: /areashop rent %region%"
|
||||
- ": [gray]%price% per %duration%."
|
||||
info-regionCanBeBought:
|
||||
- "[darkgreen][bold]►[reset] "
|
||||
- "[bold]Kjøp for[/bold]"
|
||||
- " hover: Kjøp %region% for %price%"
|
||||
- " hover: %lang:action|Buy %region%|%"
|
||||
- " kommando: /areashop buy %region%"
|
||||
- ": [gray]%price%."
|
||||
info-regionReselPrice: "[darkgreen][bold]►[reset] Videresalgs pris: [gray]%resellprice% (du kan kjøpe den fra %lang:player%)."
|
||||
info-regionFriends: "[darkgreen][bold]►[reset] Venner lagt til: [gray]%0%."
|
||||
info-friend: "%lang:tPlayer|%0%|%"
|
||||
info-friendRemove:
|
||||
- "%lang:info-friend|%0%|%"
|
||||
- "[red]✕[gray]"
|
||||
- " hover: Region %region%"
|
||||
- " hover: %lang:action|Remove %0% as friend|%"
|
||||
- " kommando: /areashop delfriend %0% %region%"
|
||||
info-regionMoneyBackBuy: "[darkgreen][bold]►[reset] Penger tilbake for salg: [gray]%moneyback% (%moneybackpercent%% av prisen)."
|
||||
info-regionMoneyBackBuyClick:
|
||||
- "[darkgreen][bold]►[reset] "
|
||||
- "[bold]Penger tilbake etter salg[/bold]"
|
||||
- " hover: Selg %region% å få igjen %moneyback%"
|
||||
- " hover: %lang:action|Sell %region%|%"
|
||||
- " kommando: /areashop sell %region%"
|
||||
- ": [gray]%moneyback% (%moneybackpercent%% av prisen)."
|
||||
info-regionMoneyBackRent: "[darkgreen][bold]►[reset] Penger tilbake fra leie: [gray]%moneyback% (%moneybackpercent%% fra gjenstående tid)."
|
||||
info-regionMoneyBackRentClick:
|
||||
- "[darkgreen][bold]►[reset] "
|
||||
- "[bold]Penger tilbake fra leie[/bold]"
|
||||
- " hover: Stopp leie %region% å få tilbake %moneyback%"
|
||||
- " hover: %lang:action|Unrent %region%|%"
|
||||
- " kommando: /areashop unrent %region%"
|
||||
- ": [gray]%moneyback% (%moneybackpercent%% av gjenstående tid)."
|
||||
info-regionMaxExtends: "[darkgreen][bold]►[reset] Maks antall utvidelser: [gray]%maxextends% gang(er)."
|
||||
info-regionNoExtending: "[darkgreen][bold]►[reset] Leien kan ikke utvides."
|
||||
info-regionExtendsLeft: "[darkgreen][bold]►[reset] Utvidelser igjen: [gray]%extendsleft% gang(er) av %maxextends%."
|
||||
info-regionMaxRentTime: "[darkgreen][bold]►[reset] Leie på forhånd: [gray]%maxrenttime% på maks."
|
||||
info-prefix: "[darkgreen][bold]►[reset] "
|
||||
info-regionTeleport:
|
||||
- "[bold]Gå til region[/bold]"
|
||||
- " hover: %lang:action|Teleporter to %region%|%"
|
||||
- " kommando: /areashop tp %region%"
|
||||
info-setRegionTeleport:
|
||||
- "[bold]Sett teleporterings posisjon[/bold]"
|
||||
- " hover: %region%"
|
||||
- " hover: %lang:action|Sett teleporterings posisjon|%"
|
||||
- " kommando: /areashop settp %region%"
|
||||
info-regionSigns: "[darkgreen][bold]►[reset] Koblete skilt: [gray]%0%."
|
||||
info-regionSignLocation: "[gray](%0%, %1%, %2%, %3%)[reset]"
|
||||
info-regionGroups: "[darkgreen][bold]►[reset] Fordelte grupper: [gray]%0%."
|
||||
info-regionInactiveUnrent: "[darkgreen][bold]►[reset] Automatisk stopp leie etter: [gray]%inactivetime% av inaktivitet fra spiller."
|
||||
info-regionInactiveSell: "[darkgreen][bold]►[reset] Automatisk selg etter: [gray]%inactivetime% av inaktivitet fra spiller."
|
||||
info-regionRestrictedRegionRent: "[darkgreen][bold]►[reset] Du må stå på innsiden av %lang:region% for å leie den."
|
||||
info-regionRestrictedWorldRent: "[darkgreen][bold]►[reset] Du må være i '%world%' for å leie %lang:region%."
|
||||
info-regionRestrictedRegionBuy: "[darkgreen][bold]►[reset] Du må være på innsiden av %lang:region% for å kjøpe den."
|
||||
info-regionRestrictedWorldBuy: "[darkgreen][bold]►[reset] Du må være i '%world%' for å kjøpe %lang:region%."
|
||||
info-regionRestoringRent: "[darkgreen][bold]►[reset] Gjenoppretting er aktivert [gray](regionen vil gjenopprettes ved stopp av leie)%0%."
|
||||
info-regionRestoringBuy: "[darkgreen][bold]►[reset] Gjenoppretting er aktivert [gray](regionen vil gjenopprettes ved salg)%0%."
|
||||
info-regionRestoringProfile: "(profil: %0%)"
|
||||
info-regionLandlord: "[darkgreen][bold]►[reset] Grunneier: [gray]%lang:landlord% (mottar pengene)."
|
||||
info-regionNotExisting: "Den spesifiserte regionen er ikke registrert: %0%."
|
||||
|
||||
setrestore-help: "/as setrestore <region> <true|false|general> [profile]."
|
||||
setrestore-noPermission: "Du har ikke rettigheter til å endre gjenopprettelses instillingene."
|
||||
setrestore-notRegistered: "Den spesifiserte regionen er ikke registrert: %0%."
|
||||
setrestore-invalidSetting: "'%0%' er ikke gyldig uttrykk, skal være true, false eller general."
|
||||
setrestore-success: "Vellykket satt innstillingene for gjenoppretting for %lang:region% til '%0%'."
|
||||
setrestore-successProfile: "Vellykket satt innstillingene for gjenoppretting for %lang:region% til '%0%' og profilen til '%1%'."
|
||||
|
||||
setprice-noPermission: "Du har ikke rettighetene til å endre prisen til en region."
|
||||
setprice-help: "/as setprice <pris> [region], den regionen du står i vil bli valgt om ikke spesifisert."
|
||||
setprice-notRegistered: "Den spesifiserte regionen er ikke registrert: %0%."
|
||||
setprice-wrongPrice: "'%0%' er ikke en gyldig pris."
|
||||
setprice-successRent: "Prisen til region %lang:region% er endret til %price% per %duration%."
|
||||
setprice-successBuy: "Prisen til region %lang:region% er endret til %price%."
|
||||
setprice-successRemoved: "Prisen til %lang:region% har blitt fjernet, den vil nå bruke prisen fra en gruppe eller fra default.yml filen, ny pris: %price%."
|
||||
setprice-noLandlord: "Du har ikke rettigheter til å endre prisen fordi du er ikke eieren av %lang:region%."
|
||||
|
||||
setduration-noPermission: "Du har ikke rettigheter til å endre tidsrommet for en leie."
|
||||
setduration-help: "/as setduration <mengde> <identifisering> [region], regionen du står i vil bli brukt om ikke spesifisert."
|
||||
setduration-notRegistered: "%0% er ikke registrert for leie."
|
||||
setduration-wrongAmount: "'%0%' er ikke gyldig, bruk hele nummer."
|
||||
setduration-wrongFormat: "'%0%' er ikke et riktig tidsformat, sjekk dokumentasjonen på Bukkit."
|
||||
setduration-success: "Tiden til region %lang:region% er endret til '%duration%'."
|
||||
setduration-noLandlord: "Du har ikke rettigheter til å endre tiden fordi du er ikke eieren av %lang:region%."
|
||||
setduration-successRemoved: "Prisen til %lang:region% har blitt fjernet, den vil nå bruke prisen fra en gruppe eller fra default.yml filen, ny pris: %price%."
|
||||
|
||||
setup-noRegion: "Du spesifiserte ikke en region på linje nummer to."
|
||||
setup-alreadyRentSign: "Regionen du spesifiserte er allerede lagt til i AreaShop som en leie region, plasser et skilt med [as] på første linjen eller bruk '/as addsign'."
|
||||
setup-alreadyBuySign: "Regionen du spesifiserte er allerede lagt til i AreaShop som en kjøp region, plasser et skilt med [as] på første linjen eller bruk '/as addsign'."
|
||||
setup-noDuration: "Du spesifiserte ikke hvor lenge den regionen kan bli leid, gjør dette på den tredje linjen."
|
||||
setup-wrongDuration: "Tiden du spesifiserte er ikke i korrekt format, eksempel: 1 dag."
|
||||
setup-noPrice: "Du spesifiserte ikke prisen på den fjerde linjen."
|
||||
setup-wrongPrice: "Du spesifiserte ikke prisen riktig, bare bruk nummer."
|
||||
setup-rentSuccess: "leie av region %lang:region% er satt opp riktig."
|
||||
setup-buySuccess: "Salg av region %lang:region% er satt opp riktig."
|
||||
setup-noPermissionRent: "Du har ikke rettigheter til å sette opp leie regioner."
|
||||
setup-noPermissionBuy: "Du har ikke rettigheter til å sette opp regioner til salgs."
|
||||
setup-couldNotDetect: "Fant flere regioner med samme prioritet og/eller foreldre/barn kobling, spesifiser en på den andre linjen (2 av regionene som ble funnet: %lang:tRegion|%0%|% og %lang:tRegion|%1%|%)."
|
||||
setup-blacklisted: "%0% er på svartelisten og kan ikke bli lagt til i AreaShop."
|
||||
setup-noPermission: "Du kan ikke legge til regionen '%0%', du er ikke en eier/medlem eller har ikke rettigheter til det."
|
||||
|
||||
destroy-noPermissionRent: "Du har ikke rettigheter til å avregistrere en leie region."
|
||||
destroy-noPermissionBuy: "Du har ikke rettigheter til å avregistrere en kjøpe region."
|
||||
destroy-successRent: "%lang:region% vellykket i å avregistrere en leie region."
|
||||
destroy-successBuy: "%lang:region% vellykket i å avregistrere en kjøpe region."
|
||||
|
||||
teleport-help: "/as tp <region> [skilt]"
|
||||
teleport-noRentOrBuy: "Den spesifiserte regionen er ikke registrert: %0%."
|
||||
teleport-noPermission: "Du har ikke rettigheter til å teleportere til din region."
|
||||
teleport-noPermissionOther: "Du har ikke rettigheter til å teleportere til regioner du ikke eier."
|
||||
teleport-noPermissionSign: "Du har ikke rettigheter til å teleportere til skiltet til din region."
|
||||
teleport-noPermissionOtherSign: "Du har ikke rettigheter til å teleportere til skiltet til regioner du ikke eier."
|
||||
teleport-noPermissionFriend: "Du har ikke rettigheter til å teleportere til regioner du er langt til som venn."
|
||||
teleport-noPermissionFriendSign: "Du har ikke rettigheter til å teleportere til skiltet til regioner du er lagt til som venn."
|
||||
teleport-success: "Du teleporterte til %lang:region%."
|
||||
teleport-successSign: "Du teleporterte til skiltet til %lang:region%."
|
||||
teleport-noSafe: "Ingen trygg posisjon funnet i %lang:region%, ingen plasser igjen i regionen eller maks forsøk overskredet (%0%/%1%)."
|
||||
teleport-blocked: "Du kan ikke teleportere fordi posisjonen er på utsiden av regionen, og du er tvunget til å teleportere til innsiden."
|
||||
teleport-changedToSign: "Du har bare rettigheter til å teleportere til skilt og ikke utsiden av regionen, teleporterer til skilt."
|
||||
teleport-changedToNoSign: "Ingen skilt tilgjengelige å teleportere til, prøver å teleportere til innsiden av regionen."
|
||||
|
||||
setteleport-help: "/as settp [region] [reset], den regionen du står i vil bli brukt om ikke spesifisert."
|
||||
setteleport-noPermission: "Du har ikke rettigheter til å sette teleporterings punkt."
|
||||
setteleport-noPermissionOther: "Du har ikke rettigheter til å sette teleporterings punktet for en region du ikke eier."
|
||||
setteleport-noRentOrBuy: "Den spesifiserte regionen er ikke registrert: %0%."
|
||||
setteleport-success: "Teleporterings posisjon for %lang:region% satt."
|
||||
setteleport-notInside: "Punktet må være på innsiden av regionen."
|
||||
setteleport-reset: "Teleporterings posisjon for %lang:region% har blitt resatt."
|
||||
|
||||
find-help: "/as find <buy|rent> [maxpris] [gruppe]."
|
||||
find-noPermission: "Du har ikke rettigheter til å søke etter regioner og teleportere til dem."
|
||||
find-success: "Fant en %0% region: %lang:region%, under søket med en makspris av din balanse: %1%%2%."
|
||||
find-successMax: "Fant en %0% region: %lang:region%, under søket med en makspris av: %1%%2%."
|
||||
find-wrongMaxPrice: "Den spesifiserte maks prisen er ikke et korrekt nummer. %0%"
|
||||
find-wrongGroup: "Den spesifiserte gruppen eksisterer ikke: %0%."
|
||||
find-noneFound: "Ingen %0% region funnet under søket med en makspris av din balanse: %1%%2%."
|
||||
find-noneFoundMax: "Ingen %0% region ble funnet under søket med en maks pris av %1%%2%."
|
||||
find-onlyInGroup: ", bare søkt etter regioner i gruppe: %0%."
|
||||
|
||||
groupadd-help: "/as groupadd <gruppe> [region], hvis ingen region er spesifisert blir alle regioner fra din WorldEdit markering brukt."
|
||||
groupadd-noPermission: "Du har ikke rettigheter til å legge til regioner i grupper."
|
||||
groupadd-success: "Region %lang:region% har blitt lagt til i gruppe '%0%', denne gruppen har nå %1% medlem(mer)."
|
||||
groupadd-failed: "Region %lang:region% er allerede et medlem av gruppe '%0%'."
|
||||
groupadd-weSuccess: "Lagt til i gruppe %0%: [gray]%1%."
|
||||
groupadd-weFailed: "Var allerede i gruppe %0%: [gray]%1%."
|
||||
|
||||
groupdel-help: "/as groupdel <gruppe> [region], hvis ingen region er spesifisert blir alle regioner fra din WorldEdit markering brukt."
|
||||
groupdel-noPermission: "Du har ikke rettigheter til å fjerne regioner fra grupper."
|
||||
groupdel-success: "Region %lang:region% har blitt fjernet fra gruppe '%0%', denne gruppen har nå %1% medlem(mer)."
|
||||
groupdel-failed: "Region %lang:region% er ikke et medlem av gruppe '%0%'."
|
||||
groupdel-weSuccess: "Fjernet fra gruppe %0%: [gray]%1%."
|
||||
groupdel-weFailed: "Var ikke i gruppe %0% likevel: [gray]%1%."
|
||||
|
||||
grouplist-noPermission: "Du har ikke rettigheter til å vise de registrerte gruppene."
|
||||
grouplist-noGroups: "Det er for øyeblikket ingen grupper registrert."
|
||||
grouplist-success: "De følgende gruppene er registrert: [gray]%0%."
|
||||
|
||||
groupinfo-help: "/as groupinfo <group>."
|
||||
groupinfo-noPermission: "Du har ikke rettigheter til å se informasjon om en gruppe."
|
||||
groupinfo-noGroup: "Det er ingen grupper registrert med navnet '%0%'. bruk /as grouplist for å sjekke grupper."
|
||||
groupinfo-members: "De følgende regionene er medlemmer av gruppe %0%: [gray]%1%."
|
||||
groupinfo-noMembers: "Gruppe %0% har ingen medlemmer."
|
||||
|
||||
schemevent-help: "/as schemevent <region> <created|deleted|rented|unrented|bought|sold>."
|
||||
schemevent-wrongEvent: "Det spesifiserte eventet '%0%' eksisterer ikke, bruk en av de følgende [gray]%1%."
|
||||
schemevent-success: "Event '%0%' har blitt aktivert vellykket for region %lang:region%."
|
||||
schemevent-noPermission: "Du har ikke rettigheter til å aktivere et schematic event."
|
||||
|
||||
add-help: "/as add <rent|buy> [region] [verden]."
|
||||
add-noPermission: "Du har ikke rettigheter til å legge til en region i AreaShop."
|
||||
add-success: "Lagt til som %0%: [gray]%1%."
|
||||
add-failed: "Allerede registrert: [gray]%0%."
|
||||
add-blacklisted: "På svartelisten: [gray]%0%."
|
||||
add-specifyWorld: "Spesifiser verdenen til en region når du bruker konsoll."
|
||||
add-incorrectWorld: "Verden '%0%' ikke funnet, prøv igjen (sensitiv for store og små bokstaver)."
|
||||
add-noRegion: "WorldGuard region '%0%' eksisterer ikke i denne verdenen."
|
||||
add-noPermissionRegions: "Ingen rettigheter til å legge til: [gray]%0%."
|
||||
add-noPermissionOwnerMember: "[gray]Du er enten ikke et medlem/eier av disse regionene eller har ikke rettigheter til å legge til dine regioner."
|
||||
|
||||
del-noPermission: "Du har ikke rettigheter til å fjerne regioner."
|
||||
del-success: "Fjernet regioner: [gray]%0%."
|
||||
del-failed: "Du har ikke rettigheter til å fjerne eller ikke registrert: [gray]%0%."
|
||||
|
||||
addsign-help: "/as addsign [region] [profil]."
|
||||
addsign-noSign: "Du ser ikke på et skilt."
|
||||
addsign-noRegions: "Ingen region funnet rundt skiltet sin posisjon."
|
||||
addsign-couldNotDetect: "Flere regioner ble funnet rundt skiltet, spesifiser region som ekstra argument (2 av regionene som ble funnet: %lang:tRegion|%0%|% og %lang:tRegion|%1%|%)."
|
||||
addsign-couldNotDetectSign: "Flere regioner ble funnet rundt skiltet, spesifiser region som ekstra argument (2 av regionene som ble funnet: %lang:tRegion|%0%|% og %lang:tRegion|%1%|%)."
|
||||
addsign-wrongProfile: "Den spesifiserte profilen finnes ikke, bruk en av de følgende (sjekk konfigurasjon): [gray]%0%."
|
||||
addsign-profile:
|
||||
- "[bold]%0%[/bold]"
|
||||
- " hover: Skiltprofil %0%"
|
||||
- " hover: %lang:action|Use this profile|%"
|
||||
- " kommando: /areashop linksigns %0%"
|
||||
addsign-success: "Skiltet har blitt lagt til %lang:region%."
|
||||
addsign-successProfile: "Skiltet har blitt lagt til %lang:region% med profil %0%."
|
||||
addsign-alreadyRegistered: "Det skiltet er allerede registrert for region %lang:region%."
|
||||
addsign-noPermission: "Du har ikke rettigheter til å legge til et skilt."
|
||||
|
||||
delsign-noSign: "Du ser ikke på et skilt."
|
||||
delsign-noPermission: "Du har ikke rettigheter til å fjerne et skilt."
|
||||
delsign-noRegion: "Det skiltet hører ikke til en AreaShop region."
|
||||
delsign-success: "Skiltet har blitt fjernet fra region %land:region%."
|
||||
|
||||
me-noPermission: "Du har ikke rettigheter til å sjekke hvilken regioner du har."
|
||||
me-header: "Regioner til %lang:tPlayer|%0%|%:"
|
||||
me-notAPlayer: "Du er ikke en spiller så du kan ikke ha noen regioner."
|
||||
me-buyLine: "[darkgreen][bold]►[reset] %lang:region%."
|
||||
me-nothing: "%lang:tPlayer|%0%|% har ikke leid eller kjøpt regioner og er ikke lagt til som venn på noen."
|
||||
me-noPlayer: "%0% kan ikke bli funnet, mest sannsynlig aldri vært på serveren."
|
||||
|
||||
setowner-help: "/as setowner <spiller> [region], regionen du står i vil bli brukt om ikke spesifisert."
|
||||
setowner-noPermission: "Du har ikke rettigheter til å sette eieren av en region."
|
||||
setowner-noPermissionRent: "Du har ikke rettigheter til å sette eieren av en leie region."
|
||||
setowner-noPermissionBuy: "Du har ikke rettigheter til å sette eieren av en kjøpe region."
|
||||
setowner-notRegistered: "Den spesifiserte regionen er ikke registrert, eier kan ikke bli satt."
|
||||
setowner-noPlayer: "Kunne ikke skaffe UUID til den spesifiserte spilleren: %0%."
|
||||
setowner-succesRent: "Eier av %lang:region% vellykket endret til %lang:player%, leid frem til %until% (%timeleft% igjen)"
|
||||
setowner-succesRentExtend: "Eier var allerede %lang:player%, leie utvidet med '%duration%', nå leid frem til %until% (%timeleft% igjen)."
|
||||
setowner-succesBuy: "Eier av %lang:region% vellykket endret til %lang:player%."
|
||||
|
||||
resell-help: "/as resell <pris> [region], regionen du står i vil bli brukt om ikke spesifisert."
|
||||
resell-wrongPrice: "'%0%' er ikke en gyldig pris."
|
||||
resell-notRegistered: "Den spesifiserte regionen er ikke registrert: %0%."
|
||||
resell-notBought: "Du kan ikke videreselge %lang:region% fordi den er ikke solgt ennå."
|
||||
resell-success: "%lang:region% er vellykket satt i videresalgsmodus for %resellprice%."
|
||||
resell-noPermission: "Du har ikke rettigheter til å sette din region i videresalgs modus."
|
||||
resell-noPermissionOther: "Du har ikke rettigheter til å sette en region i videresalgs modus."
|
||||
|
||||
stopresell-help: "/as stopresell [region], regionen du står i vil bli brukt om ikke spesifisert."
|
||||
stopresell-notRegistered: "Den spesifiserte regionen er ikke registrert: %0%."
|
||||
stopresell-notResell: "Du kan ikke stoppe videresalget av %lang:region% fordi den er ikke i videresalgs modus."
|
||||
stopresell-success: "%lang:region% er vellykket satt tilbake i solgt modus."
|
||||
stopresell-noPermission: "Du har ikke rettigheter til å sette din region tilbake i solgt modus."
|
||||
stopresell-noPermissionOther: "Du har ikke rettigheter til å sette regioner tilbake i solgt modus."
|
||||
|
||||
addfriend-help: "/as addfriend <spiller> [region], regionen du står i vil bli brukt om ikke spesifisert."
|
||||
addfriend-noPermissionOther: "Du har ikke rettigheter til å legge til venner i regioner som ikke er dine."
|
||||
addfriend-noPermission: "Du har ikke rettigheter til å legge til venner i din region."
|
||||
addfriend-successOther: "%lang:tPlayer|%0%|% har blitt lagt til som venn i region %lang:region%."
|
||||
addfriend-success: "%lang:tPlayer|%0%|% har blitt lagt til som venn i din region %lang:region%."
|
||||
addfriend-alreadyAdded: "%lang:tPlayer|%0%|% er allerede lagt til som venn i %lang:region%."
|
||||
addfriend-self: "Å legge til eieren av regionen som venn vil være meningsløst."
|
||||
addfriend-noOwner: "Du kan ikke legge til venner i en region uten eier."
|
||||
addfriend-notVisited: "Du kan ikke legge til %0% fordi h*n har ikke vært på serveren ennå."
|
||||
|
||||
delfriend-help: "/as delfriend <spiller> [region], regionen du står i vil bli brukt om ikke spesifisert."
|
||||
delfriend-noPermissionOther: "Du har ikke rettigheter til å fjerne venner fra regioner som ikke er dine."
|
||||
delfriend-noPermission: "Du har ikke rettigheter til å fjerne venner fra din region."
|
||||
delfriend-successOther: "%lang:tPlayer|%0%|% har blitt fjernet som venn fra region %lang:region%."
|
||||
delfriend-success: "%lang:tPlayer|%0%|% har blitt fjernet som venn fra din region %lang:region%."
|
||||
delfriend-noOwner: "Du kan ikke fjerne venner fra en region uten eier."
|
||||
|
||||
linksigns-multipleRegions: "Fant flere regioner: [gray]%0%."
|
||||
linksigns-multipleRegionsAdvice: "Klikk en gang til for å prøve igjen eller bruk '/as linksigns' for å stoppe."
|
||||
linksigns-noRegions: "Ingen AreaShop regioner funnet i rettningen du peker, vær sikker på at regionen er lagt til i AreaShop [gray](maksimal avstand 100 blokker)."
|
||||
linksigns-regionFound: "Region %lang:region% har blitt funnet, nå pek på et skilt og venstreklikk for å koble sammen."
|
||||
linksigns-signFound: "Fant et skilt ved (%0%, %1%, %2%), nå pek mot en region og høyreklikk for å koble sammen."
|
||||
linksigns-noSign: "Ingen skilt funnet i rettningen du peker, vær sikker på at du har en ublokkert vei mot et skilt og klikk igjen [gray](maksimal avstand 100 blokker)."
|
||||
linksigns-alreadyRegistered: "Det skiltet er allerede registrert til region %lang:region%, klikk igjen for å velge et annet skilt."
|
||||
linksigns-first: "Du har aktivert skilt koblings modus."
|
||||
linksigns-next: "[gray]Ventstreklikk for å velge et skilt, høyreklikk for å velge en region, bruk /as linksigns for å stoppe."
|
||||
linksigns-noPermission: "Du har ikke rettigheter til å aktivere masse-skilt koblings modus."
|
||||
linksigns-stopped: "Gått ut av skilt koblings modus."
|
||||
|
||||
stack-help:
|
||||
- "/as stack <amount> <gap> <name> <rent|buy> [group].[break]"
|
||||
- " [gray]<amount> Antall regioner som vil bli laget.[break]"
|
||||
- " [gray]<gap> Antall blokker mellom regioner.[break]"
|
||||
- " [gray]<name> Navnet på regioner (nummer kommer bak).[break]"
|
||||
- " [gray]<rent|buy> Bestem om dem skal leies eller kjøpes.[break]"
|
||||
- " [gray][group] En gruppe du vil legge dem til i.[break]"
|
||||
- " [gray]Regionene vil bli laget i rettningen du ser."
|
||||
stack-accepted: "Begynner å lage %0% %1% regioner med %2% blokker mellom dem, navnene starter med %3% og vil ha nummer bak seg.%4%"
|
||||
stack-addToGroup: "Regioner laget vil bli lagt til i gruppen '%0%'."
|
||||
stack-noPermission: "Du har ikke rettigheter til å lage og legge til regioner i AreaShop i store mengder."
|
||||
stack-wrongAmount: "'%0%' er ikke en riktig mengde regioner."
|
||||
stack-wrongGap: "'%0%' er ikke et riktig nummer for antall blokker mellom regioner."
|
||||
stack-noSelection: "Du har ikke laget en markering som indikerer hvor den første regionen skal bli laget."
|
||||
stack-addStart: "[gray]Legger til %0% regioner på %1% per sekund."
|
||||
stack-addComplete: "[gray]Regioner er ferdig lagt til."
|
||||
stack-unclearDirection: "Du må se rett mot nord, sør, øst eller vest, du ser mot %0%."
|
||||
|
||||
setlandlord-help: "/as setlandlord <spiller> [region], regionen du står i vil bli brukt om ikke spesifisert."
|
||||
setlandlord-noPermission: "Du har ikke rettigheter til å sette grunneier for en region."
|
||||
setlandlord-success: "%lang:landlord% har vellykket blitt satt som grunneier av %lang:region%."
|
||||
|
||||
message-help: "/as message <spiller> <melding...>"
|
||||
message-noPermission: "Du har ikke rettigheter til å sende AreaShop meldinger."
|
||||
message-notOnline: "%0% er ikke pålogget."
|
||||
|
||||
confirm-rent:
|
||||
- "%lang:prefix%Er du sikker på at du vil leie %lang:tRegion|%0%|%?[break]"
|
||||
- "[darkgreen][bold]►[reset] %lang:button|Klikk for å leie %0%|%"
|
||||
- " hover: %lang:action|Lei %0%|%"
|
||||
- " kommando: /areashop rent %0%"
|
||||
confirm-extend:
|
||||
- "%lang:prefix%Er du sikker du vil forlenge %lang:tRegion|%0%|%?[break]"
|
||||
- "[darkgreen][bold]►[reset] %lang:button|Klikk for å utvide leie %0%|%"
|
||||
- " hover: %lang:action|Utvid leie %0%|%"
|
||||
- " kommando: /areashop rent %0%"
|
||||
confirm-unrent:
|
||||
- "%lang:prefix%Er du sikker du vil stoppe leie "
|
||||
- "%lang:tRegion|%0%|%?[break]"
|
||||
- "[darkgreen][bold]►[reset] %lang:button|Klikk for å stoppe leie %0%|%"
|
||||
- " hover: %lang:action|Stopp leie %0%|%"
|
||||
- " kommando: /areashop unrent %0%"
|
||||
confirm-buy:
|
||||
- "%lang:prefix%Er du sikker du vil kjøpe %lang:tRegion|%0%|%?[break]"
|
||||
- "[darkgreen][bold]►[reset] %lang:button|Klikk for å kjøpe %0%|%"
|
||||
- " hover: %lang:action|Kjøp %0%|%"
|
||||
- " kommando: /areashop buy %0%"
|
||||
confirm-sell:
|
||||
- "%lang:prefix%Er du sikker du vil selge %lang:tRegion|%0%|%?[break]"
|
||||
- "[darkgreen][bold]►[reset] %lang:button|Klikk for å selge %0%|%"
|
||||
- " hover: %lang:action|Selg %0%|%"
|
||||
- " kommando: /areashop sell %0%"
|
||||
|
||||
timeleft-years: "%0% år"
|
||||
timeleft-months: "%0% måneder"
|
||||
timeleft-days: "%0% dager"
|
||||
timeleft-hours: "%0% timer"
|
||||
timeleft-minutes: "%0% minutter"
|
||||
timeleft-second: "%0% sekund"
|
||||
timeleft-seconds: "%0% sekunder"
|
||||
timeleft-ended: "Utløpt"
|
||||
|
||||
greeting-forrent: "%region% kan bli leid for %price% per %duration%."
|
||||
greeting-rented: "%region% er leid av %player% til %until%."
|
||||
greeting-forsale: "%region% kan bli kjøpt for %price%."
|
||||
greeting-bought: "%region% er kjøpt av %player%."
|
||||
greeting-resale: "%region% kan bli kjøpt for %resaleprice% fra %player%."
|
||||
@@ -0,0 +1,499 @@
|
||||
# ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
|
||||
# ║ Language file of the AreaShop plugin created by NLThijs48, Github can be found at https://github.com/NLthijs48/AreaShop ║
|
||||
# ║ Language: Russian, Version: V2.3.2, Percentage translated: 86% ║
|
||||
# ║ This file will be overwritten at each startup/reload of the plugin, if you want to change anything then do the following: ║
|
||||
# ║ 1: Make a copy of this file ║
|
||||
# ║ 2: Rename it to <servername>.yml (don't use a language code as filename, could otherwise be overwritten in future updates) ║
|
||||
# ║ 3: Change the 'language' setting in config.yml to '<servername>', do not include '.yml' ║
|
||||
# ║ 4: Change the strings in the new file to your liking and save the file ║
|
||||
# ║ 5: Use '/as reload' or reload/restart your server to see the changes ║
|
||||
# ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
|
||||
button: "[bold]<%0%>[/bold]"
|
||||
|
||||
command:
|
||||
- "[bold]%0%[/bold]"
|
||||
- " hover: %lang:action|Используй %1%|%"
|
||||
- " command: %1%"
|
||||
|
||||
helpCommand:
|
||||
- "[gold]%0% [gray]-[reset]"
|
||||
- " hover: %lang:action|Используй %0%|%"
|
||||
- " command: %0%"
|
||||
|
||||
region: "%lang:tRegion|%region%|%"
|
||||
|
||||
tRegion:
|
||||
- "[bold]%0%[/bold]"
|
||||
- " hover: Регион %0%"
|
||||
- " hover: %lang:action|Информация о регионе|%"
|
||||
- " command: /areashop info region %0%"
|
||||
|
||||
player: "%lang:tPlayer|%player%|%"
|
||||
|
||||
tPlayer:
|
||||
- "[bold]%0%[/bold]"
|
||||
- " hover: Игрок %0%"
|
||||
- " hover: %lang:action|Регионы %0%|%"
|
||||
- " command: /areashop info player %0%"
|
||||
|
||||
landlord:
|
||||
- "[bold]%landlord%[/bold]"
|
||||
- " hover: Владелец %landlord%"
|
||||
- " hover: %lang:action|Регионы %landlord%|%"
|
||||
- " command: /areashop info player %landlord%"
|
||||
|
||||
total-maximum: "Вы не можете арендовать или купить больше, чем %0% регион(ов) (у вас уже имеется %1% в группе '%2%')."
|
||||
|
||||
general-notReady: "Плагин AreaShop еще не полностью загружен. Пожалуйста, подождите..."
|
||||
general-noWorld: "Вы не можете сделать это, мир для %lang:region% не доступен (мир '%world%')."
|
||||
general-noRegion: "Вы не можете сделать это, WorldGuard регион не доступен (регион %lang:region%)."
|
||||
general-noEconomy: "На сервере нету плагина Экономии, либо он установлен некорректно. Оповестите администратора сервера об этом."
|
||||
general-cancelled: "%0%"
|
||||
|
||||
cmd-notValid: "Ошибка в команде, используй '/as help' для получения дополнительной информации."
|
||||
cmd-onlyByPlayer: "Эта команда может быть применена только игроком. "
|
||||
cmd-weOnlyByPlayer: "Использование выделения доступно только для игроков, укажите название региона в качестве дополнительного аргумента."
|
||||
cmd-noSelection: "Вы не выделили регион."
|
||||
cmd-noRegionsFound: "В выбранной области не найдено регионов, зарегистрированных в AreaShop."
|
||||
cmd-noWERegionsFound: "Внутри вашего выделения не обнаружено регионов."
|
||||
cmd-notRegistered: "Указаный регион не используется в AreaShop: %0%."
|
||||
cmd-noRegionsAtLocation: "В вашем местоположении не найдено регионов, укажите регион в качестве аргумента."
|
||||
cmd-moreRegionsAtLocation: "В вашем местоположении найдено несколько регионов, укажите название региона для уточнения."
|
||||
cmd-automaticRegionOnlyByPlayer: "Автоматическое определение региона доступно только для игроков, укажите регион в качестве аргумента."
|
||||
|
||||
help-header: "Страница помощи. Команды которые Вам доступны."
|
||||
help-noPermission: "У вас нет разрешения для просмотра страницы помощи."
|
||||
help-alias: "Альтернативные команды: /areashop, /as."
|
||||
help-help: "%lang:helpCommand|/as help|% Показать эту страницу помощи."
|
||||
help-info: "%lang:helpCommand|/as info|% Получить информацию о текущих регионах."
|
||||
help-rent: "%lang:helpCommand|/as rent|% Арендовать регион или расширить свою текущую аренду."
|
||||
help-buy: "%lang:helpCommand|/as buy|% Купить регион."
|
||||
help-unrent: "%lang:helpCommand|/as unrent|% Отказаться от аренды региона."
|
||||
help-sell: "%lang:helpCommand|/as sell|% Продать регион."
|
||||
help-reload: "%lang:helpCommand|/as reload|% Перезагрузить все файлы и обновить регионы."
|
||||
help-setrestore: "%lang:helpCommand|/as setrestore|% Включить/выключить восстановление и выбрать профиль."
|
||||
help-setprice: "%lang:helpCommand|/as setprice|% Изменить стоимость региона."
|
||||
help-setduration: "%lang:helpCommand|/as setduration|% Изменить длительность аренды."
|
||||
help-teleport: "%lang:helpCommand|/as tp|% Телепортироваться к вашему купленному/арендованному региону."
|
||||
help-setteleport: "%lang:helpCommand|/as settp|% Установить точку телепортации для региона."
|
||||
help-find: "%lang:helpCommand|/as find|% Найти свободный регион для покупки или аренды."
|
||||
help-groupadd: "%lang:helpCommand|/as groupadd|% Добавить регион в группу."
|
||||
help-groupdel: "%lang:helpCommand|/as groupdel|% Удалить регион из группы."
|
||||
help-grouplist: "%lang:helpCommand|/as grouplist|% Показать все доступные группы."
|
||||
help-groupinfo: "%lang:helpCommand|/as groupinfo|% Показать информацию о группе."
|
||||
help-schemevent: "%lang:helpCommand|/as schemevent|% Вызвать схематическое событие для региона."
|
||||
help-add: "%lang:helpCommand|/as add|% Зарегистрировать регион для аренды или покупки."
|
||||
help-del: "%lang:helpCommand|/as del|% Удалить зарегистрированный регион из AreaShop."
|
||||
help-addsign: "%lang:helpCommand|/as addsign|% Добавить табличку для региона."
|
||||
help-delsign: "%lang:helpCommand|/as delsign|% Удалить табличку на которую вы смотрите."
|
||||
help-me: "%lang:helpCommand|/as me|% Проверить список своих регионов(+истечение аренды)"
|
||||
help-setowner: "%lang:helpCommand|/as setowner|% Установить владельца региона или расширить аренду."
|
||||
help-resell: "%lang:helpCommand|/as resell|% Установить один из Ваших регионов в режим перепродажи."
|
||||
help-stopResell: "%lang:helpCommand|/as stopresell|% Установить Ваш регион обратно в режим продано."
|
||||
help-addFriend: "%lang:helpCommand|/as addfriend|% Добавить друга в ваш регион."
|
||||
help-delFriend: "%lang:helpCommand|/as delfriend|% Удалить друга из вашего региона."
|
||||
help-linksigns: "%lang:helpCommand|/as linksigns|% Используй, чтобы включить режим привязки табличек."
|
||||
help-stack: "%lang:helpCommand|/as stack|% Создание нескольких регионов и добавлением их."
|
||||
help-setlandlord: "%lang:helpCommand|/as setlandlord|% Установить землевладельца в регион."
|
||||
|
||||
rent-help: "/as rent [имярегиона], если не указано имя, будет выбран регион в котором вы находитесь."
|
||||
rent-noPermission: "У вас не прав для аренды данного региона."
|
||||
rent-maximum: "Вы не можете арендовать более %0% региона(ов) (у вас уже есть %1% в группе '%2%')."
|
||||
rent-maximumExtend: "Вы не можете продлить эту аренду, потому что у вас есть более чем %0% регион(ов) (у вас имеется %1% в группе '%2%')."
|
||||
rent-payError: "Что-то пошло не так с оплатой, повторите попытку позже."
|
||||
rent-rented: "Вы арендовали %lang:region% до %until%, вы можете увеличить срок аренды еще раз нажав на табличку или использовать команду /as rent."
|
||||
rent-extended: "Вы продлили свою аренду %lang:region% до %until%."
|
||||
rent-extendedToMax: "Вы не можете арендовать регион %lang:region% до %until% (максимальное время аренды %maxrenttime%)."
|
||||
rent-lowMoneyExtend: "У вас не достаточно денег для продления аренды (у вас %0%, а необходимо %price%)."
|
||||
rent-lowMoneyRent: "У вас не хватает денег для аренды %lang:region% (у вас %0%, а необходимо %price%)."
|
||||
rent-someoneElse: "Кто-то уже арендует регион %lang:region%."
|
||||
rent-notRentable: "Этот регион не доступен для аренды."
|
||||
rent-maxExtends: "Вы не можете продлить аренду на столько (максимум %maxextends%), однако после того как закончится срок аренды вы можете арендовать %lang:region% снова."
|
||||
rent-maxRentTime: "Вы не можете арендовать %lang:region% на такой период, максимальное время аренды %maxrenttime%, вы пытаетесь арендовать на %timeleft%."
|
||||
rent-restrictedToWorld: "Вы должны быть в мире '%world%', чтобы арендовать %lang:region% (вы находитесь в '%0%')."
|
||||
rent-restrictedToRegion: "Вы должны находиться внутри %lang:region% для его аренды."
|
||||
rent-expireWarning: "В вашем регионе %lang:region% закончится арендный срок %timeleft%, вы должны продлить аренду для его сохранения."
|
||||
rent-alreadyAtFull: "%lang:region% уже на уровне или выше максимального времени аренды, вы не можете продлить его еще.."
|
||||
|
||||
buy-help: "/as buy [имярегиона], если не указано имя, будет выбран регион в котором вы находитесь."
|
||||
buy-noPermission: "У Вас нет прав для покупки региона."
|
||||
buy-noPermissionResell: "У Вас нет прав для покупки региона в режиме перепродажи."
|
||||
buy-noPermissionNoResell: "У Вас нет прав для покупки региона, который не находится в режиме перепродажи."
|
||||
buy-notBuyable: "Регион %lang:region% не доступен для покупки."
|
||||
buy-maximum: "Вы не можете купить более %0% региона(ов) (у Вас уже имеется %1% в группе '%2%')"
|
||||
buy-payError: "Что-то пошло не так с оплатой, повторите попытку позже."
|
||||
buy-succes: "Вы успешно купили %lang:region%."
|
||||
buy-successResale: "Вы успешно купили %lang:region% в %lang:tPlayer|%0%|%."
|
||||
buy-successSeller: "Ваш регион %lang:region% был продан %lang:player% за %0%."
|
||||
buy-lowMoney: "У вас недостаточно денег чтобы купить %lang:region% (у вас %0%, а необходимо %price%)."
|
||||
buy-lowMoneyResell: "У вас недостаточно денег чтобы купить %lang:region% (у вас %0%, а необходимо %resellprice%)."
|
||||
buy-yours: "Вы уже владелец %lang:region%."
|
||||
buy-someoneElse: "Кто-то уже купил %lang:region%."
|
||||
buy-restrictedToWorld: "Вы должны быть в мире '%world%', чтобы купить %lang:region% (вы находитесь в '%0%')."
|
||||
buy-restrictedToRegion: "Вы должны находиться внутри %lang:region% для его покупки."
|
||||
|
||||
unrent-help: "/as unrent [имярегиона], если не указано имя, будет выбран регион в котором вы находитесь."
|
||||
unrent-noPermission: "У вас нет разрешения на снятие аренды в регионе."
|
||||
unrent-noPermissionOther: "У вас нет разрешения на снятие аренды в другом регионе."
|
||||
unrent-notRegistered: "В регионе недоступно снятие аренды, потому что он не зарегистрирован для сдачи в аренду."
|
||||
unrent-notRented: "В регионе нельзя снять аренду, потому что он не арендован."
|
||||
unrent-unrented: "%lang:region% теперь не арендует %lang:player%."
|
||||
unrent-expired: "Ваша аренда %lang:region% уже истекла."
|
||||
|
||||
sell-help: "/as sell [имярегиона], если не указано имя, будет выбран регион в котором вы находитесь."
|
||||
sell-notRegistered: "Этот регион не может быть продан, так как он не зарегистрирован на продажу."
|
||||
sell-notBought: "Этот регион не может продан, так как не находится в чьей-либо собственности."
|
||||
sell-sold: "%lang:region% был продан %lang:player%."
|
||||
sell-noPermission: "У Вас нет прав для продажи региона."
|
||||
sell-noPermissionOther: "У Вас нет прав для продажи другого региона."
|
||||
|
||||
reload-reloading: "Все файлы перезагружены, проверка аренд и обновление регионов."
|
||||
reload-updateStart: "[gray]Обновление %0% регионов за %1% секунд."
|
||||
reload-updateComplete: "[gray]Обновление регионов завершено."
|
||||
reload-noPermission: "Недостаточно полномочий для того, чтобы перезагрузить конфиги плагина."
|
||||
reload-updateCommandChanged: "'/as updaterents' и '/as updatebuys' были удалены, '/as reload' теперь будет также обновлять регионы, используйте эту команду взамен."
|
||||
|
||||
info-help:
|
||||
- "/as info[break]"
|
||||
- " %lang:command|all|/as info all|%[break]"
|
||||
- " %lang:command|rented|/as info rented|% [group] [page][break]"
|
||||
- " %lang:command|forrent|/as info forrent|% [group] [page][break]"
|
||||
- " %lang:command|sold|/as info sold|% [group] [page][break]"
|
||||
- " %lang:command|forsale|/as info forsale|% [group] [page][break]"
|
||||
- " %lang:command|reselling|/as info reselling|% [group] [page][break]"
|
||||
- " %lang:command|nogroup|/as info nogroup [page]|%"
|
||||
- " %lang:command|region|/as info region|% [region][break]"
|
||||
info-noPermission: "У Вас нет прав для получения информации о регионах."
|
||||
info-allHeader: "Все регионы%0%:"
|
||||
info-rentedHeader: "Арендовано регионов%0%:"
|
||||
info-forrentHeader: "Регионы для аренды%0%:"
|
||||
info-forsaleHeader: "Регионы для продажи%0%:"
|
||||
info-soldHeader: "Продано регионов%0%:"
|
||||
info-resellingHeader: "Перепродано регионов%0%:"
|
||||
info-nogroupHeader: "Регионы без групп%0%:"
|
||||
info-limitedToGroup: "(ограничение в группе %0%)"
|
||||
info-nogroupNone: "Здесь нет регионов без групп."
|
||||
info-noFiltergroup: "Группа '%0%' не существует, потому не может быть использована для ограничения результатов."
|
||||
info-noRegions: "Нет найденых регионов."
|
||||
info-wrongPage: "%0% неверный номер страницы."
|
||||
info-pageNoPrevious:
|
||||
- " [darkgray][bold]◄Предыдущая[/bold] "
|
||||
- " hover: Это первая страница"
|
||||
info-pageNoNext:
|
||||
- " [darkgray][bold]Следующая►[/bold]"
|
||||
- " hover: Это последняя страница"
|
||||
info-playerHelp: "/as info player <имяигрока>."
|
||||
info-playerRents: "Регионы арендованные %lang:tPlayer|%0%|%: [gray]%1%"
|
||||
info-playerNoRents: "%lang:tPlayer|%0%|% не арендовал регион."
|
||||
info-playerBuys: "Регионы купленые %lang:tPlayer|%0%|%: [gray]%1%."
|
||||
info-playerNoBuys: "%lang:tPlayer|%0%|% не покупал регион."
|
||||
info-regionHelp: "/as info region [имярегиона], если не указано имя, будет выбран регион в котором вы стоите."
|
||||
info-regionHeaderRent: "[darkgreen]Информация о %lang:region%:"
|
||||
info-regionHeaderBuy: "[darkgreen]Информация о %lang:region%:"
|
||||
info-regionRented: "[darkgreen][bold]►[reset] Арендован игроком %lang:player% до: [gray]%until%."
|
||||
info-regionBought: "[darkgreen][bold]►[reset] Куплено %lang:player%."
|
||||
info-regionReselling: "[darkgreen][bold]►[reset] Купленный %lang:player%, сейчас продаётся."
|
||||
info-regionExtending:
|
||||
- "[darkgreen][bold]►[reset] "
|
||||
- "[bold]Продление для[/bold]"
|
||||
- " hover: Продлить аренду %region%"
|
||||
- " hover: длительностью %duration% за %price%"
|
||||
- " hover: %lang:action|Продлить аренду %region%|%"
|
||||
- " command: /areashop rent %region%"
|
||||
- ": [gray]%price% на %duration%."
|
||||
info-regionCanBeRented:
|
||||
- "[darkgreen][bold]►[reset] "
|
||||
- "[bold]Аренда для[/bold]"
|
||||
- " hover: Арендовать %region% за %price% на %duration%"
|
||||
- " hover: %lang:action|Аренда %region%|%"
|
||||
- " command: /areashop rent %region%"
|
||||
- ": [gray]%price% на %duration%."
|
||||
info-regionCanBeBought:
|
||||
- "[darkgreen][bold]►[reset] "
|
||||
- "[bold]Купить для[/bold]"
|
||||
- " hover: Купить %region% за %price%"
|
||||
- " hover: %lang:action|Купить %region%|%"
|
||||
- " command: /areashop buy %region%"
|
||||
- ": [gray]%price%."
|
||||
info-regionReselPrice: "[darkgreen][bold]►[reset] Стоимость перепродажи: [gray]%resellprice% (вы можете купить его у %lang:player%)."
|
||||
info-regionFriends: "[darkgreen][bold]►[reset] Добавленные друзья: [gray]%0%."
|
||||
info-friend: "%lang:tPlayer|%0%|%"
|
||||
info-friendRemove:
|
||||
- "%lang:info-friend|%0%|%"
|
||||
- "[red]✕[gray]"
|
||||
- " hover: Регион %region%"
|
||||
- " hover: %lang:action|Удалить %0% из друзей|%"
|
||||
- " command: /areashop delfriend %0% %region%"
|
||||
info-regionMoneyBackBuy: "[darkgreen][bold]►[reset] Окупаемость продажи: [gray]%moneyback% (%moneybackpercent%% от стоимости)."
|
||||
info-regionMoneyBackBuyClick:
|
||||
- "[darkgreen][bold]►[reset] "
|
||||
- "[bold]Окупаемость продажи[/bold]"
|
||||
- " hover: Продать %region% и получить обратно %moneyback%"
|
||||
- " hover: %lang:action|Продать %region%|%"
|
||||
- " command: /areashop sell %region%"
|
||||
- ": [gray]%moneyback% (%moneybackpercent%% от стоимости)."
|
||||
info-regionMoneyBackRent: "[darkgreen][bold]►[reset] Окупаемость снятия аренды: [gray]%moneyback% (%moneybackpercent%% от оставшиеся времени)."
|
||||
info-regionMoneyBackRentClick:
|
||||
- "[darkgreen][bold]►[reset] "
|
||||
- "[bold]Окупаемость снятия аренды[/bold]"
|
||||
- " hover: Снять аренду %region% и вернуть деньги %moneyback%"
|
||||
- " hover: %lang:action|Снять аренду %region%|%"
|
||||
- " command: /areashop unrent %region%"
|
||||
- ": [gray]%moneyback% (%moneybackpercent%% от оставшиеся времени)."
|
||||
info-regionMaxExtends: "[darkgreen][bold]►[reset] Максимальное количество продления: [gray]%maxextends% раз(а)."
|
||||
info-regionNoExtending: "[darkgreen][bold]►[reset] Аренду нельзя продлить."
|
||||
info-regionExtendsLeft: "[darkgreen][bold]►[reset] Продленный осталось: [gray]%extendsleft% времени(раз) из %maxextends%."
|
||||
info-regionMaxRentTime: "[darkgreen][bold]►[reset] пред заказ аренды: [gray]%maxrenttime% максимальный."
|
||||
info-prefix: "[darkgreen][bold]►[reset] "
|
||||
info-regionTeleport:
|
||||
- "[bold]Переместится к региону[/bold]"
|
||||
- " hover: %lang:action|Телепортация на %region%|%"
|
||||
- " command: /areashop tp %region%"
|
||||
info-setRegionTeleport:
|
||||
- "[bold]установка места телепортации[/bold]"
|
||||
- " hover: %region%"
|
||||
- " hover: %lang:action|Set teleport location|%"
|
||||
- " command: /areashop settp %region%"
|
||||
info-regionSigns: "[darkgreen][bold]►[reset] Подключенные таблички: [gray]%0%."
|
||||
info-regionSignLocation: "[gray](%0%, %1%, %2%, %3%)[reset]"
|
||||
info-regionGroups: "[darkgreen][bold]►[reset] Назначенные группы: [gray]%0%."
|
||||
info-regionInactiveUnrent: "[darkgreen][bold]►[reset] Авто снятие аренды после: [gray]%inactivetime% бездействия игрока."
|
||||
info-regionInactiveSell: "[darkgreen][bold]►[reset] Авто продажа после: [gray]%inactivetime% бездействия игрока."
|
||||
info-regionRestrictedRegionRent: "[darkgreen][bold]►[reset] Ты должен быть внутри %lang:region% для его аренды."
|
||||
info-regionRestrictedWorldRent: "[darkgreen][bold]►[reset] Ты должен быть в мире '%world%' для аренды %lang:region%."
|
||||
info-regionRestrictedRegionBuy: "[darkgreen][bold]►[reset] Ты должен быть внутри %lang:region% для его покупки."
|
||||
info-regionRestrictedWorldBuy: "[darkgreen][bold]►[reset] Ты должен быть в мире '%world%' для покупки %lang:region%."
|
||||
info-regionRestoringRent: "[darkgreen][bold]►[reset] Восстановление включено [gray](регион будет сброшен после снятия аренды)%0%."
|
||||
info-regionRestoringBuy: "[darkgreen][bold]►[reset] Восстановление включено [gray](регион будет сброшен после продажи)%0%."
|
||||
info-regionRestoringProfile: " (профиль: %0%)"
|
||||
info-regionLandlord: "[darkgreen][bold]►[reset] Землевладелец: [gray]%lang:landlord% (Получит деньги)."
|
||||
info-regionNotExisting: "Указанный регион не зарегистрирован: %0%."
|
||||
|
||||
setrestore-help: "/as setrestore <регион> <true|false|general> [профиль]."
|
||||
setrestore-noPermission: "У вас нет разрешения на изменение параметров восстановления."
|
||||
setrestore-notRegistered: "Указанный регион не зарегистрирован: %0%."
|
||||
setrestore-invalidSetting: "'%0%' не является допустимым значением, должно быть true, false или general."
|
||||
setrestore-success: "Успешно установлен параметр восстановления %lang:region% до '%0%'."
|
||||
setrestore-successProfile: "Успешно установлен параметр восстановления %lang:region% до '%0%' и профиль до '%1%'."
|
||||
|
||||
setprice-noPermission: "У вас нет разрешения на изменение стоимости региона"
|
||||
setprice-help: "/as setprice <price> [имярегиона], если не указано имя, будет выбран регион в котором вы находитесь."
|
||||
setprice-notRegistered: "Указанный регион не зарегистрирован: %0%."
|
||||
setprice-wrongPrice: "'%0%' не допустимая цена."
|
||||
|
||||
setduration-noPermission: "У вас нет разрешения на изменение длительности аренды."
|
||||
setduration-help: "/as setduration <amount> <identifier> [имярегиона], если не указано имя, будет выбран регион в котором вы находитесь."
|
||||
setduration-notRegistered: "%0% не зарегистрирован для сдачи в аренду."
|
||||
|
||||
teleport-help: "/as tp <region> [табличка]."
|
||||
teleport-success: "Вы телепортированы к %lang:region%."
|
||||
teleport-successSign: "Вы телепортированы к табличке возле %lang:region%."
|
||||
teleport-blocked: "Вы не можете телепортироваться, потому что положение находится за пределами региона, и вы вынуждены телепортироваться во внутрь."
|
||||
teleport-changedToSign: "У вас есть только разрешение на телепортироваться к табличке, а не во внутрь региона, телепортация к табличке."
|
||||
teleport-changedToNoSign: "Ни одна табличка не доступна что бы телепортироваться, попытка телепортироваться во внутрь региона вместо этого."
|
||||
|
||||
setteleport-help: "/as settp [регион] [сброс], если не указать параметры, будет выбран регион в котором вы находитесь."
|
||||
setteleport-noPermission: "У вас нет прав, чтобы установить точку телепорта."
|
||||
setteleport-noPermissionOther: "У вас нет прав, чтобы установить точку телепорта для региона, который вам не принадлежит."
|
||||
setteleport-noRentOrBuy: "Указанный регион не зарегистрирован: %0%."
|
||||
setteleport-success: "Точка телепорта для %lang:region% установлена."
|
||||
setteleport-notInside: "Точка должно быть внутри региона."
|
||||
setteleport-reset: "Точка телепорта для %lang:region% была сброшена."
|
||||
|
||||
find-help: "/as find <buy|rent> [стоимость] [группа]."
|
||||
find-noPermission: "У вас нет разрешения на поиск регионов и телепортироваться к ним."
|
||||
find-successMax: "Найдено %0% регионов: %lang:region%, при поиске с максимальной ценой %1%%2%."
|
||||
find-wrongMaxPrice: "Указанная максимальная цена имеет не правильный номер: %0%."
|
||||
find-wrongGroup: "Указанная группа не существует: %0%."
|
||||
find-onlyInGroup: ", искать регионы только в группах: %0%."
|
||||
|
||||
groupadd-help: "/as groupadd <group> [имярегиона], если не указать имя, будут выбраны все регионы в вашем WorldEdit выделении."
|
||||
groupadd-noPermission: "У вас нет разрешения на добавление регионов к группам."
|
||||
groupadd-success: "Регион %lang:region% был добавлен к группе '%0%', эта группа теперь имеет %1% участника(-ов)."
|
||||
groupadd-failed: "Регион %lang:region% уже является участником группы '%0%'."
|
||||
groupadd-weSuccess: "Добавлен к группе %0%: [gray]%1%."
|
||||
groupadd-weFailed: "Уже были в группе %0%: [gray]%1%."
|
||||
|
||||
groupdel-help: "/as groupdel <group> [имярегиона], если не указать имя, будут выбраны все регионы в вашем WorldEdit выделении."
|
||||
groupdel-noPermission: "У вас нет разрешения на удаление регионов из групп."
|
||||
groupdel-success: "Регион %lang:region% был удален из группы '%0%', эта группа теперь имеет %1% участника(-ов)."
|
||||
groupdel-failed: "Регион %lang:region% не является участником группы '%0%'."
|
||||
groupdel-weSuccess: "Удален из группы %0%: [gray]%1%."
|
||||
groupdel-weFailed: "Не были в группе %0% во всяком случае: [gray]%1%."
|
||||
|
||||
grouplist-noPermission: "У вас нет разрешения на отображение зарегистрированных групп."
|
||||
grouplist-noGroups: "Нет доступных зарегистрированных груп."
|
||||
grouplist-success: "Следующие группы были зарегистрированные: [gray]%0%."
|
||||
|
||||
groupinfo-help: "/as groupinfo <группа>."
|
||||
groupinfo-noPermission: "У вас нет разрешения на отображение информации о группе."
|
||||
groupinfo-noGroup: "Нет доступной зарегистрированной группы с именем '%0%', используй /as grouplist для вывода списка групп."
|
||||
groupinfo-members: "Следующие регионы являются членами группы %0%: [gray]%1%."
|
||||
groupinfo-noMembers: "Группа %0% не имеет участников."
|
||||
|
||||
schemevent-help: "/as schemevent <регион> <created|deleted|rented|unrented|bought|sold>."
|
||||
schemevent-wrongEvent: "Событие '%0%' не существует, используйте одно из следующих действий: [gray]%1%."
|
||||
schemevent-success: "Событие '%0%' успешно сработало для региона %lang:region%."
|
||||
schemevent-noPermission: "У вас нет разрешения на иницииацию схематических событий"
|
||||
|
||||
add-help: "/as add <rent|buy> [rрегион] [мир]."
|
||||
add-noPermission: "У вас нет разрешения добавлять регионы в AreaShop."
|
||||
add-success: "AДобавлен к %0%: [gray]%1%."
|
||||
add-failed: "Уже зарегистрирован: [gray]%0%."
|
||||
add-blacklisted: "Включен в черный список : [gray]%0%."
|
||||
add-specifyWorld: "Укажите мир региона при использовании из консоли."
|
||||
add-incorrectWorld: "Мир '%0%' не найден, попробуйте еще раз (с учетом регистра)."
|
||||
add-noRegion: "WorldGuard регион '%0%' не существует в этом мире."
|
||||
add-noPermissionRegions: "Нет разрешения, чтобы добавить: [gray]%0%."
|
||||
add-noPermissionOwnerMember: "[gray]Вы либо не являетесь участником/владельцем этих регионов, либо не имеете разрешения добавлять свои регионы."
|
||||
|
||||
del-noPermission: "У вас нет разрешения на удаление регионов."
|
||||
del-success: "Удалены регионы: [gray]%0%."
|
||||
del-failed: "Нет разрешения на удаление или не зарегистрирован: [gray]%0%."
|
||||
|
||||
addsign-help: "/as addsign [регион] [профиль]."
|
||||
addsign-noSign: "Вы не смотрите на табличку."
|
||||
addsign-noRegions: "Не найдено регионов вокруг таблички."
|
||||
addsign-couldNotDetect: "Найдено несколько регионов вокруг таблички, укажите регион в качестве дополнительного аргумента (2 из регионов, которые были найдены: %lang:tRegion|%0%|% и %lang:tRegion|%1%|%)."
|
||||
addsign-couldNotDetectSign: "Найдено несколько регионов вокруг таблички, укажите регион на второй строке (2 из регионов, которые были найдены: %lang:tRegion|%0%|% и %lang:tRegion|%1%|%)."
|
||||
addsign-wrongProfile: "Указанный профиль не существует, используйте одно из следующих действий (проверьте конфиг.): [gray]%0%."
|
||||
addsign-profile:
|
||||
- "[bold]%0%[/bold]"
|
||||
- " hover: Табличка профиль %0%"
|
||||
- " hover: %lang:action|Используйте этот профиль|%"
|
||||
- " command: /areashop linksigns %0%"
|
||||
addsign-success: "Табличка была добавлена для %lang:region%."
|
||||
addsign-successProfile: "Табличка была добавлена для %lang:region% вместе с профилем %0%."
|
||||
addsign-alreadyRegistered: "Эта табличка уже зарегистрирована в регионе %lang:region%."
|
||||
addsign-noPermission: "У вас нет разрешения на добавление таблички."
|
||||
|
||||
delsign-noSign: "Вы не смотрите на табличку."
|
||||
delsign-noPermission: "У вас нет разрешения на удаление таблички."
|
||||
delsign-noRegion: "Эта табличка не принадлежит к регионам в AreaShop."
|
||||
delsign-success: "Табличка была удалена из региона %lang:region%."
|
||||
|
||||
me-noPermission: "У вас нет прав, чтобы проверить, какие регионы вы имеете."
|
||||
me-header: "Регионы %lang:tPlayer|%0%|%:"
|
||||
me-notAPlayer: "Вы не являетесь игроком, которому доступны какие-либо регионы."
|
||||
me-buyLine: "[darkgreen][bold]►[reset] %lang:region%."
|
||||
me-nothing: "%lang:tPlayer|%0%|% не арендовали или покупали регионы и не добавлялись в друзья."
|
||||
me-noPlayer: "%0% не может быть найден, вероятно, никогда не присоединился к серверу."
|
||||
|
||||
setowner-help: "/as setowner <player> [имярегиона], если не указано имя, будет выбран регион в котором вы находитесь."
|
||||
setowner-noPermission: "У вас нет прав, чтобы установить владельца региона."
|
||||
setowner-noPermissionRent: "У вас нет прав, чтобы установить владельца для аренды регионов."
|
||||
setowner-noPermissionBuy: "У вас нет прав, чтобы установить владельца для покупки регионов."
|
||||
setowner-notRegistered: "Указанный регион не зарегистрирован, владелец не может быть установлен."
|
||||
setowner-noPlayer: "Не удалось получить UUID указанного игрока: %0%."
|
||||
setowner-succesBuy: "Владелец в %lang:region% успешно изменен на %lang:player%."
|
||||
|
||||
resell-help: "/as resell <price> [имярегиона], если не указано имя, будет выбран регион в котором вы находитесь."
|
||||
resell-wrongPrice: "'%0%' не является допустимой ценой."
|
||||
resell-notRegistered: "Указанный регион не зарегистрирован: %0%."
|
||||
resell-notBought: "Вы не можете перепродать %lang:region%, так как он еще не продан."
|
||||
resell-success: "%lang:region% был успешно выставлен в режим перепродажи за %resellprice%."
|
||||
resell-noPermission: "У Вас нет прав что бы установить ваш регион в режим перепродажи."
|
||||
resell-noPermissionOther: "У Вас нет прав что бы установить регион в режим перепродажи."
|
||||
|
||||
stopresell-help: "/as stopresell [имярегиона], если не указано имя, будет выбран регион в котором вы находитесь."
|
||||
stopresell-notRegistered: "Указанный регион не зарегистрирован: %0%."
|
||||
stopresell-notResell: "Вы не можете остановить перепродажу %lang:region% потому что регион не в режиме перепродажи."
|
||||
stopresell-success: "%lang:region% был успешно выставлен в режим продажи."
|
||||
stopresell-noPermission: "У вас нет прав, чтобы установить свой регион обратно в режим продажи."
|
||||
stopresell-noPermissionOther: "У вас нет разрешения устанавливать регионы обратно в режим продажи."
|
||||
|
||||
addfriend-help: "/as addfriend <player> [имярегиона], если не указано имя, будет выбран регион в котором вы находитесь."
|
||||
addfriend-noPermissionOther: "У вас нет разрешения на добавление друзей в регионы, которые не являются вашими."
|
||||
addfriend-noPermission: "У вас нет разрешения на добавление друзей в вашем регионе."
|
||||
addfriend-successOther: "%lang:tPlayer|%0%|% был добавлен до друзей в %lang:region%."
|
||||
addfriend-success: "%lang:tPlayer|%0%|% был добавлен до друзей в вашем регионе %lang:region%."
|
||||
addfriend-alreadyAdded: "%lang:tPlayer|%0%|% уже добавлен до друзей в %lang:region%."
|
||||
addfriend-self: "Добавление владельца региона как друга было бы бессмысленно."
|
||||
addfriend-noOwner: "Вы не можете добавлять друзей в регионе без владельца."
|
||||
addfriend-notVisited: "Вы не можете добавить %0% потому что он еще не посещал этот сервер."
|
||||
|
||||
delfriend-help: "/as delfriend <player> [имярегиона], если не указано имя, будет выбран регион в котором вы находитесь."
|
||||
delfriend-noPermissionOther: "У вас нет разрешения на удаление друзей из регионов, которые не являются вашими."
|
||||
delfriend-noPermission: "У вас нет разрешения на удаление друзей из вашего региона."
|
||||
delfriend-successOther: "%lang:tPlayer|%0%|% был удален из друзей в регионе %lang:region%."
|
||||
delfriend-success: "%lang:tPlayer|%0%|% был удален из друзей в вашем регионе %lang:region%."
|
||||
delfriend-noOwner: "Вы не можете удалять друзей из региона без владельца."
|
||||
|
||||
linksigns-multipleRegions: "Найдено несколько регионов: [gray]%0%."
|
||||
linksigns-multipleRegionsAdvice: "Нажмите в другое время, чтобы попробовать еще раз или использовать '/as linksigns' чтобы остановить."
|
||||
linksigns-noRegions: "Не найдено регионов AreaShop в направлении взгляда, убедитесь что регион добавлен в AreaShop [gray](максимум расстояние в 100 блоков)."
|
||||
linksigns-regionFound: "Регион %lang:region% был найден, теперь соедините с табличкой кликнув левой кнопкой миши ."
|
||||
linksigns-signFound: "Найдена табличка в (%0%, %1%, %2%), теперь соедините с регионом кликнув правой кнопкой мыши ."
|
||||
linksigns-noSign: "Никаких табличок обнаружено в направлении взгляда, убедитесь, что у вас есть прямой взгляд на табличку и нажмите снова [gray](максимум расстояние в 100 блоков)."
|
||||
linksigns-alreadyRegistered: "Эта табличка уже зарегистрирована в регионе %lang:region%, кликни еще раз, чтобы выбрать другую табличку."
|
||||
linksigns-first: "Включен режим привязки табличек."
|
||||
linksigns-next: "[gray]Клик лкм. выбрать табличку, клик пкм. выбрать регион, использовать /as linksigns для отключения режима."
|
||||
linksigns-noPermission: "У вас нет разрешения для пользования режима привязки табличек."
|
||||
linksigns-stopped: "Отключен режим привязки табличек."
|
||||
|
||||
stack-help:
|
||||
- "/as stack <amount> <gap> <name> <rent|buy> [group].[break]"
|
||||
- " [gray]<amount> Количество создаваемых регионов.[break]"
|
||||
- " [gray]<gap> Дистанция в блоках между регионами.[break]"
|
||||
- " [gray]<name> Имя региона (с числом за ним).[break]"
|
||||
- " [gray]<rent|buy> сделать аренду или продажу.[break]"
|
||||
- " [gray][group] Добавляет регионы в группу.[break]"
|
||||
- " [gray]Регионы будут созданы в направлении взгляда."
|
||||
stack-accepted: "Началось создание %0% %1% регионов с растоянием в %2% блок(ов), имена которых начинаются с %3% и имеют номера за ними.%4%"
|
||||
stack-addToGroup: "Созданные регионы будут добавлены к группе '%0%'."
|
||||
stack-noPermission: "У вас нет разрешения создавать и добавлять регионы AreaShop в большом количестве."
|
||||
stack-wrongAmount: "'%0%' не правильное количество регионов."
|
||||
stack-wrongGap: "'%0%' не правильное число блоков для отступа между регионами."
|
||||
stack-noSelection: "У вас нет выделения, которое указывает, где должен быть создан первый регион."
|
||||
stack-addStart: "[gray]Добавлено %0% регионов около %1% в секунду."
|
||||
stack-addComplete: "[gray]Добавление регионов прошло успешно."
|
||||
stack-unclearDirection: "Посмотрите, пожалуйста, четко на север, восток, юг или запад, обнаружено %0%."
|
||||
|
||||
setlandlord-help: "/as setlandlord <player> [имярегиона], если не указано имя, будет выбран регион в котором вы находитесь."
|
||||
setlandlord-noPermission: "У вас не разрешения чтобы назначить землевладельца в регион."
|
||||
setlandlord-success: "%lang:landlord% был успешно установлен как землевладелец в %lang:region%."
|
||||
|
||||
message-help: "/as message <игрок> <сообщение...>"
|
||||
message-noPermission: "У вас нет разрешения на отправку AreaShop сообщений."
|
||||
message-notOnline: "%0% не в сети."
|
||||
|
||||
confirm-rent:
|
||||
- "%lang:prefix%Вы уверены, что вы хотите арендовать %lang:tRegion|%0%|%?[break]"
|
||||
- "[darkgreen][bold]►[reset] %lang:button|Нажмите, чтобы арендовать %0%|%"
|
||||
- " hover: %lang:action|Аренда %0%|%"
|
||||
- " command: /areashop rent %0%"
|
||||
confirm-extend:
|
||||
- "%lang:prefix%Вы уверены, что вы хотите продлить %lang:tRegion|%0%|%?[break]"
|
||||
- "[darkgreen][bold]►[reset] %lang:button|Нажмите, чтобы продлить %0%|%"
|
||||
- " hover: %lang:action|Продлить %0%|%"
|
||||
- " command: /areashop rent %0%"
|
||||
confirm-unrent:
|
||||
- "%lang:prefix%Вы уверены, что хотите снять аренду %lang:tRegion|%0%|%?[break]"
|
||||
- "[darkgreen][bold]►[reset] %lang:button|Нажмите, чтобы снять аренду %0%|%"
|
||||
- " hover: %lang:action|Снять аренду %0%|%"
|
||||
- " command: /areashop unrent %0%"
|
||||
confirm-buy:
|
||||
- "%lang:prefix%Вы уверены, что хотите купить %lang:tRegion|%0%|%?[break]"
|
||||
- "[darkgreen][bold]►[reset] %lang:button|Нажмите, чтобы купить %0%|%"
|
||||
- " hover: %lang:action|Купить %0%|%"
|
||||
- " command: /areashop buy %0%"
|
||||
confirm-sell:
|
||||
- "%lang:prefix%Вы уверены, что хотите продать %lang:tRegion|%0%|%?[break]"
|
||||
- "[darkgreen][bold]►[reset] %lang:button|Нажмите, чтобы продать %0%|%"
|
||||
- " hover: %lang:action|Продать %0%|%"
|
||||
- " command: /areashop sell %0%"
|
||||
|
||||
timeleft-years: "%0% лет"
|
||||
timeleft-months: "%0% месяцев"
|
||||
timeleft-days: "%0% дней"
|
||||
timeleft-hours: "%0% часов"
|
||||
timeleft-minutes: "%0% минут"
|
||||
timeleft-second: "%0% секунда"
|
||||
timeleft-seconds: "%0% секунд"
|
||||
timeleft-ended: "Истек"
|
||||
|
||||
greeting-forrent: "%region% может быть арендован за %price% в %duration%"
|
||||
greeting-rented: "%region% арендован игроком %player% до %untill%."
|
||||
greeting-forsale: "%region% может быть куплен за %price%."
|
||||
greeting-bought: "%region% куплен игроком %player%."
|
||||
greeting-resale: "%region% может быть куплен за %resaleprice% у игрока %player%."
|
||||
@@ -0,0 +1,260 @@
|
||||
name: AreaShop
|
||||
main: me.wiefferink.areashop.AreaShop
|
||||
version: "${project.version}${build.number}"
|
||||
description: "Selling and renting WorldGuard regions to your players, highly configurable."
|
||||
depend: [Vault, WorldGuard, WorldEdit]
|
||||
softdepend: [Multiverse-Core]
|
||||
author: NLThijs48
|
||||
website: https://github.com/NLthijs48/AreaShop
|
||||
commands:
|
||||
AreaShop:
|
||||
description: 'For all commands use /as help.'
|
||||
usage: 'AreaShop has not started correctly, check the log file (or console) and correct any errors.'
|
||||
aliases: [as]
|
||||
permissions:
|
||||
areashop.*:
|
||||
description: Give access to all commands of AreaShop
|
||||
children:
|
||||
areashop.help: true
|
||||
areashop.createrent: true
|
||||
areashop.createbuy: true
|
||||
areashop.destroyrent: true
|
||||
areashop.destroybuy: true
|
||||
areashop.rent: true
|
||||
areashop.buy: true
|
||||
areashop.buyresell: true
|
||||
areashop.buynormal: true
|
||||
areashop.unrent: true
|
||||
areashop.info: true
|
||||
areashop.reload: true
|
||||
areashop.setrestore: true
|
||||
areashop.setprice: true
|
||||
areashop.setduration: true
|
||||
areashop.teleport: true
|
||||
areashop.teleportall: true
|
||||
areashop.setteleportall: true
|
||||
areashop.teleportsign: true
|
||||
areashop.teleportsignall: true
|
||||
areashop.tabcomplete: true
|
||||
areashop.setteleportoutsideregion: true
|
||||
areashop.find: true
|
||||
areashop.groupadd: true
|
||||
areashop.groupdel: true
|
||||
areashop.grouplist: true
|
||||
areashop.groupinfo: true
|
||||
areashop.limitbypass: true
|
||||
areashop.schematicevents: true
|
||||
areashop.addsign: true
|
||||
areashop.delsign: true
|
||||
areashop.renttimebypass: true
|
||||
areashop.me: true
|
||||
areashop.resellall: true
|
||||
areashop.stopresellall: true
|
||||
areashop.addfriendall: true
|
||||
areashop.delfriendall: true
|
||||
areashop.notifyupdate: true
|
||||
areashop.stack: true
|
||||
areashop.setlandlord: true
|
||||
areashop.linksigns: true
|
||||
areashop.message: true
|
||||
areashop.landlord.*:
|
||||
description: Give access to all landlord features
|
||||
children:
|
||||
areashop.createrent.owner: true
|
||||
areashop.createbuy.owner: true
|
||||
areashop.setprice.landlord: true
|
||||
areashop.setduration.landlord: true
|
||||
areashop.destroyrent.landlord: true
|
||||
areashop.destroybuy.landlord: true
|
||||
areashop.help:
|
||||
description: Allows you to see the help pages
|
||||
default: true
|
||||
areashop.rent:
|
||||
description: Allows you to rent a region
|
||||
default: true
|
||||
areashop.buy:
|
||||
description: Allows you to buy a region
|
||||
default: true
|
||||
areashop.buyresell:
|
||||
description: Allows you to buy a region that is in resell mode
|
||||
default: true
|
||||
areashop.buynormal:
|
||||
description: Allows you to buy a region that is not in resell mode
|
||||
default: true
|
||||
areashop.unrent:
|
||||
description: Allows you to unrent a specific region
|
||||
default: op
|
||||
areashop.unrentown:
|
||||
description: Allows you to unrent your own region
|
||||
default: true
|
||||
areashop.sell:
|
||||
description: Allows you to sell a specific region
|
||||
default: op
|
||||
areashop.sellown:
|
||||
description: Allows you to sell your own region
|
||||
default: true
|
||||
areashop.createrent:
|
||||
description: Allows you to add rent regions to AreaShop
|
||||
default: op
|
||||
areashop.createrent.member:
|
||||
description: Allows you to add rent regions to AreaShop for which you are registered as member
|
||||
default: false
|
||||
areashop.createrent.owner:
|
||||
description: Allows you to add rent regions to AreaShop for which you are registered as owner
|
||||
default: false
|
||||
areashop.createbuy:
|
||||
description: Allows you to add buy regions to AreaShop
|
||||
default: op
|
||||
areashop.createbuy.member:
|
||||
description: Allows you to add buy regions to AreaShop for which you are registered as member
|
||||
default: false
|
||||
areashop.createbuy.owner:
|
||||
description: Allows you to add buy regions to AreaShop for which you are registered as owner
|
||||
default: false
|
||||
areashop.destroyrent:
|
||||
description: Allows you remove rental regions from AreaShop
|
||||
default: op
|
||||
areashop.destroyrent.landlord:
|
||||
description: Allows you to remove rental regions from AreaShop when you are the landlord
|
||||
default: false
|
||||
areashop.destroybuy:
|
||||
description: Allows you to remove buy regions from AreaShop
|
||||
default: op
|
||||
areashop.destroybuy.landlord:
|
||||
description: Allows you to remove buy regions from AreaShop when you are the landlord
|
||||
default: false
|
||||
areashop.info:
|
||||
description: Allows you check the status of regions and players
|
||||
default: true
|
||||
areashop.reload:
|
||||
description: Allows you to reload the config and update all region flags and signs
|
||||
default: op
|
||||
areashop.setrestore:
|
||||
description: Allows you to change the restore settings
|
||||
default: op
|
||||
areashop.setprice:
|
||||
description: Allows you to change the price
|
||||
default: op
|
||||
areashop.setprice.landlord:
|
||||
description: Allows you to change the price of a region that you are landlord of
|
||||
default: false
|
||||
areashop.setduration:
|
||||
description: Allows you to change the duration of a rent
|
||||
default: op
|
||||
areashop.setduration.landlord:
|
||||
description: Allows you to change the duration of a region that you are landlord of
|
||||
default: false
|
||||
areashop.teleport:
|
||||
description: Teleport to your region
|
||||
default: true
|
||||
areashop.teleportall:
|
||||
description: Teleport to all regions
|
||||
default: op
|
||||
areashop.teleportsign:
|
||||
description: Teleport to signs of regions you own
|
||||
default: true
|
||||
areashop.teleportsignall:
|
||||
description: Teleport to signs of all regions
|
||||
default: op
|
||||
areashop.teleportfriend:
|
||||
description: Teleport to regions where you are added as friend
|
||||
default: true
|
||||
areashop.teleportfriendsign:
|
||||
description: Teleport to the sign of regions where you are added as friend
|
||||
default: true
|
||||
areashop.setteleport:
|
||||
description: Set the teleport spot for your region
|
||||
default: true
|
||||
areashop.setteleportall:
|
||||
description: Set the teleport for other regions
|
||||
default: op
|
||||
areashop.setteleportoutsideregion:
|
||||
description: Set the teleport location outside the WorldGuard region
|
||||
default: op
|
||||
areashop.tabcomplete:
|
||||
description: Allows you to tabcomplete all commands (also where you dont have permission)
|
||||
default: op
|
||||
areashop.find:
|
||||
description: Allows you to teleport to a free region (/as find)
|
||||
default: true
|
||||
areashop.groupadd:
|
||||
description: Allows you to add regions to groups
|
||||
default: op
|
||||
areashop.groupdel:
|
||||
description: Allows you to delete regions from groups
|
||||
default: op
|
||||
areashop.grouplist:
|
||||
description: Allows you to list all the groups currently created
|
||||
default: op
|
||||
areashop.groupinfo:
|
||||
description: Allows you to display information about a group (all members)
|
||||
default: op
|
||||
areashop.rentextendbypass:
|
||||
description: Bypass the extend limit on rents
|
||||
default: op
|
||||
areashop.limits.default:
|
||||
description: Assign limits as set in the 'default' group in the 'limitGroups' section of the config
|
||||
default: not op
|
||||
areashop.limitbypass:
|
||||
description: Bypass the limits for renting/buying regions (how many you can have at the same time)
|
||||
default: op
|
||||
areashop.schematicevents:
|
||||
description: Allows you to trigger schematic events for regions
|
||||
default: op
|
||||
areashop.addsign:
|
||||
description: Allows you to add signs to existing regions
|
||||
default: op
|
||||
areashop.delsign:
|
||||
description: Allows you to delete signs from existing regions
|
||||
default: op
|
||||
areashop.renttimebypass:
|
||||
description: Bypass the maximum rent time you can have in advance
|
||||
default: op
|
||||
areashop.me:
|
||||
description: Allows you to get information about your regions
|
||||
default: true
|
||||
areashop.setownerrent:
|
||||
description: Allows you to set the owner of rent regions
|
||||
default: op
|
||||
areashop.setownerbuy:
|
||||
description: Allows you to set the owner of buy regions
|
||||
default: op
|
||||
areashop.resell:
|
||||
description: Allows you to set your region to sell mode for selling to other players
|
||||
default: true
|
||||
areashop.resellall:
|
||||
description: Allows you to set any region into selling mode
|
||||
default: op
|
||||
areashop.stopresell:
|
||||
description: Allows you to set your region into normal mode if it is in sell mode
|
||||
default: true
|
||||
areashop.stopresellall:
|
||||
description: Allows you to set any region into normal mode if it is in sell mode
|
||||
default: op
|
||||
areashop.addfriend:
|
||||
description: Allows you to add friends to your regions
|
||||
default: true
|
||||
areashop.addfriendall:
|
||||
description: Allows you to add friends to all regions
|
||||
default: op
|
||||
areashop.delfriend:
|
||||
description: Allows you to delete friends from your regions
|
||||
default: true
|
||||
areashop.delfriendall:
|
||||
description: Allows you to delete friends from all regions
|
||||
default: op
|
||||
areashop.notifyupdate:
|
||||
description: Will notify this player when an update is available
|
||||
default: op
|
||||
areashop.linksigns:
|
||||
description: Allows you to enter sign linking mode
|
||||
default: op
|
||||
areashop.stack:
|
||||
description: Allows you to create regions and add them to AreaShop like the WorldEdit //stack command
|
||||
default: op
|
||||
areashop.setlandlord:
|
||||
description: Allows you to set the landlord of a region, the landlord receives all revenue
|
||||
default: op
|
||||
areashop.message:
|
||||
description: Allows you to send AreaShop messages to players
|
||||
default: op
|
||||
@@ -1,434 +0,0 @@
|
||||
package nl.evolutioncoding.AreaShop;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.configuration.Configuration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.permissions.Permission;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
||||
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
|
||||
|
||||
/**
|
||||
* Main class for the AreaShop plugin
|
||||
* @author NLThijs48
|
||||
*/
|
||||
public final class AreaShop extends JavaPlugin {
|
||||
/* General variables */
|
||||
private static AreaShop instance = null;
|
||||
|
||||
private WorldGuardPlugin worldGuard = null;
|
||||
private WorldEditPlugin worldEdit = null;
|
||||
private Economy economy = null;
|
||||
private FileManager fileManager = null;
|
||||
private LanguageManager languageManager = null;
|
||||
private CommandManager commandManager = null;
|
||||
private boolean configOk = false;
|
||||
private boolean debug = false;
|
||||
private String chatprefix = null;
|
||||
|
||||
/* Folders and file names */
|
||||
public static final String languageFolder = "lang";
|
||||
public static final String schematicFolder = "schem";
|
||||
public static final String schematicExtension = ".schematic";
|
||||
public static final String regionsFolder = "regions";
|
||||
public static final String groupsFile = "groups.yml";
|
||||
public static final String defaultFile = "default.yml";
|
||||
public static final String versionFile = "versions";
|
||||
|
||||
/* Euro tag for in the config */
|
||||
public static final String currencyEuro = "%euro%";
|
||||
|
||||
/* Constants for handling file versions */
|
||||
public static final String versionFiles = "files";
|
||||
public static final int versionFilesCurrent = 2;
|
||||
|
||||
/* Keys for replacing parts of flags */
|
||||
public static final String tagPlayerName = "%player%";
|
||||
public static final String tagPlayerUUID = "%uuid%";
|
||||
public static final String tagWorldName = "%world%";
|
||||
public static final String tagRegionName = "%region%";
|
||||
public static final String tagRegionType = "%type%";
|
||||
public static final String tagPrice = "%price%";
|
||||
public static final String tagDuration = "%duration%";
|
||||
public static final String tagRentedUntil = "%until%";
|
||||
public static final String tagRentedUntilShort = "%untilshort%";
|
||||
|
||||
public static AreaShop getInstance() {
|
||||
return AreaShop.instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called on start or reload of the server
|
||||
*/
|
||||
public void onEnable(){
|
||||
AreaShop.instance = this;
|
||||
boolean error = false;
|
||||
|
||||
/* Check the config, loads default if errors */
|
||||
debug = this.getConfig().getBoolean("debug");
|
||||
configOk = true;
|
||||
|
||||
/* Check if WorldGuard is present */
|
||||
Plugin plugin = getServer().getPluginManager().getPlugin("WorldGuard");
|
||||
if (plugin == null || !(plugin instanceof WorldGuardPlugin)) {
|
||||
this.getLogger().info("Error: WorldGuard plugin is not present or has not loaded correctly");
|
||||
error = true;
|
||||
} else {
|
||||
worldGuard = (WorldGuardPlugin)plugin;
|
||||
}
|
||||
|
||||
/* Check if WorldEdit is present */
|
||||
plugin = getServer().getPluginManager().getPlugin("WorldEdit");
|
||||
if (plugin == null || !(plugin instanceof WorldEditPlugin)) {
|
||||
this.getLogger().info("Error: WorldEdit plugin is not present or has not loaded correctly");
|
||||
error = true;
|
||||
} else {
|
||||
worldEdit = (WorldEditPlugin)plugin;
|
||||
}
|
||||
|
||||
/* Check if Vault is present */
|
||||
RegisteredServiceProvider<Economy> economyProvider = getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class);
|
||||
if (economyProvider == null) {
|
||||
this.getLogger().info("Error: Vault plugin is not present or has not loaded correctly");
|
||||
error = true;
|
||||
} else {
|
||||
economy = economyProvider.getProvider();
|
||||
}
|
||||
|
||||
/* Create a LanguageMananager */
|
||||
languageManager = new LanguageManager(this);
|
||||
|
||||
/* Save the chatPrefix */
|
||||
chatprefix = this.config().getString("chatPrefix");
|
||||
|
||||
/* Load all data from files and check versions */
|
||||
fileManager = new FileManager(this);
|
||||
error = error & !fileManager.loadFiles();
|
||||
fileManager.checkRents();
|
||||
|
||||
/* Save a copy of the default config.yml if one is not present */
|
||||
this.saveDefaultConfig();
|
||||
|
||||
if(error) {
|
||||
this.getLogger().info("The plugin has not started, fix the errors listed above");
|
||||
} else {
|
||||
// Register the event listeners
|
||||
this.getServer().getPluginManager().registerEvents(new SignChangeListener(this), this);
|
||||
this.getServer().getPluginManager().registerEvents(new SignBreakListener(this), this);
|
||||
this.getServer().getPluginManager().registerEvents(new SignClickListener(this), this);
|
||||
|
||||
// Start thread for checking renting
|
||||
int checkDelay = Integer.parseInt(this.config().getString("checkDelay"))*20;
|
||||
new RentCheck(this).runTaskTimer(this, checkDelay, checkDelay);
|
||||
|
||||
// Bind commands for this plugin
|
||||
commandManager = new CommandManager(this);
|
||||
|
||||
// Enable Metrics if config allows it
|
||||
if(this.config().getBoolean("sendStats")) {
|
||||
this.startMetrics();
|
||||
}
|
||||
|
||||
// Register dynamic permission (things declared in config)
|
||||
registerDynamicPermissions();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called on shutdown or reload of the server
|
||||
*/
|
||||
public void onDisable() {
|
||||
|
||||
/* set variables to null to prevent memory leaks */
|
||||
worldGuard = null;
|
||||
economy = null;
|
||||
fileManager = null;
|
||||
languageManager = null;
|
||||
configOk = false;
|
||||
debug = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to get the WorldGuard plugin
|
||||
* @return WorldGuardPlugin
|
||||
*/
|
||||
public WorldGuardPlugin getWorldGuard() {
|
||||
return worldGuard;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to get the WorldEdit plugin
|
||||
* @return WorldEditPlugin
|
||||
*/
|
||||
public WorldEditPlugin getWorldEdit() {
|
||||
return worldEdit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to get the LanguageManager
|
||||
* @return the LanguageManager
|
||||
*/
|
||||
public LanguageManager getLanguageManager() {
|
||||
return languageManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to get the CommandManager
|
||||
* @return the CommandManager
|
||||
*/
|
||||
public CommandManager getCommandManager() {
|
||||
return commandManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to get the Vault plugin
|
||||
* @return Economy
|
||||
*/
|
||||
public Economy getEconomy() {
|
||||
return economy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the FileManager
|
||||
* @return The fileManager
|
||||
*/
|
||||
public FileManager getFileManager() {
|
||||
return fileManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register dynamic permissions controlled by config settings
|
||||
*/
|
||||
public void registerDynamicPermissions() {
|
||||
// Register limit groups of amount of regions a player can have
|
||||
for(String group : config().getConfigurationSection("limitGroups").getKeys(false)) {
|
||||
if(!"unlimited".equals(group) && !"default".equals(group)) {
|
||||
Permission perm = new Permission("areashop.limits." + group);
|
||||
Bukkit.getPluginManager().addPermission(perm);
|
||||
}
|
||||
}
|
||||
Bukkit.getPluginManager().recalculatePermissionDefaults(Bukkit.getPluginManager().getPermission("playerwarps.limits"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to send a message to a CommandSender, using chatprefix if it is a player
|
||||
* @param target The CommandSender you wan't to send the message to (e.g. a player)
|
||||
* @param key The key to get the translation
|
||||
* @param prefix Specify if the message should have a prefix
|
||||
* @param params The parameters to inject into the message string
|
||||
*/
|
||||
public void configurableMessage(Object target, String key, boolean prefix, Object... params) {
|
||||
String langString = this.fixColors(languageManager.getLang(key, params));
|
||||
if(langString == null) {
|
||||
this.getLogger().info("Something is wrong with the language file, could not find key: " + key);
|
||||
} else if(langString.equals("")) {
|
||||
// Do nothing, message is disabled
|
||||
} else {
|
||||
if(target instanceof Player) {
|
||||
if(prefix) {
|
||||
((Player)target).sendMessage(this.fixColors(chatprefix) + langString);
|
||||
} else {
|
||||
((Player)target).sendMessage(langString);
|
||||
}
|
||||
} else if(target instanceof CommandSender) {
|
||||
if(!config().getBoolean("useColorsInConsole")) {
|
||||
langString = ChatColor.stripColor(langString);
|
||||
}
|
||||
((CommandSender)target).sendMessage(langString);
|
||||
}
|
||||
else if(target instanceof Logger) {
|
||||
if(!config().getBoolean("useColorsInConsole")) {
|
||||
langString = ChatColor.stripColor(langString);
|
||||
}
|
||||
((Logger)target).info(langString);
|
||||
} else {
|
||||
langString = ChatColor.stripColor(langString);
|
||||
this.getLogger().info("Could not send message, target is wrong: " + langString);
|
||||
}
|
||||
}
|
||||
}
|
||||
public void messageNoPrefix(Object target, String key, Object... params) {
|
||||
configurableMessage(target, key, false, params);
|
||||
}
|
||||
public void message(Object target, String key, Object... params) {
|
||||
configurableMessage(target, key, true, params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert color and formatting codes to bukkit values
|
||||
* @param input Start string with color and formatting codes in it
|
||||
* @return String with the color and formatting codes in the bukkit format
|
||||
*/
|
||||
public String fixColors(String input) {
|
||||
String result = null;
|
||||
if(input != null) {
|
||||
result = input.replaceAll("(&([a-f0-9]))", "\u00A7$2");
|
||||
result = result.replaceAll("&k", ChatColor.MAGIC.toString());
|
||||
result = result.replaceAll("&l", ChatColor.BOLD.toString());
|
||||
result = result.replaceAll("&m", ChatColor.STRIKETHROUGH.toString());
|
||||
result = result.replaceAll("&n", ChatColor.UNDERLINE.toString());
|
||||
result = result.replaceAll("&o", ChatColor.ITALIC.toString());
|
||||
result = result.replaceAll("&r", ChatColor.RESET.toString());
|
||||
result = result.replaceAll("€", "\u20AC");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the currency amount with the characters before and after
|
||||
* @return Currency character format string
|
||||
* @param amount Amount of money to format
|
||||
*/
|
||||
public String formatCurrency(String amount) {
|
||||
String before = this.config().getString("moneyCharacter");
|
||||
before = before.replace(currencyEuro, "\u20ac");
|
||||
String after = this.config().getString("moneyCharacterAfter");
|
||||
after = after.replace(currencyEuro, "\u20ac");
|
||||
return before + amount + after;
|
||||
}
|
||||
public String formatCurrency(double amount) {
|
||||
return this.formatCurrency("" + amount);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function for quitting the plugin, NOT USED ATM
|
||||
*/
|
||||
public void quit() {
|
||||
this.getLogger().info("Plugin will be stopped");
|
||||
Bukkit.getPluginManager().disablePlugin(this);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the config configured by the user or the default
|
||||
*/
|
||||
public Configuration config() {
|
||||
if(configOk) {
|
||||
return this.getConfig();
|
||||
} else {
|
||||
return this.getConfig().getDefaults();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Start the Metrics stats collection
|
||||
*/
|
||||
private void startMetrics() {
|
||||
try {
|
||||
Metrics metrics = new Metrics(this);
|
||||
metrics.start();
|
||||
} catch (IOException e) {
|
||||
AreaShop.debug("Could not start Metrics");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the string is a correct time period
|
||||
* @param time String that has to be checked
|
||||
* @return true if format is correct, false if not
|
||||
*/
|
||||
public boolean checkTimeFormat(String time) {
|
||||
/* Check if the string is not empty and check the length */
|
||||
if(time == null || time.length() <= 1 || time.indexOf(' ') == -1 || time.indexOf(' ') >= (time.length()-1)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Check if the suffix is one of these values */
|
||||
String suffix = time.substring(time.indexOf(' ')+1, time.length());
|
||||
ArrayList<String> identifiers = new ArrayList<String>();
|
||||
identifiers.addAll(this.config().getStringList("minutes"));
|
||||
identifiers.addAll(this.config().getStringList("hours"));
|
||||
identifiers.addAll(this.config().getStringList("days"));
|
||||
identifiers.addAll(this.config().getStringList("months"));
|
||||
identifiers.addAll(this.config().getStringList("years"));
|
||||
if(!identifiers.contains(suffix)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* check if the part before the space is a number */
|
||||
String prefix = time.substring(0, (time.indexOf(' ')));
|
||||
return prefix.matches("\\d+");
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends an debug message to the console
|
||||
* @param message The message that should be printed to the console
|
||||
*/
|
||||
public static void debug(String message) {
|
||||
if(AreaShop.getInstance().debug) {
|
||||
AreaShop.getInstance().getLogger().info("Debug: " + message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reload the config of the plugin
|
||||
*/
|
||||
public void reload() {
|
||||
this.saveDefaultConfig();
|
||||
this.reloadConfig();
|
||||
configOk = true;
|
||||
chatprefix = this.config().getString("chatPrefix");
|
||||
debug = this.getConfig().getBoolean("debug");
|
||||
languageManager = new LanguageManager(this);
|
||||
fileManager.loadFiles();
|
||||
fileManager.checkRents();
|
||||
}
|
||||
|
||||
/**
|
||||
* Conversion to name by uuid
|
||||
* @param uuid The uuid in string format
|
||||
* @return the name of the player
|
||||
*/
|
||||
public String toName(String uuid) {
|
||||
if(uuid == null) {
|
||||
return null;
|
||||
} else {
|
||||
return this.toName(UUID.fromString(uuid));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Conversion to name by uuid object
|
||||
* @param uuid The uuid in string format
|
||||
* @return the name of the player
|
||||
*/
|
||||
public String toName(UUID uuid) {
|
||||
if(uuid == null) {
|
||||
return null;
|
||||
} else {
|
||||
return Bukkit.getOfflinePlayer(uuid).getName();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Conversion from name to uuid
|
||||
* @param name The name of the player
|
||||
* @return The uuid of the player
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Fake deprecation by Bukkit to inform developers, method will stay
|
||||
public String toUUID(String name) {
|
||||
if(name == null) {
|
||||
return null;
|
||||
} else {
|
||||
return Bukkit.getOfflinePlayer(name).getUniqueId().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
package nl.evolutioncoding.AreaShop.Exceptions;
|
||||
|
||||
public class RegionCreateException extends Exception {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public RegionCreateException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,984 +0,0 @@
|
||||
package nl.evolutioncoding.AreaShop;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import nl.evolutioncoding.AreaShop.Exceptions.RegionCreateException;
|
||||
import nl.evolutioncoding.AreaShop.regions.BuyRegion;
|
||||
import nl.evolutioncoding.AreaShop.regions.GeneralRegion;
|
||||
import nl.evolutioncoding.AreaShop.regions.GeneralRegion.RegionEvent;
|
||||
import nl.evolutioncoding.AreaShop.regions.GeneralRegion.RegionType;
|
||||
import nl.evolutioncoding.AreaShop.regions.RegionGroup;
|
||||
import nl.evolutioncoding.AreaShop.regions.RentRegion;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.google.common.io.Files;
|
||||
import com.sk89q.worldedit.BlockVector;
|
||||
import com.sk89q.worldedit.bukkit.selections.CuboidSelection;
|
||||
import com.sk89q.worldedit.bukkit.selections.Selection;
|
||||
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
||||
import com.sk89q.worldguard.protection.managers.RegionManager;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
|
||||
public class FileManager {
|
||||
private static FileManager instance = null;
|
||||
|
||||
private AreaShop plugin = null;
|
||||
private ObjectInputStream input = null;
|
||||
private ObjectOutputStream output = null;
|
||||
private HashMap<String, GeneralRegion> regions = null;
|
||||
private String regionsPath = null;
|
||||
private HashMap<String, RegionGroup> groups = null;
|
||||
private String groupsPath = null;
|
||||
private YamlConfiguration groupsConfig = null;
|
||||
private String defaultPath = null;
|
||||
private YamlConfiguration defaultConfig = null;
|
||||
|
||||
private HashMap<String,Integer> versions = null;
|
||||
private String versionPath = null;
|
||||
private String schemFolder = null;
|
||||
|
||||
/**
|
||||
* Constructor, initialize variabeles
|
||||
* @param plugin
|
||||
*/
|
||||
public FileManager(AreaShop plugin) {
|
||||
this.plugin = plugin;
|
||||
regions = new HashMap<String, GeneralRegion>();
|
||||
regionsPath = plugin.getDataFolder() + File.separator + AreaShop.regionsFolder;
|
||||
groups = new HashMap<String, RegionGroup>();
|
||||
groupsPath = plugin.getDataFolder() + File.separator + AreaShop.groupsFile;
|
||||
defaultPath = plugin.getDataFolder() + File.separator + AreaShop.defaultFile;
|
||||
versionPath = plugin.getDataFolder().getPath() + File.separator + AreaShop.versionFile;
|
||||
schemFolder = plugin.getDataFolder() + File.separator + AreaShop.schematicFolder;
|
||||
File schemFile = new File(schemFolder);
|
||||
if(!schemFile.exists()) {
|
||||
schemFile.mkdirs();
|
||||
}
|
||||
loadVersions();
|
||||
}
|
||||
|
||||
public static FileManager getInstance() {
|
||||
if(instance == null) {
|
||||
instance = new FileManager(AreaShop.getInstance());
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
// GETTERS
|
||||
//////////////////////////////////////////////////////////
|
||||
|
||||
public AreaShop getPlugin() {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
public String getSchematicFolder() {
|
||||
return schemFolder;
|
||||
}
|
||||
|
||||
public RegionGroup getGroup(String name) {
|
||||
return groups.get(name.toLowerCase());
|
||||
}
|
||||
|
||||
public Collection<RegionGroup> getGroups() {
|
||||
return groups.values();
|
||||
}
|
||||
|
||||
public YamlConfiguration getDefaultSettings() {
|
||||
return defaultConfig;
|
||||
}
|
||||
|
||||
public GeneralRegion getRegion(String name) {
|
||||
return regions.get(name.toLowerCase());
|
||||
}
|
||||
|
||||
public RentRegion getRent(String name) {
|
||||
GeneralRegion region = regions.get(name.toLowerCase());
|
||||
if(region != null && region.isRentRegion()) {
|
||||
return (RentRegion)region;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public BuyRegion getBuy(String name) {
|
||||
GeneralRegion region = regions.get(name.toLowerCase());
|
||||
if(region != null && region.isBuyRegion()) {
|
||||
return (BuyRegion)region;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<RentRegion> getRents() {
|
||||
List<RentRegion> result = new ArrayList<RentRegion>();
|
||||
for(GeneralRegion region : regions.values()) {
|
||||
if(region.isRentRegion()) {
|
||||
result.add((RentRegion)region);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<BuyRegion> getBuys() {
|
||||
List<BuyRegion> result = new ArrayList<BuyRegion>();
|
||||
for(GeneralRegion region : regions.values()) {
|
||||
if(region.isBuyRegion()) {
|
||||
result.add((BuyRegion)region);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<GeneralRegion> getRegions() {
|
||||
return new ArrayList<GeneralRegion>(regions.values());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of names of a certain group of things
|
||||
* @return A String list with all the names
|
||||
*/
|
||||
public List<String> getBuyNames() {
|
||||
ArrayList<String> result = new ArrayList<String>();
|
||||
for(BuyRegion region : getBuys()) {
|
||||
result.add(region.getName());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
public List<String> getRentNames() {
|
||||
ArrayList<String> result = new ArrayList<String>();
|
||||
for(RentRegion region : getRents()) {
|
||||
result.add(region.getName());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
public List<String> getRegionNames() {
|
||||
ArrayList<String> result = new ArrayList<String>();
|
||||
for(GeneralRegion region : getRegions()) {
|
||||
result.add(region.getName());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
public List<String> getGroupNames() {
|
||||
ArrayList<String> result = new ArrayList<String>();
|
||||
for(RegionGroup group : getGroups()) {
|
||||
result.add(group.getName());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a rent to the list
|
||||
* @param regionName Name of the region that can be rented
|
||||
* @param rent Map containing all the info for a rent
|
||||
*/
|
||||
public void addRent(RentRegion rent) {
|
||||
if(rent == null) {
|
||||
AreaShop.debug("Tried adding a null rent!");
|
||||
}
|
||||
regions.put(rent.getName().toLowerCase(), rent);
|
||||
rent.save();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a buy to the list
|
||||
* @param regionName Name of the region that can be buyed
|
||||
* @param buy Map containing all the info for a buy
|
||||
*/
|
||||
public void addBuy(BuyRegion buy) {
|
||||
if(buy == null) {
|
||||
AreaShop.debug("Tried adding a null buy!");
|
||||
}
|
||||
regions.put(buy.getName().toLowerCase(), buy);
|
||||
buy.save();
|
||||
}
|
||||
|
||||
public void addGroup(RegionGroup group) {
|
||||
groups.put(group.getName().toLowerCase(), group);
|
||||
String lowGroup = group.getName().toLowerCase();
|
||||
ConfigurationSection result = groupsConfig.getConfigurationSection(lowGroup);
|
||||
if(result == null) {
|
||||
result = groupsConfig.createSection(lowGroup);
|
||||
groupsConfig.set(lowGroup + ".name", group.getName());
|
||||
groupsConfig.set(lowGroup + ".priority", 0);
|
||||
}
|
||||
saveGroups();
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a rent from the list
|
||||
* @param regionName
|
||||
*/
|
||||
public boolean removeRent(RentRegion rent, boolean giveMoneyBack) {
|
||||
boolean result = false;
|
||||
if(rent != null) {
|
||||
if(rent.isRented()) {
|
||||
rent.unRent(giveMoneyBack);
|
||||
}
|
||||
// Handle schematics and run commands
|
||||
rent.handleSchematicEvent(RegionEvent.DELETED);
|
||||
rent.runEventCommands(RegionEvent.DELETED, true);
|
||||
|
||||
/* Delete the sign and the variable */
|
||||
if(rent.getWorld() != null) {
|
||||
for(Location sign : rent.getSignLocations()) {
|
||||
sign.getBlock().setType(Material.AIR);
|
||||
}
|
||||
}
|
||||
RegionGroup[] groups = getGroups().toArray(new RegionGroup[getGroups().size()]);
|
||||
for(RegionGroup group : groups) {
|
||||
group.removeMember(rent);
|
||||
}
|
||||
rent.resetRegionFlags();
|
||||
regions.remove(rent.getLowerCaseName());
|
||||
File file = new File(plugin.getDataFolder() + File.separator + AreaShop.regionsFolder + File.separator + rent.getLowerCaseName() + ".yml");
|
||||
boolean deleted = true;
|
||||
try {
|
||||
deleted = file.delete();
|
||||
} catch(Exception e) {
|
||||
deleted = false;
|
||||
}
|
||||
if(!deleted) {
|
||||
plugin.getLogger().warning("File could not be deleted: " + file.toString());
|
||||
}
|
||||
|
||||
|
||||
result = true;
|
||||
|
||||
// Run commands
|
||||
rent.runEventCommands(RegionEvent.DELETED, false);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a region by providing a location of the sign
|
||||
* @param location The locatin of the sign
|
||||
* @return The generalRegion that has a sign at this location
|
||||
*/
|
||||
public GeneralRegion getRegionBySignLocation(Location location) {
|
||||
for(GeneralRegion region : getRegions()) {
|
||||
if(region.isSignOfRegion(location)) {
|
||||
return region;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a buy from the list
|
||||
* @param regionName
|
||||
*/
|
||||
public boolean removeBuy(BuyRegion buy, boolean giveMoneyBack) {
|
||||
boolean result = false;
|
||||
if(buy != null) {
|
||||
if(buy.isSold()) {
|
||||
buy.sell(giveMoneyBack);
|
||||
}
|
||||
// Handle schematics and run commands
|
||||
buy.handleSchematicEvent(RegionEvent.DELETED);
|
||||
buy.runEventCommands(RegionEvent.DELETED, true);
|
||||
|
||||
// Delete the sign and the variable
|
||||
if(buy.getWorld() != null) {
|
||||
for(Location sign : buy.getSignLocations()) {
|
||||
sign.getBlock().setType(Material.AIR);
|
||||
}
|
||||
}
|
||||
regions.remove(buy.getLowerCaseName());
|
||||
buy.resetRegionFlags();
|
||||
|
||||
// Removing from groups
|
||||
for(RegionGroup group : getGroups()) {
|
||||
group.removeMember(buy);
|
||||
}
|
||||
|
||||
// Deleting the file
|
||||
File file = new File(plugin.getDataFolder() + File.separator + AreaShop.regionsFolder + File.separator + buy.getLowerCaseName() + ".yml");
|
||||
boolean deleted = true;
|
||||
try {
|
||||
deleted = file.delete();
|
||||
} catch(Exception e) {
|
||||
deleted = false;
|
||||
}
|
||||
if(!deleted) {
|
||||
plugin.getLogger().warning("File could not be deleted: " + file.toString());
|
||||
}
|
||||
|
||||
result = true;
|
||||
|
||||
// Run commands
|
||||
buy.runEventCommands(RegionEvent.DELETED, false);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a group
|
||||
* @param group Group to remove
|
||||
*/
|
||||
public void removeGroup(RegionGroup group) {
|
||||
groups.remove(group.getLowerCaseName());
|
||||
groupsConfig.set(group.getLowerCaseName(), null);
|
||||
saveGroups();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update all rent signs
|
||||
* @return true if all signs are updated, otherwise false
|
||||
*/
|
||||
public boolean updateRentSigns() {
|
||||
boolean result = true;
|
||||
for(RentRegion rent : getRents()) {
|
||||
result = result & rent.updateSigns();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update all buy signs
|
||||
* @return true if all signs are updated, otherwise false
|
||||
*/
|
||||
public boolean updateBuySigns() {
|
||||
boolean result = true;
|
||||
for(BuyRegion buy : getBuys()) {
|
||||
result = result & buy.updateSigns();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update all regions registered for renting
|
||||
*/
|
||||
public void updateRentRegions() {
|
||||
for(RentRegion rent : getRents()) {
|
||||
rent.updateRegionFlags();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update all regions registered for buying
|
||||
*/
|
||||
public void updateBuyRegions() {
|
||||
for(BuyRegion buy : getBuys()) {
|
||||
buy.updateRegionFlags();
|
||||
}
|
||||
}
|
||||
|
||||
public void saveGroups() {
|
||||
try {
|
||||
groupsConfig.save(groupsPath);
|
||||
} catch (IOException e) {
|
||||
plugin.getLogger().warning("Groups file could not be saved: " + groupsPath);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Save all region related files
|
||||
*/
|
||||
public void saveAll() {
|
||||
// Safe regions
|
||||
for(GeneralRegion region : getRegions()) {
|
||||
region.save();
|
||||
}
|
||||
|
||||
// Safe groups and default config
|
||||
this.saveGroups();
|
||||
try {
|
||||
defaultConfig.save(defaultPath);
|
||||
} catch (IOException e) {
|
||||
plugin.getLogger().warning("Default file could not be saved: " + defaultPath);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public String getRegionFolder() {
|
||||
return regionsPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unrent region that have no time left
|
||||
*/
|
||||
public void checkRents() {
|
||||
/* Check if regions and signs are still present */
|
||||
long now = Calendar.getInstance().getTimeInMillis();
|
||||
for(RentRegion rent : getRents()) {
|
||||
if(rent.isRented() && now > rent.getRentedUntil()) {
|
||||
/* Send message to the player if online */
|
||||
Player player = Bukkit.getPlayer(rent.getRenter());
|
||||
if(player != null) {
|
||||
plugin.message(player, "unrent-expired", rent.getName());
|
||||
}
|
||||
rent.unRent(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load the file with the versions, used to check if the other files need conversion
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public void loadVersions() {
|
||||
File file = new File(versionPath);
|
||||
if(file.exists()) {
|
||||
/* Load versions from the file */
|
||||
try {
|
||||
input = new ObjectInputStream(new FileInputStream(versionPath));
|
||||
versions = (HashMap<String,Integer>)input.readObject();
|
||||
input.close();
|
||||
} catch (IOException | ClassNotFoundException | ClassCastException e) {
|
||||
plugin.getLogger().info("Error: Something went wrong reading file: " + versionPath);
|
||||
versions = null;
|
||||
}
|
||||
}
|
||||
if(versions == null || versions.size() == 0) {
|
||||
versions = new HashMap<String, Integer>();
|
||||
versions.put(AreaShop.versionFiles, 0);
|
||||
this.saveVersions();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the versions file to disk
|
||||
*/
|
||||
public void saveVersions() {
|
||||
if(!(new File(versionPath).exists())) {
|
||||
plugin.getLogger().info("versions file created, this should happen only after installing or upgrading the plugin");
|
||||
}
|
||||
try {
|
||||
output = new ObjectOutputStream(new FileOutputStream(versionPath));
|
||||
output.writeObject(versions);
|
||||
output.close();
|
||||
} catch (IOException e) {
|
||||
plugin.getLogger().info("File could not be saved: " + versionPath);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load all files from disk
|
||||
* @return true
|
||||
*/
|
||||
public boolean loadFiles() {
|
||||
boolean result = false;
|
||||
|
||||
convertFiles();
|
||||
|
||||
// Load regions
|
||||
File file = new File(regionsPath);
|
||||
if(!file.exists()) {
|
||||
file.mkdirs();
|
||||
} else if(file.isDirectory()) {
|
||||
for(File region : file.listFiles()) {
|
||||
if(region.isFile()) {
|
||||
YamlConfiguration config = YamlConfiguration.loadConfiguration(region);
|
||||
if(RegionType.RENT.getValue().equals(config.getString("general.type"))) {
|
||||
try {
|
||||
RentRegion rent = new RentRegion(plugin, config);
|
||||
addRent(rent);
|
||||
} catch (RegionCreateException exception) {
|
||||
plugin.getLogger().warning(exception.getMessage());
|
||||
try {
|
||||
region.delete();
|
||||
} catch(Exception e) {}
|
||||
}
|
||||
|
||||
} else if(RegionType.BUY.getValue().equals(config.getString("general.type"))) {
|
||||
try {
|
||||
BuyRegion buy = new BuyRegion(plugin, config);
|
||||
addBuy(buy);
|
||||
} catch (RegionCreateException exception) {
|
||||
// This prints out a message in the console that indicates why the region cannot be created
|
||||
plugin.getLogger().warning(exception.getMessage());
|
||||
// Catch all exeptions because it just has to try delete the region, if it fails it does not matter
|
||||
try {
|
||||
region.delete();
|
||||
} catch(Exception e) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Load groups
|
||||
File groupFile = new File(groupsPath);
|
||||
if(groupFile.exists() && groupFile.isFile()) {
|
||||
groupsConfig = YamlConfiguration.loadConfiguration(groupFile);
|
||||
} else {
|
||||
groupsConfig = new YamlConfiguration();
|
||||
}
|
||||
for(String groupName : groupsConfig.getKeys(false)) {
|
||||
RegionGroup group = new RegionGroup(plugin, groupName);
|
||||
groups.put(groupName, group);
|
||||
}
|
||||
|
||||
// Load default settings
|
||||
File defaultFile = new File(defaultPath);
|
||||
if(!defaultFile.exists()) {
|
||||
InputStream input = null;
|
||||
OutputStream output = null;
|
||||
try {
|
||||
input = plugin.getResource(AreaShop.defaultFile);
|
||||
output = new FileOutputStream(defaultFile);
|
||||
|
||||
int read = 0;
|
||||
byte[] bytes = new byte[1024];
|
||||
while ((read = input.read(bytes)) != -1) {
|
||||
output.write(bytes, 0, read);
|
||||
}
|
||||
input.close();
|
||||
output.close();
|
||||
plugin.getLogger().info("File with default region settings has been saved, should only happen the first time");
|
||||
} catch(IOException e) {
|
||||
try {
|
||||
input.close();
|
||||
output.close();
|
||||
} catch (IOException e1) {} catch (NullPointerException e2) {}
|
||||
|
||||
plugin.getLogger().warning("Something went wrong saving the default region settings: " + defaultFile.getPath());
|
||||
}
|
||||
}
|
||||
defaultConfig = YamlConfiguration.loadConfiguration(defaultFile);
|
||||
return result;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void convertFiles() {
|
||||
String rentPath = plugin.getDataFolder() + File.separator + "rents";
|
||||
String buyPath = plugin.getDataFolder() + File.separator + "buys";
|
||||
File rentFile = new File(rentPath);
|
||||
File buyFile = new File(buyPath);
|
||||
String oldFolderPath = plugin.getDataFolder() + File.separator + "#old" + File.separator;
|
||||
File oldFolderFile = new File(oldFolderPath);
|
||||
|
||||
// If the the files are already the current version
|
||||
if(versions.get(AreaShop.versionFiles) != null && versions.get(AreaShop.versionFiles) == AreaShop.versionFilesCurrent) {
|
||||
return;
|
||||
}
|
||||
|
||||
plugin.getLogger().info("Conversion to a new version of the file format starts, could take some time");
|
||||
|
||||
// Convert old rent files
|
||||
if(rentFile.exists()) {
|
||||
if(!oldFolderFile.exists()) {
|
||||
oldFolderFile.mkdirs();
|
||||
}
|
||||
|
||||
if(versions.get("rents") == null) {
|
||||
versions.put("rents", -1);
|
||||
}
|
||||
|
||||
HashMap<String, HashMap<String, String>> rents = null;
|
||||
try {
|
||||
ObjectInputStream input = new ObjectInputStream(new FileInputStream(rentPath));
|
||||
rents = (HashMap<String,HashMap<String,String>>)input.readObject();
|
||||
input.close();
|
||||
} catch (IOException | ClassNotFoundException | ClassCastException e) {
|
||||
plugin.getLogger().warning(" Error: Something went wrong reading file: " + rentPath);
|
||||
}
|
||||
// Delete the file if it is totally wrong
|
||||
if(rents == null) {
|
||||
try {
|
||||
rentFile.delete();
|
||||
} catch(Exception e) {}
|
||||
} else {
|
||||
// Move old file
|
||||
try {
|
||||
Files.move(new File(rentPath), new File(oldFolderPath + "rents"));
|
||||
} catch (Exception e) {
|
||||
plugin.getLogger().info(" Could not create a backup of '" + rentPath + "', check the file permissions (conversion to next version continues)");
|
||||
}
|
||||
// Check if conversion is needed
|
||||
if(versions.get("rents") < 1) {
|
||||
/* Upgrade the rent to the latest version */
|
||||
if(versions.get("rents") < 0) {
|
||||
for(String rentName : rents.keySet()) {
|
||||
HashMap<String,String> rent = rents.get(rentName);
|
||||
/* Save the rentName in the hashmap and use a small caps rentName as key */
|
||||
if(rent.get("name") == null) {
|
||||
rent.put("name", rentName);
|
||||
rents.remove(rentName);
|
||||
rents.put(rentName.toLowerCase(), rent);
|
||||
}
|
||||
/* Save the default setting for region restoring */
|
||||
if(rent.get("restore") == null) {
|
||||
rent.put("restore", "general");
|
||||
}
|
||||
/* Save the default setting for the region restore profile */
|
||||
if(rent.get("profile") == null) {
|
||||
rent.put("profile", "default");
|
||||
}
|
||||
/* Change to version 0 */
|
||||
versions.put("rents", 0);
|
||||
}
|
||||
plugin.getLogger().info(" Updated version of '" + buyPath + "' from -1 to 0 (switch to using lowercase region names, adding default schematic enabling and profile)");
|
||||
}
|
||||
if(versions.get("rents") < 1) {
|
||||
for(String rentName : rents.keySet()) {
|
||||
HashMap<String,String> rent = rents.get(rentName);
|
||||
if(rent.get("player") != null) {
|
||||
@SuppressWarnings("deprecation") // Fake deprecation by Bukkit to inform developers, method will stay
|
||||
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(rent.get("player"));
|
||||
rent.put("playeruuid", offlinePlayer.getUniqueId().toString());
|
||||
rent.remove("player");
|
||||
}
|
||||
/* Change version to 1 */
|
||||
versions.put("rents", 1);
|
||||
}
|
||||
plugin.getLogger().info(" Updated version of '" + rentPath + "' from 0 to 1 (switch to UUID's for player identification)");
|
||||
}
|
||||
}
|
||||
// Save rents to new format
|
||||
File regionsFile = new File(regionsPath);
|
||||
if(!regionsFile.exists()) {
|
||||
regionsFile.mkdirs();
|
||||
}
|
||||
for(HashMap<String, String> rent : rents.values()) {
|
||||
YamlConfiguration config = new YamlConfiguration();
|
||||
config.set("general.name", rent.get("name").toLowerCase());
|
||||
config.set("general.type", "rent");
|
||||
config.set("general.world", rent.get("world"));
|
||||
config.set("general.signs.0.location.world", rent.get("world"));
|
||||
config.set("general.signs.0.location.x", Double.parseDouble(rent.get("x")));
|
||||
config.set("general.signs.0.location.y", Double.parseDouble(rent.get("y")));
|
||||
config.set("general.signs.0.location.z", Double.parseDouble(rent.get("z")));
|
||||
config.set("rent.price", Double.parseDouble(rent.get("price")));
|
||||
config.set("rent.duration", rent.get("duration"));
|
||||
if(rent.get("restore") != null && !rent.get("restore").equals("general")) {
|
||||
config.set("general.enableRestore", rent.get("restore"));
|
||||
}
|
||||
if(rent.get("profile") != null && !rent.get("profile").equals("default")) {
|
||||
config.set("general.schematicProfile", rent.get("profile"));
|
||||
}
|
||||
if(rent.get("tpx") != null) {
|
||||
config.set("general.teleportLocation.world", rent.get("world"));
|
||||
config.set("general.teleportLocation.x", Double.parseDouble(rent.get("tpx")));
|
||||
config.set("general.teleportLocation.y", Double.parseDouble(rent.get("tpy")));
|
||||
config.set("general.teleportLocation.z", Double.parseDouble(rent.get("tpz")));
|
||||
config.set("general.teleportLocation.yaw", rent.get("tpyaw"));
|
||||
config.set("general.teleportLocation.pitch", rent.get("tppitch"));
|
||||
}
|
||||
if(rent.get("playeruuid") != null) {
|
||||
config.set("rent.renter", rent.get("playeruuid"));
|
||||
config.set("rent.rentedUntil", Long.parseLong(rent.get("rented")));
|
||||
}
|
||||
try {
|
||||
config.save(new File(regionsPath + File.separator + rent.get("name").toLowerCase() + ".yml"));
|
||||
} catch (IOException e) {
|
||||
plugin.getLogger().warning(" Error: Could not save region file while converting: " + regionsPath + File.separator + rent.get("name").toLowerCase() + ".yml");
|
||||
}
|
||||
}
|
||||
plugin.getLogger().info(" Updated rent regions to new .yml format (check the /regions folder)");
|
||||
}
|
||||
|
||||
// Change version number
|
||||
versions.remove("rents");
|
||||
versions.put(AreaShop.versionFiles, AreaShop.versionFilesCurrent);
|
||||
saveVersions();
|
||||
}
|
||||
|
||||
if(buyFile.exists()) {
|
||||
if(!oldFolderFile.exists()) {
|
||||
oldFolderFile.mkdirs();
|
||||
}
|
||||
|
||||
if(versions.get("buys") == null) {
|
||||
versions.put("buys", -1);
|
||||
}
|
||||
|
||||
HashMap<String, HashMap<String, String>> buys = null;
|
||||
try {
|
||||
ObjectInputStream input = new ObjectInputStream(new FileInputStream(buyPath));
|
||||
buys = (HashMap<String,HashMap<String,String>>)input.readObject();
|
||||
input.close();
|
||||
} catch (IOException | ClassNotFoundException | ClassCastException e) {
|
||||
plugin.getLogger().warning(" Error: Something went wrong reading file: " + buyPath);
|
||||
}
|
||||
// Delete the file if it is totally wrong
|
||||
if(buys == null) {
|
||||
try {
|
||||
buyFile.delete();
|
||||
} catch(Exception e) {}
|
||||
} else {
|
||||
// Backup current file
|
||||
try {
|
||||
Files.move(new File(buyPath), new File(oldFolderPath + "buys"));
|
||||
} catch (Exception e) {
|
||||
plugin.getLogger().info(" Could not create a backup of '" + buyPath + "', check the file permissions (conversion to next version continues)");
|
||||
}
|
||||
// Check if conversion is needed
|
||||
if(versions.get("buys") < 1) {
|
||||
/* Upgrade the buy to the latest version */
|
||||
if(versions.get("buys") < 0) {
|
||||
for(String buyName : buys.keySet()) {
|
||||
HashMap<String,String> buy = buys.get(buyName);
|
||||
/* Save the buyName in the hashmap and use a small caps buyName as key */
|
||||
if(buy.get("name") == null) {
|
||||
buy.put("name", buyName);
|
||||
buys.remove(buyName);
|
||||
buys.put(buyName.toLowerCase(), buy);
|
||||
}
|
||||
/* Save the default setting for region restoring */
|
||||
if(buy.get("restore") == null) {
|
||||
buy.put("restore", "general");
|
||||
}
|
||||
/* Save the default setting for the region restore profile */
|
||||
if(buy.get("profile") == null) {
|
||||
buy.put("profile", "default");
|
||||
}
|
||||
/* Change to version 0 */
|
||||
versions.put("buys", 0);
|
||||
}
|
||||
plugin.getLogger().info(" Updated version of '" + buyPath + "' from -1 to 0 (switch to using lowercase region names, adding default schematic enabling and profile)");
|
||||
}
|
||||
if(versions.get("buys") < 1) {
|
||||
for(String buyName : buys.keySet()) {
|
||||
HashMap<String,String> buy = buys.get(buyName);
|
||||
if(buy.get("player") != null) {
|
||||
@SuppressWarnings("deprecation") // Fake deprecation by Bukkit to inform developers, method will stay
|
||||
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(buy.get("player"));
|
||||
buy.put("playeruuid", offlinePlayer.getUniqueId().toString());
|
||||
buy.remove("player");
|
||||
}
|
||||
/* Change version to 1 */
|
||||
versions.put("buys", 1);
|
||||
}
|
||||
plugin.getLogger().info(" Updated version of '" + buyPath + "' from 0 to 1 (switch to UUID's for player identification)");
|
||||
}
|
||||
}
|
||||
|
||||
// Save buys to new format
|
||||
File regionsFile = new File(regionsPath);
|
||||
if(!regionsFile.exists()) {
|
||||
regionsFile.mkdirs();
|
||||
}
|
||||
for(HashMap<String, String> buy : buys.values()) {
|
||||
YamlConfiguration config = new YamlConfiguration();
|
||||
config.set("general.name", buy.get("name").toLowerCase());
|
||||
config.set("general.type", "buy");
|
||||
config.set("general.world", buy.get("world"));
|
||||
config.set("general.signs.0.location.world", buy.get("world"));
|
||||
config.set("general.signs.0.location.x", Double.parseDouble(buy.get("x")));
|
||||
config.set("general.signs.0.location.y", Double.parseDouble(buy.get("y")));
|
||||
config.set("general.signs.0.location.z", Double.parseDouble(buy.get("z")));
|
||||
config.set("buy.price", Double.parseDouble(buy.get("price")));
|
||||
if(buy.get("restore") != null && !buy.get("restore").equals("general")) {
|
||||
config.set("general.enableRestore", buy.get("restore"));
|
||||
}
|
||||
if(buy.get("profile") != null && !buy.get("profile").equals("default")) {
|
||||
config.set("general.schematicProfile", buy.get("profile"));
|
||||
}
|
||||
if(buy.get("tpx") != null) {
|
||||
config.set("general.teleportLocation.world", buy.get("world"));
|
||||
config.set("general.teleportLocation.x", Double.parseDouble(buy.get("tpx")));
|
||||
config.set("general.teleportLocation.y", Double.parseDouble(buy.get("tpy")));
|
||||
config.set("general.teleportLocation.z", Double.parseDouble(buy.get("tpz")));
|
||||
config.set("general.teleportLocation.yaw", buy.get("tpyaw"));
|
||||
config.set("general.teleportLocation.pitch", buy.get("tppitch"));
|
||||
}
|
||||
if(buy.get("playeruuid") != null) {
|
||||
config.set("buy.buyer", buy.get("playeruuid"));
|
||||
}
|
||||
try {
|
||||
config.save(new File(regionsPath + File.separator + buy.get("name").toLowerCase() + ".yml"));
|
||||
} catch (IOException e) {
|
||||
plugin.getLogger().warning(" Error: Could not save region file while converting: " + regionsPath + File.separator + buy.get("name").toLowerCase() + ".yml");
|
||||
}
|
||||
}
|
||||
plugin.getLogger().info(" Updated buy regions to new .yml format (check the /regions folder)");
|
||||
}
|
||||
|
||||
// Change version number
|
||||
versions.remove("buys");
|
||||
versions.put(AreaShop.versionFiles, AreaShop.versionFilesCurrent);
|
||||
saveVersions();
|
||||
}
|
||||
|
||||
// Separate try-catch blocks to try them all individually (don't stop after 1 has failed)
|
||||
try {
|
||||
Files.move(new File(rentPath + ".old"), new File(oldFolderPath + "rents.old"));
|
||||
} catch (Exception e) {}
|
||||
try {
|
||||
Files.move(new File(buyPath + ".old"), new File(oldFolderPath + "buys.old"));
|
||||
} catch (Exception e) {}
|
||||
try {
|
||||
Files.move(new File(plugin.getDataFolder() + File.separator + "config.yml"), new File(oldFolderPath + "config.yml"));
|
||||
} catch (Exception e) {}
|
||||
|
||||
plugin.getLogger().info("Conversion to new version of the file format complete, this should not show up anymore next restart/reload");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the settings of a group
|
||||
* @param groupName Name of the group to get the settings from
|
||||
* @return The settings of the group
|
||||
*/
|
||||
public ConfigurationSection getGroupSettings(String groupName) {
|
||||
return groupsConfig.getConfigurationSection(groupName.toLowerCase());
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a setting for a group
|
||||
* @param group The group to set it for
|
||||
* @param path The path to set
|
||||
* @param setting The value to set
|
||||
*/
|
||||
public void setGroupSetting(RegionGroup group, String path, Object setting) {
|
||||
groupsConfig.set(group.getName().toLowerCase() + "." + path, setting);
|
||||
}
|
||||
|
||||
// UTILITIES
|
||||
/**
|
||||
* Get all AreaShop regions intersecting with a WorldEdit selection
|
||||
* @param selection The selection to check
|
||||
* @return A list with all the AreaShop regions intersecting with the selection
|
||||
*/
|
||||
public List<GeneralRegion> getASRegionsInSelection(Selection selection) {
|
||||
ArrayList<GeneralRegion> result = new ArrayList<GeneralRegion>();
|
||||
for(ProtectedRegion region : getWERegionsInSelection(selection)) {
|
||||
GeneralRegion asRegion = getRegion(region.getId());
|
||||
if(asRegion != null) {
|
||||
result.add(asRegion);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
public List<GeneralRegion> getASRegionsByLocation(Location location) {
|
||||
Selection selection = new CuboidSelection(location.getWorld(), location, location);
|
||||
return getASRegionsInSelection(selection);
|
||||
}
|
||||
|
||||
public List<ProtectedRegion> getWERegionsInSelection(Selection selection) {
|
||||
// Get all regions inside or intersecting with the WorldEdit selection of the player
|
||||
World world = selection.getWorld();
|
||||
RegionManager regionManager = plugin.getWorldGuard().getRegionManager(world);
|
||||
ArrayList<ProtectedRegion> result = new ArrayList<ProtectedRegion>();
|
||||
Location selectionMin = selection.getMinimumPoint();
|
||||
Location selectionMax = selection.getMaximumPoint();
|
||||
for(ProtectedRegion region : regionManager.getRegions().values()) {
|
||||
BlockVector regionMin = region.getMinimumPoint();
|
||||
BlockVector regionMax = region.getMaximumPoint();
|
||||
if(
|
||||
( // x part, resolves to true if the selection and region overlap anywhere on the x-axis
|
||||
(regionMin.getBlockX() <= selectionMax.getBlockX() && regionMin.getBlockX() >= selectionMin.getBlockX())
|
||||
|| (regionMax.getBlockX() <= selectionMax.getBlockX() && regionMax.getBlockX() >= selectionMin.getBlockX())
|
||||
|| (selectionMin.getBlockX() >= regionMin.getBlockX() && selectionMin.getBlockX() <= regionMax.getBlockX())
|
||||
|| (selectionMax.getBlockX() >= regionMin.getBlockX() && selectionMax.getBlockX() <= regionMax.getBlockX())
|
||||
) && ( // Y part, resolves to true if the selection and region overlap anywhere on the y-axis
|
||||
(regionMin.getBlockY() <= selectionMax.getBlockY() && regionMin.getBlockY() >= selectionMin.getBlockY())
|
||||
|| (regionMax.getBlockY() <= selectionMax.getBlockY() && regionMax.getBlockY() >= selectionMin.getBlockY())
|
||||
|| (selectionMin.getBlockY() >= regionMin.getBlockY() && selectionMin.getBlockY() <= regionMax.getBlockY())
|
||||
|| (selectionMax.getBlockY() >= regionMin.getBlockY() && selectionMax.getBlockY() <= regionMax.getBlockY())
|
||||
) && ( // Z part, resolves to true if the selection and region overlap anywhere on the z-axis
|
||||
(regionMin.getBlockZ() <= selectionMax.getBlockZ() && regionMin.getBlockZ() >= selectionMin.getBlockZ())
|
||||
|| (regionMax.getBlockZ() <= selectionMax.getBlockZ() && regionMax.getBlockZ() >= selectionMin.getBlockZ())
|
||||
|| (selectionMin.getBlockZ() >= regionMin.getBlockZ() && selectionMin.getBlockZ() <= regionMax.getBlockZ())
|
||||
|| (selectionMax.getBlockZ() >= regionMin.getBlockZ() && selectionMax.getBlockZ() <= regionMax.getBlockZ())
|
||||
)
|
||||
) {
|
||||
result.add(region);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of regions around a location
|
||||
* - Returns highest priority, child instead of parent regions
|
||||
* @param location The location to check for regions
|
||||
* @return empty list if no regions found, 1 member if 1 region is a priority, more if regions with the same priority
|
||||
*/
|
||||
public List<ProtectedRegion> getApplicableRegions(Location location) {
|
||||
List<ProtectedRegion> result = new ArrayList<ProtectedRegion>();
|
||||
// If the secondLine does not contain a name try to find the region by location
|
||||
ApplicableRegionSet regions = plugin.getWorldGuard().getRegionManager(location.getWorld()).getApplicableRegions(location);
|
||||
if(regions != null) {
|
||||
boolean first = true;
|
||||
for(ProtectedRegion pr : regions) {
|
||||
if(first) {
|
||||
result.add(pr);
|
||||
first = false;
|
||||
} else {
|
||||
if(pr.getPriority() > result.get(0).getPriority()) {
|
||||
result.clear();
|
||||
result.add(pr);
|
||||
} else if(pr.getParent() != null && pr.getParent().equals(result.get(0))) {
|
||||
result.clear();
|
||||
result.add(pr);
|
||||
} else {
|
||||
result.add(pr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<GeneralRegion> getApplicalbeASRegions(Location location) {
|
||||
List<GeneralRegion> result = new ArrayList<GeneralRegion>();
|
||||
// If the secondLine does not contain a name try to find the region by location
|
||||
ApplicableRegionSet regions = plugin.getWorldGuard().getRegionManager(location.getWorld()).getApplicableRegions(location);
|
||||
if(regions != null) {
|
||||
List<GeneralRegion> candidates = new ArrayList<GeneralRegion>();
|
||||
for(ProtectedRegion pr : regions) {
|
||||
GeneralRegion region = getRegion(pr.getId());
|
||||
if(region != null) {
|
||||
candidates.add(region);
|
||||
}
|
||||
}
|
||||
boolean first = true;
|
||||
for(GeneralRegion region : candidates) {
|
||||
if(first) {
|
||||
result.add(region);
|
||||
first = false;
|
||||
} else {
|
||||
if(region.getRegion().getPriority() > result.get(0).getRegion().getPriority()) {
|
||||
result.clear();
|
||||
result.add(region);
|
||||
} else if(region.getRegion().getParent() != null && region.getRegion().getParent().equals(result.get(0))) {
|
||||
result.clear();
|
||||
result.add(region);
|
||||
} else {
|
||||
result.add(region);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,195 +0,0 @@
|
||||
package nl.evolutioncoding.AreaShop;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
|
||||
public class LanguageManager {
|
||||
private AreaShop plugin = null;
|
||||
private String languages[] = {"EN", "NL", "FR"};
|
||||
private HashMap<String, String> currentLanguage, defaultLanguage;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param plugin The AreaShop plugin
|
||||
*/
|
||||
public LanguageManager(AreaShop plugin) {
|
||||
this.plugin = plugin;
|
||||
|
||||
/* Save default language files if not present */
|
||||
this.saveDefaults();
|
||||
|
||||
/* Open current language file */
|
||||
this.loadLanguage();
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the default language files if not already present
|
||||
*/
|
||||
public void saveDefaults() {
|
||||
/* Create the language folder if it not exists */
|
||||
File langFolder;
|
||||
langFolder = new File(plugin.getDataFolder() + File.separator + AreaShop.languageFolder);
|
||||
if(!langFolder.exists()) {
|
||||
langFolder.mkdirs();
|
||||
}
|
||||
|
||||
/* Create the language files, overwrites if a file already exists */
|
||||
/* Overriding is necessary because otherwise with an update the new lang */
|
||||
/* files would not be used, when translating your own use another */
|
||||
/* file name as the default */
|
||||
File langFile;
|
||||
for(int i=0; i<languages.length; i++) {
|
||||
langFile = new File(plugin.getDataFolder() + File.separator + AreaShop.languageFolder + File.separator + languages[i] + ".yml");
|
||||
InputStream input = null;
|
||||
OutputStream output = null;
|
||||
try {
|
||||
input = plugin.getResource(AreaShop.languageFolder + "/" + languages[i] + ".yml");
|
||||
output = new FileOutputStream(langFile);
|
||||
|
||||
int read = 0;
|
||||
byte[] bytes = new byte[1024];
|
||||
while ((read = input.read(bytes)) != -1) {
|
||||
output.write(bytes, 0, read);
|
||||
}
|
||||
input.close();
|
||||
output.close();
|
||||
} catch(IOException e) {
|
||||
try {
|
||||
input.close();
|
||||
output.close();
|
||||
} catch (IOException e1) {} catch (NullPointerException e2) {}
|
||||
|
||||
plugin.getLogger().info("Something went wrong saving a default language file: " + langFile.getPath());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the current language file specified in the config
|
||||
*/
|
||||
public void loadLanguage() {
|
||||
Map<String, Object> map;
|
||||
Set<String> set;
|
||||
YamlConfiguration ymlFile;
|
||||
|
||||
/* Save the current language file to the HashMap */
|
||||
currentLanguage = new HashMap<String, String>();
|
||||
File file = new File(plugin.getDataFolder() + File.separator + AreaShop.languageFolder + File.separator + plugin.config().getString("language") + ".yml");
|
||||
InputStreamReader reader = null;
|
||||
try {
|
||||
reader = new InputStreamReader(new FileInputStream(file), Charsets.UTF_8);
|
||||
} catch (FileNotFoundException e1) {}
|
||||
if(reader != null) {
|
||||
ymlFile = YamlConfiguration.loadConfiguration(reader);
|
||||
map = ymlFile.getValues(true);
|
||||
set = map.keySet();
|
||||
try {
|
||||
for(String key : set) {
|
||||
currentLanguage.put(key, (String)map.get(key));
|
||||
}
|
||||
} catch(ClassCastException e) {}
|
||||
}
|
||||
|
||||
/* Save the default strings to the HashMap */
|
||||
defaultLanguage = new HashMap<String, String>();
|
||||
File standard = new File(plugin.getDataFolder() + File.separator + AreaShop.languageFolder + "/" + languages[0]+ ".yml");
|
||||
InputStreamReader reader2 = null;
|
||||
try {
|
||||
reader2 = new InputStreamReader(new FileInputStream(standard), Charsets.UTF_8);
|
||||
} catch (FileNotFoundException e1) {}
|
||||
if(reader2 != null) {
|
||||
ymlFile = YamlConfiguration.loadConfiguration(reader2);
|
||||
map = ymlFile.getValues(true);
|
||||
set = map.keySet();
|
||||
try {
|
||||
for(String key : set) {
|
||||
defaultLanguage.put(key, (String)map.get(key));
|
||||
}
|
||||
} catch(ClassCastException e) {}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to get the string in the language that has been set
|
||||
* @param key Key to the language string
|
||||
* @param params The replacements for the %1% tags
|
||||
* @return String The language string specified with the key
|
||||
*/
|
||||
public String getLang(String key, Object... params) {
|
||||
String result = null;
|
||||
|
||||
/* Get the language string */
|
||||
if(currentLanguage.containsKey(key)) {
|
||||
result = currentLanguage.get(key);
|
||||
} else {
|
||||
result = defaultLanguage.get(key);
|
||||
}
|
||||
|
||||
if(result == null) {
|
||||
plugin.getLogger().info("Wrong key for getting translation: " + key);
|
||||
} else {
|
||||
/* Replace all tags, e.g. %0% */
|
||||
for (int i=0; i<params.length; i++) {
|
||||
if(params[i] != null) {
|
||||
result = result.replace("%" + i + "%", params[i].toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
package nl.evolutioncoding.AreaShop;
|
||||
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
public class RentCheck extends BukkitRunnable {
|
||||
AreaShop plugin;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param plugin The AreaShop plugin
|
||||
*/
|
||||
public RentCheck(AreaShop plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
plugin.getFileManager().checkRents();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,140 +0,0 @@
|
||||
package nl.evolutioncoding.AreaShop;
|
||||
|
||||
import nl.evolutioncoding.AreaShop.regions.BuyRegion;
|
||||
import nl.evolutioncoding.AreaShop.regions.GeneralRegion;
|
||||
import nl.evolutioncoding.AreaShop.regions.RentRegion;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.Sign;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
import org.bukkit.event.block.BlockPhysicsEvent;
|
||||
|
||||
/**
|
||||
* Checks for placement of signs for this plugin
|
||||
* @author NLThijs48
|
||||
*/
|
||||
public final class SignBreakListener implements Listener {
|
||||
AreaShop plugin;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param plugin The AreaShop plugin
|
||||
*/
|
||||
public SignBreakListener(AreaShop plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called when a block is broken
|
||||
* @param event The event
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onSignBreak(BlockBreakEvent event) {
|
||||
Block block = event.getBlock();
|
||||
/* Check if it is a sign */
|
||||
if(block.getType() == Material.WALL_SIGN || block.getType() == Material.SIGN_POST) {
|
||||
/* Check if the rent sign is really the same as a saved rent */
|
||||
GeneralRegion region = plugin.getFileManager().getRegionBySignLocation(block.getLocation());
|
||||
if(region == null) {
|
||||
return;
|
||||
}
|
||||
if(region.isRentRegion()) {
|
||||
/* Remove the rent if the player has permission */
|
||||
if(event.getPlayer().hasPermission("areashop.destroyrent")) {
|
||||
plugin.getFileManager().removeRent((RentRegion)region, true);
|
||||
plugin.message(event.getPlayer(), "destroy-successRent", region.getName());
|
||||
} else { /* Cancel the breaking of the sign */
|
||||
event.setCancelled(true);
|
||||
plugin.message(event.getPlayer(), "destroy-noPermissionRent");
|
||||
}
|
||||
} else if(region.isBuyRegion()) {
|
||||
/* Remove the buy if the player has permission */
|
||||
if(event.getPlayer().hasPermission("areashop.destroybuy")) {
|
||||
plugin.getFileManager().removeBuy((BuyRegion)region, true);
|
||||
plugin.message(event.getPlayer(), "destroy-successBuy", region.getName());
|
||||
} else { /* Cancel the breaking of the sign */
|
||||
event.setCancelled(true);
|
||||
plugin.message(event.getPlayer(), "destroy-noPermissionBuy");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the physics of a block change
|
||||
* @param event The event
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onIndirectSignBreak(BlockPhysicsEvent event){
|
||||
Block block = event.getBlock();
|
||||
if(block.getType() == Material.SIGN_POST || block.getType() == Material.WALL_SIGN){
|
||||
Sign sign = (Sign)block.getState();
|
||||
Block attachedTo = block.getRelative(((org.bukkit.material.Sign)sign.getData()).getAttachedFace());
|
||||
if(attachedTo.getType() == Material.AIR){
|
||||
/* Check if the rent sign is really the same as a saved rent */
|
||||
GeneralRegion region = plugin.getFileManager().getRegionBySignLocation(block.getLocation());
|
||||
if(region == null) {
|
||||
return;
|
||||
}
|
||||
region.removeSign(block.getLocation());
|
||||
plugin.getLogger().info("A sign of region " + region.getName() + " has been removed by indirectly breaking it (block below/behind is destroyed)");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
package nl.evolutioncoding.AreaShop;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
public class Utils {
|
||||
|
||||
// Not used
|
||||
private Utils() {}
|
||||
|
||||
|
||||
/**
|
||||
* Create a map from a location, to save it in the config
|
||||
* @param location The location to transform
|
||||
* @return The map with the location values
|
||||
*/
|
||||
public static ConfigurationSection locationToConfig(Location location, boolean setPitchYaw) {
|
||||
if(location == null) {
|
||||
return null;
|
||||
}
|
||||
ConfigurationSection result = new YamlConfiguration();
|
||||
result.set("world", location.getWorld().getName());
|
||||
result.set("x", location.getX());
|
||||
result.set("y", location.getY());
|
||||
result.set("z", location.getZ());
|
||||
if(setPitchYaw) {
|
||||
result.set("yaw", Float.toString(location.getYaw()));
|
||||
result.set("pitch", Float.toString(location.getPitch()));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
public static ConfigurationSection locationToConfig(Location location) {
|
||||
return locationToConfig(location, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a location from a map, reconstruction from the config values
|
||||
* @param map The map to reconstruct from
|
||||
* @return The location
|
||||
*/
|
||||
public static Location configToLocation(ConfigurationSection config) {
|
||||
if(config == null
|
||||
|| !config.isString("world")
|
||||
|| !config.isDouble("x")
|
||||
|| !config.isDouble("y")
|
||||
|| !config.isDouble("z")) {
|
||||
return null;
|
||||
}
|
||||
Location result = new Location(
|
||||
Bukkit.getWorld(config.getString("world")),
|
||||
(Double)config.getDouble("x"),
|
||||
(Double)config.getDouble("y"),
|
||||
(Double)config.getDouble("z"));
|
||||
if(config.isString("yaw") && config.isString("pitch")) {
|
||||
result.setPitch(Float.parseFloat(config.getString("pitch")));
|
||||
result.setYaw(Float.parseFloat(config.getString("yaw")));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static String createCommaSeparatedList(Collection<? extends Object> input) {
|
||||
String result = "";
|
||||
boolean first = true;
|
||||
for(Object object : input) {
|
||||
if(first) {
|
||||
first = false;
|
||||
result += object.toString();
|
||||
} else {
|
||||
result += ", " + object.toString();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loaded 100 of 140 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user