mirror of
https://github.com/md5sha256/AreaShop.git
synced 2026-11-06 17:32:43 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
8d254e17bb | ||
|
|
2098b9f4e3 | ||
|
|
95e3a4a120 | ||
|
|
9269279d44 | ||
|
|
d8fbeaf53a | ||
|
|
6886db8edc | ||
|
|
05df539189 | ||
|
|
f20c573b06 | ||
|
|
793e3dfd1b | ||
|
|
d7eff6c0df | ||
|
|
911115213f | ||
|
|
beeef8c757 | ||
|
|
60bdd50ab6 | ||
|
|
b5ba813410 | ||
|
|
7de0b34b3b | ||
|
|
b5077215ec | ||
|
|
98c45866a3 | ||
|
|
a96101519a | ||
|
|
fc18819a95 | ||
|
|
6dd0750bea | ||
|
|
36b73f57fd | ||
|
|
b111110251 | ||
|
|
555f648dfe | ||
|
|
4ac4c9ae35 | ||
|
|
97fe92588c | ||
|
|
8fc03b21f0 | ||
|
|
a74643d724 | ||
|
|
c309cbbbae | ||
|
|
73ceee6f27 | ||
|
|
9c57f434db | ||
|
|
f41e614d38 | ||
|
|
4fa1267971 | ||
|
|
e99ca02bcb | ||
|
|
3479bcd0d8 | ||
|
|
c0cd528f0e | ||
|
|
14f379f7c6 | ||
|
|
73c1f88d8c | ||
|
|
1bbca09fc6 | ||
|
|
8219269fbb | ||
|
|
bf283d52b6 | ||
|
|
def6005b92 | ||
|
|
62934ceab6 | ||
|
|
9124de9bb0 | ||
|
|
d5da1bb012 | ||
|
|
99d4cdb685 | ||
|
|
b3ea7f7e73 | ||
|
|
24ee8df215 | ||
|
|
63e8f10e20 | ||
|
|
7c03041ae1 | ||
|
|
fb03baf3ad | ||
|
|
c1ef15193c | ||
|
|
c1e89ef75e | ||
|
|
56a35d373b | ||
|
|
5aff3f1ce6 | ||
|
|
6a4b8f9d9a | ||
|
|
ef4b599897 | ||
|
|
a04b96d452 | ||
|
|
0728ce672d | ||
|
|
c42e1ccbe5 | ||
|
|
dfcd896cab | ||
|
|
69ee2d5c7f | ||
|
|
b42bb38e5f | ||
|
|
418b736fae | ||
|
|
bed4bbac23 | ||
|
|
f13534ae33 | ||
|
|
3b1522bad8 | ||
|
|
2995b59070 | ||
|
|
0e46f01150 |
No files matched your search
+1
-2
@@ -1,2 +1 @@
|
||||
/.project
|
||||
/.classpath
|
||||
/target
|
||||
@@ -1 +0,0 @@
|
||||
/org.eclipse.jdt.core.prefs
|
||||
@@ -1 +0,0 @@
|
||||
/nl
|
||||
@@ -1,64 +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 Prison server for a demo #
|
||||
##############################################
|
||||
|
||||
########## GENERAL ##########
|
||||
## Chatprefix used for all messages in the chat
|
||||
chatPrefix: '&2[AreaShop]&r '
|
||||
## The character used for the prices of regions, for the euro character use '%euro%'
|
||||
moneyCharacter: '$'
|
||||
## 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
|
||||
## Maximum total amount of rents and buys together
|
||||
maximumTotal: 1
|
||||
|
||||
########## RENTING ##########
|
||||
## The tag you have to write on the sign for renting a region
|
||||
rentSign: '[rent]'
|
||||
## The line that should be placed on the sign when the region is not rented
|
||||
signRentable: '&2&l[For Rent]'
|
||||
## The line that should be placed on the sign when the region is rented
|
||||
signRented: '&4&l[Rented]'
|
||||
## How much regions a player can rent at the same time, -1 for not limited
|
||||
maximumRents: 1
|
||||
## The percentage of the renting price you get back if you unrent the region (price of time left will be multiplied by this/100)
|
||||
rentMoneyBack: 100
|
||||
## How much seconds between checking if renting has expired (don't put this to low)
|
||||
checkDelay: 60
|
||||
## Flags for the 'For Rent' regions, flags and options to apply when the region is not rented
|
||||
## All region flags can be used + members, owners, priority and parent.
|
||||
flagsForRent:
|
||||
members: -%player%
|
||||
greeting: '%region% can be rented for %price% per %duration%'
|
||||
## Flags for the 'Rented' regions, flags and options to apply when the region is rented
|
||||
## All region flags can be used + members, owners, priority and parent.
|
||||
flagsRented:
|
||||
members: +%player%
|
||||
greeting: '%region% is rented by %player% until %until%'
|
||||
|
||||
########## BUYING ##########
|
||||
## The tag you have to write on the sign for renting a region
|
||||
buySign: '[buy]'
|
||||
## The line that should be placed on the sign when the region is not sold
|
||||
signBuyable: '&2&l[For Sale]'
|
||||
## The line that should be placed on the sign when the region is sold
|
||||
signBuyed: '&4&l[Sold]'
|
||||
## How much regions a player can buy at the same time, -1 for not limited
|
||||
maximumBuys: 1
|
||||
## The percentage of the buying price you get back if you sell the region
|
||||
buyMoneyBack: 100
|
||||
## Flags for the 'For Sale' regions, flags and options to apply when the region is for sale
|
||||
## All region flags can be used + members, owners, priority and parent.
|
||||
flagsForSale:
|
||||
members: -%player%
|
||||
greeting: '%region% can be bought for %price%'
|
||||
## Flags for the 'Sold' regions, flags and options to apply when the region is rented
|
||||
## All region flags can be used + members, owners, priority and parent.
|
||||
flagsSold:
|
||||
members: +%player%
|
||||
greeting: '%region% is bought by %player%'
|
||||
@@ -1,116 +0,0 @@
|
||||
###################################################
|
||||
# English language file for the AreaShop plugin #
|
||||
###################################################
|
||||
# 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: "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"
|
||||
|
||||
rent-regionNotRentable: "That region is not available for renting"
|
||||
rent-help: "/as rent <regionname>"
|
||||
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 /rs 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"
|
||||
|
||||
buy-help: "/as buy <regionname>"
|
||||
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>"
|
||||
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>"
|
||||
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"
|
||||
|
||||
rentsigns-updated: "All signs for renting have been updated"
|
||||
rentsigns-notUpdated: "Not all signs have been updated, maybe reload fixes it"
|
||||
rentsgins-noPermission: "You don't have permission to update all rentsigns"
|
||||
|
||||
buysigns-updated: "All signs for selling have been updated"
|
||||
buysigns-notUpdated: "Not all signs have been updated, maybe reload fixes it"
|
||||
buysigns-noPermission: "You don't have permission to update all buysigns"
|
||||
|
||||
rentregions-updated: "All renting regions have been updated"
|
||||
rentregions-noPermission: "You don't have permission to update all renting regions"
|
||||
|
||||
buyregions-updated: "All buying regions have been updated"
|
||||
buyregions-noPermission: "You don't have permission to update all buying regions"
|
||||
|
||||
reload-reloaded: "The config has been reloaded successfully"
|
||||
reload-noPermission: "You don't have permission to reload the config"
|
||||
|
||||
info-help: "/rs info <all|rented|forrent|sold|forsale|player|region>"
|
||||
info-all-rents: "Regions registered for renting: %0%"
|
||||
info-all-noRents: "There are no regions registered for renting"
|
||||
info-all-buys: "Regions registered for buying: %0%"
|
||||
info-all-noBuys: "There are no regions registered for buying"
|
||||
info-rented: "Rented regions: %0%"
|
||||
info-noRented: "No regions are rented"
|
||||
info-unrented: "Unrented regions: %0%"
|
||||
info-noUnrented: "All regions are rented"
|
||||
info-sold: "Sold regions: %0%"
|
||||
info-noSold: "No regions are sold"
|
||||
info-forsale: "Regions for sale: %0%"
|
||||
info-noForsale: "All regions are sold"
|
||||
info-playerHelp: "/rs info player <name>"
|
||||
info-playerRents: "Regions rented by %0%: %1%"
|
||||
info-playerNoRents: "%0% has not rented a region"
|
||||
info-playerBuys: "Regions bought by %0%: %1%"
|
||||
info-playerNoBuys: "%0% has not bought a region"
|
||||
info-regionHelp: "/rs info region <name>"
|
||||
info-regionNoRenting: "%0% is not registered for renting"
|
||||
info-regionRenting: "&6Renting details for %0%"
|
||||
info-regionRentedBy: "Rented by: %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: %0%"
|
||||
info-regionSign: "Sign position: world=%0%, X=%1%, Y=%2%, Z=%3%"
|
||||
info-regionPriceDuration: "Price: %0% for each %1%"
|
||||
info-regionPrice: "Price: %0%"
|
||||
|
||||
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-updaterentsigns: "&6/as updaterentsigns &7-&r Update all rent signs"
|
||||
help-updatebuysigns: "&6/as updatebuysigns &7-&r Update all buy signs"
|
||||
help-updaterentregions: "&6/as updaterentregions &7-&r Update all rent regions"
|
||||
help-updatebuyregions: "&6/as updatebuyregions &7-&r Update all buy regions"
|
||||
help-reload: "&6/as reload &7-&r Reload the config and languages"
|
||||
@@ -1,116 +0,0 @@
|
||||
###################################################
|
||||
# Dutch language file for the AreaShop plugin #
|
||||
###################################################
|
||||
# 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 '/rs 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 /rs 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"
|
||||
|
||||
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"
|
||||
|
||||
rentsigns-updated: "Alle bordjes voor de verhuur zijn geupdate"
|
||||
rentsigns-notUpdated: "Niet alle bordjes zijn geupdate, een reload zou het op kunnen lossen"
|
||||
rentsgins-noPermission: "Je hebt geen toestemming om alle verhuur bordjes te updaten"
|
||||
|
||||
buysigns-updated: "All bordjes voor de verkoop zijn geupdate"
|
||||
buysigns-notUpdated: "Niet alle bordjes zijn geupdate, een reload zou het op kunnen lossen"
|
||||
buysigns-noPermission: "Je hebt geen toestemming om alle verkoop bordjes te updaten"
|
||||
|
||||
rentregions-updated: "Alle verhuur gebieden zijn geupdate"
|
||||
rentregions-noPermission: "Je hebt geen toestemming om de verhuur gebieden te updaten"
|
||||
|
||||
buyregions-updated: "Alle verkoop gebieden zijn geupdate"
|
||||
buyregions-noPermission: "Je hebt geen toestemming om alle verkoop 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: "/rs 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: "/rs 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%"
|
||||
|
||||
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-updaterentsigns: "&6/as updaterentsigns &7-&r Update alle huur borden"
|
||||
help-updatebuysigns: "&6/as updatebuysigns &7-&r Update alle koop borden"
|
||||
help-updaterentregions: "&6/as updaterentregions &7-&r Update alle huur gebieden"
|
||||
help-updatebuyregions: "&6/as updatebuyregions &7-&r Update alle koop gebieden"
|
||||
help-reload: "&6/as reload &7-&r Herlaad de config en de taalbestanden"
|
||||
@@ -1,80 +0,0 @@
|
||||
name: AreaShop
|
||||
main: nl.evolutioncoding.AreaShop.AreaShop
|
||||
version: 1.0
|
||||
depend: [Vault, WorldGuard]
|
||||
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 RegionRent
|
||||
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.updaterentsigns: true
|
||||
areashop.updatebuysigns: true
|
||||
areashop.updaterentregions: true
|
||||
areashop.updatebuyregions: true
|
||||
areashop.reload: 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.updaterentsigns:
|
||||
description: Allows you to update all rent signs
|
||||
default: op
|
||||
areashop.updatebuysigns:
|
||||
description: Allows you to update all buy signs
|
||||
default: op
|
||||
areashop.updaterentregions:
|
||||
description: Allows you to update all rent regions
|
||||
default: op
|
||||
areashop.updatebuyregions:
|
||||
description: Allows you to update all buy regions
|
||||
default: op
|
||||
areashop.reload:
|
||||
description: Allows you to reload the config
|
||||
default: op
|
||||
@@ -0,0 +1,159 @@
|
||||
<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>
|
||||
<groupId>nl.evolutioncoding</groupId>
|
||||
<artifactId>areashop</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>AreaShop</name>
|
||||
<version>2.2.0</version> <!-- Main plugin version -->
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>bukkit-repo</id>
|
||||
<url>http://repo.bukkit.org/content/groups/public</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>sk89q-repo-wg</id>
|
||||
<url>http://maven.sk89q.com/artifactory/repo/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<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>nl.evolutioncoding</groupId>
|
||||
<artifactId>areashop-worldguard-5</artifactId>
|
||||
<version>WorldGuard-5</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>nl.evolutioncoding</groupId>
|
||||
<artifactId>areashop-worldguard-6</artifactId>
|
||||
<version>WorldGuard-6</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>nl.evolutioncoding</groupId>
|
||||
<artifactId>areashop-interface</artifactId>
|
||||
<version>AreaShopInterface</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>nl.evolutioncoding</groupId>
|
||||
<artifactId>areashop-worldedit-5</artifactId>
|
||||
<version>WorldEdit-5</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>nl.evolutioncoding</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</groupId>
|
||||
<artifactId>vault</artifactId>
|
||||
<version>1.4.1</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/../Dependencies/Vault.jar</systemPath>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<directory>target</directory>
|
||||
<finalName>AreaShop</finalName>
|
||||
<!-- Include all required resources -->
|
||||
<resources>
|
||||
<resource>
|
||||
<targetPath>.</targetPath>
|
||||
<filtering>true</filtering>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>plugin.yml</include>
|
||||
<include>config.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>1.4</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.3</version>
|
||||
<configuration>
|
||||
<source>1.7</source>
|
||||
<target>1.7</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- Copy resulting file to local server, change to your own path -->
|
||||
<plugin>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<configuration>
|
||||
<tasks>
|
||||
<copy file="./target/${project.build.finalName}.jar" tofile="C:\Games\Minecraft\Spigot 1.8.7\plugins\${project.build.finalName}.jar"/>
|
||||
</tasks>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<target failonerror="false"></target>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,914 @@
|
||||
package nl.evolutioncoding.areashop;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
import nl.evolutioncoding.areashop.Updater.UpdateResult;
|
||||
import nl.evolutioncoding.areashop.Updater.UpdateType;
|
||||
import nl.evolutioncoding.areashop.interfaces.AreaShopInterface;
|
||||
import nl.evolutioncoding.areashop.interfaces.WorldEditInterface;
|
||||
import nl.evolutioncoding.areashop.interfaces.WorldGuardInterface;
|
||||
import nl.evolutioncoding.areashop.listeners.PlayerLoginLogoutListener;
|
||||
import nl.evolutioncoding.areashop.listeners.SignBreakListener;
|
||||
import nl.evolutioncoding.areashop.listeners.SignChangeListener;
|
||||
import nl.evolutioncoding.areashop.listeners.SignClickListener;
|
||||
import nl.evolutioncoding.areashop.managers.CommandManager;
|
||||
import nl.evolutioncoding.areashop.managers.FileManager;
|
||||
import nl.evolutioncoding.areashop.managers.LanguageManager;
|
||||
import nl.evolutioncoding.areashop.managers.SignLinkerManager;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
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 org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
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 implements AreaShopInterface {
|
||||
/* General variables */
|
||||
private static AreaShop instance = null;
|
||||
|
||||
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 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 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 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;
|
||||
Plugin plugin = getServer().getPluginManager().getPlugin("WorldGuard");
|
||||
if (plugin == null || !(plugin instanceof WorldGuardPlugin)) {
|
||||
this.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)
|
||||
if(worldGuard.getDescription().getVersion().startsWith("5.")) {
|
||||
wgVersion = "5";
|
||||
} else {
|
||||
wgVersion = "6";
|
||||
}
|
||||
try {
|
||||
final Class<?> clazz = Class.forName("nl.evolutioncoding.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
|
||||
this.worldGuardInterface = (WorldGuardInterface) clazz.getConstructor(AreaShopInterface.class).newInstance(this); // Set our handler
|
||||
}
|
||||
} catch (final Exception e) {
|
||||
e.printStackTrace();
|
||||
this.getLogger().severe("Could not load the handler for WorldGuard (tried to load " + wgVersion + "), report this problem to the author.");
|
||||
error = true;
|
||||
wgVersion = null;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if WorldEdit is present
|
||||
String weVersion = null;
|
||||
plugin = getServer().getPluginManager().getPlugin("WorldEdit");
|
||||
if (plugin == null || !(plugin instanceof WorldEditPlugin)) {
|
||||
this.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("nl.evolutioncoding.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
|
||||
this.worldEditInterface = (WorldEditInterface) clazz.getConstructor(AreaShopInterface.class).newInstance(this); // Set our handler
|
||||
}
|
||||
} catch (final Exception e) {
|
||||
e.printStackTrace();
|
||||
this.getLogger().severe("Could not load the handler for WorldEdit (tried to load " + weVersion + "), report this problem to the author.");
|
||||
error = true;
|
||||
weVersion = null;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if Vault is present
|
||||
if(getServer().getPluginManager().getPlugin("Vault") == null) {
|
||||
this.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);
|
||||
}
|
||||
if(weVersion != null) {
|
||||
AreaShop.debug("Loaded WorldEditHandler" + weVersion);
|
||||
}
|
||||
|
||||
// Create a LanguageMananager
|
||||
languageManager = new LanguageManager(this);
|
||||
|
||||
if(error) {
|
||||
this.getLogger().severe("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);
|
||||
this.getServer().getPluginManager().registerEvents(new PlayerLoginLogoutListener(this), this);
|
||||
|
||||
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(this.getConfig().getBoolean("sendStats")) {
|
||||
this.startMetrics();
|
||||
}
|
||||
|
||||
// Register dynamic permission (things declared in config)
|
||||
registerDynamicPermissions();
|
||||
|
||||
// Dont initialize the updatechecker if disabled in the config
|
||||
if(this.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 : Bukkit.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() {
|
||||
fileManager.saveRequiredFilesAtOnce();
|
||||
Bukkit.getServer().getScheduler().cancelTasks(this);
|
||||
|
||||
/* set variables to null to prevent memory leaks */
|
||||
worldGuard = null;
|
||||
worldEdit = null;
|
||||
fileManager = null;
|
||||
languageManager = null;
|
||||
commandManager = null;
|
||||
chatprefix = null;
|
||||
debug = false;
|
||||
ready = false;
|
||||
updater = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 like &1)
|
||||
*/
|
||||
public void setChatprefix(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) {
|
||||
this.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
|
||||
*/
|
||||
public 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) {
|
||||
this.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(getDurationFromSecondsOrString("expiration.delay"));
|
||||
final AreaShop finalPlugin = this;
|
||||
if(expirationCheck > 0) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if(isReady()) {
|
||||
finalPlugin.getFileManager().checkRents();
|
||||
AreaShop.debug("Checking rent expirations...");
|
||||
} else {
|
||||
AreaShop.debug("Skipped checking rent expirations, plugin not ready");
|
||||
}
|
||||
}
|
||||
}.runTaskTimer(this, 1, expirationCheck);
|
||||
}
|
||||
// Inactive unrenting/selling timer
|
||||
long inactiveCheck = Utils.millisToTicks(getDurationFromMinutesOrString("inactive.delay"));
|
||||
if(inactiveCheck > 0) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if(isReady()) {
|
||||
finalPlugin.getFileManager().checkForInactiveRegions();
|
||||
AreaShop.debug("Checking for regions with players that are inactive too long...");
|
||||
} else {
|
||||
AreaShop.debug("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(getDurationFromSecondsOrString("signs.delay"));
|
||||
if(periodicUpdate > 0) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if(isReady()) {
|
||||
finalPlugin.getFileManager().performPeriodicSignUpdate();
|
||||
AreaShop.debug("Performing periodic sign update...");
|
||||
} else {
|
||||
AreaShop.debug("Skipped performing periodic sign update, plugin not ready");
|
||||
}
|
||||
}
|
||||
}.runTaskTimer(this, periodicUpdate, periodicUpdate);
|
||||
}
|
||||
// Saving regions and group settings
|
||||
long saveFiles = Utils.millisToTicks(getDurationFromMinutesOrString("saving.delay"));
|
||||
if(saveFiles > 0) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if(isReady()) {
|
||||
finalPlugin.getFileManager().saveRequiredFiles();
|
||||
AreaShop.debug("Saving required files...");
|
||||
} else {
|
||||
AreaShop.debug("Skipped saving required files, plugin not ready");
|
||||
}
|
||||
}
|
||||
}.runTaskTimer(this, saveFiles, saveFiles);
|
||||
}
|
||||
// Sending warnings about rent regions to online players
|
||||
long expireWarning = Utils.millisToTicks(getDurationFromMinutesOrString("expireWarning.delay"));
|
||||
if(expireWarning > 0) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if(isReady()) {
|
||||
finalPlugin.getFileManager().sendRentExpireWarnings();
|
||||
AreaShop.debug("Sending rent expire warnings...");
|
||||
} else {
|
||||
AreaShop.debug("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.debug("Updating all regions at startup...");
|
||||
}
|
||||
}.runTaskLater(this, 20L);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 || langString.equals("")) {
|
||||
// Do nothing, message is not available or 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(!getConfig().getBoolean("useColorsInConsole")) {
|
||||
langString = ChatColor.stripColor(langString);
|
||||
}
|
||||
((CommandSender)target).sendMessage(langString);
|
||||
}
|
||||
else if(target instanceof Logger) {
|
||||
if(!getConfig().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 = ChatColor.translateAlternateColorCodes('&', input);
|
||||
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(double amount) {
|
||||
String before = this.getConfig().getString("moneyCharacter");
|
||||
before = before.replace(currencyEuro, "\u20ac");
|
||||
String after = this.getConfig().getString("moneyCharacterAfter");
|
||||
after = after.replace(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 = getConfig().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(getConfig().getInt("fractionalNumbers") + (3-frontLength), RoundingMode.HALF_UP);
|
||||
}
|
||||
result = bigDecimal.toString();
|
||||
} else {
|
||||
BigDecimal bigDecimal = new BigDecimal(amount);
|
||||
bigDecimal = bigDecimal.setScale(getConfig().getInt("fractionalNumbers"), RoundingMode.HALF_UP);
|
||||
amount = bigDecimal.doubleValue();
|
||||
result = bigDecimal.toString();
|
||||
if(getConfig().getBoolean("hideEmptyFractionalPart") && (amount%1.0) == 0.0 && result.contains(".")) {
|
||||
result = result.substring(0, result.indexOf('.'));
|
||||
}
|
||||
}
|
||||
}
|
||||
result = result.replace(".", getConfig().getString("decimalMark"));
|
||||
return before + result + after;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
@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");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.getConfig().getStringList("minutes"));
|
||||
identifiers.addAll(this.getConfig().getStringList("hours"));
|
||||
identifiers.addAll(this.getConfig().getStringList("days"));
|
||||
identifiers.addAll(this.getConfig().getStringList("months"));
|
||||
identifiers.addAll(this.getConfig().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+");
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 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);
|
||||
|
||||
ArrayList<String> seconds = new ArrayList<String>(this.getConfig().getStringList("seconds"));
|
||||
ArrayList<String> minutes = new ArrayList<String>(this.getConfig().getStringList("minutes"));
|
||||
ArrayList<String> hours = new ArrayList<String>(this.getConfig().getStringList("hours"));
|
||||
ArrayList<String> days = new ArrayList<String>(this.getConfig().getStringList("days"));
|
||||
ArrayList<String> months = new ArrayList<String>(this.getConfig().getStringList("months"));
|
||||
ArrayList<String> years = new ArrayList<String>(this.getConfig().getStringList("years"));
|
||||
|
||||
String durationString = duration.substring(duration.indexOf(' ')+1, duration.length());
|
||||
int durationInt = 0;
|
||||
try {
|
||||
durationInt = Integer.parseInt(duration.substring(0, duration.indexOf(' ')));
|
||||
} catch(NumberFormatException exception) {}
|
||||
|
||||
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(months.contains(durationString)) {
|
||||
calendar.add(Calendar.MONTH, durationInt);
|
||||
} else if(years.contains(durationString)) {
|
||||
calendar.add(Calendar.YEAR, durationInt);
|
||||
}
|
||||
return calendar.getTimeInMillis();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 long getDurationFromSecondsOrString(String path) {
|
||||
if(getConfig().isLong(path) || getConfig().isInt(path)) {
|
||||
long setting = getConfig().getLong(path);
|
||||
if(setting != -1) {
|
||||
setting = setting*1000;
|
||||
}
|
||||
return setting;
|
||||
} else {
|
||||
return durationStringToLong(getConfig().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 long getDurationFromMinutesOrString(String path) {
|
||||
if(getConfig().isLong(path) || getConfig().isInt(path)) {
|
||||
long setting = getConfig().getLong(path);
|
||||
if(setting != -1) {
|
||||
setting = setting*60*1000;
|
||||
}
|
||||
return setting;
|
||||
} else {
|
||||
return durationStringToLong(getConfig().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 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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Non-static debug to use as implementation of the interface
|
||||
*/
|
||||
public void debugI(String message) {
|
||||
AreaShop.debug(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reload all files of the plugin and update all regions
|
||||
* confirmationReceiver The CommandSender that should receive confirmation messages, null for nobody
|
||||
*/
|
||||
public void reload(final CommandSender confirmationReceiver) {
|
||||
setReady(false);
|
||||
fileManager.saveRequiredFilesAtOnce();
|
||||
chatprefix = this.getConfig().getString("chatPrefix");
|
||||
debug = this.getConfig().getBoolean("debug");
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 "";
|
||||
} else {
|
||||
UUID parsed = null;
|
||||
try {
|
||||
parsed = UUID.fromString(uuid);
|
||||
} catch(IllegalArgumentException e) {}
|
||||
if(parsed == null) {
|
||||
return "";
|
||||
}
|
||||
return this.toName(parsed);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 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 "";
|
||||
} 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 String toUUID(String name) {
|
||||
if(name == null) {
|
||||
return null;
|
||||
} else {
|
||||
return Bukkit.getOfflinePlayer(name).getUniqueId().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,760 @@
|
||||
/*
|
||||
* Copyright 2011-2013 Tyler Blair. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and contributors and should not be interpreted as representing official policies,
|
||||
* either expressed or implied, of anybody else.
|
||||
*/
|
||||
package nl.evolutioncoding.areashop;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.InvalidConfigurationException;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.PluginDescriptionFile;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.Proxy;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
import java.util.zip.GZIPOutputStream;
|
||||
|
||||
public class Metrics {
|
||||
|
||||
/**
|
||||
* The current revision number
|
||||
*/
|
||||
private final static int REVISION = 7;
|
||||
|
||||
/**
|
||||
* The base url of the metrics domain
|
||||
*/
|
||||
private static final String BASE_URL = "http://report.mcstats.org";
|
||||
|
||||
/**
|
||||
* The url used to report a server's status
|
||||
*/
|
||||
private static final String REPORT_URL = "/plugin/%s";
|
||||
|
||||
/**
|
||||
* Interval of time to ping (in minutes)
|
||||
*/
|
||||
private static final int PING_INTERVAL = 15;
|
||||
|
||||
/**
|
||||
* The plugin this metrics submits for
|
||||
*/
|
||||
private final Plugin plugin;
|
||||
|
||||
/**
|
||||
* All of the custom graphs to submit to metrics
|
||||
*/
|
||||
private final Set<Graph> graphs = Collections.synchronizedSet(new HashSet<Graph>());
|
||||
|
||||
/**
|
||||
* The plugin configuration file
|
||||
*/
|
||||
private final YamlConfiguration configuration;
|
||||
|
||||
/**
|
||||
* The plugin configuration file
|
||||
*/
|
||||
private final File configurationFile;
|
||||
|
||||
/**
|
||||
* Unique server id
|
||||
*/
|
||||
private final String guid;
|
||||
|
||||
/**
|
||||
* Debug mode
|
||||
*/
|
||||
private final boolean debug;
|
||||
|
||||
/**
|
||||
* Lock for synchronization
|
||||
*/
|
||||
private final Object optOutLock = new Object();
|
||||
|
||||
/**
|
||||
* The scheduled task
|
||||
*/
|
||||
private volatile BukkitTask task = null;
|
||||
|
||||
public Metrics(final Plugin plugin) throws IOException {
|
||||
if (plugin == null) {
|
||||
throw new IllegalArgumentException("Plugin cannot be null");
|
||||
}
|
||||
|
||||
this.plugin = plugin;
|
||||
|
||||
// load the config
|
||||
configurationFile = getConfigFile();
|
||||
configuration = YamlConfiguration.loadConfiguration(configurationFile);
|
||||
|
||||
// add some defaults
|
||||
configuration.addDefault("opt-out", false);
|
||||
configuration.addDefault("guid", UUID.randomUUID().toString());
|
||||
configuration.addDefault("debug", false);
|
||||
|
||||
// Do we need to create the file?
|
||||
if (configuration.get("guid", null) == null) {
|
||||
configuration.options().header("http://mcstats.org").copyDefaults(true);
|
||||
configuration.save(configurationFile);
|
||||
}
|
||||
|
||||
// Load the guid then
|
||||
guid = configuration.getString("guid");
|
||||
debug = configuration.getBoolean("debug", false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct and create a Graph that can be used to separate specific plotters to their own graphs on the metrics
|
||||
* website. Plotters can be added to the graph object returned.
|
||||
*
|
||||
* @param name The name of the graph
|
||||
* @return Graph object created. Will never return NULL under normal circumstances unless bad parameters are given
|
||||
*/
|
||||
public Graph createGraph(final String name) {
|
||||
if (name == null) {
|
||||
throw new IllegalArgumentException("Graph name cannot be null");
|
||||
}
|
||||
|
||||
// Construct the graph object
|
||||
final Graph graph = new Graph(name);
|
||||
|
||||
// Now we can add our graph
|
||||
graphs.add(graph);
|
||||
|
||||
// and return back
|
||||
return graph;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a Graph object to BukkitMetrics that represents data for the plugin that should be sent to the backend
|
||||
*
|
||||
* @param graph The name of the graph
|
||||
*/
|
||||
public void addGraph(final Graph graph) {
|
||||
if (graph == null) {
|
||||
throw new IllegalArgumentException("Graph cannot be null");
|
||||
}
|
||||
|
||||
graphs.add(graph);
|
||||
}
|
||||
|
||||
/**
|
||||
* Start measuring statistics. This will immediately create an async repeating task as the plugin and send the
|
||||
* initial data to the metrics backend, and then after that it will post in increments of PING_INTERVAL * 1200
|
||||
* ticks.
|
||||
*
|
||||
* @return True if statistics measuring is running, otherwise false.
|
||||
*/
|
||||
public boolean start() {
|
||||
synchronized (optOutLock) {
|
||||
// Did we opt out?
|
||||
if (isOptOut()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Is metrics already running?
|
||||
if (task != null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Begin hitting the server with glorious data
|
||||
task = plugin.getServer().getScheduler().runTaskTimerAsynchronously(plugin, new Runnable() {
|
||||
|
||||
private boolean firstPost = true;
|
||||
|
||||
public void run() {
|
||||
try {
|
||||
// This has to be synchronized or it can collide with the disable method.
|
||||
synchronized (optOutLock) {
|
||||
// Disable Task, if it is running and the server owner decided to opt-out
|
||||
if (isOptOut() && task != null) {
|
||||
task.cancel();
|
||||
task = null;
|
||||
// Tell all plotters to stop gathering information.
|
||||
for (Graph graph : graphs) {
|
||||
graph.onOptOut();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// We use the inverse of firstPost because if it is the first time we are posting,
|
||||
// it is not a interval ping, so it evaluates to FALSE
|
||||
// Each time thereafter it will evaluate to TRUE, i.e PING!
|
||||
postPlugin(!firstPost);
|
||||
|
||||
// After the first post we set firstPost to false
|
||||
// Each post thereafter will be a ping
|
||||
firstPost = false;
|
||||
} catch (IOException e) {
|
||||
if (debug) {
|
||||
Bukkit.getLogger().log(Level.INFO, "[Metrics] " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 0, PING_INTERVAL * 1200);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Has the server owner denied plugin metrics?
|
||||
*
|
||||
* @return true if metrics should be opted out of it
|
||||
*/
|
||||
public boolean isOptOut() {
|
||||
synchronized (optOutLock) {
|
||||
try {
|
||||
// Reload the metrics file
|
||||
configuration.load(getConfigFile());
|
||||
} catch (IOException ex) {
|
||||
if (debug) {
|
||||
Bukkit.getLogger().log(Level.INFO, "[Metrics] " + ex.getMessage());
|
||||
}
|
||||
return true;
|
||||
} catch (InvalidConfigurationException ex) {
|
||||
if (debug) {
|
||||
Bukkit.getLogger().log(Level.INFO, "[Metrics] " + ex.getMessage());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return configuration.getBoolean("opt-out", false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables metrics for the server by setting "opt-out" to false in the config file and starting the metrics task.
|
||||
*
|
||||
* @throws java.io.IOException
|
||||
*/
|
||||
public void enable() throws IOException {
|
||||
// This has to be synchronized or it can collide with the check in the task.
|
||||
synchronized (optOutLock) {
|
||||
// Check if the server owner has already set opt-out, if not, set it.
|
||||
if (isOptOut()) {
|
||||
configuration.set("opt-out", false);
|
||||
configuration.save(configurationFile);
|
||||
}
|
||||
|
||||
// Enable Task, if it is not running
|
||||
if (task == null) {
|
||||
start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Disables metrics for the server by setting "opt-out" to true in the config file and canceling the metrics task.
|
||||
*
|
||||
* @throws java.io.IOException
|
||||
*/
|
||||
public void disable() throws IOException {
|
||||
// This has to be synchronized or it can collide with the check in the task.
|
||||
synchronized (optOutLock) {
|
||||
// Check if the server owner has already set opt-out, if not, set it.
|
||||
if (!isOptOut()) {
|
||||
configuration.set("opt-out", true);
|
||||
configuration.save(configurationFile);
|
||||
}
|
||||
|
||||
// Disable Task, if it is running
|
||||
if (task != null) {
|
||||
task.cancel();
|
||||
task = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the File object of the config file that should be used to store data such as the GUID and opt-out status
|
||||
*
|
||||
* @return the File object for the config file
|
||||
*/
|
||||
public File getConfigFile() {
|
||||
// I believe the easiest way to get the base folder (e.g craftbukkit set via -P) for plugins to use
|
||||
// is to abuse the plugin object we already have
|
||||
// plugin.getDataFolder() => base/plugins/PluginA/
|
||||
// pluginsFolder => base/plugins/
|
||||
// The base is not necessarily relative to the startup directory.
|
||||
File pluginsFolder = plugin.getDataFolder().getParentFile();
|
||||
|
||||
// return => base/plugins/PluginMetrics/config.yml
|
||||
return new File(new File(pluginsFolder, "PluginMetrics"), "config.yml");
|
||||
}
|
||||
|
||||
/**
|
||||
* Generic method that posts a plugin to the metrics website
|
||||
*/
|
||||
private void postPlugin(final boolean isPing) throws IOException {
|
||||
// Server software specific section
|
||||
PluginDescriptionFile description = plugin.getDescription();
|
||||
String pluginName = description.getName();
|
||||
boolean onlineMode = Bukkit.getServer().getOnlineMode(); // TRUE if online mode is enabled
|
||||
String pluginVersion = description.getVersion();
|
||||
String serverVersion = Bukkit.getVersion();
|
||||
// TODO change to different method
|
||||
int playersOnline = Bukkit.getServer().getOnlinePlayers().length;
|
||||
|
||||
// END server software specific section -- all code below does not use any code outside of this class / Java
|
||||
|
||||
// Construct the post data
|
||||
StringBuilder json = new StringBuilder(1024);
|
||||
json.append('{');
|
||||
|
||||
// The plugin's description file containg all of the plugin data such as name, version, author, etc
|
||||
appendJSONPair(json, "guid", guid);
|
||||
appendJSONPair(json, "plugin_version", pluginVersion);
|
||||
appendJSONPair(json, "server_version", serverVersion);
|
||||
appendJSONPair(json, "players_online", Integer.toString(playersOnline));
|
||||
|
||||
// New data as of R6
|
||||
String osname = System.getProperty("os.name");
|
||||
String osarch = System.getProperty("os.arch");
|
||||
String osversion = System.getProperty("os.version");
|
||||
String java_version = System.getProperty("java.version");
|
||||
int coreCount = Runtime.getRuntime().availableProcessors();
|
||||
|
||||
// normalize os arch .. amd64 -> x86_64
|
||||
if (osarch.equals("amd64")) {
|
||||
osarch = "x86_64";
|
||||
}
|
||||
|
||||
appendJSONPair(json, "osname", osname);
|
||||
appendJSONPair(json, "osarch", osarch);
|
||||
appendJSONPair(json, "osversion", osversion);
|
||||
appendJSONPair(json, "cores", Integer.toString(coreCount));
|
||||
appendJSONPair(json, "auth_mode", onlineMode ? "1" : "0");
|
||||
appendJSONPair(json, "java_version", java_version);
|
||||
|
||||
// If we're pinging, append it
|
||||
if (isPing) {
|
||||
appendJSONPair(json, "ping", "1");
|
||||
}
|
||||
|
||||
if (graphs.size() > 0) {
|
||||
synchronized (graphs) {
|
||||
json.append(',');
|
||||
json.append('"');
|
||||
json.append("graphs");
|
||||
json.append('"');
|
||||
json.append(':');
|
||||
json.append('{');
|
||||
|
||||
boolean firstGraph = true;
|
||||
|
||||
final Iterator<Graph> iter = graphs.iterator();
|
||||
|
||||
while (iter.hasNext()) {
|
||||
Graph graph = iter.next();
|
||||
|
||||
StringBuilder graphJson = new StringBuilder();
|
||||
graphJson.append('{');
|
||||
|
||||
for (Plotter plotter : graph.getPlotters()) {
|
||||
appendJSONPair(graphJson, plotter.getColumnName(), Integer.toString(plotter.getValue()));
|
||||
}
|
||||
|
||||
graphJson.append('}');
|
||||
|
||||
if (!firstGraph) {
|
||||
json.append(',');
|
||||
}
|
||||
|
||||
json.append(escapeJSON(graph.getName()));
|
||||
json.append(':');
|
||||
json.append(graphJson);
|
||||
|
||||
firstGraph = false;
|
||||
}
|
||||
|
||||
json.append('}');
|
||||
}
|
||||
}
|
||||
|
||||
// close json
|
||||
json.append('}');
|
||||
|
||||
// Create the url
|
||||
URL url = new URL(BASE_URL + String.format(REPORT_URL, urlEncode(pluginName)));
|
||||
|
||||
// Connect to the website
|
||||
URLConnection connection;
|
||||
|
||||
// Mineshafter creates a socks proxy, so we can safely bypass it
|
||||
// It does not reroute POST requests so we need to go around it
|
||||
if (isMineshafterPresent()) {
|
||||
connection = url.openConnection(Proxy.NO_PROXY);
|
||||
} else {
|
||||
connection = url.openConnection();
|
||||
}
|
||||
|
||||
|
||||
byte[] uncompressed = json.toString().getBytes();
|
||||
byte[] compressed = gzip(json.toString());
|
||||
|
||||
// Headers
|
||||
connection.addRequestProperty("User-Agent", "MCStats/" + REVISION);
|
||||
connection.addRequestProperty("Content-Type", "application/json");
|
||||
connection.addRequestProperty("Content-Encoding", "gzip");
|
||||
connection.addRequestProperty("Content-Length", Integer.toString(compressed.length));
|
||||
connection.addRequestProperty("Accept", "application/json");
|
||||
connection.addRequestProperty("Connection", "close");
|
||||
|
||||
connection.setDoOutput(true);
|
||||
|
||||
if (debug) {
|
||||
System.out.println("[Metrics] Prepared request for " + pluginName + " uncompressed=" + uncompressed.length + " compressed=" + compressed.length);
|
||||
}
|
||||
|
||||
// Write the data
|
||||
OutputStream os = connection.getOutputStream();
|
||||
os.write(compressed);
|
||||
os.flush();
|
||||
|
||||
// Now read the response
|
||||
final BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
|
||||
String response = reader.readLine();
|
||||
|
||||
// close resources
|
||||
os.close();
|
||||
reader.close();
|
||||
|
||||
if (response == null || response.startsWith("ERR") || response.startsWith("7")) {
|
||||
if (response == null) {
|
||||
response = "null";
|
||||
} else if (response.startsWith("7")) {
|
||||
response = response.substring(response.startsWith("7,") ? 2 : 1);
|
||||
}
|
||||
|
||||
throw new IOException(response);
|
||||
} else {
|
||||
// Is this the first update this hour?
|
||||
if (response.equals("1") || response.contains("This is your first update this hour")) {
|
||||
synchronized (graphs) {
|
||||
final Iterator<Graph> iter = graphs.iterator();
|
||||
|
||||
while (iter.hasNext()) {
|
||||
final Graph graph = iter.next();
|
||||
|
||||
for (Plotter plotter : graph.getPlotters()) {
|
||||
plotter.reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* GZip compress a string of bytes
|
||||
*
|
||||
* @param input
|
||||
* @return
|
||||
*/
|
||||
public static byte[] gzip(String input) {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
GZIPOutputStream gzos = null;
|
||||
|
||||
try {
|
||||
gzos = new GZIPOutputStream(baos);
|
||||
gzos.write(input.getBytes("UTF-8"));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (gzos != null) try {
|
||||
gzos.close();
|
||||
} catch (IOException ignore) {
|
||||
}
|
||||
}
|
||||
|
||||
return baos.toByteArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if mineshafter is present. If it is, we need to bypass it to send POST requests
|
||||
*
|
||||
* @return true if mineshafter is installed on the server
|
||||
*/
|
||||
private boolean isMineshafterPresent() {
|
||||
try {
|
||||
Class.forName("mineshafter.MineServer");
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a json encoded key/value pair to the given string builder.
|
||||
*
|
||||
* @param json
|
||||
* @param key
|
||||
* @param value
|
||||
* @throws UnsupportedEncodingException
|
||||
*/
|
||||
private static void appendJSONPair(StringBuilder json, String key, String value) throws UnsupportedEncodingException {
|
||||
boolean isValueNumeric = false;
|
||||
|
||||
try {
|
||||
if (value.equals("0") || !value.endsWith("0")) {
|
||||
Double.parseDouble(value);
|
||||
isValueNumeric = true;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
isValueNumeric = false;
|
||||
}
|
||||
|
||||
if (json.charAt(json.length() - 1) != '{') {
|
||||
json.append(',');
|
||||
}
|
||||
|
||||
json.append(escapeJSON(key));
|
||||
json.append(':');
|
||||
|
||||
if (isValueNumeric) {
|
||||
json.append(value);
|
||||
} else {
|
||||
json.append(escapeJSON(value));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Escape a string to create a valid JSON string
|
||||
*
|
||||
* @param text
|
||||
* @return
|
||||
*/
|
||||
private static String escapeJSON(String text) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
||||
builder.append('"');
|
||||
for (int index = 0; index < text.length(); index++) {
|
||||
char chr = text.charAt(index);
|
||||
|
||||
switch (chr) {
|
||||
case '"':
|
||||
case '\\':
|
||||
builder.append('\\');
|
||||
builder.append(chr);
|
||||
break;
|
||||
case '\b':
|
||||
builder.append("\\b");
|
||||
break;
|
||||
case '\t':
|
||||
builder.append("\\t");
|
||||
break;
|
||||
case '\n':
|
||||
builder.append("\\n");
|
||||
break;
|
||||
case '\r':
|
||||
builder.append("\\r");
|
||||
break;
|
||||
default:
|
||||
if (chr < ' ') {
|
||||
String t = "000" + Integer.toHexString(chr);
|
||||
builder.append("\\u" + t.substring(t.length() - 4));
|
||||
} else {
|
||||
builder.append(chr);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
builder.append('"');
|
||||
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode text as UTF-8
|
||||
*
|
||||
* @param text the text to encode
|
||||
* @return the encoded text, as UTF-8
|
||||
*/
|
||||
private static String urlEncode(final String text) throws UnsupportedEncodingException {
|
||||
return URLEncoder.encode(text, "UTF-8");
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a custom graph on the website
|
||||
*/
|
||||
public static class Graph {
|
||||
|
||||
/**
|
||||
* The graph's name, alphanumeric and spaces only :) If it does not comply to the above when submitted, it is
|
||||
* rejected
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
/**
|
||||
* The set of plotters that are contained within this graph
|
||||
*/
|
||||
private final Set<Plotter> plotters = new LinkedHashSet<Plotter>();
|
||||
|
||||
private Graph(final String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the graph's name
|
||||
*
|
||||
* @return the Graph's name
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a plotter to the graph, which will be used to plot entries
|
||||
*
|
||||
* @param plotter the plotter to add to the graph
|
||||
*/
|
||||
public void addPlotter(final Plotter plotter) {
|
||||
plotters.add(plotter);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a plotter from the graph
|
||||
*
|
||||
* @param plotter the plotter to remove from the graph
|
||||
*/
|
||||
public void removePlotter(final Plotter plotter) {
|
||||
plotters.remove(plotter);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an <b>unmodifiable</b> set of the plotter objects in the graph
|
||||
*
|
||||
* @return an unmodifiable {@link java.util.Set} of the plotter objects
|
||||
*/
|
||||
public Set<Plotter> getPlotters() {
|
||||
return Collections.unmodifiableSet(plotters);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return name.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object object) {
|
||||
if (!(object instanceof Graph)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final Graph graph = (Graph) object;
|
||||
return graph.name.equals(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the server owner decides to opt-out of BukkitMetrics while the server is running.
|
||||
*/
|
||||
protected void onOptOut() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Interface used to collect custom data for a plugin
|
||||
*/
|
||||
public static abstract class Plotter {
|
||||
|
||||
/**
|
||||
* The plot's name
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
/**
|
||||
* Construct a plotter with the default plot name
|
||||
*/
|
||||
public Plotter() {
|
||||
this("Default");
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a plotter with a specific plot name
|
||||
*
|
||||
* @param name the name of the plotter to use, which will show up on the website
|
||||
*/
|
||||
public Plotter(final String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current value for the plotted point. Since this function defers to an external function it may or may
|
||||
* not return immediately thus cannot be guaranteed to be thread friendly or safe. This function can be called
|
||||
* from any thread so care should be taken when accessing resources that need to be synchronized.
|
||||
*
|
||||
* @return the current value for the point to be plotted.
|
||||
*/
|
||||
public abstract int getValue();
|
||||
|
||||
/**
|
||||
* Get the column name for the plotted point
|
||||
*
|
||||
* @return the plotted point's column name
|
||||
*/
|
||||
public String getColumnName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called after the website graphs have been updated
|
||||
*/
|
||||
public void reset() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return getColumnName().hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object object) {
|
||||
if (!(object instanceof Plotter)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final Plotter plotter = (Plotter) object;
|
||||
return plotter.name.equals(name) && plotter.getValue() == getValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,746 @@
|
||||
package nl.evolutioncoding.areashop;
|
||||
|
||||
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;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 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) {
|
||||
final String localVersion = this.plugin.getDescription().getVersion();
|
||||
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().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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,293 @@
|
||||
package nl.evolutioncoding.areashop;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import nl.evolutioncoding.areashop.regions.BuyRegion;
|
||||
import nl.evolutioncoding.areashop.regions.GeneralRegion;
|
||||
import nl.evolutioncoding.areashop.regions.GeneralRegion.RegionType;
|
||||
import nl.evolutioncoding.areashop.regions.RentRegion;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
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;
|
||||
|
||||
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")
|
||||
|| Bukkit.getWorld(config.getString("world")) == null) {
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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<? extends Object> 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;
|
||||
}
|
||||
|
||||
public 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<GeneralRegion>();
|
||||
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<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 static List<ProtectedRegion> getApplicableRegions(Location location) {
|
||||
List<ProtectedRegion> result = new ArrayList<ProtectedRegion>();
|
||||
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;
|
||||
}
|
||||
|
||||
// Methods to get the most important AreaShop regions at a certain location
|
||||
public static List<RentRegion> getApplicableRentRegions(Location location) {
|
||||
List<RentRegion> result = new ArrayList<RentRegion>();
|
||||
for(GeneralRegion region : getApplicableASRegions(location, RegionType.RENT)) {
|
||||
result.add((RentRegion)region);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
public static List<BuyRegion> getApplicableBuyRegions(Location location) {
|
||||
List<BuyRegion> result = new ArrayList<BuyRegion>();
|
||||
for(GeneralRegion region : getApplicableASRegions(location, RegionType.BUY)) {
|
||||
result.add((BuyRegion)region);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
public static List<GeneralRegion> getAllApplicableRegions(Location location) {
|
||||
return getApplicableASRegions(location, null);
|
||||
}
|
||||
public static List<GeneralRegion> getApplicableASRegions(Location location, RegionType type) {
|
||||
List<GeneralRegion> result = new ArrayList<GeneralRegion>();
|
||||
// TODO move to version specific classes
|
||||
Set<ProtectedRegion> regions = AreaShop.getInstance().getWorldGuardHandler().getApplicableRegionsSet(location);
|
||||
if(regions != null) {
|
||||
List<GeneralRegion> candidates = new ArrayList<GeneralRegion>();
|
||||
for(ProtectedRegion pr : regions) {
|
||||
GeneralRegion region = AreaShop.getInstance().getFileManager().getRegion(pr.getId());
|
||||
if(region != null && (
|
||||
(type == RegionType.RENT && region.isRentRegion())
|
||||
|| (type == 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))) {
|
||||
result.clear();
|
||||
result.add(region);
|
||||
} else {
|
||||
result.add(region);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return new ArrayList<GeneralRegion>(result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,239 @@
|
||||
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.managers.FileManager.AddResult;
|
||||
import nl.evolutioncoding.areashop.regions.BuyRegion;
|
||||
import nl.evolutioncoding.areashop.regions.GeneralRegion.RegionEvent;
|
||||
import nl.evolutioncoding.areashop.regions.GeneralRegion.RegionType;
|
||||
import nl.evolutioncoding.areashop.regions.RentRegion;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import com.sk89q.worldedit.bukkit.selections.Selection;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
|
||||
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 plugin.getLanguageManager().getLang("help-add");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(final CommandSender sender, Command command, 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<ProtectedRegion>();
|
||||
World world = null;
|
||||
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 ArrayList<String> namesSuccess = new ArrayList<String>();
|
||||
private ArrayList<String> namesAlready = new ArrayList<String>();
|
||||
private ArrayList<String> namesBlacklisted = new ArrayList<String>();
|
||||
private ArrayList<String> namesNoPermission = new ArrayList<String>();
|
||||
|
||||
@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 = null;
|
||||
if(isRent) {
|
||||
type = "rent";
|
||||
} else {
|
||||
type = "buy";
|
||||
}
|
||||
AddResult result = plugin.getFileManager().checkRegionAdd(sender, region, isRent ? RegionType.RENT : RegionType.BUY);
|
||||
if(result == AddResult.ALREADYADDED) {
|
||||
namesAlready.add(region.getId());
|
||||
} else if(result == AddResult.BLACKLISTED) {
|
||||
namesBlacklisted.add(region.getId());
|
||||
} else if(result == AddResult.NOPERMISSION) {
|
||||
namesNoPermission.add(region.getId());
|
||||
} else {
|
||||
namesSuccess.add(region.getId());
|
||||
// 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(RegionEvent.CREATED, true);
|
||||
plugin.getFileManager().addRent(rent);
|
||||
rent.handleSchematicEvent(RegionEvent.CREATED);
|
||||
// Set the flags for the region
|
||||
rent.updateRegionFlags();
|
||||
// Run commands
|
||||
rent.runEventCommands(RegionEvent.CREATED, false);
|
||||
} else {
|
||||
BuyRegion buy = new BuyRegion(plugin, region.getId(), finalWorld);
|
||||
// Set landlord
|
||||
if(landlord) {
|
||||
buy.setLandlord(finalPlayer.getUniqueId(), finalPlayer.getName());
|
||||
}
|
||||
// Run commands
|
||||
buy.runEventCommands(RegionEvent.CREATED, true);
|
||||
|
||||
plugin.getFileManager().addBuy(buy);
|
||||
buy.handleSchematicEvent(RegionEvent.CREATED);
|
||||
// Set the flags for the region
|
||||
buy.updateRegionFlags();
|
||||
// Run commands
|
||||
buy.runEventCommands(RegionEvent.CREATED, false);
|
||||
}
|
||||
}
|
||||
current++;
|
||||
}
|
||||
}
|
||||
if(current >= finalRegions.size()) {
|
||||
if(!namesSuccess.isEmpty()) {
|
||||
plugin.message(sender, "add-success", args[1], Utils.createCommaSeparatedList(namesSuccess));
|
||||
}
|
||||
if(!namesAlready.isEmpty()) {
|
||||
plugin.message(sender, "add-failed", Utils.createCommaSeparatedList(namesAlready));
|
||||
}
|
||||
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<String>();
|
||||
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,149 @@
|
||||
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.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
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")) {
|
||||
return plugin.getLanguageManager().getLang("help-addFriendAll");
|
||||
} else if(target.hasPermission("areashop.addfriend")) {
|
||||
return plugin.getLanguageManager().getLang("help-addFriend");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void execute(CommandSender sender, Command command, 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 = null;
|
||||
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");
|
||||
return;
|
||||
}
|
||||
OfflinePlayer friend = Bukkit.getOfflinePlayer(args[1]);
|
||||
if(friend.getLastPlayed() == 0 && !plugin.getConfig().getBoolean("addFriendNotExistingPlayers")) {
|
||||
plugin.message(sender, "addfriend-notVisited", args[1]);
|
||||
return;
|
||||
}
|
||||
if(region.getFriends().contains(friend.getUniqueId())) {
|
||||
plugin.message(sender, "addfriend-alreadyAdded", friend.getName());
|
||||
return;
|
||||
}
|
||||
if(region.isOwner(friend.getUniqueId())) {
|
||||
plugin.message(sender, "addfriend-self", friend.getName());
|
||||
return;
|
||||
}
|
||||
region.addFriend(friend.getUniqueId());
|
||||
region.updateRegionFlags();
|
||||
region.updateSigns();
|
||||
plugin.message(sender, "addfriend-successOther", friend.getName(), region.getName());
|
||||
} 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]);
|
||||
return;
|
||||
}
|
||||
if(region.getFriends().contains(friend.getUniqueId())) {
|
||||
plugin.message(sender, "addfriend-alreadyAdded", friend.getName());
|
||||
return;
|
||||
}
|
||||
if(region.isOwner(friend.getUniqueId())) {
|
||||
plugin.message(sender, "addfriend-self", friend.getName());
|
||||
return;
|
||||
}
|
||||
region.addFriend(friend.getUniqueId());
|
||||
region.updateRegionFlags();
|
||||
region.updateSigns();
|
||||
plugin.message(sender, "addfriend-success", friend.getName(), region.getName());
|
||||
} else {
|
||||
plugin.message(sender, "addfriend-noPermissionOther");
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "addfriend-noPermission");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
ArrayList<String> result = new ArrayList<String>();
|
||||
if(toComplete == 2) {
|
||||
for(Player player : Bukkit.getOnlinePlayers()) {
|
||||
result.add(player.getName());
|
||||
}
|
||||
} else if(toComplete == 3) {
|
||||
result.addAll(plugin.getFileManager().getRegionNames());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
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.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 = 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 = 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));
|
||||
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);
|
||||
} else {
|
||||
plugin.message(sender, "addsign-successProfile", region, profile);
|
||||
}
|
||||
region.updateSigns();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
List<String> result = new ArrayList<String>();
|
||||
if(toComplete == 2) {
|
||||
result.addAll(plugin.getFileManager().getRegionNames());
|
||||
} else if(toComplete == 3) {
|
||||
result.addAll(plugin.getConfig().getStringList("signProfiles"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
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 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.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");
|
||||
return;
|
||||
} else if (regions.size() > 1) {
|
||||
plugin.message(sender, "cmd-moreRegionsAtLocation");
|
||||
return;
|
||||
} else {
|
||||
regions.get(0).buy(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
ArrayList<String> result = new ArrayList<String>();
|
||||
if(toComplete == 2) {
|
||||
for(BuyRegion region : plugin.getFileManager().getBuys()) {
|
||||
if(!region.isSold()) {
|
||||
result.add(region.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
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, CommandSender sender);
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
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.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 region that he has permission for
|
||||
ArrayList<String> namesSuccess = new ArrayList<String>();
|
||||
ArrayList<String> namesFailed = new ArrayList<String>();
|
||||
for(GeneralRegion region : regions) {
|
||||
boolean isLandlord = sender instanceof Player && region.isLandlord(((Player)sender).getUniqueId());
|
||||
if(region.isRentRegion()) {
|
||||
if(!sender.hasPermission("areashop.destroyrent") && !(isLandlord && sender.hasPermission("areashop.destroyrent.landlord"))) {
|
||||
namesFailed.add(region.getName());
|
||||
} 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.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;
|
||||
}
|
||||
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.getName());
|
||||
} else {
|
||||
plugin.message(sender, "destroy-noPermissionRent");
|
||||
}
|
||||
} 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.getName());
|
||||
} else {
|
||||
plugin.message(sender, "destroy-noPermissionBuy");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
List<String> result = new ArrayList<String>();
|
||||
if(toComplete == 2) {
|
||||
result = plugin.getFileManager().getRegionNames();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
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.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
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")) {
|
||||
return plugin.getLanguageManager().getLang("help-delFriendAll");
|
||||
} else if(target.hasPermission("areashop.delfriend")) {
|
||||
return plugin.getLanguageManager().getLang("help-delFriend");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void execute(CommandSender sender, Command command, 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 = null;
|
||||
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");
|
||||
return;
|
||||
}
|
||||
OfflinePlayer friend = Bukkit.getOfflinePlayer(args[1]);
|
||||
if(!region.getFriends().contains(friend.getUniqueId())) {
|
||||
plugin.message(sender, "delfriend-notAdded", friend.getName());
|
||||
return;
|
||||
}
|
||||
region.deleteFriend(friend.getUniqueId());
|
||||
region.updateRegionFlags();
|
||||
region.updateSigns();
|
||||
plugin.message(sender, "delfriend-successOther", friend.getName(), region.getName());
|
||||
} else {
|
||||
if(sender.hasPermission("areashop.delfriend") && sender instanceof Player) {
|
||||
if(region.isOwner((Player)sender)) {
|
||||
OfflinePlayer friend = Bukkit.getOfflinePlayer(args[1]);
|
||||
if(!region.getFriends().contains(friend.getUniqueId())) {
|
||||
plugin.message(sender, "delfriend-notAdded", friend.getName());
|
||||
return;
|
||||
}
|
||||
region.deleteFriend(friend.getUniqueId());
|
||||
region.updateRegionFlags();
|
||||
region.updateSigns();
|
||||
plugin.message(sender, "delfriend-success", friend.getName(), region.getName());
|
||||
} else {
|
||||
plugin.message(sender, "delfriend-noPermissionOther");
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "delfriend-noPermission");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
ArrayList<String> result = new ArrayList<String>();
|
||||
if(toComplete == 2) {
|
||||
for(Player player : Bukkit.getOnlinePlayers()) {
|
||||
result.add(player.getName());
|
||||
}
|
||||
} else if(toComplete == 3) {
|
||||
result.addAll(plugin.getFileManager().getRegionNames());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
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.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;
|
||||
}
|
||||
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();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
return new ArrayList<String>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,200 @@
|
||||
package nl.evolutioncoding.areashop.commands;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import nl.evolutioncoding.areashop.AreaShop;
|
||||
import nl.evolutioncoding.areashop.regions.BuyRegion;
|
||||
import nl.evolutioncoding.areashop.regions.RegionGroup;
|
||||
import nl.evolutioncoding.areashop.regions.RentRegion;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
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 plugin.getLanguageManager().getLang("help-find");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, Command command, 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) {
|
||||
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<BuyRegion>();
|
||||
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()));
|
||||
|
||||
BigDecimal bigDecimal = new BigDecimal(balance);
|
||||
bigDecimal = bigDecimal.setScale(2, RoundingMode.HALF_UP);
|
||||
balance = bigDecimal.doubleValue();
|
||||
String onlyInGroup = "";
|
||||
if(group != null) {
|
||||
onlyInGroup = plugin.getLanguageManager().getLang("find-onlyInGroup", args[3]);
|
||||
}
|
||||
if(maxPriceSet) {
|
||||
plugin.message(player, "find-successMax", "buy", region.getName(), maxPrice, onlyInGroup);
|
||||
} else {
|
||||
plugin.message(player, "find-success", "buy", region.getName(), balance, onlyInGroup);
|
||||
}
|
||||
region.teleportPlayer(player, region.getBooleanSetting("general.findTeleportToSign"), false);
|
||||
} else {
|
||||
BigDecimal bigDecimal = new BigDecimal(balance);
|
||||
bigDecimal = bigDecimal.setScale(2, RoundingMode.HALF_UP);
|
||||
balance = bigDecimal.doubleValue();
|
||||
String onlyInGroup = "";
|
||||
if(group != null) {
|
||||
onlyInGroup = plugin.getLanguageManager().getLang("find-onlyInGroup", args[3]);
|
||||
}
|
||||
if(maxPriceSet) {
|
||||
plugin.message(player, "find-noneFound", "buy", maxPrice, onlyInGroup);
|
||||
} else {
|
||||
plugin.message(player, "find-noneFoundMax", "buy", balance, onlyInGroup);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
List<RentRegion> regions = plugin.getFileManager().getRents();
|
||||
List<RentRegion> results = new ArrayList<RentRegion>();
|
||||
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()));
|
||||
|
||||
BigDecimal bigDecimal = new BigDecimal(balance);
|
||||
bigDecimal = bigDecimal.setScale(2, RoundingMode.HALF_UP);
|
||||
balance = bigDecimal.doubleValue();
|
||||
String onlyInGroup = "";
|
||||
if(group != null) {
|
||||
onlyInGroup = plugin.getLanguageManager().getLang("find-onlyInGroup", args[3]);
|
||||
}
|
||||
if(maxPriceSet) {
|
||||
plugin.message(player, "find-successMax", "rent", region.getName(), maxPrice, onlyInGroup);
|
||||
} else {
|
||||
plugin.message(player, "find-success", "rent", region.getName(), balance, onlyInGroup);
|
||||
}
|
||||
region.teleportPlayer(player, region.getBooleanSetting("general.findTeleportToSign"), false);
|
||||
} else {
|
||||
BigDecimal bigDecimal = new BigDecimal(balance);
|
||||
bigDecimal = bigDecimal.setScale(2, RoundingMode.HALF_UP);
|
||||
balance = bigDecimal.doubleValue();
|
||||
String onlyInGroup = "";
|
||||
if(group != null) {
|
||||
onlyInGroup = plugin.getLanguageManager().getLang("find-onlyInGroup", args[3]);
|
||||
}
|
||||
if(maxPriceSet) {
|
||||
plugin.message(player, "find-noneFound", "rent", maxPrice, onlyInGroup);
|
||||
} else {
|
||||
plugin.message(player, "find-noneFoundMax", "rent", balance, onlyInGroup);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
ArrayList<String> result = new ArrayList<String>();
|
||||
if(toComplete == 2) {
|
||||
result.add("buy");
|
||||
result.add("rent");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
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 = Utils.getASRegionsInSelection(selection);
|
||||
if(regions.size() == 0) {
|
||||
plugin.message(player, "cmd-noRegionsFound");
|
||||
return;
|
||||
}
|
||||
ArrayList<String> namesSuccess = new ArrayList<String>();
|
||||
ArrayList<String> namesFailed = new ArrayList<String>();
|
||||
ArrayList<GeneralRegion> toUpdate = new ArrayList<GeneralRegion>();
|
||||
for(GeneralRegion region : regions) {
|
||||
if(group.addMember(region)) {
|
||||
namesSuccess.add(region.getName());
|
||||
toUpdate.add(region);
|
||||
} 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));
|
||||
}
|
||||
// Update all regions, this does it in a task, updating them without lag
|
||||
plugin.getFileManager().updateRegions(toUpdate, player);
|
||||
} else {
|
||||
GeneralRegion region = plugin.getFileManager().getRegion(args[2]);
|
||||
if(region == null) {
|
||||
plugin.message(sender, "groupadd-noRegion", args[2]);
|
||||
return;
|
||||
}
|
||||
if(group.addMember(region)) {
|
||||
region.updateRegionFlags();
|
||||
region.updateSigns();
|
||||
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, CommandSender sender) {
|
||||
List<String> result = new ArrayList<String>();
|
||||
if(toComplete == 2) {
|
||||
result = plugin.getFileManager().getGroupNames();
|
||||
} else if(toComplete == 3) {
|
||||
result = plugin.getFileManager().getRegionNames();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
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 = Utils.getASRegionsInSelection(selection);
|
||||
if(regions.size() == 0) {
|
||||
plugin.message(player, "cmd-noRegionsFound");
|
||||
return;
|
||||
}
|
||||
ArrayList<String> namesSuccess = new ArrayList<String>();
|
||||
ArrayList<String> namesFailed = new ArrayList<String>();
|
||||
ArrayList<GeneralRegion> toUpdate = new ArrayList<GeneralRegion>();
|
||||
for(GeneralRegion region : regions) {
|
||||
if(group.removeMember(region)) {
|
||||
namesSuccess.add(region.getName());
|
||||
toUpdate.add(region);
|
||||
} 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));
|
||||
}
|
||||
// Update all regions, this does it in a task, updating them without lag
|
||||
plugin.getFileManager().updateRegions(toUpdate, player);
|
||||
group.saveRequired();
|
||||
} else {
|
||||
GeneralRegion region = plugin.getFileManager().getRegion(args[2]);
|
||||
if(region == null) {
|
||||
plugin.message(sender, "groupdel-noRegion", args[2]);
|
||||
return;
|
||||
}
|
||||
if(group.removeMember(region)) {
|
||||
region.updateRegionFlags();
|
||||
region.updateSigns();
|
||||
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, CommandSender sender) {
|
||||
List<String> result = new ArrayList<String>();
|
||||
if(toComplete == 2) {
|
||||
result = plugin.getFileManager().getGroupNames();
|
||||
} else if(toComplete == 3) {
|
||||
result = plugin.getFileManager().getRegionNames();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
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, CommandSender sender) {
|
||||
List<String> result = new ArrayList<String>();
|
||||
if(toComplete == 2) {
|
||||
result = plugin.getFileManager().getGroupNames();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
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, CommandSender sender) {
|
||||
return new ArrayList<String>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package nl.evolutioncoding.areashop.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import nl.evolutioncoding.areashop.AreaShop;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
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 plugin.getLanguageManager().getLang("help-help");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, Command command, String[] args) {
|
||||
plugin.getCommandManager().showHelp(sender);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
ArrayList<String> result = new ArrayList<String>();
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,488 @@
|
||||
package nl.evolutioncoding.areashop.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
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.RegionGroup;
|
||||
import nl.evolutioncoding.areashop.regions.RentRegion;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
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 plugin.getLanguageManager().getLang("help-info");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, Command command, String[] args) {
|
||||
if(!sender.hasPermission("areashop.info")) {
|
||||
plugin.message(sender, "info-noPermission");
|
||||
return;
|
||||
}
|
||||
if(args.length > 1 && args[1] != null) {
|
||||
/* List of all regions */
|
||||
if(args[1].equalsIgnoreCase("all")) {
|
||||
String message = "";
|
||||
/* Message for rents */
|
||||
Iterator<RentRegion> itRent = plugin.getFileManager().getRents().iterator();
|
||||
if(itRent.hasNext()) {
|
||||
message = itRent.next().getName();
|
||||
while(itRent.hasNext()) {
|
||||
message += ", " + itRent.next().getName();
|
||||
}
|
||||
}
|
||||
if(message.equals("")) {
|
||||
plugin.message(sender, "info-all-noRents");
|
||||
} else {
|
||||
plugin.message(sender, "info-all-rents", message);
|
||||
}
|
||||
|
||||
/* Message for buys */
|
||||
message = "";
|
||||
Iterator<BuyRegion> itBuy = plugin.getFileManager().getBuys().iterator();
|
||||
if(itBuy.hasNext()) {
|
||||
message = itBuy.next().getName();
|
||||
while(itBuy.hasNext()) {
|
||||
message += ", " + itBuy.next().getName();
|
||||
}
|
||||
}
|
||||
if(message.equals("")) {
|
||||
plugin.message(sender, "info-all-noBuys");
|
||||
} else {
|
||||
plugin.message(sender, "info-all-buys", message);
|
||||
}
|
||||
}
|
||||
/* List of rented regions */
|
||||
else if(args[1].equalsIgnoreCase("rented")) {
|
||||
String message = "";
|
||||
Iterator<RentRegion> it = plugin.getFileManager().getRents().iterator();
|
||||
boolean first = true;
|
||||
while(it.hasNext()) {
|
||||
RentRegion next = it.next();
|
||||
if(next.isRented()) {
|
||||
if(!first) {
|
||||
message += ", " + next.getName();
|
||||
} else {
|
||||
first = false;
|
||||
message += next.getName();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(message.equals("")) {
|
||||
plugin.message(sender, "info-noRented");
|
||||
} else {
|
||||
plugin.message(sender, "info-rented", message);
|
||||
}
|
||||
}
|
||||
/* List of unrented regions */
|
||||
else if(args[1].equalsIgnoreCase("forrent")) {
|
||||
String message = "";
|
||||
Iterator<RentRegion> it = plugin.getFileManager().getRents().iterator();
|
||||
boolean first = true;
|
||||
while(it.hasNext()) {
|
||||
RentRegion next = it.next();
|
||||
if(!next.isRented()) {
|
||||
if(!first) {
|
||||
message += ", " + next.getName();
|
||||
} else {
|
||||
first = false;
|
||||
message = next.getName();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(message.equals("")) {
|
||||
plugin.message(sender, "info-noUnrented");
|
||||
} else {
|
||||
plugin.message(sender, "info-unrented", message);
|
||||
}
|
||||
} else if(args[1].equalsIgnoreCase("sold")) {
|
||||
String message = "";
|
||||
Iterator<BuyRegion> it = plugin.getFileManager().getBuys().iterator();
|
||||
boolean first = true;
|
||||
while(it.hasNext()) {
|
||||
BuyRegion next = it.next();
|
||||
if(next.isSold()) {
|
||||
if(!first) {
|
||||
message += ", ";
|
||||
} else {
|
||||
first = false;
|
||||
}
|
||||
message += next.getName();
|
||||
}
|
||||
}
|
||||
if(message.equals("")) {
|
||||
plugin.message(sender, "info-noSold");
|
||||
} else {
|
||||
plugin.message(sender, "info-sold", message);
|
||||
}
|
||||
} else if(args[1].equalsIgnoreCase("forsale")) {
|
||||
String message = "";
|
||||
Iterator<BuyRegion> it = plugin.getFileManager().getBuys().iterator();
|
||||
boolean first = true;
|
||||
while(it.hasNext()) {
|
||||
BuyRegion next =it.next();
|
||||
if(!next.isSold()) {
|
||||
if(!first) {
|
||||
message += ", " + next.getName();
|
||||
} else {
|
||||
first = false;
|
||||
message = next.getName();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(message.equals("")) {
|
||||
plugin.message(sender, "info-noForsale");
|
||||
} else {
|
||||
plugin.message(sender, "info-forsale", message);
|
||||
}
|
||||
} else if(args[1].equalsIgnoreCase("player")) {
|
||||
if(args.length > 2 && args[2] != null) {
|
||||
String message = "";
|
||||
Iterator<RentRegion> itRent = plugin.getFileManager().getRents().iterator();
|
||||
boolean first = true;
|
||||
while(itRent.hasNext()) {
|
||||
RentRegion next = itRent.next();
|
||||
if(next.isRented() && next.getPlayerName().equalsIgnoreCase(args[2])) {
|
||||
if(!first) {
|
||||
message += ", " + next.getName();
|
||||
} else {
|
||||
first = false;
|
||||
message = next.getName();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(message.equals("")) {
|
||||
plugin.message(sender, "info-playerNoRents", args[2]);
|
||||
} else {
|
||||
plugin.message(sender, "info-playerRents", args[2], message);
|
||||
}
|
||||
|
||||
message = "";
|
||||
Iterator<BuyRegion> itBuy = plugin.getFileManager().getBuys().iterator();
|
||||
first = true;
|
||||
while(itBuy.hasNext()) {
|
||||
BuyRegion next = itBuy.next();
|
||||
if(next.isSold() && next.getPlayerName().equalsIgnoreCase(args[2])) {
|
||||
if(!first) {
|
||||
message += ", ";
|
||||
} else {
|
||||
first = false;
|
||||
}
|
||||
message += next.getName();
|
||||
}
|
||||
}
|
||||
if(message.equals("")) {
|
||||
plugin.message(sender, "info-playerNoBuys", args[2]);
|
||||
} else {
|
||||
plugin.message(sender, "info-playerBuys", args[2], message);
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "info-playerHelp");
|
||||
}
|
||||
} 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);
|
||||
plugin.messageNoPrefix(sender, "info-regionMoneyBackRent", rent);
|
||||
if(!rent.getFriendNames().isEmpty()) {
|
||||
plugin.messageNoPrefix(sender, "info-regionFriends", rent);
|
||||
}
|
||||
} else {
|
||||
plugin.messageNoPrefix(sender, "info-regionCanBeRented", rent);
|
||||
}
|
||||
if(rent.getLandlordName() != null) {
|
||||
plugin.messageNoPrefix(sender, "info-regionLandlord", rent);
|
||||
}
|
||||
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);
|
||||
}
|
||||
if(sender.hasPermission("areashop.teleport") || sender.hasPermission("areashop.teleportall")) {
|
||||
Location teleport = rent.getTeleportLocation();
|
||||
if(teleport == null) {
|
||||
if(rent.isRented()) {
|
||||
plugin.messageNoPrefix(sender, "info-regionNoTeleport", rent, plugin.getLanguageManager().getLang("info-regionTeleportHint", rent));
|
||||
} else {
|
||||
plugin.messageNoPrefix(sender, "info-regionNoTeleport", rent, "");
|
||||
}
|
||||
} else {
|
||||
plugin.messageNoPrefix(sender, "info-regionTeleportAt", rent, teleport.getWorld().getName(), teleport.getBlockX(), teleport.getBlockY(), teleport.getBlockZ(), (int)teleport.getPitch(), (int)teleport.getYaw());
|
||||
}
|
||||
}
|
||||
List<String> signLocations = new ArrayList<String>();
|
||||
for(Location location : rent.getSignLocations()) {
|
||||
signLocations.add(plugin.getLanguageManager().getLang("info-regionSignLocation", location.getWorld().getName(), location.getBlockX(), location.getBlockY(), location.getBlockZ()));
|
||||
}
|
||||
if(!signLocations.isEmpty()) {
|
||||
plugin.messageNoPrefix(sender, "info-regionSigns", Utils.createCommaSeparatedList(signLocations));
|
||||
}
|
||||
if(sender.hasPermission("areashop.groupinfo") && !rent.getGroupNames().isEmpty()) {
|
||||
plugin.messageNoPrefix(sender, "info-regionGroups", Utils.createCommaSeparatedList(rent.getGroupNames()));
|
||||
}
|
||||
if(rent.isRestoreEnabled()) {
|
||||
if(sender.hasPermission("areashop.setrestore")) {
|
||||
plugin.messageNoPrefix(sender, "info-regionRestoringRent", rent, plugin.getLanguageManager().getLang("info-regionRestoringProfile", rent.getRestoreProfile()));
|
||||
} else {
|
||||
plugin.messageNoPrefix(sender, "info-regionRestoringRent", rent, "");
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
plugin.messageNoPrefix(sender, "info-regionMoneyBackBuy", buy);
|
||||
if(!buy.getFriendNames().isEmpty()) {
|
||||
plugin.messageNoPrefix(sender, "info-regionFriends", buy);
|
||||
}
|
||||
} 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);
|
||||
}
|
||||
if(sender.hasPermission("areashop.teleport") || sender.hasPermission("areashop.teleportall")) {
|
||||
Location teleport = buy.getTeleportLocation();
|
||||
if(teleport == null) {
|
||||
if(buy.isSold()) {
|
||||
plugin.messageNoPrefix(sender, "info-regionNoTeleport", buy, plugin.getLanguageManager().getLang("info-regionTeleportHint", buy));
|
||||
} else {
|
||||
plugin.messageNoPrefix(sender, "info-regionNoTeleport", buy, "");
|
||||
}
|
||||
} else {
|
||||
plugin.messageNoPrefix(sender, "info-regionTeleportAt", buy, teleport.getWorld().getName(), teleport.getBlockX(), teleport.getBlockY(), teleport.getBlockZ(), (int)teleport.getPitch(), (int)teleport.getYaw());
|
||||
}
|
||||
}
|
||||
List<String> signLocations = new ArrayList<String>();
|
||||
for(Location location : buy.getSignLocations()) {
|
||||
signLocations.add(plugin.getLanguageManager().getLang("info-regionSignLocation", location.getWorld().getName(), location.getBlockX(), location.getBlockY(), location.getBlockZ()));
|
||||
}
|
||||
if(!signLocations.isEmpty()) {
|
||||
plugin.messageNoPrefix(sender, "info-regionSigns", Utils.createCommaSeparatedList(signLocations));
|
||||
}
|
||||
if(sender.hasPermission("areashop.groupinfo") && !buy.getGroupNames().isEmpty()) {
|
||||
plugin.messageNoPrefix(sender, "info-regionGroups", Utils.createCommaSeparatedList(buy.getGroupNames()));
|
||||
}
|
||||
if(buy.isRestoreEnabled()) {
|
||||
if(sender.hasPermission("areashop.setrestore")) {
|
||||
plugin.messageNoPrefix(sender, "info-regionRestoringBuy", buy, plugin.getLanguageManager().getLang("info-regionRestoringProfile", buy.getRestoreProfile()));
|
||||
} else {
|
||||
plugin.messageNoPrefix(sender, "info-regionRestoringBuy", buy, "");
|
||||
}
|
||||
}
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
/* List of regions without a group */
|
||||
else if(args[1].equalsIgnoreCase("nogroup")) {
|
||||
String message = "";
|
||||
/* Message for rents */
|
||||
List<String> rents = plugin.getFileManager().getRentNames();
|
||||
// Remove regions that have a group
|
||||
for(RegionGroup group : plugin.getFileManager().getGroups()) {
|
||||
rents.removeAll(group.getMembers());
|
||||
}
|
||||
// Create the list message
|
||||
Iterator<String> itRent = rents.iterator();
|
||||
if(itRent.hasNext()) {
|
||||
message = itRent.next();
|
||||
while(itRent.hasNext()) {
|
||||
message += ", " + itRent.next();
|
||||
}
|
||||
}
|
||||
if(message.equals("")) {
|
||||
plugin.message(sender, "info-nogroupNoRents");
|
||||
} else {
|
||||
plugin.message(sender, "info-nogroupRents", message);
|
||||
}
|
||||
|
||||
/* Message for buys */
|
||||
message = "";
|
||||
// Remove regions that have a group
|
||||
List<String> buys = plugin.getFileManager().getBuyNames();
|
||||
for(RegionGroup group : plugin.getFileManager().getGroups()) {
|
||||
buys.removeAll(group.getMembers());
|
||||
}
|
||||
// Create the list message
|
||||
Iterator<String> itBuy = buys.iterator();
|
||||
if(itBuy.hasNext()) {
|
||||
message = itBuy.next();
|
||||
while(itBuy.hasNext()) {
|
||||
message += ", " + itBuy.next();
|
||||
}
|
||||
}
|
||||
if(message.equals("")) {
|
||||
plugin.message(sender, "info-nogroupNoBuys");
|
||||
} else {
|
||||
plugin.message(sender, "info-nogroupBuys", message);
|
||||
}
|
||||
} 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<String>();
|
||||
if(toComplete == 2) {
|
||||
result.addAll(Arrays.asList("all", "rented", "forrent", "sold", "forsale", "player", "region", "nogroup"));
|
||||
} else if(toComplete == 3) {
|
||||
if(start[2].equalsIgnoreCase("player")) {
|
||||
for(Player player : Bukkit.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,83 @@
|
||||
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 org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
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 plugin.getLanguageManager().getLang("help-linksigns");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, Command command, 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)) {
|
||||
plugin.message(sender, "addsign-wrongProfile", Utils.createCommaSeparatedList(profiles));
|
||||
return;
|
||||
}
|
||||
}
|
||||
plugin.getSignlinkerManager().enterSignLinkMode(player, profile);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
List<String> result = new ArrayList<String>();
|
||||
if(toComplete == 2) {
|
||||
result.addAll(plugin.getFileManager().getRegionNames());
|
||||
} else if(toComplete == 3) {
|
||||
result.addAll(plugin.getConfig().getStringList("signProfiles"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
package nl.evolutioncoding.areashop.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import nl.evolutioncoding.areashop.AreaShop;
|
||||
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;
|
||||
|
||||
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 plugin.getLanguageManager().getLang("help-me");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, Command command, String[] args) {
|
||||
if(!sender.hasPermission("areashop.me")) {
|
||||
plugin.message(sender, "me-noPermission");
|
||||
return;
|
||||
}
|
||||
if(!(sender instanceof Player)) {
|
||||
plugin.message(sender, "me-notAPlayer");
|
||||
return;
|
||||
}
|
||||
Player player = (Player)sender;
|
||||
// Get the regions owned by the player
|
||||
Set<RentRegion> rentRegions = new HashSet<RentRegion>();
|
||||
for(RentRegion region : plugin.getFileManager().getRents()) {
|
||||
if(region.isOwner(player)) {
|
||||
rentRegions.add(region);
|
||||
}
|
||||
}
|
||||
Set<BuyRegion> buyRegions = new HashSet<BuyRegion>();
|
||||
for(BuyRegion region : plugin.getFileManager().getBuys()) {
|
||||
if(region.isOwner(player)) {
|
||||
buyRegions.add(region);
|
||||
}
|
||||
}
|
||||
// Send messages
|
||||
if(rentRegions.isEmpty()) {
|
||||
plugin.message(player, "me-noRentRegions");
|
||||
} else {
|
||||
plugin.message(player, "me-rentRegions");
|
||||
for(RentRegion region : rentRegions) {
|
||||
plugin.messageNoPrefix(player, "me-rentLine", region);
|
||||
}
|
||||
}
|
||||
if(buyRegions.isEmpty()) {
|
||||
plugin.message(player, "me-noBuyRegions");
|
||||
} else {
|
||||
plugin.message(player, "me-buyRegions");
|
||||
for(BuyRegion region : buyRegions) {
|
||||
plugin.messageNoPrefix(player, "me-buyLine", region);
|
||||
}
|
||||
}
|
||||
Set<GeneralRegion> friendRegions = new HashSet<GeneralRegion>();
|
||||
for(GeneralRegion region : plugin.getFileManager().getRegions()) {
|
||||
if(region.getFriends() != null && region.getFriends().contains(player.getUniqueId())) {
|
||||
friendRegions.add(region);
|
||||
}
|
||||
}
|
||||
if(friendRegions.isEmpty()) {
|
||||
plugin.message(player, "me-noFriendRegions");
|
||||
} else {
|
||||
plugin.message(player, "me-friendRegions");
|
||||
for(GeneralRegion region : friendRegions) {
|
||||
plugin.messageNoPrefix(player, "me-friendLine", region);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
List<String> result = new ArrayList<String>();
|
||||
// Nothing to complete
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package nl.evolutioncoding.areashop.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import nl.evolutioncoding.areashop.AreaShop;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
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 plugin.getLanguageManager().getLang("help-reload");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, Command command, 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");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
ArrayList<String> result = new ArrayList<String>();
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
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.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.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");
|
||||
return;
|
||||
} else if (regions.size() > 1) {
|
||||
plugin.message(sender, "cmd-moreRegionsAtLocation");
|
||||
return;
|
||||
} else {
|
||||
regions.get(0).rent(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
ArrayList<String> result = new ArrayList<String>();
|
||||
if(toComplete == 2) {
|
||||
for(RentRegion region : plugin.getFileManager().getRents()) {
|
||||
if(!region.isRented()) {
|
||||
result.add(region.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
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 org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
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")) {
|
||||
return plugin.getLanguageManager().getLang("help-resellAll");
|
||||
} else if(target.hasPermission("areashop.resell")) {
|
||||
return plugin.getLanguageManager().getLang("help-resell");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, Command command, 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 = 0.0;
|
||||
try {
|
||||
price = Double.parseDouble(args[1]);
|
||||
} catch(NumberFormatException e) {
|
||||
plugin.message(sender, "resell-wrongPrice", args[1]);
|
||||
return;
|
||||
}
|
||||
BuyRegion buy = null;
|
||||
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, "resell-noRegionFound");
|
||||
return;
|
||||
}
|
||||
if(!buy.isSold()) {
|
||||
plugin.message(sender, "resell-notBought", buy);
|
||||
return;
|
||||
}
|
||||
if(sender.hasPermission("areashop.resellall")) {
|
||||
buy.enableReselling(price);
|
||||
plugin.message(sender, "resell-success", buy);
|
||||
buy.updateSigns();
|
||||
buy.updateRegionFlags();
|
||||
} else if(sender.hasPermission("areashop.resell") && sender instanceof Player) {
|
||||
if(buy.isOwner((Player)sender)) {
|
||||
buy.enableReselling(price);
|
||||
plugin.message(sender, "resell-success", buy);
|
||||
buy.updateSigns();
|
||||
buy.updateRegionFlags();
|
||||
} else {
|
||||
plugin.message(sender, "resell-noPermissionOther");
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "resell-noPermission");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
ArrayList<String> result = new ArrayList<String>();
|
||||
if(toComplete == 3) {
|
||||
for(BuyRegion region : plugin.getFileManager().getBuys()) {
|
||||
if(region.isSold() && !region.isInResellingMode()) {
|
||||
result.add(region.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
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;
|
||||
}
|
||||
if(region.getRegion() == null) {
|
||||
plugin.message(sender, "general-noRegion", region.getName());
|
||||
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, CommandSender sender) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
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 org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
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")) {
|
||||
return plugin.getLanguageManager().getLang("help-sell");
|
||||
} else if(target.hasPermission("areashop.sellown")) {
|
||||
return plugin.getLanguageManager().getLang("help-sellOwn");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, Command command, String[] args) {
|
||||
if(!sender.hasPermission("areashop.sell") && !sender.hasPermission("areashop.sellown")) {
|
||||
plugin.message(sender, "sell-noPermission");
|
||||
return;
|
||||
}
|
||||
BuyRegion buy = null;
|
||||
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");
|
||||
return;
|
||||
}
|
||||
if(sender.hasPermission("areashop.sell")) {
|
||||
plugin.message(sender, "sell-sold", buy.getPlayerName());
|
||||
buy.sell(true);
|
||||
} else {
|
||||
if(sender.hasPermission("areashop.sellown") && sender instanceof Player) {
|
||||
if(buy.getBuyer().equals(((Player)sender).getUniqueId())) {
|
||||
plugin.message(sender, "sell-soldYours");
|
||||
buy.sell(true);
|
||||
} else {
|
||||
plugin.message(sender, "sell-noPermissionOther");
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "sell-noPermission");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
ArrayList<String> result = new ArrayList<String>();
|
||||
if(toComplete == 2) {
|
||||
for(BuyRegion region : plugin.getFileManager().getBuys()) {
|
||||
if(region.isSold()) {
|
||||
result.add(region.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
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.RentRegion;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
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 plugin.getLanguageManager().getLang("help-setduration");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, Command command, 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 = null;
|
||||
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") && !rent.isLandlord(((Player)sender).getUniqueId())) {
|
||||
plugin.message(sender, "setduration-noLandlord", rent);
|
||||
return;
|
||||
}
|
||||
if("default".equalsIgnoreCase(args[1]) || "reset".equalsIgnoreCase(args[1])) {
|
||||
plugin.message(sender, "setduration-successRemoved", rent);
|
||||
rent.setDuration(null);
|
||||
rent.updateRegionFlags();
|
||||
rent.updateSigns();
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Integer.parseInt(args[1]);
|
||||
} catch(NumberFormatException e) {
|
||||
plugin.message(sender, "setduration-wrongAmount", args[1]);
|
||||
return;
|
||||
}
|
||||
if(!plugin.checkTimeFormat(args[1] + " " + args[2])) {
|
||||
plugin.message(sender, "setduration-wrongFormat", args[1]+" "+args[2]);
|
||||
return;
|
||||
}
|
||||
rent.setDuration(args[1]+" "+args[2]);
|
||||
rent.updateRegionFlags();
|
||||
rent.updateSigns();
|
||||
plugin.message(sender, "setduration-success", rent.getName(), rent.getDurationString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
List<String> result = new ArrayList<String>();
|
||||
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,93 @@
|
||||
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 org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
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 plugin.getLanguageManager().getLang("help-setlandlord");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, Command command, 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 = null;
|
||||
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, "setlandlord-noRegion", args[2]);
|
||||
return;
|
||||
}
|
||||
String playerName = player.getName();
|
||||
if(playerName == null || playerName.isEmpty()) {
|
||||
playerName = args[1];
|
||||
}
|
||||
region.setLandlord(player.getUniqueId(), playerName);
|
||||
plugin.message(sender, "setlandlord-success", playerName, region.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
ArrayList<String> result = new ArrayList<String>();
|
||||
if(toComplete == 2) {
|
||||
for(Player player : Bukkit.getOnlinePlayers()) {
|
||||
result.add(player.getName());
|
||||
}
|
||||
} else if(toComplete == 3) {
|
||||
result.addAll(plugin.getFileManager().getRegionNames());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
package nl.evolutioncoding.areashop.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
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.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
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 plugin.getLanguageManager().getLang("help-setowner");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, Command command, 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");
|
||||
return;
|
||||
}
|
||||
if(region.isBuyRegion() && !sender.hasPermission("areashop.setownerbuy")) {
|
||||
plugin.message(sender, "setowner-noPermissionBuy");
|
||||
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]);
|
||||
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);
|
||||
plugin.message(sender, "setowner-succesRentExtend", region);
|
||||
rent.updateRegionFlags();
|
||||
rent.updateSigns();
|
||||
} 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);
|
||||
plugin.message(sender, "setowner-succesRent", region);
|
||||
rent.updateRegionFlags();
|
||||
rent.updateSigns();
|
||||
}
|
||||
rent.updateRegionFlags();
|
||||
rent.updateSigns();
|
||||
}
|
||||
if(region.isBuyRegion()) {
|
||||
BuyRegion buy = (BuyRegion)region;
|
||||
buy.setBuyer(uuid);
|
||||
plugin.message(sender, "setowner-succesBuy", region);
|
||||
buy.updateRegionFlags();
|
||||
buy.updateSigns();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
ArrayList<String> result = new ArrayList<String>();
|
||||
if(toComplete == 2) {
|
||||
for(Player player : Bukkit.getOnlinePlayers()) {
|
||||
result.add(player.getName());
|
||||
}
|
||||
} else if(toComplete == 3) {
|
||||
result.addAll(plugin.getFileManager().getRegionNames());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
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;
|
||||
|
||||
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 plugin.getLanguageManager().getLang("help-setprice");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, Command command, 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 = null;
|
||||
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") && !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();
|
||||
}
|
||||
plugin.message(sender, "setprice-successRemoved", region);
|
||||
region.updateSigns();
|
||||
region.updateRegionFlags();
|
||||
return;
|
||||
}
|
||||
double price = 0.0;
|
||||
try {
|
||||
price = Double.parseDouble(args[1]);
|
||||
} catch(NumberFormatException e) {
|
||||
plugin.message(sender, "setprice-wrongPrice", args[1]);
|
||||
return;
|
||||
}
|
||||
AreaShop.debug("price: " + price + ", raw: " + args[1]);
|
||||
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.updateSigns();
|
||||
region.updateRegionFlags();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
List<String> result = new ArrayList<String>();
|
||||
if(toComplete == 3) {
|
||||
result = plugin.getFileManager().getRegionNames();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
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;
|
||||
}
|
||||
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", region.getName(), valueString, args[3]);
|
||||
} else {
|
||||
plugin.message(sender, "setrestore-success", region.getName(), valueString);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
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.getConfig().getConfigurationSection("schematicProfiles").getKeys(false));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
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.worldguard.protection.regions.ProtectedRegion;
|
||||
|
||||
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")) {
|
||||
return plugin.getLanguageManager().getLang("help-setteleportAll");
|
||||
} else if(target.hasPermission("areashop.teleport")) {
|
||||
return plugin.getLanguageManager().getLang("help-setteleport");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, Command command, 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 = null;
|
||||
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[1]);
|
||||
}
|
||||
|
||||
boolean owner = false;
|
||||
|
||||
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");
|
||||
return;
|
||||
} else if(!owner && !player.hasPermission("areashop.setteleportall")) {
|
||||
plugin.message(player, "setteleport-noPermissionOther");
|
||||
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);
|
||||
plugin.message(player, "setteleport-reset", region.getName());
|
||||
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.getName());
|
||||
return;
|
||||
}
|
||||
region.setTeleport(player.getLocation());
|
||||
plugin.message(player, "setteleport-success", region.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
ArrayList<String> result = new ArrayList<String>();
|
||||
if(toComplete == 2) {
|
||||
result.addAll(plugin.getFileManager().getRegionNames());
|
||||
} else if(toComplete == 3) {
|
||||
result.add("reset");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,229 @@
|
||||
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.RegionEvent;
|
||||
import nl.evolutioncoding.areashop.regions.RegionGroup;
|
||||
import nl.evolutioncoding.areashop.regions.RentRegion;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
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;
|
||||
|
||||
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 plugin.getLanguageManager().getLang("help-stack");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, Command command, 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) {}
|
||||
if(tempAmount <= 0) {
|
||||
plugin.message(player, "stack-wrongAmount", args[1]);
|
||||
return;
|
||||
}
|
||||
// Check gap
|
||||
int gap = -1;
|
||||
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 = null;
|
||||
if(rentRegions) {
|
||||
type = "rent";
|
||||
} else {
|
||||
type = "buy";
|
||||
}
|
||||
String groupsMessage = "";
|
||||
if(group != null) {
|
||||
groupsMessage = plugin.getLanguageManager().getLang("stack-addToGroup", 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(RegionEvent.CREATED, true);
|
||||
plugin.getFileManager().addRent(rent);
|
||||
rent.handleSchematicEvent(RegionEvent.CREATED);
|
||||
rent.updateRegionFlags();
|
||||
rent.runEventCommands(RegionEvent.CREATED, false);
|
||||
} else {
|
||||
BuyRegion buy = new BuyRegion(plugin, region.getId(), selection.getWorld());
|
||||
if(finalGroup != null) {
|
||||
finalGroup.addMember(buy);
|
||||
}
|
||||
buy.runEventCommands(RegionEvent.CREATED, true);
|
||||
plugin.getFileManager().addBuy(buy);
|
||||
buy.handleSchematicEvent(RegionEvent.CREATED);
|
||||
buy.updateRegionFlags();
|
||||
buy.runEventCommands(RegionEvent.CREATED, false);
|
||||
}
|
||||
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<String>();
|
||||
if(toComplete == 5) {
|
||||
result.add("rent");
|
||||
result.add("buy");
|
||||
} else if(toComplete == 6) {
|
||||
result.addAll(plugin.getFileManager().getGroupNames());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
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 org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
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")) {
|
||||
return plugin.getLanguageManager().getLang("help-stopResellAll");
|
||||
} else if(target.hasPermission("areashop.stopresell")) {
|
||||
return plugin.getLanguageManager().getLang("help-stopResell");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, Command command, String[] args) {
|
||||
if(!sender.hasPermission("areashop.stopresell") && !sender.hasPermission("areashop.stopresellall")) {
|
||||
plugin.message(sender, "stopresell-noPermissionOther");
|
||||
return;
|
||||
}
|
||||
|
||||
BuyRegion buy = null;
|
||||
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, "stopresell-noRegionFound");
|
||||
return;
|
||||
}
|
||||
if(!buy.isInResellingMode()) {
|
||||
plugin.message(sender, "stopresell-notResell", buy);
|
||||
return;
|
||||
}
|
||||
if(sender.hasPermission("areashop.stopresellall")) {
|
||||
buy.disableReselling();
|
||||
plugin.message(sender, "stopresell-success", buy);
|
||||
buy.updateSigns();
|
||||
buy.updateRegionFlags();
|
||||
} else if(sender.hasPermission("areashop.stopresell") && sender instanceof Player) {
|
||||
if(buy.isOwner((Player)sender)) {
|
||||
buy.disableReselling();
|
||||
plugin.message(sender, "stopresell-success", buy);
|
||||
buy.updateSigns();
|
||||
buy.updateRegionFlags();
|
||||
} else {
|
||||
plugin.message(sender, "stopresell-noPermissionOther");
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "stopresell-noPermission");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
ArrayList<String> result = new ArrayList<String>();
|
||||
if(toComplete == 2) {
|
||||
for(BuyRegion region : plugin.getFileManager().getBuys()) {
|
||||
if(region.isSold() && region.isInResellingMode()) {
|
||||
result.add(region.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
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;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
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")) {
|
||||
return plugin.getLanguageManager().getLang("help-teleportAll");
|
||||
} else if(target.hasPermission("areashop.teleport")) {
|
||||
return plugin.getLanguageManager().getLang("help-teleport");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, Command command, 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<String>();
|
||||
if(toComplete == 2) {
|
||||
result.addAll(plugin.getFileManager().getRegionNames());
|
||||
} else if(toComplete == 3) {
|
||||
result.add("sign");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
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.RentRegion;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
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")) {
|
||||
return plugin.getLanguageManager().getLang("help-unrent");
|
||||
} else if(target.hasPermission("areashop.unrentown")) {
|
||||
return plugin.getLanguageManager().getLang("help-unrentOwn");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, Command command, String[] args) {
|
||||
if(!sender.hasPermission("areashop.unrent") && !sender.hasPermission("areashop.unrentown")) {
|
||||
plugin.message(sender, "unrent-noPermission");
|
||||
return;
|
||||
}
|
||||
RentRegion rent = null;
|
||||
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");
|
||||
return;
|
||||
}
|
||||
if(sender.hasPermission("areashop.unrent")) {
|
||||
plugin.message(sender, "unrent-other", rent.getPlayerName());
|
||||
rent.unRent(true);
|
||||
} else {
|
||||
if(sender.hasPermission("areashop.unrentown") && sender instanceof Player) {
|
||||
if(rent.getRenter().equals(((Player)sender).getUniqueId())) {
|
||||
plugin.message(sender, "unrent-unrented");
|
||||
rent.unRent(true);
|
||||
} else {
|
||||
plugin.message(sender, "unrent-noPermissionOther");
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "unrent-noPermission");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
|
||||
ArrayList<String> result = new ArrayList<String>();
|
||||
if(toComplete == 2) {
|
||||
for(RentRegion region : plugin.getFileManager().getRents()) {
|
||||
if(region.isRented()) {
|
||||
result.add(region.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package nl.evolutioncoding.areashop.exceptions;
|
||||
|
||||
public class RegionCreateException extends Exception {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public RegionCreateException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
}
|
||||
+172
@@ -0,0 +1,172 @@
|
||||
package nl.evolutioncoding.areashop.listeners;
|
||||
|
||||
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.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;
|
||||
|
||||
/**
|
||||
* Checks for placement of signs for this plugin
|
||||
* @author NLThijs48
|
||||
*/
|
||||
public final class PlayerLoginLogoutListener implements Listener {
|
||||
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 = plugin.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<GeneralRegion>(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.updateRegionFlags();
|
||||
region.updateSigns();
|
||||
}
|
||||
} else if(region.isRentRegion()) {
|
||||
if(!player.getName().equals(region.getStringSetting("rent.renterName"))) {
|
||||
region.setSetting("rent.renterName", player.getName());
|
||||
region.updateRegionFlags();
|
||||
region.updateSigns();
|
||||
}
|
||||
}
|
||||
}
|
||||
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
|
||||
*/
|
||||
public void updateLastActive(Player player) {
|
||||
for(GeneralRegion region : plugin.getFileManager().getRegions()) {
|
||||
if(region.isOwner(player)) {
|
||||
region.updateLastActiveTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
package nl.evolutioncoding.areashop.listeners;
|
||||
|
||||
import nl.evolutioncoding.areashop.AreaShop;
|
||||
import nl.evolutioncoding.areashop.regions.GeneralRegion;
|
||||
|
||||
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) {
|
||||
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 */
|
||||
GeneralRegion region = plugin.getFileManager().getRegionBySignLocation(block.getLocation());
|
||||
if(region == null) {
|
||||
return;
|
||||
}
|
||||
/* Remove the sign of the rental region if the player has permission */
|
||||
if(event.getPlayer().hasPermission("areashop.delsign")) {
|
||||
region.removeSign(block.getLocation());
|
||||
plugin.message(event.getPlayer(), "delsign-success", region.getName());
|
||||
} else { /* Cancel the breaking of the sign */
|
||||
event.setCancelled(true);
|
||||
plugin.message(event.getPlayer(), "delsign-noPermission");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the physics of a block change
|
||||
* @param event The event
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
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 */
|
||||
GeneralRegion region = plugin.getFileManager().getRegionBySignLocation(block.getLocation());
|
||||
if(region == null) {
|
||||
return;
|
||||
}
|
||||
region.removeSign(block.getLocation());
|
||||
plugin.getLogger().warning("A sign of region " + region.getName() + " has been removed by indirectly breaking it (block below/behind is destroyed)");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,370 @@
|
||||
package nl.evolutioncoding.areashop.listeners;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import nl.evolutioncoding.areashop.AreaShop;
|
||||
import nl.evolutioncoding.areashop.Utils;
|
||||
import nl.evolutioncoding.areashop.managers.FileManager.AddResult;
|
||||
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.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.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) {
|
||||
// TODO move to version specific classes or use available method
|
||||
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;
|
||||
}
|
||||
ProtectedRegion region = regionManager.getRegion(secondLine);
|
||||
if(region == null) {
|
||||
plugin.message(player, "setup-wrongRegion");
|
||||
return;
|
||||
}
|
||||
|
||||
AddResult addResult = plugin.getFileManager().checkRegionAdd(player, regionManager.getRegion(secondLine), RegionType.RENT);
|
||||
if(addResult == AddResult.BLACKLISTED) {
|
||||
plugin.message(player, "setup-blacklisted", secondLine);
|
||||
return;
|
||||
} else if(addResult == AddResult.ALREADYADDED) {
|
||||
plugin.message(player, "setup-alreadyRentSign");
|
||||
return;
|
||||
} else if(addResult == AddResult.NOPERMISSION) {
|
||||
plugin.message(player, "setup-noPermission", secondLine);
|
||||
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());
|
||||
boolean isMember = player != null && plugin.getWorldGuardHandler().containsMember(rent.getRegion(), player.getUniqueId());
|
||||
boolean isOwner = player != null && 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.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.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) {
|
||||
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;
|
||||
}
|
||||
ProtectedRegion region = regionManager.getRegion(secondLine);
|
||||
if(region == null) {
|
||||
plugin.message(player, "setup-wrongRegion");
|
||||
return;
|
||||
}
|
||||
AddResult addResult = plugin.getFileManager().checkRegionAdd(player, region, RegionType.BUY);
|
||||
if(addResult == AddResult.BLACKLISTED) {
|
||||
plugin.message(player, "setup-blacklisted", secondLine);
|
||||
return;
|
||||
} else if(addResult == AddResult.ALREADYADDED) {
|
||||
plugin.message(player, "setup-alreadyRentSign");
|
||||
return;
|
||||
} else if(addResult == AddResult.NOPERMISSION) {
|
||||
plugin.message(player, "setup-noPermission", secondLine);
|
||||
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());
|
||||
boolean isMember = player != null && plugin.getWorldGuardHandler().containsMember(buy.getRegion(), player.getUniqueId());
|
||||
boolean isOwner = player != null && 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.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.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 = 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 = 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.addSign(event.getBlock().getLocation(), event.getBlock().getType(), sign.getFacing(), null);
|
||||
plugin.message(player, "addsign-success", region);
|
||||
} else {
|
||||
region.addSign(event.getBlock().getLocation(), event.getBlock().getType(), sign.getFacing(), thirdLine);
|
||||
plugin.message(player, "addsign-successProfile", region, thirdLine);
|
||||
}
|
||||
|
||||
// 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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
package nl.evolutioncoding.areashop.listeners;
|
||||
|
||||
import nl.evolutioncoding.areashop.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();
|
||||
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 runned = result.runSignCommands(signName, player, clickType);
|
||||
// Only cancel event if at least one command has been executed
|
||||
event.setCancelled(runned);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,214 @@
|
||||
package nl.evolutioncoding.areashop.managers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.SortedSet;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import nl.evolutioncoding.areashop.AreaShop;
|
||||
import nl.evolutioncoding.areashop.commands.AddCommand;
|
||||
import nl.evolutioncoding.areashop.commands.AddfriendCommand;
|
||||
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.DelfriendCommand;
|
||||
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.LinksignsCommand;
|
||||
import nl.evolutioncoding.areashop.commands.MeCommand;
|
||||
import nl.evolutioncoding.areashop.commands.ReloadCommand;
|
||||
import nl.evolutioncoding.areashop.commands.RentCommand;
|
||||
import nl.evolutioncoding.areashop.commands.ResellCommand;
|
||||
import nl.evolutioncoding.areashop.commands.SchematiceventCommand;
|
||||
import nl.evolutioncoding.areashop.commands.SellCommand;
|
||||
import nl.evolutioncoding.areashop.commands.SetdurationCommand;
|
||||
import nl.evolutioncoding.areashop.commands.SetlandlordCommand;
|
||||
import nl.evolutioncoding.areashop.commands.SetownerCommand;
|
||||
import nl.evolutioncoding.areashop.commands.SetpriceCommand;
|
||||
import nl.evolutioncoding.areashop.commands.SetrestoreCommand;
|
||||
import nl.evolutioncoding.areashop.commands.SetteleportCommand;
|
||||
import nl.evolutioncoding.areashop.commands.StackCommand;
|
||||
import nl.evolutioncoding.areashop.commands.StopresellCommand;
|
||||
import nl.evolutioncoding.areashop.commands.TeleportCommand;
|
||||
import nl.evolutioncoding.areashop.commands.UnrentCommand;
|
||||
|
||||
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 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));
|
||||
|
||||
/* 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.getConfig().getString("chatPrefix") + plugin.getLanguageManager().getLang("help-header"));
|
||||
messages.add(plugin.getConfig().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.getConfig().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) {
|
||||
if(!plugin.isReady()) {
|
||||
plugin.message(sender, "general-notReady");
|
||||
return true;
|
||||
}
|
||||
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) {
|
||||
// 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<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, sender);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
+64
-32
@@ -1,19 +1,27 @@
|
||||
package nl.evolutioncoding.AreaShop;
|
||||
package nl.evolutioncoding.areashop.managers;
|
||||
|
||||
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 nl.evolutioncoding.areashop.AreaShop;
|
||||
import nl.evolutioncoding.areashop.regions.GeneralRegion;
|
||||
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
|
||||
public class LanguageManager {
|
||||
private AreaShop plugin = null;
|
||||
private String languages[] = {"EN", "NL"};
|
||||
private String languages[] = {"EN", "NL", "FI", "DE", "FR", "PL", "ZH_TW"};
|
||||
private HashMap<String, String> currentLanguage, defaultLanguage;
|
||||
|
||||
/**
|
||||
@@ -22,11 +30,14 @@ public class LanguageManager {
|
||||
*/
|
||||
public LanguageManager(AreaShop plugin) {
|
||||
this.plugin = plugin;
|
||||
|
||||
/* Save default language files if not present */
|
||||
startup();
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the default language files and open the current and backup language file
|
||||
*/
|
||||
public void startup() {
|
||||
this.saveDefaults();
|
||||
|
||||
/* Open current language file */
|
||||
this.loadLanguage();
|
||||
}
|
||||
|
||||
@@ -36,7 +47,7 @@ public class LanguageManager {
|
||||
public void saveDefaults() {
|
||||
/* Create the language folder if it not exists */
|
||||
File langFolder;
|
||||
langFolder = new File(plugin.getDataFolder() + File.separator + plugin.languageFolder);
|
||||
langFolder = new File(plugin.getDataFolder() + File.separator + AreaShop.languageFolder);
|
||||
if(!langFolder.exists()) {
|
||||
langFolder.mkdirs();
|
||||
}
|
||||
@@ -47,11 +58,15 @@ public class LanguageManager {
|
||||
/* file name as the default */
|
||||
File langFile;
|
||||
for(int i=0; i<languages.length; i++) {
|
||||
langFile = new File(plugin.getDataFolder() + File.separator + plugin.languageFolder + File.separator + languages[i] + ".yml");
|
||||
langFile = new File(plugin.getDataFolder() + File.separator + AreaShop.languageFolder + File.separator + languages[i] + ".yml");
|
||||
InputStream input = null;
|
||||
OutputStream output = null;
|
||||
try {
|
||||
input = plugin.getResource(plugin.languageFolder + "/" + languages[i] + ".yml");
|
||||
input = plugin.getResource(AreaShop.languageFolder + "/" + languages[i] + ".yml");
|
||||
if(input == null) {
|
||||
plugin.getLogger().warning("Could not save default language to the '" + AreaShop.languageFolder + "' folder: " + languages[i] + ".yml");
|
||||
continue;
|
||||
}
|
||||
output = new FileOutputStream(langFile);
|
||||
|
||||
int read = 0;
|
||||
@@ -67,7 +82,7 @@ public class LanguageManager {
|
||||
output.close();
|
||||
} catch (IOException e1) {} catch (NullPointerException e2) {}
|
||||
|
||||
plugin.getLogger().info("Something went wrong saving a default language file: " + langFile.getPath());
|
||||
plugin.getLogger().warning("Something went wrong saving a default language file: " + langFile.getPath());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,30 +98,39 @@ public class LanguageManager {
|
||||
|
||||
/* Save the current language file to the HashMap */
|
||||
currentLanguage = new HashMap<String, String>();
|
||||
File file = new File(plugin.getDataFolder() + File.separator + plugin.languageFolder + File.separator + plugin.config().getString("language") + ".yml");
|
||||
ymlFile = YamlConfiguration.loadConfiguration(file);
|
||||
map = ymlFile.getValues(true);
|
||||
set = map.keySet();
|
||||
File file = new File(plugin.getDataFolder() + File.separator + AreaShop.languageFolder + File.separator + plugin.getConfig().getString("language") + ".yml");
|
||||
InputStreamReader reader = null;
|
||||
try {
|
||||
for(String key : set) {
|
||||
currentLanguage.put(key, (String)map.get(key));
|
||||
}
|
||||
} catch(ClassCastException e) {}
|
||||
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>();
|
||||
InputStream defConfigStream = plugin.getResource(plugin.languageFolder + "/" + plugin.config().getString("language") + ".yml");
|
||||
if (defConfigStream == null) {
|
||||
defConfigStream = plugin.getResource(plugin.languageFolder + "/" + languages[0]+ ".yml");
|
||||
}
|
||||
ymlFile = YamlConfiguration.loadConfiguration(defConfigStream);
|
||||
map = ymlFile.getValues(true);
|
||||
set = map.keySet();
|
||||
File standard = new File(plugin.getDataFolder() + File.separator + AreaShop.languageFolder + "/" + languages[0]+ ".yml");
|
||||
InputStreamReader reader2 = null;
|
||||
try {
|
||||
for(String key : set) {
|
||||
defaultLanguage.put(key, (String)map.get(key));
|
||||
}
|
||||
} catch(ClassCastException e) {}
|
||||
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) {}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -126,11 +150,19 @@ public class LanguageManager {
|
||||
}
|
||||
|
||||
if(result == null) {
|
||||
plugin.getLogger().info("Wrong key for getting translation: " + key);
|
||||
plugin.getLogger().info("Wrong key for getting translation: " + key + ", please contact the author about this");
|
||||
} else {
|
||||
/* Replace all tags, e.g. %1% */
|
||||
/* Replace all tags like %0% and if given a GeneralRegion apply all replacements */
|
||||
int number=0;
|
||||
for (int i=0; i<params.length; i++) {
|
||||
result = result.replace("%" + i + "%", params[i].toString());
|
||||
if(params[i] != null) {
|
||||
if(params[i] instanceof GeneralRegion) {
|
||||
result = ((GeneralRegion)params[i]).applyAllReplacements(result);
|
||||
} else {
|
||||
result = result.replace("%" + number + "%", params[i].toString());
|
||||
number++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,225 @@
|
||||
package nl.evolutioncoding.areashop.managers;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import nl.evolutioncoding.areashop.AreaShop;
|
||||
import nl.evolutioncoding.areashop.Utils;
|
||||
import nl.evolutioncoding.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;
|
||||
|
||||
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<UUID, SignLinker>();
|
||||
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());
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onPlayerInteract(PlayerInteractEvent event) {
|
||||
AreaShop.debug("PlayerInteractEvent of " + event.getPlayer().getName() + ", " + signLinkers.size() + " signlinkers");
|
||||
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<String>();
|
||||
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");
|
||||
return;
|
||||
} 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;
|
||||
}
|
||||
|
||||
GeneralRegion signRegion = plugin.getFileManager().getRegionBySignLocation(block.getLocation());
|
||||
if(signRegion != null) {
|
||||
plugin.message(player, "linksigns-alreadyRegistered", signRegion);
|
||||
return;
|
||||
}
|
||||
Sign sign = (Sign)block.getState().getData();
|
||||
linker.setSign(block.getLocation(), block.getType(), sign.getFacing());
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle disconnection players
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPlayerLeave(PlayerQuitEvent event) {
|
||||
AreaShop.debug("PlayerQuitEvent of " + event.getPlayer().getName() + ", " + signLinkers.size() + " signlinkers");
|
||||
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);
|
||||
}
|
||||
finalize();
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
finalize();
|
||||
}
|
||||
|
||||
public void finalize() {
|
||||
if(isComplete()) {
|
||||
region.addSign(location, type, facing, profile);
|
||||
if(profile == null) {
|
||||
plugin.message(linker, "addsign-success", region);
|
||||
} else {
|
||||
plugin.message(linker, "addsign-successProfile", region, profile);
|
||||
}
|
||||
region.updateSigns();
|
||||
reset();
|
||||
|
||||
plugin.message(linker, "linksigns-next");
|
||||
}
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
hasSign = false;
|
||||
hasRegion = false;
|
||||
}
|
||||
|
||||
public boolean isComplete() {
|
||||
return hasSign && hasRegion;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,499 @@
|
||||
package nl.evolutioncoding.areashop.regions;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.UUID;
|
||||
|
||||
import net.milkbowl.vault.economy.EconomyResponse;
|
||||
import nl.evolutioncoding.areashop.AreaShop;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
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) {}
|
||||
}
|
||||
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) {
|
||||
if(player == null) {
|
||||
return false;
|
||||
} else {
|
||||
return isBuyer(player.getUniqueId());
|
||||
}
|
||||
}
|
||||
public boolean isBuyer(UUID player) {
|
||||
UUID buyer = getBuyer();
|
||||
if(buyer == null || player == null) {
|
||||
return false;
|
||||
} else {
|
||||
return 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", plugin.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 = plugin.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 plugin.formatCurrency(getPrice());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the formatted string of the resellprice (includes prefix and suffix)
|
||||
* @return The formatted string of the resellprice
|
||||
*/
|
||||
public String getFormattedResellPrice() {
|
||||
return plugin.formatCurrency(getResellPrice());
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the price of the region
|
||||
* @param price
|
||||
*/
|
||||
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 plugin.formatCurrency(getMoneyBackAmount());
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, Object> getSpecificReplacements() {
|
||||
// Fill the replacements map with things specific to a BuyRegion
|
||||
HashMap<String, Object> result = new HashMap<String, Object>();
|
||||
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 plugin.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 this.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) {
|
||||
plugin.message(player, "general-noEconomy");
|
||||
return false;
|
||||
}
|
||||
if(getWorld() == null) {
|
||||
plugin.message(player, "general-noWorld", getWorldName());
|
||||
return false;
|
||||
}
|
||||
if(getRegion() == null) {
|
||||
plugin.message(player, "general-noRegion", getName());
|
||||
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()))) {
|
||||
plugin.message(player, "buy-restrictedToRegion", getName());
|
||||
return false;
|
||||
}
|
||||
if(restrictedToWorld() && !player.getWorld().getName().equals(getWorldName())) {
|
||||
plugin.message(player, "buy-restrictedToWorld", getWorldName(), player.getWorld().getName());
|
||||
return false;
|
||||
}
|
||||
// Check region limits
|
||||
LimitResult limitResult = this.limitsAllowBuying(player);
|
||||
AreaShop.debug("LimitResult: " + limitResult.toString());
|
||||
if(!limitResult.actionAllowed()) {
|
||||
if(limitResult.getLimitingFactor() == LimitType.TOTAL) {
|
||||
plugin.message(player, "total-maximum", limitResult.getMaximum(), limitResult.getCurrent(), limitResult.getLimitingGroup());
|
||||
return false;
|
||||
}
|
||||
if(limitResult.getLimitingFactor() == LimitType.BUYS) {
|
||||
plugin.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) {
|
||||
clearFriends();
|
||||
double resellPrice = getResellPrice();
|
||||
/* Transfer the money to the previous owner */
|
||||
EconomyResponse r = plugin.getEconomy().withdrawPlayer(player, getWorldName(), getResellPrice());
|
||||
if(!r.transactionSuccess()) {
|
||||
plugin.message(player, "buy-payError");
|
||||
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());
|
||||
} else if (oldOwnerName != null) {
|
||||
r = plugin.getEconomy().depositPlayer(oldOwnerName, getWorldName(), getResellPrice());
|
||||
}
|
||||
if(r == null || !r.transactionSuccess()) {
|
||||
plugin.getLogger().warning("Something went wrong with paying '" + oldOwnerPlayer.getName() + "' " + 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());
|
||||
|
||||
// Update everything
|
||||
handleSchematicEvent(RegionEvent.RESELL);
|
||||
updateSigns();
|
||||
updateRegionFlags();
|
||||
|
||||
// Send message to the player
|
||||
plugin.message(player, "buy-successResale", getName(), oldOwnerPlayer.getName());
|
||||
Player seller = Bukkit.getPlayer(oldOwner);
|
||||
if(seller != null) {
|
||||
plugin.message(player, "buy-successSeller", getName(), getPlayerName(), resellPrice);
|
||||
}
|
||||
AreaShop.debug(player.getName() + " has bought region " + getName() + " for " + getFormattedPrice() + " from " + oldOwnerPlayer.getName());
|
||||
// Run commands
|
||||
this.runEventCommands(RegionEvent.RESELL, false);
|
||||
} else {
|
||||
// Substract the money from the players balance
|
||||
EconomyResponse r = plugin.getEconomy().withdrawPlayer(player, getWorldName(), getPrice());
|
||||
if(!r.transactionSuccess()) {
|
||||
plugin.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();
|
||||
r = null;
|
||||
if(landlordPlayer != null && landlordPlayer.getName() != null) {
|
||||
r = plugin.getEconomy().depositPlayer(landlordPlayer, getWorldName(), getPrice());
|
||||
} else if(landlordName != null) {
|
||||
r = plugin.getEconomy().depositPlayer(landlordName, getWorldName(), getPrice());
|
||||
}
|
||||
if(r != null && !r.transactionSuccess()) {
|
||||
plugin.getLogger().warning("Something went wrong with paying '" + landlordName + "' " + getFormattedPrice() + " for his sell of region " + getName() + " to " + player.getName());
|
||||
}
|
||||
AreaShop.debug(player.getName() + " has bought region " + getName() + " for " + getFormattedPrice());
|
||||
|
||||
// Run commands
|
||||
this.runEventCommands(RegionEvent.BOUGHT, true);
|
||||
// Set the owner
|
||||
setBuyer(player.getUniqueId());
|
||||
|
||||
// Update everything
|
||||
handleSchematicEvent(RegionEvent.BOUGHT);
|
||||
updateSigns();
|
||||
updateRegionFlags();
|
||||
|
||||
// Send message to the player
|
||||
plugin.message(player, "buy-succes", getName());
|
||||
// Run commands
|
||||
this.runEventCommands(RegionEvent.BOUGHT, false);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
/* Player has not enough money */
|
||||
String requiredMoney = "";
|
||||
if(isResell) {
|
||||
requiredMoney = getFormattedResellPrice();
|
||||
} else {
|
||||
requiredMoney = getFormattedPrice();
|
||||
}
|
||||
plugin.message(player, "buy-lowMoney", plugin.formatCurrency(plugin.getEconomy().getBalance(player, getWorldName())), requiredMoney);
|
||||
}
|
||||
} else {
|
||||
if(isBuyer(player)) {
|
||||
plugin.message(player, "buy-yours");
|
||||
} else {
|
||||
plugin.message(player, "buy-someoneElse");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
plugin.message(player, "buy-noPermission");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sell a buyed region, get part of the money back
|
||||
* @param regionName
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public void sell(boolean giveMoneyBack) {
|
||||
// Run commands
|
||||
this.runEventCommands(RegionEvent.SOLD, true);
|
||||
|
||||
disableReselling();
|
||||
/* Give part of the buying price back */
|
||||
double moneyBack = getMoneyBackAmount();
|
||||
if(moneyBack > 0 && giveMoneyBack) {
|
||||
/* Give back the money */
|
||||
OfflinePlayer player = Bukkit.getOfflinePlayer(getBuyer());
|
||||
if(player != null) {
|
||||
EconomyResponse response = null;
|
||||
boolean error = false;
|
||||
try {
|
||||
if(player != null && 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()) {
|
||||
plugin.getLogger().warning("Something went wrong with paying back money to " + getPlayerName() + " while selling region " + getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Debug message */
|
||||
AreaShop.debug(getPlayerName() + " has sold " + getName() + ", got " + plugin.formatCurrency(moneyBack) + " money back");
|
||||
|
||||
/* Update everything */
|
||||
handleSchematicEvent(RegionEvent.SOLD);
|
||||
updateRegionFlags(RegionState.FORSALE);
|
||||
|
||||
/* Remove friends and the owner */
|
||||
clearFriends();
|
||||
setBuyer(null);
|
||||
|
||||
updateSigns();
|
||||
// Run commands
|
||||
this.runEventCommands(RegionEvent.SOLD, false);
|
||||
}
|
||||
|
||||
@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*60*1000=" + inactiveSetting * 60 * 1000);
|
||||
if(Calendar.getInstance().getTimeInMillis() > (lastPlayed + inactiveSetting)) {
|
||||
plugin.getLogger().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*60*1000=" + inactiveSetting * 60 * 1000);
|
||||
this.sell(true);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,158 @@
|
||||
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();
|
||||
int previousCount = members.size();
|
||||
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() != 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<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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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,639 @@
|
||||
package nl.evolutioncoding.areashop.regions;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.UUID;
|
||||
|
||||
import net.milkbowl.vault.economy.EconomyResponse;
|
||||
import nl.evolutioncoding.areashop.AreaShop;
|
||||
import nl.evolutioncoding.areashop.exceptions.RegionCreateException;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class RentRegion extends GeneralRegion {
|
||||
private long warningsDoneUntil = Calendar.getInstance().getTimeInMillis();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param plugin The areashop plugin
|
||||
* @param settings All settings of this region
|
||||
* @throws RegionCreateException
|
||||
*/
|
||||
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) {}
|
||||
}
|
||||
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) {
|
||||
if(player == null) {
|
||||
return false;
|
||||
} else {
|
||||
return isRenter(player.getUniqueId());
|
||||
}
|
||||
}
|
||||
public boolean isRenter(UUID player) {
|
||||
UUID renter = getRenter();
|
||||
if(player == null || renter == null) {
|
||||
return false;
|
||||
} else {
|
||||
return 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", plugin.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<String, Object>();
|
||||
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, this.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 = plugin.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
|
||||
*/
|
||||
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 plugin.formatCurrency(getPrice());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the duration of 1 rent period
|
||||
* @return The duration in milliseconds of 1 rent period
|
||||
*/
|
||||
public long getDuration() {
|
||||
return plugin.durationStringToLong(getDurationString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the duration string, includes number<space>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 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 plugin.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 this.millisToHumanFormat(getInactiveTimeUntilUnrent());
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the price of the region
|
||||
* @param price
|
||||
*/
|
||||
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;
|
||||
double moneyBack = periods * getPrice() * percentage;
|
||||
return moneyBack;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the formatted string of the amount of the moneyBack amount
|
||||
* @return String with currency symbols and proper fractional part
|
||||
*/
|
||||
public String getFormattedMoneyBackAmount() {
|
||||
return plugin.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 plugin.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(player != null) {
|
||||
plugin.message(player, "unrent-expired", getName());
|
||||
}
|
||||
unRent(false);
|
||||
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());
|
||||
if(player != null) {
|
||||
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 = plugin.durationStringToLong(timeBefore);
|
||||
if(timeBeforeParsed <= 0) {
|
||||
return;
|
||||
}
|
||||
long checkTime = getRentedUntil() - timeBeforeParsed;
|
||||
|
||||
if(checkTime > warningsDoneUntil && checkTime <= sendUntil) {
|
||||
if(plugin.getConfig().getBoolean(configPath + "." + timeBefore + ".warnPlayer")) {
|
||||
plugin.message(player, "rent-expireWarning", this);
|
||||
}
|
||||
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
|
||||
* @param regionName The name of the region you want to rent
|
||||
* @return true if it succeeded and false if not
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean rent(Player player) {
|
||||
/* Check if the player has permission */
|
||||
if(player.hasPermission("areashop.rent")) {
|
||||
if(plugin.getEconomy() == null) {
|
||||
plugin.message(player, "general-noEconomy");
|
||||
return false;
|
||||
}
|
||||
if(getWorld() == null) {
|
||||
plugin.message(player, "general-noWorld", getWorldName());
|
||||
return false;
|
||||
}
|
||||
if(getRegion() == null) {
|
||||
plugin.message(player, "general-noRegion", getName());
|
||||
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()))) {
|
||||
plugin.message(player, "rent-restrictedToRegion", getName());
|
||||
return false;
|
||||
}
|
||||
if(restrictedToWorld() && !player.getWorld().getName().equals(getWorldName())) {
|
||||
plugin.message(player, "rent-restrictedToWorld", getWorldName(), player.getWorld().getName());
|
||||
return false;
|
||||
}
|
||||
// Check region limits if this is not extending
|
||||
if(!extend) {
|
||||
LimitResult limitResult = this.limitsAllowRenting(player);
|
||||
AreaShop.debug("LimitResult: " + limitResult.toString());
|
||||
if(!limitResult.actionAllowed()) {
|
||||
if(limitResult.getLimitingFactor() == LimitType.TOTAL) {
|
||||
plugin.message(player, "total-maximum", limitResult.getMaximum(), limitResult.getCurrent(), limitResult.getLimitingGroup());
|
||||
return false;
|
||||
}
|
||||
if(limitResult.getLimitingFactor() == LimitType.RENTS) {
|
||||
plugin.message(player, "rent-maximum", limitResult.getMaximum(), limitResult.getCurrent(), limitResult.getLimitingGroup());
|
||||
return false;
|
||||
}
|
||||
// Should not be reached, but is safe like this
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the player can still extend this rent
|
||||
if(extend && !player.hasPermission("areashop.rentextendbypass")) {
|
||||
if(getMaxExtends() >= 0 && getTimesExtended() >= getMaxExtends()) {
|
||||
plugin.message(player, "rent-maxExtends", getMaxExtends());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if there is enough time left before hitting maxRentTime
|
||||
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) {
|
||||
plugin.message(player, "rent-maxRentTime", this.millisToHumanFormat(maxRentTime), this.millisToHumanFormat(timeRented));
|
||||
return false;
|
||||
}
|
||||
|
||||
if(plugin.getEconomy().has(player, getWorldName(), getPrice())) {
|
||||
/* Substract the money from the players balance */
|
||||
EconomyResponse r = plugin.getEconomy().withdrawPlayer(player, getWorldName(), getPrice());
|
||||
if(!r.transactionSuccess()) {
|
||||
plugin.message(player, "rent-payError");
|
||||
return false;
|
||||
}
|
||||
// Optionally give money to the landlord
|
||||
OfflinePlayer landlordPlayer = null;
|
||||
if(getLandlord() != null) {
|
||||
landlordPlayer = Bukkit.getOfflinePlayer(getLandlord());
|
||||
}
|
||||
String landlordName = getLandlordName();
|
||||
r = null;
|
||||
if(landlordPlayer != null && landlordPlayer.getName() != null) {
|
||||
r = plugin.getEconomy().depositPlayer(landlordPlayer, getWorldName(), getPrice());
|
||||
} else if(landlordName != null) {
|
||||
r = plugin.getEconomy().depositPlayer(landlordName, getWorldName(), getPrice());
|
||||
}
|
||||
if(r == null || !r.transactionSuccess()) {
|
||||
plugin.getLogger().warning("Something went wrong with paying '" + landlordName + "' " + getFormattedPrice() + " 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(extend) {
|
||||
calendar.setTimeInMillis(getRentedUntil());
|
||||
}
|
||||
calendar.setTimeInMillis(calendar.getTimeInMillis() + getDuration());
|
||||
SimpleDateFormat dateFull = new SimpleDateFormat(plugin.getConfig().getString("timeFormatChat"));
|
||||
AreaShop.debug(player.getName() + " has rented region " + getName() + " for " + getFormattedPrice() + " until " + dateFull.format(calendar.getTime()));
|
||||
|
||||
/* Add values to the rent and send it to FileManager */
|
||||
setRentedUntil(calendar.getTimeInMillis());
|
||||
setRenter(player.getUniqueId());
|
||||
|
||||
// Fire schematic event and updated times extended
|
||||
if(!extend) {
|
||||
this.handleSchematicEvent(RegionEvent.RENTED);
|
||||
setTimesExtended(0);
|
||||
} else {
|
||||
setTimesExtended(getTimesExtended() + 1);
|
||||
}
|
||||
|
||||
/* Change the sign and the region flags */
|
||||
updateSigns();
|
||||
updateRegionFlags(RegionState.RENTED);
|
||||
|
||||
/* Send message to the player */
|
||||
if(extend) {
|
||||
plugin.message(player, "rent-extended", getName(), dateFull.format(calendar.getTime()));
|
||||
} else {
|
||||
plugin.message(player, "rent-rented", getName(), dateFull.format(calendar.getTime()));
|
||||
plugin.message(player, "rent-extend");
|
||||
}
|
||||
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) {
|
||||
plugin.message(player, "rent-lowMoneyExtend", plugin.formatCurrency(plugin.getEconomy().getBalance(player, getWorldName())), getFormattedPrice());
|
||||
} else {
|
||||
plugin.message(player, "rent-lowMoneyRent", plugin.formatCurrency(plugin.getEconomy().getBalance(player, getWorldName())), getFormattedPrice());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
plugin.message(player, "rent-someoneElse");
|
||||
}
|
||||
} else {
|
||||
plugin.message(player, "rent-noPermission");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unrent a region, reset to unrented
|
||||
* @param regionName Region that should be unrented
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public void unRent(boolean giveMoneyBack) {
|
||||
// Run commands
|
||||
this.runEventCommands(RegionEvent.UNRENTED, true);
|
||||
double moneyBack = getMoneyBackAmount();
|
||||
if(moneyBack > 0 && giveMoneyBack) {
|
||||
/* Give back the money */
|
||||
OfflinePlayer player = Bukkit.getOfflinePlayer(getRenter());
|
||||
if(player != null) {
|
||||
EconomyResponse r = null;
|
||||
boolean error = false;
|
||||
try {
|
||||
if(player != null && 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() || error) {
|
||||
plugin.getLogger().warning("Something went wrong with paying back to " + getPlayerName() + " money while unrenting region " + getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Debug message */
|
||||
AreaShop.debug(getPlayerName() + " has unrented " + getName() + ", got " + plugin.formatCurrency(moneyBack) + " money back");
|
||||
|
||||
/* Update the signs and region flags */
|
||||
handleSchematicEvent(RegionEvent.UNRENTED);
|
||||
updateRegionFlags(RegionState.FORRENT);
|
||||
|
||||
/* Remove friends, the owner and renteduntil values */
|
||||
clearFriends();
|
||||
setRenter(null);
|
||||
setRentedUntil(null);
|
||||
setTimesExtended(-1);
|
||||
|
||||
updateSigns();
|
||||
// Run commands
|
||||
this.runEventCommands(RegionEvent.UNRENTED, false);
|
||||
}
|
||||
|
||||
@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*60*1000=" + inactiveSetting * 60 * 1000);
|
||||
if(Calendar.getInstance().getTimeInMillis() > (lastPlayed + inactiveSetting)) {
|
||||
plugin.getLogger().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*60*1000=" + inactiveSetting * 60 * 1000);
|
||||
this.unRent(true);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,368 @@
|
||||
# ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
|
||||
# ║ 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. ║
|
||||
# ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
|
||||
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ GENERAL: Options that influence the global state of the plugin │
|
||||
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
## Chatprefix used for all messages in the chat, also changes the greeting messages.
|
||||
chatPrefix: '&2[AreaShop]&r '
|
||||
## The language file that should be used, check the 'lang' folder for build-in languages (use the filename without .yml here).
|
||||
language: EN
|
||||
## The tags you need to 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]'
|
||||
|
||||
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ NUMBERS: Options to change the output of prices. │
|
||||
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
## The characters displayed before a price, special characters like € can be used.
|
||||
moneyCharacter: '$'
|
||||
## The characters displayed after a price, special characters like € can be used.
|
||||
moneyCharacterAfter: ''
|
||||
## How many numbers behind the dot should be shown (2 will make numbers like '8.55', '9.01').
|
||||
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 for 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).
|
||||
## Be careful with deleting words, will break settings using those, adding is no problem.
|
||||
seconds: [s, sec, secs, second, seconds]
|
||||
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]
|
||||
|
||||
|
||||
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ 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' and ops have the unlimited group.
|
||||
## All the groups applied to the player will be checked and only if they all allow an extra region it will be permitted.
|
||||
## Add a 'worlds' or 'groups' list to a group to only count regions from those worlds and/or groups.
|
||||
## This can be used to get different limits for other worlds or area's.
|
||||
## Give players permissions globally and not per world! That would break limits when then try renting/buying from within another world.
|
||||
limitGroups:
|
||||
default:
|
||||
total: 1
|
||||
rents: 1
|
||||
buys: 1
|
||||
|
||||
|
||||
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ PROFILES: Assigned in general (default.yml), for a group (groups.yml) or individually (<region>.yml) │
|
||||
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
## Below is a list of tags that can be used with all the profiles below.
|
||||
## If a tag has no value (for example when you use %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), will not get replaced if no renter/buyer.
|
||||
## %uuid% The uuid of the player that rents/buys the region, will not get replaced if no renter/buyer.
|
||||
## %friends% The names of friends added to this region separated by ', '.
|
||||
## %friendsuuid% The UUID's of friends added to this region separated by ', '.
|
||||
## %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 (amount of blocks on the x-axis).
|
||||
## %depth% The depth of the region (amount of blocks on the z-axis).
|
||||
## %height% The height of the region (amount 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, like '10.0' or '7.77'.
|
||||
## %moneyback% The amount of money the player will get back when unrenting/selling the region (formatted with currency characters).
|
||||
## %rawmoneyback% The moneyback without formatting, like '10.0' or '7.77'.
|
||||
## %moneybackpercent% The percentage of the price the player will get back when unrenting (only the number between 0-100).
|
||||
## %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).
|
||||
|
||||
## 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:
|
||||
## 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:
|
||||
- 'areashop rent %region%'
|
||||
leftClickPlayer:
|
||||
- 'areashop info region %region%'
|
||||
rented:
|
||||
line1: '&4&l[Rented]'
|
||||
line2: '%region%'
|
||||
line3: '%player%'
|
||||
line4: '%untilshort%'
|
||||
rightClickPlayer:
|
||||
- 'areashop rent %region%'
|
||||
leftClickPlayer:
|
||||
- 'areashop info region %region%'
|
||||
shiftRightClickPlayer:
|
||||
- 'areashop unrent %region%'
|
||||
forsale:
|
||||
line1: '&2&l[For Sale]'
|
||||
line2: '%region%'
|
||||
line3: '%price%'
|
||||
line4:
|
||||
rightClickPlayer:
|
||||
- 'areashop buy %region%'
|
||||
leftClickPlayer:
|
||||
- 'areashop info region %region%'
|
||||
resell:
|
||||
line1: '&9&l[Resale]'
|
||||
line2: '%region%'
|
||||
line3: '%resellprice%'
|
||||
line4: '&8%player%'
|
||||
rightClickPlayer:
|
||||
- 'areashop buy %region%'
|
||||
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 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:
|
||||
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.
|
||||
## If you want your regions all looking the same then you can leave out the %region% part to use the same schematic for all.
|
||||
## Be carefull with these options, it could crash your server or destroy (parts of) your world if used wrong!
|
||||
## The limit 'maximumBlocks' applies to restoring/saving schematics, be sure your regions are below the limit.
|
||||
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: ''
|
||||
## Flag profiles to specify what flags should be set on the WorldGuard regions.
|
||||
## All normal region flags as present in WorldGuard can be used, and also members, owners, priority and parent.
|
||||
## Each line represents a WorldGuard setting that should be set to a certain value when the region is in the specified state.
|
||||
## The members and owners flag normally take a list of UUID's separated by 'comma space', adding by name is possible with 'n:<name>'.
|
||||
## You can add groups by using 'g:<groupname>', so in total you could use: '%uuid%, %friendsuuid%, g:vip, n:cool-guy'.
|
||||
## For flags like 'entry' and 'exit' you can add group setting by using 'g:<scope>' behind it, <scope> is one of the following:
|
||||
## members, non_members, owners, non_owners, all. Example, only owners can enter the region:
|
||||
## entry: 'deny g:non_owners'
|
||||
## Use '' for a flag to reset it.
|
||||
flagProfiles:
|
||||
default:
|
||||
forrent:
|
||||
members: ''
|
||||
greeting: '%lang:prefix%%lang:greeting-forrent%'
|
||||
rented:
|
||||
members: '%uuid%, %friendsuuid%'
|
||||
greeting: '%lang:prefix%%lang:greeting-rented%'
|
||||
forsale:
|
||||
members: ''
|
||||
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%'
|
||||
## Profiles that specify when players should get messages about rent that almost run out.
|
||||
## The numbers that start sections in the profile specify how time before it actually runs out it should be executed.
|
||||
## 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. The case-insensitive option is enabled because
|
||||
## WorldGuard will return the correct region no matter what the casing is.
|
||||
## 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
|
||||
## Post error messages in the console when a command run from the config fails (from the 'runCommands' section for example).
|
||||
postCommandErrors: 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}
|
||||
|
||||
|
||||
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ LIMITS AND TIMINGS: Options for limits and the frequencies for certain functions (be very careful with these!). │
|
||||
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
## 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
|
||||
|
||||
## Setting the 'delay' setting to 0 or lower will prevent the taks from runnning, if you don't use a certain feature you
|
||||
## could switch the task off this way.
|
||||
## The 'delay' settings are specified using a number followed by one of the identifiers as defined above in the config.
|
||||
## 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:
|
||||
## Time between saving files that need to be saved (not all files will be saved by default).
|
||||
delay: '10 minutes'
|
||||
## How many regions per tick will be saved.
|
||||
regionsPerTick: 1
|
||||
## Timings for rent expiration checking.
|
||||
expiration:
|
||||
## Time between checking if rent regions have been expired.
|
||||
delay: '59 seconds'
|
||||
## Number of rent regions to check per tick.
|
||||
regionsPerTick: 5
|
||||
## Timings for expiration warning to online players.
|
||||
expireWarning:
|
||||
## The time between checking if expiration warning need to be sent.
|
||||
delay: '5 minutes'
|
||||
## Number of regions to update per tick.
|
||||
regionsPerTick: 3
|
||||
## Timings for updating signs and region flags ('/as reload' or after '/as groupadd' or '/as groupdel').
|
||||
update:
|
||||
## Number of regions to update per tick.
|
||||
regionsPerTick: 5
|
||||
## Time between checking if any regions need to be unrented because the player was not online for the specified time period.
|
||||
inactive:
|
||||
## Time between checking if a regions needs to be unrented/sold because of inactivity by the player.
|
||||
delay: '15 minutes'
|
||||
## Number of rent regions to check per tick.
|
||||
regionsPerTick: 5
|
||||
## Timings for the periodic updating of signs (for timeleft tags etc).
|
||||
signs:
|
||||
## Time between updates of all signs.
|
||||
delay: '60 seconds'
|
||||
## Number of regions to update signs for per tick.
|
||||
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:
|
||||
## Number of regions to update signs for per tick.
|
||||
regionsPerTick: 5
|
||||
## Timings for adding regions to AreaShop ('/as stack').
|
||||
adding:
|
||||
## Number of regions to add per tick.
|
||||
regionsPerTick: 2
|
||||
@@ -0,0 +1,79 @@
|
||||
# ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
|
||||
# ║ 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. ║
|
||||
# ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
|
||||
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ GENERAL: Options for all regions. │
|
||||
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
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
|
||||
## 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 .
|
||||
## Useful if you have diffrent economies for different worlds.
|
||||
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').
|
||||
## If you use this value be sure that you set 'moneyBack' to 0, because money will not be substracted from the account
|
||||
## of the landlord and the player would get money 'out of thin air'.
|
||||
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 renting region.
|
||||
price: 1000
|
||||
## The default duration of a renting region, you can find all time indicators in config.yml below the RENTING header.
|
||||
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
|
||||
## The Maximum time they can have the region rented in advance (use times like '1 day' etc, or 'unlimited' for no limit).
|
||||
## If you set this lower then the rent duration then players will not be able to rent the region
|
||||
## (because it always exceeds the maxRentTime in that case).
|
||||
maxRentTime: 'unlimited'
|
||||
## Automatically unrent the region after the specified number of minutes 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 warning.
|
||||
## You can find all time indicators in config.yml below the RENTING header, change to '' to disable.
|
||||
warningOnLoginTime: '1 day'
|
||||
## The profile for the expiration warnings as specified in the config.
|
||||
expirationWarningProfile: 'default'
|
||||
|
||||
|
||||
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ BUY: Options for buy regions. │
|
||||
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
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
|
||||
## Automatically sell the region after the specified number of minutes between the last login time of the buyer and the current time
|
||||
## -1 mean never, 1440 is one day, 43200 is one month, 525600 is one year.
|
||||
inactiveTimeUntilSell: -1
|
||||
@@ -0,0 +1,413 @@
|
||||
# ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
|
||||
# ║ Language file of the AreaShop plugin created by NLThijs48, Github can be found at https://github.com/NLthijs48/AreaShop ║
|
||||
# ║ Language: German, Version: V2.2.0, 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 ║
|
||||
# ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
|
||||
total-maximum: "Du kannst nicht mehr als %0% Region(en) mieten/kaufen (Du hast bereits %1% in Gruppe '%2%')."
|
||||
|
||||
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 mit AreaShop registrierten Regionen gefunden."
|
||||
cmd-noWERegionsFound: "Es wurden keine WorldEdit-Regionen gefunden, die sich mit deiner Selektion überschneiden."
|
||||
cmd-notRegistered: "Die angegebene Region ist nicht eingetragen: %0%."
|
||||
cmd-noRegionsAtLocation: "Keine Regionen an deiner Stelle 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: "Automatische Auswahl einer Region ist nur für Spieler möglich, gibt die Region als Argument an."
|
||||
|
||||
help-header: "Hilfeseite mit Befehlen, die du ausführen kannst."
|
||||
help-alias: "Befehlsaliase: /areashop, /as."
|
||||
help-help: "&6/as help &7-&r Zeigt diese Hilfeseite."
|
||||
help-info: "&6/as info &7-&r Zeigt Informationen über die aktuellen Regionen."
|
||||
help-rent: "&6/as rent &7-&r Miete eine Region oder verlängere die Mietzeit."
|
||||
help-buy: "&6/as buy &7-&r Kaufe eine Region."
|
||||
help-unrent: "&6/as unrent &7-&r Kündige den Mietvertrag einer Region."
|
||||
help-unrentOwn: "&6/as unrent &7-&r Kündige den Mietvertrag deiner Region."
|
||||
help-sell: "&6/as sell &7-&r Verkaufe eine Region."
|
||||
help-sellOwn: "&6/as sell &7-&r Verkaufe deine Region."
|
||||
help-reload: "&6/as reload &7-&r Lädt alle Dateien neu ein und updatet die Regionen."
|
||||
help-setrestore: "&6/as setrestore &7-&r Setze Wiederherstellung an/aus und wähle Profil."
|
||||
help-setprice: "&6/as setprice &7-&r Ändere den Preis einer Region."
|
||||
help-setduration: "&6/as setduration &7-&r Ändere die Mietdauer einer Region."
|
||||
help-teleport: "&6/as tp &7-&r Teleportiere zu deiner gekauften/gemieteten Region."
|
||||
help-teleportAll: "&6/as tp &7-&r Teleportiere zu einer gekauften/gemieteten Region."
|
||||
help-setteleport: "&6/as settp &7-&r Erstelle einen Teleport-Punkt für eine gekaufte/gemietete Region."
|
||||
help-setteleportAll: "&6/as settp &7-&r Erstellt einen Teleportpunkt für eine Region."
|
||||
help-find: "&6/as find &7-&r Finde eine Region, welche gekauft oder gemietet werden kann."
|
||||
help-groupadd: "&6/as groupadd &7-&r Füge eine Region einer Gruppe hinzu."
|
||||
help-groupdel: "&6/as groupdel &7-&r Entferne eine Region aus einer Gruppe."
|
||||
help-grouplist: "&6/as grouplist &7-&r Zeige alle momentan existierenden Gruppen an."
|
||||
help-groupinfo: "&6/as groupinfo &7-&r Zeige Informationen über eine Gruppe an."
|
||||
help-schemevent: "&6/as schemevent &7-&r Starte ein Schematic-Event für eine Region."
|
||||
help-add: "&6/as add &7-&r Definiere eine Region als zu verkaufen oder zu vermieten."
|
||||
help-del: "&6/as del &7-&r Entferne eine Region aus AreaShop."
|
||||
help-addsign: "&6/as addsign &7-&r Füge einer Region ein Schild hinzu."
|
||||
help-delsign: "&6/as delsign &7-&r Lösche das Schild einer Region, welches du gerade ansiehst."
|
||||
help-me: "&6/as me &7-&r Überprüfe, welche Regionen du besitzt (+Verfallsdatum)."
|
||||
help-setowner: "&6/as setowner &7-&r Lege den Besitzer der Region fest oder verlängere die Mietdauer."
|
||||
help-resell: "&6/as resell &7-&r Aktiviere den Weiterverkaufs-Modus für eine deiner Regionen."
|
||||
help-resellAll: "&6/as resell &7-&r Aktiviere den Weiterverkaufs-Modus für eine Region."
|
||||
help-stopResell: "&6/as stopresell &7-&r Stoppe den Weiterverkauf deiner Region."
|
||||
help-stopResellAll: "&6/as stopresell &7-&r Stoppe den Weiterverkauf einer Region."
|
||||
help-addFriend: "&6/as addfriend &7-&r Füge einen Freund zu deiner Region hinzu."
|
||||
help-addFriendAll: "&6/as addfriend &7-&r Füge einen Spieler zu einer Region hinzu."
|
||||
help-delFriend: "&6/as delfriend &7-&r Entferne einen Freund von deiner Region."
|
||||
help-delFriendAll: "&6/as delfriend &7-&r Entferne einen Spieler von einer Region."
|
||||
help-linksigns: "&6/as linksigns &7-&r Benutze Schilder Massenverlinkungsmodus"
|
||||
help-stack: "&6/as stack &7-&r Erstellt mehrere Regionen und fügt sie hinzu."
|
||||
|
||||
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-payError: "Die Bezahlung hat nicht funktioniert. Bitte versuche es später noch einmal."
|
||||
rent-rented: "Du hast %0% von %1% gemietet."
|
||||
rent-extended: "Du hast die Miete verlängert von %0% bis %1%."
|
||||
rent-extend: "Du kannst die Miete verlängern, indem du mit rechts noch einmal auf das Schild klickst oder den Befehl /as rent nutzt."
|
||||
rent-lowMoneyExtend: "Du hast nicht genug Geld, um die Miete zu verlängern (Du hast %0%, benötigst aber %1%)."
|
||||
rent-lowMoneyRent: "Du hast nicht genug Geld, um diese Region zu mieten (Du hast %0%, benötigst aber %1%)."
|
||||
rent-someoneElse: "Diese Region ist bereits vermietet."
|
||||
rent-notRentable: "Diese Region ist nicht mietbar."
|
||||
rent-maxExtends: "Du kannst die Miete nicht verlängern (Die Miete ist maximal %0% mal verlängerbar), du kannst die Region allerdings neu mieten, sobald sie wieder zu vermieten ist."
|
||||
rent-maxRentTime: "Du kannst die Mietdauer dieser Region nicht erneut verlängern. Die maximale Zeit beträgt %0% Minuten und du hast sie bereits für %1% Minuten gemietet."
|
||||
rent-restrictedToWorld: "Du musst dich in der '%0%' Welt befinden, um diese Region mieten zu können (Du bist in '%1%')."
|
||||
rent-restrictedToRegion: "Du musst innerhalb von '%0%' sein, um es zu mieten."
|
||||
rent-expireWarning: "Deine Region %region% hat %timeleft% übrig. Gehe sicher, dass du es rechtzeitig verlängerst, wenn du sie behalten willst."
|
||||
|
||||
buy-help: "/as buy [Region], 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-notBuyable: "Diese Region steht nicht zum Verkauf bereit."
|
||||
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 %0% erfolgreich gekauft."
|
||||
buy-successResale: "Du hast %0% erfolgreich von %1% gekauft."
|
||||
buy-successSeller: "Deine Region %0% wurde an %1% für %2% verkauft."
|
||||
buy-lowMoney: "Du hast nicht genug Geld, um diese Region zu kaufen. (Du hast %0% benötigst aber %1%)."
|
||||
buy-yours: "Du besitzt diese Region bereits."
|
||||
buy-someoneElse: "Jemand anderes hat diese Region bereits gekauft."
|
||||
buy-restrictedToWorld: "Du musst in der Welt '%0%' sein, um diese Region kaufen zu können (Du befindest dich in '%1%')."
|
||||
buy-restrictedToRegion: "Du musst innerhalb von '%0%' sein, um es zu kaufen."
|
||||
|
||||
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: "Der Mietvertrag wurde gekündigt."
|
||||
unrent-other: "Der Mietvertrag dieser Region wurde von %0% gekündigt."
|
||||
unrent-expired: "Dein Mietvertrag von %0% 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: "Diese Region wurde verkauft an %0%."
|
||||
sell-soldYours: "Region erfolgreich verkauft."
|
||||
sell-noPermission: "Du bist nicht berechtigt, diese Region zu verkaufen."
|
||||
sell-noPermissionOther: "Du bist nicht berechtigt, eine Region zu verkaufen."
|
||||
|
||||
reload-reloaded: "Alle Dateien wurden erfolgreich neu geladen."
|
||||
reload-updateStart: "&Aktualisiere %0% Regionen mit %1% Regionen pro Sekunde."
|
||||
reload-updateComplete: "&7Regionen 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 <all|rented|forrent|sold|forsale|player|region|nogroup>."
|
||||
info-noPermission: "Du hast keine Berechtigung, Informationen über Regionen zu erhalten."
|
||||
info-all-rents: "Mietbare Regionen: &7%0%."
|
||||
info-all-noRents: "Es gibt momentan keine mietbaren Regionen."
|
||||
info-all-buys: "Regionen zum Verkauf: &7%0%."
|
||||
info-all-noBuys: "Es gibt momentan keine verkauften Regionen."
|
||||
info-nogroupRents: "Miete Regionen ohne Gruppe: &7%0%."
|
||||
info-nogroupBuys: "Kaufe Regionen ohne Gruppe: &7%0%."
|
||||
info-nogroupNoRents: "Es gibt keine Miet-Regionen ohne eine Gruppe."
|
||||
info-nogroupNoBuys: "Es gibt keine Kauf-Regionen ohne eine Gruppe."
|
||||
info-rented: "Vermietete Regionen: &7%0%."
|
||||
info-noRented: "Momentan sind keine Regionen vermietet."
|
||||
info-unrented: "Nicht vermietete Regionen: &7%0%."
|
||||
info-noUnrented: "Sämtliche Regionen sind vermietet."
|
||||
info-sold: "Verkaufte Regionen: &7%0%."
|
||||
info-noSold: "Es sind momentan keine Regionen verkauft."
|
||||
info-forsale: "Zum Verkauf stehende Regionen: &7%0%."
|
||||
info-noForsale: "Sämtliche Regionen sind verkauft."
|
||||
info-playerHelp: "/as info player <Spielername>."
|
||||
info-playerRents: "Von %0% gemietete Regionen: &7%1%."
|
||||
info-playerNoRents: "%0% hat bisher keine Region(en) gemietet."
|
||||
info-playerBuys: "Von %0% verkaufte Regionen: &7%1%."
|
||||
info-playerNoBuys: "%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: "&2Informationen über %region%:"
|
||||
info-regionHeaderBuy: "&2Informationen über %region%:"
|
||||
info-regionRented: "&2&l►&r Gemietet von %player% bis: &7%until%."
|
||||
info-regionBought: "&2&l►&r Gekauft von %player%."
|
||||
info-regionReselling: "&2&l►&r Gekauft von %player%, derzeit Weiterverkauf."
|
||||
info-regionExtending: "&2&l►&r Preis zum Verlängern: &7%price% für %duration%."
|
||||
info-regionCanBeRented: "&2&l►&r Preis zum Mieten: &7%price% für %duration%."
|
||||
info-regionCanBeBought: "&2&l►&r Kaufpreis: &7%price%."
|
||||
info-regionReselPrice: "&2&l►&r Weiterverkaufspreis: &7%resellprice% (Du kannst es von %player% kaufen)."
|
||||
info-regionFriends: "&2&l►&r Freunde hinzugefügt: &7%friends%."
|
||||
info-regionMoneyBackBuy: "&2&l►&r Verkaufpreis: &7%moneyback% (%moneybackpercent%% des Kaufpreises)."
|
||||
info-regionMoneyBackRent: "&2&l►&r Rückzahlung bei Mietkündigung: &7%moneyback% (%moneybackpercent%% der verbleibenden Zeit)."
|
||||
info-regionMaxExtends: "&2&l►&r Maximale Anzahl an Mietverlängerungen: &7%maxextends% mal."
|
||||
info-regionNoExtending: "&2&l►&r Miete kann nicht verlängert werden."
|
||||
info-regionExtendsLeft: "&2&l►&r Verbleibende Mietverlängerungen: &7%extendsleft% von %maxextends% mal."
|
||||
info-regionMaxRentTime: "&2&l►&r Miete im Voraus: &7Maximal %maxrenttime%."
|
||||
info-regionNoTeleport: "&2&l►&r Teleport-Position nicht gesetzt%0%."
|
||||
info-regionTeleportHint: " &7(Benutze '/as settp' für einen bessere Position)"
|
||||
info-regionTeleportAt: "&2&l►&r Teleport-Punkt bei: &7(%0%, %1%, %2%, %3%, Neigung:%4%, Drehung:%5%)."
|
||||
info-regionSigns: "&2&l►&r Verbundene Schilder: &7%0%."
|
||||
info-regionSignLocation: "&7(%0%, %1%, %2%, %3%)&r"
|
||||
info-regionGroups: "&2&l►&r Zugewiesene Gruppen: &7%0%."
|
||||
info-regionInactiveUnrent: "&2&l►&r Automatische Mietkündigung nach: &7%inactivetime% Inaktivität des Spielers."
|
||||
info-regionInactiveSell: "&2&l►&r Automatischer Verkauf nach: &7%inactivetime% Inaktivität des Spielers."
|
||||
info-regionRestrictedRegionRent: "&2&l►&r Du musst dich in der Region befinden, um sie mieten zu können."
|
||||
info-regionRestrictedWorldRent: "&2&l►&r Du musst in der Welt '%world%' sein, um diese Region mieten zu können."
|
||||
info-regionRestrictedRegionBuy: "&2&l►&r Du musst sich in der Region befinden, um sie kaufen zu können."
|
||||
info-regionRestrictedWorldBuy: "&2&l►&r Du musst in der Welt '%world%' sein, um diese Region kaufen zu können."
|
||||
info-regionRestoringRent: "&2&l►&r Die Wiederherstellung ist aktiviert. &7(Region wird bei Mietkündigung zurückgesetzt)%0%."
|
||||
info-regionRestoringBuy: "&2&l►&r Die Wiederherstellung ist aktiviert. &7(Region wird beim Verkauf zurückgesetzt)%0%."
|
||||
info-regionRestoringProfile: " (Profil: %0%)"
|
||||
info-regionNoSign: "Für diese Region gibt es bisher kein Schild."
|
||||
info-regionPriceDuration: "Preis: &7%0% pro %1%."
|
||||
info-regionPrice: "Preis: &7%0%."
|
||||
info-regionRestore: "Wiederherstellung aktiviert: &7%0%."
|
||||
info-regionRestoreProfile: "Wiederherstellungs-Profil: &7%0%."
|
||||
info-regionTPLocation: "Teleport-Adresse: &7Welt=%0%, X=%1%, Y=%2%, Z=%3%, Pitch=%4%, Yaw=%5%."
|
||||
info-regionNoTP: "Keine Teleport-Adressen vorhanden."
|
||||
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 erfolgreich von %0% zu '%1%' geändert."
|
||||
setrestore-successProfile: "Wiederherstellungs-Einstellung erfolgreich von %0% zu '%1%' und das Profil zu '%2%' 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: "Preis der Region %0% geändert auf %1% von %2%."
|
||||
setprice-successBuy: "Preis der Region %0% geändert auf %1%."
|
||||
|
||||
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 %0% geändert zu '%1%'."
|
||||
|
||||
setup-noRegion: "Du hast in der zweiten Zeile keine Region angegeben."
|
||||
setup-wrongRegion: "Die angegebene Region existiert nicht."
|
||||
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 von %0% ist korrekt erfolgt."
|
||||
setup-buySuccess: "Der Kauf von %0% ist korrekt erfolgt."
|
||||
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: %0% und %1%)."
|
||||
setup-blacklisted: "%0% ist auf der Blacklist und kann nicht in AreaShop eingefügt werden."
|
||||
|
||||
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: "%0% erfolgreich als mietbare Region abgemeldet."
|
||||
destroy-successBuy: "%0% 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 %0% teleportiert."
|
||||
teleport-successSign: "Du wurdest zu %0% teleportiert."
|
||||
teleport-noSafe: "Keine sichere Position in %0% gefunden, kein Boden vorhanden oder maximale Anzahl an Versuchen erreicht (%1%/%2%)."
|
||||
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."
|
||||
|
||||
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 %0% erfolgreich gesetzt."
|
||||
setteleport-notInside: "Der Teleportpunkt muss sich innerhalb einer Region befinden."
|
||||
setteleport-reset: "Teleport-Punkt von %0% 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: %1%, bei Suche nach max. Preis in Höhe deines Guthabens: %2%%3%."
|
||||
find-successMax: "%0% Region gefunden: %1%, bei Suche nach max. Preis in Höhe von %2%%3%."
|
||||
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-noRegion: "Die angegebene Region ist nicht eingetragen: %0%."
|
||||
groupadd-success: "Region %0% wurde zu Gruppe '%1%' hinzugefügt, diese Gruppe hat nun %2% Mitglied(er)."
|
||||
groupadd-failed: "Region %0% ist bereits Mitglied der Gruppe '%1%'."
|
||||
groupadd-weSuccess: "Zu Gruppe %0% hinzugefügt: &7%1%."
|
||||
groupadd-weFailed: "Ist bereits in Gruppe %0%: &7%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-noRegion: "Die angegebene Region ist nicht eingetragen: %0%."
|
||||
groupdel-success: "Region %0% ist aus Gruppe '%1%' entfernt worden. Diese Gruppe hat nun %2% Mitglied(er)."
|
||||
groupdel-failed: "Region %0% gehört nicht zur Gruppe '%1%'."
|
||||
groupdel-weSuccess: "Entfernt aus Gruppe %0%: &7%1%."
|
||||
groupdel-weFailed: "Ist nicht länger in Gruppe %0%: &7%1%."
|
||||
|
||||
grouplist-noPermission: "Du bist nicht berechtigt, die eingetragenen Gruppen abzurufen."
|
||||
grouplist-noGroups: "Momentan sind keine Gruppen vorhanden."
|
||||
grouplist-success: "Folgende Gruppen sind vorhanden: &7%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%: &7%1%."
|
||||
groupinfo-noMembers: "Gruppe %0% hat keine Mitglieder."
|
||||
|
||||
schemevent-help: "/as schemevent <Region> <created|deleted|rented|unrented|bought|sold>."
|
||||
schemevent-noRegion: "Folgende angegebene Region ist nicht eingetragen: %0%."
|
||||
schemevent-wrongEvent: "Das angegebene Event '%0%' existiert nicht, bitte benutze eines der folgenden: &7%1%."
|
||||
schemevent-success: "'%0%'-Event wurde erfolgreich für Region %1% 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%: &7%1%."
|
||||
add-failed: "Bereits eingetragen: &7%0%."
|
||||
add-blacklisted: "Auf der Blacklist: &7%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: "Region '%0%' existiert nicht in dieser Welt."
|
||||
|
||||
del-noRegion: "Die angegebene Region ist nicht registriert: %0%."
|
||||
del-noPermission: "Du bist nicht berechtigt, Regionen zu entfernen."
|
||||
del-success: "Entfernte Region(en): &7%0%."
|
||||
del-failed: "Keine Berechtigung zum Entfernen oder nicht in AreaShop eingetragen: &7%0%."
|
||||
|
||||
addsign-help: "/as addsign [Region] [Profil]."
|
||||
addsign-noSign: "Du schaust gerade nicht auf ein Schild."
|
||||
addsign-noRegion: "Region '%0%' nicht gefunden."
|
||||
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: %0% und %1%)."
|
||||
addsign-couldNotDetectSign: "Mehrere Regionen um das Schild herum gefunden, bitte gewünschte Region in die zweite Zeile eintragen (zwei der gefundenen Regionen: %0% und %1%)."
|
||||
addsign-wrongProfile: "Das eingetragene Profil existiert nicht. Bitte benutze eines der folgenden (überprüfe config): &7%0%."
|
||||
addsign-success: "Das Schild wurde hinzugefügt zu %region%."
|
||||
addsign-successProfile: "Das Schild wurde zu %region% mit dem Profil %0% hinzugefügt."
|
||||
addsign-alreadyRegistered: "Dieses Schild gehört zur Region %0%."
|
||||
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: "Schild von Region %0% erfolgreich entfernt."
|
||||
|
||||
me-noPermission: "Dir fehlt die Berechtigung einzusehen, welche Regionen du besitzt."
|
||||
me-notAPlayer: "Du bist kein Spieler, darum können dir keine Regionen gehören."
|
||||
me-noRentRegions: "Du hast aktuell keine Regionen angemietet."
|
||||
me-noBuyRegions: "Du hast aktuell keine Regionen im Besitz."
|
||||
me-rentRegions: "Du hast die folgenden Regionen angemietet:"
|
||||
me-buyRegions: "Du bist Eigentümer der folgenden Regionen:"
|
||||
me-rentLine: "&2&l►&r %region% bis %until% &7(noch %timeleft% verbleibend)."
|
||||
me-buyLine: "&2&l►&r %region%."
|
||||
me-noFriendRegions: "Du wurdest noch nicht als Freund zu einer Region hinzugefügt."
|
||||
me-friendRegions: "Du bist in folgenden Regionen als Freund hinzugefügt:"
|
||||
me-friendLine: "&2&l►&r %region% &7(Besitzer: %player%)."
|
||||
|
||||
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 %region% erfolgreich geändert zu %player%, gemietet bis %until% (%timeleft% verbleibend)."
|
||||
setowner-succesRentExtend: "%player% ist bereits Besitzer, Miete verlängert um '%duration%', nun gemietet bist %until% (%timeleft% verbleibend)."
|
||||
setowner-succesBuy: "Besitzer von %region% erfolgreich geändert zu %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-noRegionFound: "Keine AreaShop-Region an deiner Stelle gefunden, gib die Region als Argument an."
|
||||
resell-notBought: "Du kannst %region% nicht weiterverkaufen, weil sie noch nicht erworben wurde."
|
||||
resell-success: "Weiterverkauf für %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-noRegionFound: "Keine AreaShop-Region an deiner Stelle gefunden, gib die Region als Argument an."
|
||||
stopresell-notResell: "Du kannst den Weiterverkauf von %region% nicht stoppen, weil sie bisher nicht weiterverkauft werden soll."
|
||||
stopresell-success: "Weiterverkauf von %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: "%0% wurde als Freund zu Region %1% hinzugefügt."
|
||||
addfriend-success: "%0% wurde als Freund zu deiner Region %1% hinzugefügt."
|
||||
addfriend-alreadyAdded: "&0% wurde bereits als Freund zu dieser 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: "%0% wurde als Freund der Region %1% entfernt."
|
||||
delfriend-success: "%0% wurde als Freund deiner Region %1% entfernt."
|
||||
delfriend-notAdded: "%0% ist nicht als Freund dieser Region eingetragen."
|
||||
delfriend-noOwner: "Du kannst keine Freunde von einer Region ohne Besitzer entfernen."
|
||||
|
||||
linksigns-multipleRegions: "Mehrere Regionen gefunden: &7%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. &7(Maximale Reichweite 100 Blöcke)"
|
||||
linksigns-regionFound: "Region %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 &7(Maximale Reichweite 100 Blöcke)."
|
||||
linksigns-alreadyRegistered: "Dieses Schild ist bereits auf die Region %region% registriert, klicke erneut um ein anderes Schild zu wählen."
|
||||
linksigns-first: "Du bist nun im Schilderverbindungsmodus."
|
||||
linksigns-next: "&7Linksklicke 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].\n&7 <Menge> Nummer der Regionen, die erstellt werden.\n <Abstand> Block-Abstand zwischen den Regionen.\n <Name> Namen der Regionen (Nummer wird dahinter sein).\n <rent|buy> Macht die Regionen zu kauf- oder Mietregionen\n [Gruppe] Eine Gruppe, die zu den erstellten Regionen hinzugefügt wird.\n 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: "&7Füge %0% Regionen mit %1% Regionen pro Sekunde hinzu."
|
||||
stack-addComplete: "&7Regionen erfolgreich hinzugefügt."
|
||||
stack-unclearDirection: "Bitte gucke nur nach Norden, Osten, Süden oder Westen. Du guckst im Moment nach %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."
|
||||
|
||||
update-playerNotify: "&2Es ist ein Update von AreaShop V%0% auf %1% verfügbar, lade die neuste Version hier herunter: http://dev.bukkit.org/bukkit-plugins/regionbuyandrent/."
|
||||
@@ -0,0 +1,430 @@
|
||||
# ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
|
||||
# ║ Language file of the AreaShop plugin created by NLThijs48, Github can be found at https://github.com/NLthijs48/AreaShop ║
|
||||
# ║ Language: English, Version: V2.2.0, 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 ║
|
||||
# ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
|
||||
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 this region is currently unavailable (world '%0%')."
|
||||
general-noRegion: "You cannot do that, the WorldGuard region is currently unavailable (region '%0%')."
|
||||
general-noEconomy: "There is no economy plugin installed or it is not setup correctly, notify the server owner about this."
|
||||
|
||||
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 registered: %0%."
|
||||
cmd-noRegionsAtLocation: "No regions found at your location, specify the region as argument."
|
||||
cmd-moreRegionsAtLocation: "More than one region has been found at your location, specify the region as argument."
|
||||
cmd-automaticRegionOnlyByPlayer: "Automatically determining the region is only possible for players, specify the region as argument."
|
||||
|
||||
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-reload: "&6/as reload &7-&r Reload all files and update the regions."
|
||||
help-setrestore: "&6/as setrestore &7-&r Set restoring on/off and choose profile."
|
||||
help-setprice: "&6/as setprice &7-&r Change the price of a region."
|
||||
help-setduration: "&6/as setduration &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."
|
||||
help-me: "&6/as me &7-&r Check which regions you have (+expiration)."
|
||||
help-setowner: "&6/as setowner &7-&r Set region owner or extend the rent."
|
||||
help-resell: "&6/as resell &7-&r Put one of your regions into resell mode."
|
||||
help-resellAll: "&6/as resell &7-&r Put a region into resell mode."
|
||||
help-stopResell: "&6/as stopresell &7-&r Put your region back into sold mode."
|
||||
help-stopResellAll: "&6/as stopresell &7-&r Put a region back into sold mode."
|
||||
help-addFriend: "&6/as addfriend &7-&r Add a friend to your region."
|
||||
help-addFriendAll: "&6/as addfriend &7-&r Add a friend to a region."
|
||||
help-delFriend: "&6/as delfriend &7-&r Delete a friend from your region."
|
||||
help-delFriendAll: "&6/as delfriend &7-&r Delete a friend from a region."
|
||||
help-linksigns: "&6/as linksigns &7-&r Use bulk sign linking mode."
|
||||
help-stack: "&6/as stack &7-&r Create multiple regions and add them."
|
||||
help-setlandlord: "&6/as setlandlord &7-&r Set the landlord of a region."
|
||||
|
||||
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) (you already have %1% in group '%2%')."
|
||||
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."
|
||||
rent-maxRentTime: "You cannot rent this region more time in advance, the maximum time is %0% and you have currently rented it for %1%."
|
||||
rent-restrictedToWorld: "You need to be in the '%0%' world to rent this region (you are in '%1%')."
|
||||
rent-restrictedToRegion: "You need to be inside '%0%' to rent it."
|
||||
rent-expireWarning: "Your region %region% has %timeleft% left, be sure to extend it if you want to keep it."
|
||||
|
||||
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) (you already have %1% in group '%2%')."
|
||||
buy-payError: "Something went wrong with paying, try again later."
|
||||
buy-succes: "You successfully bought %0%."
|
||||
buy-successResale: "You successfully bought %0% from %1%."
|
||||
buy-successSeller: "Your region %0% has been sold to %1% for %2%."
|
||||
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."
|
||||
buy-restrictedToWorld: "You need to be in the '%0%' world to buy this region (you are in '%1%')."
|
||||
buy-restrictedToRegion: "You need to be inside '%0%' to buy it."
|
||||
|
||||
unrent-help: "/as unrent [regionname], the region you stand in will be used if not specified."
|
||||
unrent-noPermission: "You don't have permission to unrent a region."
|
||||
unrent-noPermissionOther: "You don't have permission to unrent another region."
|
||||
unrent-notRegistered: "The region can't be unrented because it is not registered for renting."
|
||||
unrent-notRented: "The region can't be unrented because it is not rented."
|
||||
unrent-unrented: "Your region has been unrented."
|
||||
unrent-other: "The region has been unrented for player %0%."
|
||||
unrent-expired: "Your rent of %0% has expired."
|
||||
|
||||
sell-help: "/as sell [regionname], 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: "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."
|
||||
|
||||
reload-reloading: "Reloaded all files, now checking rents and updating regions."
|
||||
reload-updateStart: "&7Updating %0% regions at %1% per second."
|
||||
reload-updateComplete: "&7Updating 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 <all|rented|forrent|sold|forsale|player|region|nogroup>."
|
||||
info-noPermission: "You don't have permission to get information about regions."
|
||||
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-nogroupRents: "Rent regions without group: &7%0%."
|
||||
info-nogroupBuys: "Buy regions without group: &7%0%."
|
||||
info-nogroupNoRents: "There are no rent regions without a group."
|
||||
info-nogroupNoBuys: "There are no buy regions without a group."
|
||||
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-regionHeaderRent: "&2Information about %region%:"
|
||||
info-regionHeaderBuy: "&2Information about %region%:"
|
||||
info-regionFooterRent: ""
|
||||
info-regionFooterBuy: ""
|
||||
info-regionRented: "&2&l►&r Rented by %player% until: &7%until%."
|
||||
info-regionBought: "&2&l►&r Bought by %player%."
|
||||
info-regionReselling: "&2&l►&r Bought by %player%, currently reselling."
|
||||
info-regionExtending: "&2&l►&r Price to extend: &7%price% per %duration%."
|
||||
info-regionCanBeRented: "&2&l►&r Price to rent: &7%price% per %duration%."
|
||||
info-regionCanBeBought: "&2&l►&r Price to buy: &7%price%."
|
||||
info-regionReselPrice: "&2&l►&r Resell price: &7%resellprice% (you can buy it from %player%)."
|
||||
info-regionFriends: "&2&l►&r Added friends: &7%friends%."
|
||||
info-regionMoneyBackBuy: "&2&l►&r Selling payback: &7%moneyback% (%moneybackpercent%% of the price)."
|
||||
info-regionMoneyBackRent: "&2&l►&r Unrenting payback: &7%moneyback% (%moneybackpercent%% of the remaining time)."
|
||||
info-regionMaxExtends: "&2&l►&r Maximum number of extensions: &7%maxextends% time(s)."
|
||||
info-regionNoExtending: "&2&l►&r Rent cannot be extended."
|
||||
info-regionExtendsLeft: "&2&l►&r Extensions left: &7%extendsleft% time(s) out of %maxextends%."
|
||||
info-regionMaxRentTime: "&2&l►&r In advance renting: &7%maxrenttime% at maximum."
|
||||
info-regionNoTeleport: "&2&l►&r Teleport location not set%0%."
|
||||
info-regionTeleportHint: " &7(use '/as settp' for a better spot)"
|
||||
info-regionTeleportAt: "&2&l►&r Teleport set at: &7(%0%, %1%, %2%, %3%, pitch:%4%, yaw:%5%)."
|
||||
info-regionSigns: "&2&l►&r Connected signs: &7%0%."
|
||||
info-regionSignLocation: "&7(%0%, %1%, %2%, %3%)&r"
|
||||
info-regionGroups: "&2&l►&r Assigned groups: &7%0%."
|
||||
info-regionInactiveUnrent: "&2&l►&r Auto unrent after: &7%inactivetime% of inactivity by the player."
|
||||
info-regionInactiveSell: "&2&l►&r Auto sell after: &7%inactivetime% of inactivity by the player."
|
||||
info-regionRestrictedRegionRent: "&2&l►&r You must be inside this region to rent it."
|
||||
info-regionRestrictedWorldRent: "&2&l►&r You need to be inside world '%world%' to rent this region."
|
||||
info-regionRestrictedRegionBuy: "&2&l►&r You must be inside this region to buy it."
|
||||
info-regionRestrictedWorldBuy: "&2&l►&r You need to be inside world '%world%' to buy this region."
|
||||
info-regionRestoringRent: "&2&l►&r Restoring is enabled &7(region will reset at unrent)%0%."
|
||||
info-regionRestoringBuy: "&2&l►&r Restoring is enabled &7(region will reset at sell)%0%."
|
||||
info-regionRestoringProfile: " (profile: %0%)"
|
||||
info-regionLandlord: "&2&l►&r Landlord: &7%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 %0% to '%1%'."
|
||||
setrestore-successProfile: "Successfully set the restore setting of %0% to '%1%' and the profile to '%2%'."
|
||||
|
||||
setprice-noPermission: "You don't have permission to change the price of a region."
|
||||
setprice-help: "/as setprice <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 %region% changed to %price% per %duration%."
|
||||
setprice-successBuy: "Price of region %region% changed to %price%."
|
||||
setprice-successRemoved: "Price of %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 %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 %0% changed to '%1%'."
|
||||
setduration-noLandlord: "You don't have permission to change the duration because you are not the landlord of %region%."
|
||||
setduration-successRemoved: "Duration of %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-wrongRegion: "The region you specified does not exist."
|
||||
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 %0% is setup correctly."
|
||||
setup-buySuccess: "Buying of region %0% 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: %0% and %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: "%0% successfully deregistered as rental region."
|
||||
destroy-successBuy: "%0% 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 %0%."
|
||||
teleport-successSign: "You teleported to the sign of %0%."
|
||||
teleport-noSafe: "No safe position found in region %0%, no spots in region left or maximum tries exceeded (%1%/%2%)."
|
||||
teleport-blocked: "You can't teleport because the position is outside the region, and you are forced to teleport inside."
|
||||
teleport-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 %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] [group]."
|
||||
find-noPermission: "You don't have permission to search regions and teleport to them."
|
||||
find-success: "Found a %0% region: %1%, while searching with a max price of your balance: %2%%3%."
|
||||
find-successMax: "Found a %0% region: %1%, while searching with a max price of %2%%3%."
|
||||
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-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 successfully 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-blacklisted: "On the blacklist: &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."
|
||||
add-noPermissionRegions: "No permission to add: &7%0%."
|
||||
add-noPermissionOwnerMember: "&7You either are not a member/owner of this region or have no permission to add your regions."
|
||||
|
||||
del-noRegion: "The specified region is not registered: %0%."
|
||||
del-noPermission: "You don't have permission to remove regions."
|
||||
del-success: "Removed regions: &7%0%."
|
||||
del-failed: "No permission to remove or not registered: &7%0%."
|
||||
|
||||
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 %region%."
|
||||
addsign-successProfile: "The sign has been added to %region% with profile %0%."
|
||||
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%."
|
||||
|
||||
me-noPermission: "You don't have permission to check which regions you have."
|
||||
me-notAPlayer: "You are not a player so you can't have any regions."
|
||||
me-noRentRegions: "You have not rented any rent regions."
|
||||
me-noBuyRegions: "You have not bought any buy regions."
|
||||
me-rentRegions: "You have rented the following regions:"
|
||||
me-buyRegions: "You have bought the following regions:"
|
||||
me-rentLine: "&2&l►&r %region% until %until% &7(%timeleft% left)."
|
||||
me-buyLine: "&2&l►&r %region%."
|
||||
me-noFriendRegions: "You have not been added to any regions as friend."
|
||||
me-friendRegions: "You are added as a friend to the following regions:"
|
||||
me-friendLine: "&2&l►&r %region% &7(owner: %player%)."
|
||||
|
||||
setowner-help: "/as setowner <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 %region% successfully changed to %player%, rented until %until% (%timeleft% left)."
|
||||
setowner-succesRentExtend: "Owner was already %player%, rent extended with '%duration%', now rented until %until% (%timeleft% left)."
|
||||
setowner-succesBuy: "Owner of %region% successfully changed to %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-noRegionFound: "No AreaShop region could be found at your location, try specifying the region as argument."
|
||||
resell-notBought: "You can't resell %region% because it is not sold yet."
|
||||
resell-success: "%region% is successfully put into reselling mode for %resellprice%."
|
||||
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-noRegionFound: "No AreaShop region could be found at your location, try specifying the region as argument."
|
||||
stopresell-notResell: "You can't stop reselling %region% because it is not in resell mode."
|
||||
stopresell-success: "%region% is successfully put back into sold mode."
|
||||
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: "%0% has been added as friend to region %1%."
|
||||
addfriend-success: "%0% has been added as friend to your region %1%."
|
||||
addfriend-alreadyAdded: "%0% is already added as friend for this 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: "%0% has been deleted as friend from region %1%."
|
||||
delfriend-success: "%0% has been deleted as friend from your region %1%."
|
||||
delfriend-notAdded: "%0% is not added as friend for this region."
|
||||
delfriend-noOwner: "You cannot remove friends from a region without owner."
|
||||
|
||||
linksigns-multipleRegions: "Found multiple regions: &7%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 &7(maximum range 100 blocks)."
|
||||
linksigns-regionFound: "Region %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 &7(maximum range 100 blocks)."
|
||||
linksigns-alreadyRegistered: "That sign is already registered for region %region%, click again to select another sign."
|
||||
linksigns-first: "You have entered sign linking mode."
|
||||
linksigns-next: "&7Leftclick 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].\n&7 <amount> Number of regions that will be created.\n <gap> Blocks distance between the regions.\n <name> Name of the regions (number will be behind it).\n <rent|buy> Make then rent or buy regions.\n [group] A group to add the created regions to.\n 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: "&7Adding %0% regions at %1% per second."
|
||||
stack-addComplete: "&7Adding 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-didNotPlayBefore: "&7Note: '%0%' did not play on the server yet, are you using the correct player?"
|
||||
setlandlord-noRegion: "The specified region is not registered: %0%."
|
||||
setlandlord-success: "%0% has successfully been set as landlord of %1%."
|
||||
|
||||
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: "&2Update from AreaShop V%0% to %1% available, get the latest version at http://dev.bukkit.org/bukkit-plugins/regionbuyandrent/."
|
||||
@@ -0,0 +1,413 @@
|
||||
# ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
|
||||
# ║ Language file of the AreaShop plugin created by NLThijs48, Github can be found at https://github.com/NLthijs48/AreaShop ║
|
||||
# ║ Language: Finnish, Version: V2.2.0, 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 ║
|
||||
# ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
|
||||
total-maximum: "Et voi vuokrata tai ostaa yhteensä enempää kuin %0% alueen(aluetta) (sinulla on jo %1% ryhmässä '%2%')"
|
||||
|
||||
cmd-notValid: "Tuo komento ei ole käytettävissä, käytä '/as help' saadaksesi lisätietoja."
|
||||
cmd-onlyByPlayer: "Tämän komennon voi suorittaa vain pelaaja."
|
||||
cmd-weOnlyByPlayer: "Käytetään WorldEditin valintaa ainoastaan pelaajan toimesta, lisäksi erittele alueen nimi,"
|
||||
cmd-noSelection: "Sinulla ei ole WorldEditin valintaa."
|
||||
cmd-noRegionsFound: "Rekisteröityjä alueita ei löytynyt AreaShopista sinun valinnoillasi."
|
||||
cmd-noWERegionsFound: "WorldEditin risteäviä alueita sinun valinnallasi ei löytynyt."
|
||||
cmd-notRegistered: "Määritetty alue ei ole rekisteröity: %0%."
|
||||
cmd-noRegionsAtLocation: "Alueita ei löytynyt sinun sijainnissasi, erittele alueen nimi."
|
||||
cmd-moreRegionsAtLocation: "Enemmän kuin yksi alue on löydetty sinun sijainnissasi, erittele alueen nimi jota haluat tarkastella."
|
||||
cmd-automaticRegionOnlyByPlayer: "Alueen automaattinen määrittäminen on vain mahdollinen pelaajille, erittele alueen nimi."
|
||||
|
||||
help-header: "Apusivu, komennot joita sinä voit suorittaa"
|
||||
help-alias: "Komennon aliakset: /areashop, /as."
|
||||
help-help: "&6/as help &7-&r Näyttää sinulle apusivun."
|
||||
help-info: "&6/as info &7-&r Saadaksesi lisätietoa alueesta."
|
||||
help-rent: "&6/as rent &7-&r Vuokrataksesi regionin tai laajentaaksesi nykyistä aluetta."
|
||||
help-buy: "&6/as buy &7-&r Ostaa alueen."
|
||||
help-unrent: "&6/as unrent &7-&r Lopettaa alueen vuokraamisen."
|
||||
help-unrentOwn: "&6/as unrent &7-&r Lopettaa alueesi vuokraamisen."
|
||||
help-sell: "&6/as sell &7-&r Myy alueen."
|
||||
help-sellOwn: "&6/as sell &7-&r Myy alueesi."
|
||||
help-reload: "&6/as reload &7-&r Päivittää kaikki tiedostot ja päivittää alueet."
|
||||
help-setrestore: "&6/as setrestore &7-&r Asetta palauttaminen ON/OFF ja valitse profiili."
|
||||
help-setprice: "&6/as setprice &7-&r Vaihda alueen hintaa."
|
||||
help-setduration: "&6/as setduration &7-&r Vaihda vuokrattavan alueen vuokra-aikaa."
|
||||
help-teleport: "&6/as tp &7-&r Teleporttaa sinun omistamalle/vuokraamalle alueelle."
|
||||
help-teleportAll: "&6/as tp &7-&r Teleporttaa vuokrattavalle/ostettavalle alueelle."
|
||||
help-setteleport: "&6/as settp &7-&r Aseta teleporttaus-paikka ostetulle/vuokratulle alueelle."
|
||||
help-setteleportAll: "&6/as settp &7-&r Aseta teleporttaus-paikka alueelle."
|
||||
help-find: "&6/as find &7-&r Etsi tyhjä vuokrattava tai ostettava alue."
|
||||
help-groupadd: "&6/as groupadd &7-&r Lisää alue ryhmään."
|
||||
help-groupdel: "&6/as groupdel &7-&r Poista alue ryhmästä."
|
||||
help-grouplist: "&6/as grouplist &7-&r Näyttääksesi kaikki rekisteröidyt ryhmät."
|
||||
help-groupinfo: "&6/as groupinfo &7-&r Näyttääksesi ryhmän tiedot."
|
||||
help-schemevent: "&6/as schemevent &7-&r Aloittaa kaavamaisen tapahtuman alueelle."
|
||||
help-add: "&6/as add &7-&r Rekisteröi alue vuokrattavaksi tai ostettavaksi."
|
||||
help-del: "&6/as del &7-&r Poistaa rekisteröidyn alueen AreaShopista."
|
||||
help-addsign: "&6/as addsign &7-&r Lisää kyltin jo olemassa olevalle alueelle."
|
||||
help-delsign: "&6/as delsign &7-&r Poistaa kyltin jota katsot."
|
||||
help-me: "&6/as me &7-&r Tarkastaaksesi mitä alueita sinulla on (+vanhentuminen)"
|
||||
help-setowner: "&6/as setowner &7-&r Asettaa alueen omistajan tai pidentää alueen vuokrausta."
|
||||
help-resell: "&6/as resell &7-&r Laittaa yhden sinun alueistasi jälleenmyynti tilaan."
|
||||
help-resellAll: "&6/as resell &7-&r Laittaa alueen jäälleenmyynti tilaan."
|
||||
help-stopResell: "&6/as stopresell &7-&r Laittaa sinun alueen takaisin myyntitilaan."
|
||||
help-stopResellAll: "&6/as stopresell &7-&r Laittaa alueen takaisin myyntitilaan."
|
||||
help-addFriend: "&6/as addfriend &7-&r Lisää kaveri sinun alueellesi."
|
||||
help-addFriendAll: "&6/as addfriend &7-&r Lisää kaveri alueelle."
|
||||
help-delFriend: "&6/as delfriend &7-&r Poista kaveri sinun alueeltasi."
|
||||
help-delFriendAll: "&6/as delfriend &7-&r Poista kaveri alueelta."
|
||||
help-linksigns: "&6/as linksigns &7-&r Käytä irtokylttiä yhdistämiseen."
|
||||
help-stack: "&6/as stack &7-&r Luo useita alueita ja lisää ne."
|
||||
|
||||
rent-help: "/as rent [alueennimi], alue jolla seisot valitaan jos et käytä alueen nimeä."
|
||||
rent-noPermission: "Sinulla ei ole oikeuksia alueen vuokraamiseen."
|
||||
rent-maximum: "Et voi vuokrata enempää kuin %0% alueen(aluetta) (sinulla on jo %1% ryhmässä '%2%')"
|
||||
rent-payError: "Jokin meni pieleen maksamisessa, kokeile myöhemmin uudestaan."
|
||||
rent-rented: "Vuokrasit %0%:n %1% asti."
|
||||
rent-extended: "Pidensit vuokra-aikaa %0%, joka kestää %1% asti."
|
||||
rent-extend: "Voit laajentaa vuokra-aluettasi klikkaamalla oikealla hiiren napilla kylttiä uudestaan tai käyttämällä /as rent"
|
||||
rent-lowMoneyExtend: "Sinulla eiole tarpeeksi rahaa laajentaaksesi vuokra-aluetta (sinulla on %0% ja tarvitset %1%)"
|
||||
rent-lowMoneyRent: "Sinulla ei ole tarpeeksi rahaa vuokrata tätä alueetta (sinulla on %0% ja tarvtiset %1%)"
|
||||
rent-someoneElse: "Joku muu on jo vuokraamassa tätä aluetta."
|
||||
rent-notRentable: "Tuo alue ei ole saatavissa vuokraamiselle."
|
||||
rent-maxExtends: "Et voi enään laajentaa tätä vuokra-aluetta (maksimi on %0% kertaa), kuitenkin vuokra-ajan päättymisen jälkeen voit vuokrata tämän uudestaan."
|
||||
rent-maxRentTime: "Et voi vuokrata tätä aluetta pidemmäksi ajaksi kerrallaan, maksimi aika on %0% minuuttia ja sinulla on nyt vuokra-aikaa jäljellä %1% minuuttia."
|
||||
rent-restrictedToWorld: "Sinun pitää olla '%0%' maailmassa vuokrataksesi tuon alueen (olet nyt '%1%')"
|
||||
rent-restrictedToRegion: "Sinun pitää olla alueen '%0%' sisässä vuokrataksesi sen."
|
||||
rent-expireWarning: "Sinun alueessa %region% on aikaa jäljellä %timeleft%, muista pidentää vuokra-aikaa jos haluat pitää sen."
|
||||
|
||||
buy-help: "/as buy [alueenNimi], alueen jonka päällä seisot, ostetaan jos se ei ole käytössä."
|
||||
buy-noPermission: "Sinulla ei ole oikeuksia ostaa aluetta."
|
||||
buy-notBuyable: "Tuo alue ei ole juuri nyt ostettavissa."
|
||||
buy-maximum: "Sinä et voi ostaa enempää kuin %0% alueen(aluetta) (sinulla on jo %1% ryhmässä '%2%')"
|
||||
buy-payError: "Jokun meni pieleen maksamisessa, kokeile myöhemmin uudestaan."
|
||||
buy-succes: "Ostit onnistuneesti %0%."
|
||||
buy-successResale: "Ostit onnistuneesti %0% pelaajalta %1%."
|
||||
buy-successSeller: "Sinun alueesi %0% on myyty pelaajalle %1% hintaan %2%."
|
||||
buy-lowMoney: "Sinulla ei ole tarpeeksi rahaa ostaaksesi tätä aluetta (sinulla on %0% ja tarvitset %1%)."
|
||||
buy-yours: "Sinä omistat jo tuon alueen."
|
||||
buy-someoneElse: "Joku muu on jo ostanut tämän alueen."
|
||||
buy-restrictedToWorld: "Sinun pitää olla '%0%' maailmassa ostaaksesi tämän alueen (sinä olet '%1%' maailmassa)"
|
||||
buy-restrictedToRegion: "Sinun pitää olla alueen '%0%' sisässä ostaaksesi sen."
|
||||
|
||||
unrent-help: "/as unrent [AlueenNimi], alue missä seisot valitaan jos et erittele alueen nimeä."
|
||||
unrent-noPermission: "Sinulla ei ole oikeuksia lopettaa alueen vuokrausta keskenkaiken."
|
||||
unrent-noPermissionOther: "Sinulla ei ole oikeuksia lopettaa vuokrausta toisen alueelta."
|
||||
unrent-notRegistered: "Tämän alueen vuokrausta ei voi lopettaa sillä pelaaja ei ole rekisteröitynyt vuokraamiseen."
|
||||
unrent-notRented: "Alueen vuokrausta ei voi lopettaa sillä se ei ole edes vuokrattuna."
|
||||
unrent-unrented: "Alueesi vuokraaminen on lopetettu."
|
||||
unrent-other: "Alueen vuokraaminen on lopetettu pelaajalla %0%."
|
||||
unrent-expired: "Sinun vuokra alueella %0% on vanhentunut."
|
||||
|
||||
sell-help: "/as sell [alueenNimi], alue jolla seisot valitaan jos et erittele alueen nimeä."
|
||||
sell-notRegistered: "Tätä aluetta ei voida myydä koska omistaja ei myy sitä."
|
||||
sell-notBought: "Aluetta ei voi myydä koska se on jonkun toisen omaisuutta."
|
||||
sell-sold: "Alue on myyty pelaajalle %0%."
|
||||
sell-soldYours: "Sinun alueesi on myyty."
|
||||
sell-noPermission: "Sinulla ei ole oikeuksia myydä aluetta."
|
||||
sell-noPermissionOther: "Sinulla ei ole oikeuksia myydä jonkun toisen aluetta."
|
||||
|
||||
reload-reloaded: "Kaikki tiedostot on päivitetty onnistuneesti."
|
||||
reload-updateStart: "&7Päivitetään %0% aluetta vauhdilla %1% per sekunti."
|
||||
reload-updateComplete: "&7Alueiden päivitys on valmis."
|
||||
reload-noPermission: "Sinulla ei ole oikeuksia päivittää config-tiedostoja."
|
||||
reload-updateCommandChanged: "'/as updaterents' ja '/as updatebuys' ovat poistettu, '/as reload' päivittää alueet joten voit käyttää sitä komentoa."
|
||||
|
||||
info-help: "/as info <all|rented|forrent|sold|forsale|player|region|nogroup>"
|
||||
info-noPermission: "Sinulla ei ole oikeuksia saada lisätietoja alueista."
|
||||
info-all-rents: "Alueet jotka ovat tehty vuokrattaviksi: &7%0%."
|
||||
info-all-noRents: "Vuokrattavissa olevia alueita ole."
|
||||
info-all-buys: "Alueet jotka on tehty ostettaviksi: &7%0%."
|
||||
info-all-noBuys: "Ostettavia alueita ei ole."
|
||||
info-nogroupRents: "Vuokraa alueita ilman ryhmää: &7%0%."
|
||||
info-nogroupBuys: "Osta alueita ilman ryhmää: &7%0%."
|
||||
info-nogroupNoRents: "Ilman ryhmää, vuokrattavia alueita ei ole."
|
||||
info-nogroupNoBuys: "Ilman ryhmää, ostettavia alueita ei ole."
|
||||
info-rented: "Vuokratut alueet: &7%0%."
|
||||
info-noRented: "Alueita ei ole vuokrattuna."
|
||||
info-unrented: "Vuokraamattomat alueet: &7%0%."
|
||||
info-noUnrented: "Kaikki alueet on vuokrattu."
|
||||
info-sold: "Myydyt alueet: &7%0%."
|
||||
info-noSold: "Myytyjä alueita ei ole."
|
||||
info-forsale: "Alueet, jotka on myytävissä: &7%0%."
|
||||
info-noForsale: "Kaikki alueet on myyty."
|
||||
info-playerHelp: "/as info player <nimi>"
|
||||
info-playerRents: "Alueet, jotka on vuokrannut pelaaja %0%: &7%1%."
|
||||
info-playerNoRents: "%0% ei ole vuokrannut aluetta."
|
||||
info-playerBuys: "Alueet, jotka on ostanut pelaaja %0%: &7%1%."
|
||||
info-playerNoBuys: "%0% ei ole ostanut alueita."
|
||||
info-regionHelp: "/as info region [nimi], alue jolla seisot valitaan jos et erittele nimeä."
|
||||
info-regionHeaderRent: "&2Lisätiedot alueesta %region%."
|
||||
info-regionHeaderBuy: "&2Lisätiedot alueesta %region%."
|
||||
info-regionRented: "&2&l►&r Vuokrannut pelaaja %player%: &7%until% asti."
|
||||
info-regionBought: "&2&l►&r Tämän alueen on ostanut %player%."
|
||||
info-regionReselling: "&2&l►&r Tämän alueen on ostanut %player%, ja hän on jälleenmyymässä tätä."
|
||||
info-regionExtending: "&2&l►&r Hinta vuokran pidentämiseen: &7%price% per %duration%."
|
||||
info-regionCanBeRented: "&2&l►&r Hinta vuokraamiselle: &7%price% per %duration%."
|
||||
info-regionCanBeBought: "&2&l►&r Hinta ostamiselle: &7%price%."
|
||||
info-regionReselPrice: "&2&l►&r Jälleenmyynnin hinta: &7%resellprice% (voit ostaa sen pelaajalta %player%)"
|
||||
info-regionFriends: "&2&l►&r Lisätty kaverit: &7%friends%."
|
||||
info-regionMoneyBackBuy: "&2&l►&r Myydään takaisinmaksulla: &7%moneyback% (%moneybackpercent%% hinnasta)."
|
||||
info-regionMoneyBackRent: "&2&l►&r Lopetetaan vuokraaminen takaisinmaksuun: &7%moneyback% (%moneybackpercent%% jäljellä olevasta ajasta)"
|
||||
info-regionMaxExtends: "&2&l►&r Maksimi määrä pidennyksille: &7%maxextends% kerta(a)."
|
||||
info-regionNoExtending: "&2&l►&r `Vuokraa ei voida pidentää."
|
||||
info-regionExtendsLeft: "&2&l►&r Pidennyksiä jäljellä: &7%extendsleft% kerta(a) määrästä %maxextends%."
|
||||
info-regionMaxRentTime: "&2&l►&r Etukäteen vuokrataan: &7%maxrenttime% maksimista."
|
||||
info-regionNoTeleport: "&2&l►&r Teleporttaus paikkaa ei ole asetettu: %0%."
|
||||
info-regionTeleportHint: "&7(käytä '/as settp' paremmalle paikalle)"
|
||||
info-regionTeleportAt: "&2&l►&r Teleport asetettu: &7(%0%, %1%, %2%, %3%, pitch:%4%, yaw:%5%)."
|
||||
info-regionSigns: "&2&l►&r Liitetyt kyltit: &7%0%."
|
||||
info-regionSignLocation: "&7(%0%, %1%, %2%, %3%)&r"
|
||||
info-regionGroups: "&2&l►&r Määritetyt ryhmät: &7%0%."
|
||||
info-regionInactiveUnrent: "&2&l►&r Automaattinen vuokran purkaminen: &7%inactivetime% epäaktiivisuudesta pelaajalla."
|
||||
info-regionInactiveSell: "&2&l►&r Automaattinen myynti jälkeen: &7%inactivetime% epäaktiivisuudesta pelaajalla."
|
||||
info-regionRestrictedRegionRent: "&2&l►&r Sinun täytyy olla alueen sisässä vuokrataksesi sen."
|
||||
info-regionRestrictedWorldRent: "&2&l►&r Sinun pitää olla oikeassa maailmassa '%world%' vuokrataksesi tämän alueen."
|
||||
info-regionRestrictedRegionBuy: "&2&l►&r Sinun täytyy seistä alueen sisässä ostaaksesi sen."
|
||||
info-regionRestrictedWorldBuy: "&2&l►&r Sinun täytyy olla maailmassa '%world%' ostaaksesi tuon alueen."
|
||||
info-regionRestoringRent: "&2&l►&r Palautus päällä &7(alue nollaantuu vuokran lopettamisen yhteydessä)%0%."
|
||||
info-regionRestoringBuy: "&2&l►&r Palautus on päällä &7(alue nollaantuu myynnin jälkeen)%0%."
|
||||
info-regionRestoringProfile: "(profiili: %0%)"
|
||||
info-regionNoSign: "Kylttiä ei ole tehty tuolle alueelle."
|
||||
info-regionPriceDuration: "Hinta: &7%0% jokaista %1% kohtaan."
|
||||
info-regionPrice: "Hinta: &7%0%."
|
||||
info-regionRestore: "Palautus päällä: &7%0%."
|
||||
info-regionRestoreProfile: "Palautetaan profiili: &7%0%."
|
||||
info-regionTPLocation: "Teleporttaus-paikka: &7Maailma=%0%, X=%1%, Y=%2%, Z=%3%, Pitch=%4%, Yaw=%5%."
|
||||
info-regionNoTP: "Teleporttaus-paikkaa ei ole asetettu."
|
||||
info-regionNotExisting: "Aluetta ei ole olemassa: %0%."
|
||||
|
||||
setrestore-help: "/as setrestore <alue> <true|false|general> [profiili]."
|
||||
setrestore-noPermission: "Sinulla ei ole oikeuksia vaihtaa palautusasetuksia."
|
||||
setrestore-notRegistered: "Aluetta ei ole olemassa: %0%."
|
||||
setrestore-invalidSetting: "'%0%' ei ole kelvollinen tila, pitäisi olla true, false tai general."
|
||||
setrestore-success: "Onnistuneesti asetettu palautus-asetus %0% > '%1%'."
|
||||
setrestore-successProfile: "Onnistuneesti asetettu palautus-asetus %0% > '%1%' ja profiili '%2%':ksi."
|
||||
|
||||
setprice-noPermission: "Sinulla ei ole oikeuksia vaihtaa hintaa millä alue myydään tai vuokrataan."
|
||||
setprice-help: "/as set price <hinta> [alue], alue jolla seisot valitaan, jos et käytä alueen nimeä."
|
||||
setprice-notRegistered: "Aluetta ei ole olemassa: %0%."
|
||||
setprice-wrongPrice: "'%0%' ei ole kelvollinen hinta."
|
||||
setprice-successRent: "Alueen %0% hinta vaihdettu %1% per %2%."
|
||||
setprice-successBuy: "Alueen %0% hinta vaihdettu %1%."
|
||||
|
||||
setduration-noPermission: "Sinulla ei ole oikeuksia vaihtaa vuokran pituutta."
|
||||
setduration-help: "/as setduration <määrä> <tunniste> [alue], alue jolla seisot valitaan, jos et käytä alueen nimeä."
|
||||
setduration-notRegistered: "%0% aluetta ei ole tehty vuokraamiseen."
|
||||
setduration-wrongAmount: "'%0%' ei ole pätevä määrä, käytä kokonaisia numeroita."
|
||||
setduration-wrongFormat: "'%0%' ei ole asianmukainen aikamuoto, tarkista asiakirjat Bukkitista."
|
||||
setduration-success: "Alueen %0% kesto vaihdettu '%1%'."
|
||||
|
||||
setup-noRegion: "Et määritellyt alueen nimeä toiselle riville."
|
||||
setup-wrongRegion: "Alue, jonka määrittelit, ei ole olemassa."
|
||||
setup-alreadyRentSign: "Alue, jonka määrittelit on jo lisätty AreaShoppiin vuokra-alueena, lisää kyltti käyttäen [as] ensimmäisellä rivillä tai '/as addsign'."
|
||||
setup-alreadyBuySign: "Alue, jonka määrittelit on jo lisätty AreaShoppiin osto-alueena, lisää kyltti käyttäen [as] ensimmäisellä rivillä tai '/as addsign'."
|
||||
setup-noDuration: "Et määrittänyt kuinka pitkäksi aikaa alueen voi vuokrata, laita tämä kolmannelle riville."
|
||||
setup-wrongDuration: "Määritelty aika ei ole oikeassa muodossa, esimerkiksi: 1 day."
|
||||
setup-noPrice: "Et määritellyt hintaa neljännelle riville."
|
||||
setup-wrongPrice: "Et määrittänyt hintaa oikealla tavalla, käytä vain numeroita."
|
||||
setup-rentSuccess: "Alueen %0% vuokraaminen on asetettu onnistuneesti."
|
||||
setup-buySuccess: "Alueen %0% ostaminen on asetettu onnistuneesti."
|
||||
setup-noPermissionRent: "Sinulla ei ole oikeuksia asettaa vuokrattavia alueita."
|
||||
setup-noPermissionBuy: "Sinulla ei ole oikeuksia asettaa myytäviä alueita."
|
||||
setup-couldNotDetect: "Löydetty moninkertaisia alueita samalla tärkeystasolla ja/tai parent/child suhteella, määritä yksi alue toiselle riville (2 aluettta jotka löydettiin: %0% ja %1%)"
|
||||
setup-blacklisted: "%0% on mustalistattuna eikä sitä voi lisätä AreaShoppiin."
|
||||
|
||||
destroy-noPermissionRent: "Sinulla ei ole oikeuksia poistaa vuokrattavaa aluetta."
|
||||
destroy-noPermissionBuy: "Sinulla ei ole oikeuksia poistaa ostettavaa aluetta."
|
||||
destroy-successRent: "%0% vuokra-alue poistettu onnistuneesti."
|
||||
destroy-successBuy: "%0% osto-alue poistettu onnistuneesti."
|
||||
|
||||
teleport-help: "/as tp <alue> [kyltti]."
|
||||
teleport-noRentOrBuy: "Määritettyä aluetta ei ole rekisteröity: %0%."
|
||||
teleport-noPermission: "Sinulla ei ole oikeuksia teleportata omalle alueellesi."
|
||||
teleport-noPermissionOther: "Sinulla ei ole oikeuksia teleportata alueelle joka ei ole sinun omistuksessasi."
|
||||
teleport-noPermissionSign: "Sinulla ei ole oikeuksia teleportata sinun alueesi kyltille."
|
||||
teleport-noPermissionOtherSign: "Sinulla ei ole oikeuksia teleportata toisen alueen kyltille, jota sinä et omista."
|
||||
teleport-noPermissionFriend: "Sinulla ei ole oikeuksia teleportata alueille, joilla sinä olet vain kaverina."
|
||||
teleport-noPermissionFriendSign: "Sinulla ei ole oikeuksia teleportata alueiden kylteille, joilla sinä olet vain kaverina."
|
||||
teleport-success: "Teleporttasit %0%:lle."
|
||||
teleport-successSign: "Teleporttasit kyltille: %0%."
|
||||
teleport-noSafe: "Turvallista paikkaa ei löydetty alueella %0%, ei paikkoja alueella vapaana tai maksimi yritykset ylitetty (%1%/%2%)"
|
||||
teleport-blocked: "Et voi teleportata, koska paikka on alueen ulkopuolella ja sinä olet pakotettu teleporttamaan sen sisään."
|
||||
|
||||
setteleport-help: "/as settp [alue] [reset], alue jolla seisot valitaan, jos et määrittele alueen nimeä."
|
||||
setteleport-noPermission: "Sinulla ei ole oikeuksia asettaa teleporttaus-paikkaa."
|
||||
setteleport-noPermissionOther: "Sinulla ei ole oikeuksia asettaa teleporttaus-paikkaa alueelle, jota sinä et omista."
|
||||
setteleport-noRentOrBuy: "Aluetta ei ole rekisteröity: %0%."
|
||||
setteleport-success: "Teleporttaus-paikka %0% asetettu."
|
||||
setteleport-notInside: "Teleporttaus-paikan pitää olla alueen sisällä."
|
||||
setteleport-reset: "Teleporttaus-paikka alueelle %0% on resetoitu."
|
||||
|
||||
find-help: "/as find <buy|rent> [maksimiHinta] [ryhmä]"
|
||||
find-noPermission: "Sinulla ei ole oikeuksia etsiä alueita ja teleportata niihin."
|
||||
find-success: "Löydetty %0% alue: %1%, kun etsitty alueista sinun maksimi saldollasi: %2%%3%."
|
||||
find-successMax: "Löydetty %0% alue: %1%, kun etsitty alueista maksimihinnalla %2%%3%."
|
||||
find-wrongMaxPrice: "Määritetty maksimihinta ei ole oikea numero: %0%."
|
||||
find-wrongGroup: "Määriteltyä ryhmää ei ole olemassa: %0%."
|
||||
find-noneFound: "Ei %0% aluetta löydetty, kun etsittiin sinun saldosi hinnalla: %1%%2%."
|
||||
find-noneFoundMax: "Ei %0% aluetta löydetty, kun etsittiin hinnalla: %1%%2%."
|
||||
find-onlyInGroup: ", vain etsitty alueita ryhmällä: %0%."
|
||||
|
||||
groupadd-help: "/as groupadd <ryhmä> [alue], jos aluetta ei määritelty, kaikki alueet sinun WorldEdit valinnaltasi valitaan."
|
||||
groupadd-noPermission: "Sinulla ei ole oikeuksia lisätä alueita ryhmille."
|
||||
groupadd-noRegion: "Määritelty alue ei ole rekisteröity: %0%."
|
||||
groupadd-success: "Alue %0% on lisätty ryhmään '%1%', tällä ryhmällä on nyt %2% jäsen(tä)."
|
||||
groupadd-failed: "Alue %0% on jo ryhmän '%1%' osa."
|
||||
groupadd-weSuccess: "Lisätty ryhmään %0%: &7%1%."
|
||||
groupadd-weFailed: "Oli jo ryhmässä %0%: &7%1%."
|
||||
|
||||
groupdel-help: "/as groupdel <ryhmä> [alue], jos aluetta ei määritelty, kaikki alueet WorldEdit valinnaltasi käytetään."
|
||||
groupdel-noPermission: "Sinulla ei ole oikeuksia poistaa alueita ryhmiltä."
|
||||
groupdel-noRegion: "Määritelty alue ei ole rekisteröity: %0%."
|
||||
groupdel-success: "Alue %0% on poistettu ryhmästä '%1%', tällä ryhmällä on nyt %2% jäsen(tä)."
|
||||
groupdel-failed: "Alue %0% ei ole osa ryhmää '%1%'."
|
||||
groupdel-weSuccess: "Poistettu ryhmä %0%: &7%1%."
|
||||
groupdel-weFailed: "Eivät olleet ryhmässä %0% kuitenkin: &7%1%."
|
||||
|
||||
grouplist-noPermission: "Sinulla ei ole oikeuksia katsoa rekisteröityjä ryhmiä."
|
||||
grouplist-noGroups: "Yhtään rekisteröityä ryhmää ei ole."
|
||||
grouplist-success: "Seuraavat ryhmät ovat rekisteröityjä: &7%0%."
|
||||
|
||||
groupinfo-help: "/as groupinfo <ryhmä>"
|
||||
groupinfo-noPermission: "Sinulla ei ole oikeuksia katsoa lisätietoja ryhmästä."
|
||||
groupinfo-noGroup: "Ryhmää nimellä '%0%' ei ole olemassa, käytä /as grouplist nähdäksesi kaikki ryhmät."
|
||||
groupinfo-members: "Seuraavat alueet ovat jäsenien omistamia ryhmästä %0%: &7%1%."
|
||||
groupinfo-noMembers: "Ryhmässä %0% ei ole yhtään jäsentä."
|
||||
|
||||
schemevent-help: "/as schemevent <alue> <created|deleted|rented|unrented|bought|sold>."
|
||||
schemevent-noRegion: "Määritelty alue ei ole rekisteröity: %0%."
|
||||
schemevent-wrongEvent: "Määriteltyä tapahtumaa '%0%' ei ole olemassa, käytä yhtä seuraavista: &7%1%."
|
||||
schemevent-success: "Tapahtuma '%0%' on onnistuneesti laukaistu alueelle %1%."
|
||||
schemevent-noPermission: "Sinulla ei ole oikeuksia tehdä kaavamaisia tapahtumia."
|
||||
|
||||
add-help: "/as add <rent|buy> [alue] [maailma]."
|
||||
add-noPermission: "Sinulla ei ole oikeuksia lisätä aluetta AreaShoppiin."
|
||||
add-success: "Lisätty %0%: &7%1%."
|
||||
add-failed: "On jo rekisteröitynä: &7%0%."
|
||||
add-blacklisted: "Mustalistattu: &7%0%."
|
||||
add-specifyWorld: "Määrittele maailma, jossa alue on kun käytät konsolia."
|
||||
add-incorrectWorld: "Maailmaa '%0%' ei löydetty, kokeile uudestaan (KirjainKoko)"
|
||||
add-noRegion: "Aluetta '%0%' ei ole olemassa tässä maailmassa."
|
||||
|
||||
del-noRegion: "Määritelty alue ei ole rekisteröity: %0%."
|
||||
del-noPermission: "Sinulla ei ole oikeuksia poistaa alueita."
|
||||
del-success: "Poistetut alueet: &7%0%."
|
||||
del-failed: "Ei oikeuksia poistaa tai ei ole rekisteröitynä: &7%0%."
|
||||
|
||||
addsign-help: "/as addsign [alue] [profiili]"
|
||||
addsign-noSign: "Et katso kylttiä."
|
||||
addsign-noRegion: "Aluetta '%0%' ei löytynyt."
|
||||
addsign-noRegions: "Aluetta ei löytynyt kyltin olinpaikassa."
|
||||
addsign-couldNotDetect: "Löydettiin moninkertaisia alueita kyltin ympäriltä, määrittele alue paremmin (2 aluetta jotka löydettiin: %0% ja %1%)"
|
||||
addsign-couldNotDetectSign: "Löydettiin moninkertaisia alueita kyltin ympäriltä, määrittele alue toiselle riville (2 aluetta jotka löydettiin: %0% ja %1%)"
|
||||
addsign-wrongProfile: "Määriteltyä profiilia ei ole olemassa, käytä jotain seuraavista (katso configit): &7%0%."
|
||||
addsign-success: "Kyltti on lisätty alueelle %region%"
|
||||
addsign-successProfile: "Kyltti on lisätty alueelle %region% profiililla %0%."
|
||||
addsign-alreadyRegistered: "Kyltti on jo rekisteröitynä alueelle %0%."
|
||||
addsign-noPermission: "Sinulla ei ole oikeutta lisätä kylttiä."
|
||||
|
||||
delsign-noSign: "Et katso kylttiä."
|
||||
delsign-noPermission: "Sinulla ei ole oikeuksia poistaa kylttiä."
|
||||
delsign-noRegion: "Tuo kyltti ei ole AreaShopin-alueen kyltti."
|
||||
delsign-success: "Kyltti on poistettu alueesta: %0%."
|
||||
|
||||
me-noPermission: "Sinulla ei ole oikeuksia katsoa mitä alueita omistat."
|
||||
me-notAPlayer: "Sinä et ole pelaaja, joten et voi omistaa yhtään aluetta."
|
||||
me-noRentRegions: "Et ole vuokrannut yhtään vuokrattavaa aluetta."
|
||||
me-noBuyRegions: "Et ole ostanut yhtään ostettavaa aluetta."
|
||||
me-rentRegions: "Olet vuokrannut seuraavat alueet:"
|
||||
me-buyRegions: "Olet ostanut seuraavat alueet:"
|
||||
me-rentLine: "&2&l►&r %region% %until% asti &7(%timeleft% jäljellä)"
|
||||
me-buyLine: "&2&l►&r %region%."
|
||||
me-noFriendRegions: "Sinua ei ole lisätty kaveriksi yhdellekkään alueelle."
|
||||
me-friendRegions: "Sinut on lisätty kaveriksi seuraaville alueille:"
|
||||
me-friendLine: "&2&l►&r %region% &7(Omistaja: %player%)"
|
||||
|
||||
setowner-help: "/as setowner <pelaaja> [alue], alue millä seisot valitaan jos et erittele alueen nimeä."
|
||||
setowner-noPermission: "Sinulla ei ole oikeuksia asettaa alueen omistajaa."
|
||||
setowner-noPermissionRent: "Sinulla ei ole oikeuksia asettaa vuokrattujen alueiden omistajia."
|
||||
setowner-noPermissionBuy: "Sinulla ei ole oikeuksia asettaa ostettujen alueiden omistajaa."
|
||||
setowner-notRegistered: "Alueen nimi ei ole rekisteröity, omistajaa ei voitu asettaa."
|
||||
setowner-noPlayer: "Pelaajan UUID:n saaminen epäonnistui pelaajalla: %0%."
|
||||
setowner-succesRent: "Alueen %region% omistajaksi asetettu onnistuneesti %player%, vuokrattu %until% asti (%timeleft% jäljellä)"
|
||||
setowner-succesRentExtend: "Omistajana oli jo pelaaja %player%, vuokraa pidennetty '%duration%', nyt vuokrattuna %until% asti (%timeleft% jäljellä)"
|
||||
setowner-succesBuy: "Alueen %region% omistaja vaihdettu onnistuneesti pelaajalle %player%."
|
||||
|
||||
resell-help: "/as resell <hinta> [alue], alue jolla seisot valitaan, jos et määrittele alueen nimeä."
|
||||
resell-wrongPrice: "'%0%' ei ole pätevä hinta."
|
||||
resell-notRegistered: "Aluetta ei ole rekisteröity: %0%."
|
||||
resell-noRegionFound: "AreaShopin aluetta ei löydetty sijainnistasi, kokeile määrittämällä alueen nimi komentoon."
|
||||
resell-notBought: "Sinä et voi jälleenmyydä aluetta %region% koska se ei ole myytynä."
|
||||
resell-success: "%region% on onnistuneesti laitettu jälleenmyynti-tilaan hinnalla %resellprice%."
|
||||
resell-noPermission: "Sinulla ei ole oikeuksia asettaa aluettasi jälleenmyyntitilaan."
|
||||
resell-noPermissionOther: "Sinulla ei ole oikeuksia asettaa alueita jälleenmyyntitilaan."
|
||||
|
||||
stopresell-help: "/as stopresell [alue], alue jolla seisot valitaan, jos et määritä alueen nimeä."
|
||||
stopresell-notRegistered: "Alue ei ole rekisteröity: %0%."
|
||||
stopresell-noRegionFound: "AreaShopin aluetta ei löytynyt sijainnistasi, kokeile määrittämällä alueen nimi komentoon."
|
||||
stopresell-notResell: "Et voi lopettaa alueen %region% jälleenmyyntiä sillä se ei ole jälleenmyynti-tilassa."
|
||||
stopresell-success: "%region% on onnistuneesti laitettu takaisin myynti-tilaan."
|
||||
stopresell-noPermission: "Sinulla ei ole oikeuksia asettaa sinun aluettasi takaisin myyty-tilaan."
|
||||
stopresell-noPermissionOther: "Sinulla ei ole oikeuksia asettaa alueita takaisin myyty-tilaan."
|
||||
|
||||
addfriend-help: "/as addfriend <pelaaja> [alue], alue jolla seisot valitaan jos alueen nimeä ei ole määritelty."
|
||||
addfriend-noPermissionOther: "Sinulla ei ole oikeuksia lisätä kavereita alueille, jotka eivät ole sinun."
|
||||
addfriend-noPermission: "Sinulla ei ole oikeuksia lisätä kavereita sinun alueellesi."
|
||||
addfriend-successOther: "%0% on lisätty kaveriksi alueelle %1%."
|
||||
addfriend-success: "%0% on lisätty kaveriksi sinun alueellesi: %1%."
|
||||
addfriend-alreadyAdded: "%0% on jo lisätty kaveriksi tällä alueella."
|
||||
addfriend-self: "Lisäämällä omistajan alueen kaveriksi olisi järetöntä."
|
||||
addfriend-noOwner: "Et voi lisätä kavereita alueelle ilman omistajaa."
|
||||
addfriend-notVisited: "Sinä et voi lisätä pelaajaa %0% koska hän ei ole vielä edes käynyt serverillä."
|
||||
|
||||
delfriend-help: "/as delfriend <pelaaja> [alue], alue jolla seisot valitaan jos alueen nimeä ei ole määritelty."
|
||||
delfriend-noPermissionOther: "Sinulla ei ole oikeuksia poistaa kavereita alueilta, jotka eivät ole sinun."
|
||||
delfriend-noPermission: "Sinulla ei ole oikeutta poistaa kaveria sinun alueeltasi."
|
||||
delfriend-successOther: "%0% on poistettu kavereista alueella %1%."
|
||||
delfriend-success: "%0% on poistettu kavereista sinun alueelta %1%."
|
||||
delfriend-notAdded: "%0% ei ole lisätty kavereihin tällä alueella."
|
||||
delfriend-noOwner: "Et voi poistaa kavereita tältä alueelta ilman omistajaa."
|
||||
|
||||
linksigns-multipleRegions: "Löydetty moninkertaisia alueita: &7%0%."
|
||||
linksigns-multipleRegionsAdvice: "Klikkaa uudemman kerran kokeillaksesi uudestaan tai käytä '/as linksigns' lopettaaksesi."
|
||||
linksigns-noRegions: "AreaShopin alueita ei löydetty kursorisi suunnasta, olethan varma että alue on lisätty AreaShoppiin &7(maksimi etäisyys 100 palikkaa)"
|
||||
linksigns-regionFound: "Alue %region% on löydetty, nyt osoita kylttiä ja vasen-klikkaa sitä linkataksesi sen."
|
||||
linksigns-signFound: "Löydetty kyltti paikassa (%0%, %1%, %2%), nyt osoita suoraan alueelle ja oikea-klikkaa linkataksesi sen."
|
||||
linksigns-noSign: "Kylttiä ei löydetty kursorisi suunnasta, olethjan varma että sinulla on suora näkyvyys kylttiin ja klikkaa uudestaan &7(maksimi etäisyys 100 palikkaa)"
|
||||
linksigns-alreadyRegistered: "Tuo kyltti on jo rekisteröity alueelle %region%, klikkaa uudestaan valitaksesi toisen kyltin."
|
||||
linksigns-first: "Olet nyt kylttien-linkkaus tilassa."
|
||||
linksigns-next: "&7Vasen-klikkaa valitaksesi kyltin, oikea-klikkaa valitaksesi alueen, käytä /as linksigns lopettaaksesi."
|
||||
linksigns-noPermission: "Sinulla ei ole oikeuksia siirtä kylttien-linkkaus tilaan."
|
||||
linksigns-stopped: "Kylttien-linkkaus lopetettu."
|
||||
|
||||
stack-help: "/as stack <määrä> <gap> <nimi> <rent|buy> [ryhmä].\n&7 <määrä> Alueiden määrä, jotka luodaan.\n<gap> Palikoiden etäisyys alueiden välissä.\n<nimi> Alueiden nimet (numero tulee olemaan perässä)\n<rent|buy> Tee niistä vuokrattavia tai ostettavia.\n[ryhmä] Ryhmä, jolle alueet tehdään.\nAlueet luodaan siihen suuntaan johon katsot."
|
||||
stack-accepted: "Aloitetaan luomaan %0% %1% aluetta %2% palikoita niiden välissä, nimet alkavat %3% ja niiden perässä on alueiden numero. %4%."
|
||||
stack-addToGroup: "Luodut alueet lisätään ryhmälle '%0%'."
|
||||
stack-noPermission: "Sinulla ei ole oikeuksia luoda ja lisätä alueita AreaShoppiin."
|
||||
stack-wrongAmount: "'%0%' ei ole oikea määrä alueita."
|
||||
stack-wrongGap: "'%0%' ei ole oikea numero numeroidessa palikoita alueiden väliseen väliin."
|
||||
stack-noSelection: "Sinulla ei ole valintaa, joka osoittaa missä ensimmäinen alue pitäisi tehdä."
|
||||
stack-addStart: "&7Lisätään %0% aluetta, %1% per sekunti."
|
||||
stack-addComplete: "&7Alueiden lisäys valmis."
|
||||
stack-unclearDirection: "Katso tarkasti pohjoiseen, itään, etelään tai länteen, tällä hetkellä havaittu %0%."
|
||||
|
||||
timeleft-years: "%0% vuotta"
|
||||
timeleft-months: "%0% kuukautta"
|
||||
timeleft-days: "%0% päivää"
|
||||
timeleft-hours: "%0% tuntia"
|
||||
timeleft-minutes: "%0% minuuttia"
|
||||
timeleft-second: "%0% sekunti"
|
||||
timeleft-seconds: "%0% sekuntia"
|
||||
timeleft-ended: "Vanhentunut"
|
||||
|
||||
greeting-forrent: "Alueen %region% voi vuokrata hintaan %price% per %duration%."
|
||||
greeting-rented: "Alueen %region% on vuokrannut pelaaja %player% %until% asti."
|
||||
greeting-forsale: "Alueen %region% voi ostaa hintaan %price%."
|
||||
greeting-bought: "Alueen %region% on ostanut pelaaja %player%."
|
||||
greeting-resale: "Alueen %region% voi ostaa hintaan %resaleprice% pelaajalta %player%."
|
||||
|
||||
update-playerNotify: "&2Päivitys AreaShopista V%0% versioon %1% on saatavilla, hanki viimeisin päivitys osoitteesta http://dev.bukkit.org/bukkit-plugins/regionbuyandrent/."
|
||||
@@ -0,0 +1,412 @@
|
||||
# ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
|
||||
# ║ Language file of the AreaShop plugin created by NLThijs48, Github can be found at https://github.com/NLthijs48/AreaShop ║
|
||||
# ║ Language: French, Version: V2.2.0, Percentage translated: 99% ║
|
||||
# ║ 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 ║
|
||||
# ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
|
||||
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%')."
|
||||
|
||||
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 enregistrée : %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-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 votre propre région."
|
||||
help-reload: "&6/as reload &7-&r Recharge tous les fichiers et met à jour les régions."
|
||||
help-setrestore: "&6/as setrestore &7-&r Activer ou désactiver la restauration et choisir le profil."
|
||||
help-setprice: "&6/as setprice &7-&r Changer le prix d'une région."
|
||||
help-setduration: "&6/as setduration &7-&r Changer le temps de location d'une région."
|
||||
help-teleport: "&6/as tp &7-&r Téléportation vers votre région achetée / louée."
|
||||
help-teleportAll: "&6/as tp &7-&r Téléportation vers une région louée / achetée."
|
||||
help-setteleport: "&6/as settp &7-&r Définit la position de téléportation pour la région louée / achetée."
|
||||
help-setteleportAll: "&6/as settp &7-&r Définit 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 tous 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éclenche un événement schématique d'une région."
|
||||
help-add: "&6/as add &7-&r Enregistre une région comme louée ou achetée."
|
||||
help-del: "&6/as del &7-&r Supprime une région enregistrée 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."
|
||||
help-me: "&6/as me &7-&r Voir les régions que vous possédez (et le temps restant)."
|
||||
help-setowner: "&6/as setowner &7-&r Change le propriétaire d'une région ou allonge le temps de location."
|
||||
help-resell: "&6/as resell &7-&r Mettre une de vos régions en vente."
|
||||
help-resellAll: "&6/as resell &7-&r Mettre une région en vente."
|
||||
help-stopResell: "&6/as stopresell &7-&r Ne plus revendre votre région."
|
||||
help-stopResellAll: "&6/as stopresell &7-&r Récupérer une de vos régions."
|
||||
help-addFriend: "&6/as addfriend &7-&r Ajouter un ami à votre région."
|
||||
help-addFriendAll: "&6/as addfriend &7-&r Ajouter un ami à une région."
|
||||
help-delFriend: "&6/as delfriend &7-&r Supprimer un ami de votre région."
|
||||
help-delFriendAll: "&6/as delfriend &7-&r Supprimer un ami d'une région."
|
||||
help-linksigns: "&6/as linksigns &7-&r Utilisez le mode de liaison de panneau."
|
||||
help-stack: "&6/as stack &7-&r Créez plusieurs régions et ajoutez les."
|
||||
|
||||
rent-help: "/as rent [regionname], 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-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 loue déjà 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ée, vous pourrez de nouveau louer cette région."
|
||||
rent-maxRentTime: "Vous ne pouvez pas louer plus longtemps à l'avance, le maximum est de %0% minutes et vous avez déjà loué pour %1% minutes."
|
||||
rent-restrictedToWorld: "Vous devez être dans le monde '%0%' pour louer cette région (vous êtes dans '%1%')."
|
||||
rent-restrictedToRegion: "Vous devez être dans la région '%0%' pour la louer."
|
||||
rent-expireWarning: "Votre région '%region%' n'a plus que %timeleft% de temps de location, soyez sûr d'allonger ce temps de location si vous voulez la conserver."
|
||||
|
||||
buy-help: "/as buy [regionname], 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-notBuyable: "Cette région 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 venez d'acheter la région '%0%'."
|
||||
buy-successResale: "Vous venez d'acheter '%0%' à %1%."
|
||||
buy-successSeller: "Votre région '%0%' a été vendue pour %1% à %2%."
|
||||
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à acheté cette région."
|
||||
buy-someoneElse: "Quelqu'un a déjà acheté cette région."
|
||||
buy-restrictedToWorld: "Vous devez être dans le monde '%0%' pour acheter cette région (vous êtes dans '%1%')."
|
||||
buy-restrictedToRegion: "Vous devez être dans '%0%' pour l'acheter."
|
||||
|
||||
unrent-help: "/as unrent [regionname], 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: "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é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: "Cette région a été vendue 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."
|
||||
|
||||
reload-reloaded: "Tous les fichiers ont été rechargés avec succès."
|
||||
reload-updateStart: "&7Met à jour %0% régions, %1% par seconde."
|
||||
reload-updateComplete: "&7Mise à 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 <all|rented|forrent|sold|forsale|player|region|nogroup>."
|
||||
info-noPermission: "Vous n'avez pas la permission d'avoir des informations à propos des régions."
|
||||
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-nogroupRents: "Régions louables sans groupe : &7%0%."
|
||||
info-nogroupBuys: "Régions achetables sans groupe : &7%0%."
|
||||
info-nogroupNoRents: "Il n'y a pas de régions à louer car vous n'appartenez pas à un groupe."
|
||||
info-nogroupNoBuys: "Il n'y a aucune région à acheter puisque vous ne faites pas partie d'un groupe."
|
||||
info-rented: "Régions louées : &7%0%"
|
||||
info-noRented: "Aucune région 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égions en vente : &7%0%"
|
||||
info-noForsale: "Toutes les régions sont vendues."
|
||||
info-playerHelp: "/as info player <name>"
|
||||
info-playerRents: "Régions louées par %0% : &7%1%"
|
||||
info-playerNoRents: "%0% n'a de régions louées."
|
||||
info-playerBuys: "Régions achetées par %0% : &7%1%"
|
||||
info-playerNoBuys: "%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: "&2Informations à propos de '%region%' :"
|
||||
info-regionHeaderBuy: "&2Informations à propos de '%region%' :"
|
||||
info-regionRented: "&2&l►&r Louée par %player% jusqu'à : &7%until%"
|
||||
info-regionBought: "&2&l►&r Achetée par %player%"
|
||||
info-regionReselling: "&2&l►&r Achetée par %player%, en cours de revente."
|
||||
info-regionExtending: "&2&l►&r Prix pour allonger : &7%price% pour %duration%"
|
||||
info-regionCanBeRented: "&2&l►&r Prix pour louer : &7%price% pour %duration%"
|
||||
info-regionCanBeBought: "&2&l►&r Prix d'achat : &7%price%"
|
||||
info-regionReselPrice: "&2&l►&r Prix de revente : &7%resellprice% (vous pouvez l'acheter à %player%)."
|
||||
info-regionFriends: "&2&l►&r Ami(s) ajouté(s) : &7%friends%"
|
||||
info-regionMoneyBackBuy: "&2&l►&r Prix de revente : &7%moneyback% (%moneybackpercent%% du prix)"
|
||||
info-regionMoneyBackRent: "&2&l►&r Remboursement de location : &7%moneyback% (%moneybackpercent%% du temps restant)"
|
||||
info-regionMaxExtends: "&2&l►&r Nombre maximum de région : &7%maxextends% fois."
|
||||
info-regionNoExtending: "&2&l►&r La location ne peut être allongée."
|
||||
info-regionExtendsLeft: "&2&l►&r Extensions restantes : &7%extendsleft% fois sur %maxextends%."
|
||||
info-regionMaxRentTime: "&2&l►&r Location à l'avance : &7%maxrenttime% au maximum"
|
||||
info-regionNoTeleport: "&2&l►&r Emplacement de téléportation non défini%0%."
|
||||
info-regionTeleportHint: "&7(utilisez '/as settp' pour un meilleur emplacement)"
|
||||
info-regionTeleportAt: "&2&l►&r Emplacement de téléportation défini à : &7(%0%, %1%, %2%, %3%, pitch:%4%, yaw:%5%)"
|
||||
info-regionSigns: "&2&l►&r Pancartes connectées : &7%0%"
|
||||
info-regionSignLocation: "&7(%0%, %1%, %2%, %3%)&r"
|
||||
info-regionGroups: "&2&l►&r Assigné aux groupes : &7%0%"
|
||||
info-regionInactiveUnrent: "&2&l►&r Fin de le location automatique après : &7%inactivetime% de temps d'inactivité du joueur"
|
||||
info-regionInactiveSell: "&2&l►&r Revente automatique après : &7%inactivetime% de temps d'inactivité du joueur"
|
||||
info-regionRestrictedRegionRent: "&2&l►&r Vous devez être à l'intérieur de la région pour la louer."
|
||||
info-regionRestrictedWorldRent: "&2&l►&r Vous devez à l'intérieur du monde '%world%' pour louer cette région."
|
||||
info-regionRestrictedRegionBuy: "&2&l►&r Vous devez être à l'intérieur de la région pour l'acheter."
|
||||
info-regionRestrictedWorldBuy: "&2&l►&r Vous devez à l'intérieur du monde '%world%' pour acheter cette région."
|
||||
info-regionRestoringRent: "&2&l►&r La restauration est activée &7(la région sera remise à zéro a la fin de la location)%0%"
|
||||
info-regionRestoringBuy: "&2&l►&r La restauration est activée &7(la région sera remise à zéro a la fin de la location)%0%"
|
||||
info-regionRestoringProfile: "(Profil : %0%)"
|
||||
info-regionNoSign: "Il n'y a pas de panneau enregistré pour cette région."
|
||||
info-regionPriceDuration: "Prix : &7%0% pour chaque %1%"
|
||||
info-regionPrice: "Prix : &7%0%"
|
||||
info-regionRestore: "Restauration activée : &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 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 %0% à %1% avec succès."
|
||||
setrestore-successProfile: "Paramètre de restauration défini de %0% à %1% et le profil à '%2%' 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: "Prix de la région '%0%' changé de %1% à %2%."
|
||||
setprice-successBuy: "Prix de la région '%0%' changé à %1%."
|
||||
|
||||
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: "Temps de location de la région '%0%' changé à '%1%'."
|
||||
|
||||
setup-noRegion: "Vous n'avez pas spécifié de région à la seconde ligne."
|
||||
setup-wrongRegion: "La région que vous avez spécifiée n'existe pas."
|
||||
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 '%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 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: %0% et %1%)."
|
||||
setup-blacklisted: "%0% est sur la blacklist et ne peut pas être ajouté à AreaShop."
|
||||
|
||||
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: "%0% a bien été dés-enregistrée des régions louables."
|
||||
destroy-successBuy: "%0% 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é à '%0%'."
|
||||
teleport-successSign: "Vous vous téléportez à la pancarte de '%0%'."
|
||||
teleport-noSafe: "Aucune position sécurisée trouvée dans la région '%0%'. Pas de point restant, ou tentatives maximales dépassées (%1%/%2%)."
|
||||
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."
|
||||
|
||||
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: "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é 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: "Trouvé une région %0% : %1%, en recherchant avec un prix maximum de: %2%%3%."
|
||||
find-successMax: "Trouvé une région %0% : %1%, en recherchant avec un prix maximum de: %2%%3%."
|
||||
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-noRegion: "La région spécifiée n'est pas enregistrée : %0%."
|
||||
groupadd-success: "La région '%0%' a été ajoutée 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é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-noRegion: "La région spécifiée n'est pas enregistrée : %0%."
|
||||
groupdel-success: "La région '%0%' a été supprimée 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ée du groupe %0% : &7%1%."
|
||||
groupdel-weFailed: "Nous ne sommes de toute façon pas dans le groupe %0% : &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ée : %0%."
|
||||
schemevent-wrongEvent: "L'évent spécifié '%0%' n'existe pas, utilisez un des suivants: &7%1%."
|
||||
schemevent-success: "L’événement '%0%' a été activé dans 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ée comme %0% : &7%1%."
|
||||
add-failed: "Déjà enregistrée : &7%0%."
|
||||
add-blacklisted: "Sur la blacklist : &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: "La région spécifiée n'est pas enregistrée : %0%."
|
||||
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ée: &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ée."
|
||||
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: %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é à la région %region%."
|
||||
addsign-successProfile: "Le panneau a été ajouté à la région %region% avec le profil %0%."
|
||||
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%'."
|
||||
|
||||
me-noPermission: "Vous n'avez pas la permission de voir quelle(s) région(s) vous possédez."
|
||||
me-notAPlayer: "Vous n'êtes pas un joueur. Vous ne pouvez donc pas avoir de régions."
|
||||
me-noRentRegions: "Vous ne louez aucune région."
|
||||
me-noBuyRegions: "Vous n'avez acheté aucune région."
|
||||
me-rentRegions: "Vous louez les régions suivantes :"
|
||||
me-buyRegions: "Vous avez acheté les régions suivantes :"
|
||||
me-rentLine: "&2&l►&r %region% jusqu'au %until% &7(%timeleft% restant)"
|
||||
me-buyLine: "&2&l►&r %region%"
|
||||
me-noFriendRegions: "Vous n'avez été ajouté à aucune région en tant qu'ami."
|
||||
me-friendRegions: "Vous avez été ajouté en tant qu'ami aux régions suivantes : "
|
||||
me-friendLine: "&2&l►&r %region% &7(propriétaire : %player%)"
|
||||
|
||||
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 '%region%' modifié avec succès. Elle appartient maintenant à %player% et est louée jusqu'au %until% (%timeleft% restant)."
|
||||
setowner-succesRentExtend: "Le propriétaire était déjà %player%, location prolongée de '%duration%', maintenant louée jusqu'au %until% (%timeleft% restant%)."
|
||||
setowner-succesBuy: "Propriétaire de la région '%region%' changé avec succès. Elle appartient maintenant à %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-noRegionFound: "Aucune région AreaShop n'a pu être trouvée à votre emplacement, essayez de spécifier la région en argument."
|
||||
resell-notBought: "Vous ne pouvez pas revendre la région '%region%', elle n'est pas encore achetée."
|
||||
resell-success: "'%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-noRegionFound: "Aucune région AreaShop n'a été trouvée à votre emplacement, essayez de la spécifier en argument."
|
||||
stopresell-notResell: "Vous ne pouvez pas arrêter la revente de la région '%region%' car elle n'est pas en vente."
|
||||
stopresell-success: "'%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: "%0% a été ajouté en ami a la région '%1%'."
|
||||
addfriend-success: "%0% a été ajouté ajouté en ami à votre région '%1%'."
|
||||
addfriend-alreadyAdded: "%0% est déjà ami avec cette région."
|
||||
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: "%0% a été supprimé de la liste d'amis de la région '%1%'."
|
||||
delfriend-success: "%0% a été supprimé des amis de votre région '%1%'."
|
||||
delfriend-notAdded: "%0% n'est pas dans les amis de cette région."
|
||||
delfriend-noOwner: "Vous ne pouvez pas supprimer les amis d'une région sans propriétaire."
|
||||
|
||||
linksigns-multipleRegions: "Plusieurs régions trouvées : &7%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 &7(portée maximale de 100 blocs)."
|
||||
linksigns-regionFound: "La région %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 &7(portée maximale de 100 blocs)."
|
||||
linksigns-alreadyRegistered: "Ce panneau est déjà enregistré avec la région %region%, cliquez encore pour sélectionner un autre panneau."
|
||||
linksigns-first: "Vous êtes entré dans le mode de liaison d'un panneau."
|
||||
linksigns-next: "&7Faites 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-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: "&7Ajout de %0% régions, %1% par seconde."
|
||||
stack-addComplete: "&7Ajout de régions terminé."
|
||||
stack-unclearDirection: "Merci de regarder clairement le Nord, l'Est, le Sud ou l'Ouest, actuellement détectée %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%."
|
||||
|
||||
update-playerNotify: "&2Une mise à jour d'AreaShop V%0% à %1% est disponible, téléchargez là à cette adresse : http://dev.bukkit.org/bukkit-plugins/regionbuyandrent/."
|
||||
@@ -0,0 +1,413 @@
|
||||
# ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
|
||||
# ║ Language file of the AreaShop plugin created by NLThijs48, Github can be found at https://github.com/NLthijs48/AreaShop ║
|
||||
# ║ Language: Dutch, Version: V2.2.0, 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 ║
|
||||
# ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
|
||||
total-maximum: "Je kunt niet meer dan %0% gebied(en) kopen en huren in totaal (je hebt er al %1% in groep '%2%')."
|
||||
|
||||
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: %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-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-reload: "&6/as reload &7-&r Herlaad bestanden en update gebieden."
|
||||
help-setrestore: "&6/as setrestore &7-&r Schakel herstellen in/uit en kies het profiel."
|
||||
help-setprice: "&6/as setprice &7-&r Verander de prijs van een gebied."
|
||||
help-setduration: "&6/as setduration &7-&r Verander de huurtijd van een region."
|
||||
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."
|
||||
help-setteleport: "&6/as settp &7-&r Stel de teleporteer locatie in van jouw gebieden."
|
||||
help-setteleportAll: "&6/as settp &7-&r Stel een teleporteer gebied in."
|
||||
help-find: "&6/as find &7-&r Zoek een leeg huur of koop gebied."
|
||||
help-groupadd: "&6/as groupadd &7-&r Voeg een gebied toe aan een groep."
|
||||
help-groupdel: "&6/as groupdel &7-&r Verwijder een gebied uit een groep."
|
||||
help-grouplist: "&6/as grouplist &7-&r Laat een lijst met groepen zien."
|
||||
help-groupinfo: "&6/as groupinfo &7-&r Laat informatie over een groep zien."
|
||||
help-schemevent: "&6/as schemevent &7-&r Voer een schematic gebeurtenis uit."
|
||||
help-add: "&6/as add &7-&r Registreer een huur of koop gebied."
|
||||
help-del: "&6/as del &7-&r Verwijder een geregistreerd gebied."
|
||||
help-addsign: "&6/as addsign &7-&r Voeg een bordje toe aan een bestaand gebied."
|
||||
help-delsign: "&6/as delsign &7-&r Verwijder het bord waar je naar kijkt."
|
||||
help-me: "&6/as me &7-&r Bekijk welke gebieden je hebt (+aflooptijd)."
|
||||
help-setowner: "&6/as setowner &7-&r Stel gebied eigenaar in of verleng de huur."
|
||||
help-resell: "&6/as resell &7-&r Zet een gebied in doorverkoop modus."
|
||||
help-resellAll: "&6/as resell &7-&r Zet een gebied in doorverkoop modus."
|
||||
help-stopResell: "&6/as stopresell &7-&r Stop het herverkopen van je gebied."
|
||||
help-stopResellAll: "&6/as stopresell &7-&r Stop het herverkopen van een gebied."
|
||||
help-addFriend: "&6/as addfriend &7-&r Voeg een vriend toe aan je gebied."
|
||||
help-addFriendAll: "&6/as addfriend &7-&r Voeg een vriend toe aan een gebied."
|
||||
help-delFriend: "&6/as delfriend &7-&r Verwijder een vriend van je gebied."
|
||||
help-delFriendAll: "&6/as delfriend &7-&r Verwijder een vriend van een gebied."
|
||||
help-linksigns: "&6/as linksigns &7-&r Gebruik massa bord koppelen mode."
|
||||
help-stack: "&6/as stack &7-&r Creer meerdere gebieden en voeg ze toe."
|
||||
|
||||
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 (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 %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."
|
||||
rent-maxExtends: "Je kunt de huur niet meer verlengen (het maximum is %0% keer), je kunt echter wel het gebied opnieuw huren als het afgelopen is."
|
||||
rent-maxRentTime: "Je kunt dit huur gebied niet meer tijd van tevoren huren, de maximum tijd is %0% minuten en je hebt het al voor %1% minuten gehuurt."
|
||||
rent-restrictedToWorld: "Je moet in de '%0%' wereld zijn om dit gebied te huren (je bent in '%1%')."
|
||||
rent-restrictedToRegion: "Je moet in '%0%' staan om hem te huren."
|
||||
rent-expireWarning: "Je gebied %region% heeft nog %timeleft% over, verleng het als je het wilt houden.."
|
||||
|
||||
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 (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 %0% succesvol gekocht."
|
||||
buy-successResale: "Je hebt %0% succesvol gekocht van %1%."
|
||||
buy-successSeller: "Je gebied %0% is verkocht aan %1% voor %2%."
|
||||
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."
|
||||
buy-restrictedToWorld: "Je moet in de wereld '%0%' zijn om dit gebied te kopen (je ben in '%1%')."
|
||||
buy-restrictedToRegion: "Je moet in '%0%' staan om hem te kopen."
|
||||
|
||||
unrent-help: "/as unrent <gebiednaam>, 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 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>, 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: "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."
|
||||
|
||||
reload-reloaded: "Alle bestanden zijn succesvol herladen."
|
||||
reload-updateStart: "&7%0% gebieden aan het updaten met %1% per seconde."
|
||||
reload-updateComplete: "&7Updaten 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 <all|rented|forrent|sold|forsale|player|region|nogroup>."
|
||||
info-noPermission: "Je hebt geen toestemming om informatie over gebieden te bekijken."
|
||||
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-nogroupRents: "Huur gebieden zonder groep: &7%0%."
|
||||
info-nogroupBuys: "Koop gebieden zonder groep: &7%0%."
|
||||
info-nogroupNoRents: "Er zijn geen huur gebieden zonder een groep."
|
||||
info-nogroupNoBuys: "Er zijn geen koop gebieden zonder een groep."
|
||||
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-regionHeaderRent: "&2Informatie over %region%:"
|
||||
info-regionHeaderBuy: "&2Informatie over %region%:"
|
||||
info-regionRented: "&2&l►&r Gehuurd door %player% tot: &7%until%."
|
||||
info-regionBought: "&2&l►&r Gekocht door %player%."
|
||||
info-regionReselling: "&2&l►&r Gekocht door %player%, aan het doorverkopen."
|
||||
info-regionExtending: "&2&l►&r Verleng prijs: &7%price% per %duration%."
|
||||
info-regionCanBeRented: "&2&l►&r Huurprijs: &7%price% per %duration%."
|
||||
info-regionCanBeBought: "&2&l►&r Koopprijs: &7%price%."
|
||||
info-regionReselPrice: "&2&l►&r Doorverkoop prijs: &7%resellprice% (je kunt het kopen van %player%)."
|
||||
info-regionFriends: "&2&l►&r Toegevoegde vrienden: &7%friends%."
|
||||
info-regionMoneyBackBuy: "&2&l►&r Verkoop terugbetaling: &7%moneyback% (%moneybackpercent%% van de prijs)."
|
||||
info-regionMoneyBackRent: "&2&l►&r Huurstop geld terug: &7%moneyback% (%moneybackpercent%% van de overgebleven tijd)."
|
||||
info-regionMaxExtends: "&2&l►&r Maximaal aantal keer verlengen: &7%maxextends% keer."
|
||||
info-regionNoExtending: "&2&l►&r Huurgebied kan niet verlengt worden."
|
||||
info-regionExtendsLeft: "&2&l►&r Keer verlengen over: &7%extendsleft%van de %maxextends%."
|
||||
info-regionMaxRentTime: "&2&l►&r Van te voren huren: &7%maxrenttime% maximum."
|
||||
info-regionNoTeleport: "&2&l►&r Teleporteer lokatie niet ingesteld%0%."
|
||||
info-regionTeleportHint: " &7(gebruik '/as settp' voor een betere lokatie)"
|
||||
info-regionTeleportAt: "&2&l►&r Teleporteer lokatie ingesteld op: &7(%0%, %1%, %2%, %3%, helling:%4%, draaiing:%5%)."
|
||||
info-regionSigns: "&2&l►&r Verbonden borden: &7%0%."
|
||||
info-regionSignLocation: "&7(%0%, %1%, %2%, %3%)&r"
|
||||
info-regionGroups: "&2&l►&r Toegewezen groepen: &7%0%."
|
||||
info-regionInactiveUnrent: "&2&l►&r Automatische huurstop na: &7%inactivetime% inactiviteit van de speler."
|
||||
info-regionInactiveSell: "&2&l►&r Automatische verkoop na: &7%inactivetime% inactiviteit van de speler."
|
||||
info-regionRestrictedRegionRent: "&2&l►&r Je moet in dit gebied staan om hem te huren."
|
||||
info-regionRestrictedWorldRent: "&2&l►&r Je moet in de wereld '%world%' staan om dit gebied te huren."
|
||||
info-regionRestrictedRegionBuy: "&2&l►&r Je moet in dit gebied staan om hem te kopen."
|
||||
info-regionRestrictedWorldBuy: "&2&l►&r Je moet in de wereld '%world%' staan om dit gebied te kopen."
|
||||
info-regionRestoringRent: "&2&l►&r Herstel is ingeschakeld &7(gebied zal resetten bij een huurstop)%0%."
|
||||
info-regionRestoringBuy: "&2&l►&r Herstel is ingeschakeld &7(gebied zal resetten bij een verkoop)%0%."
|
||||
info-regionRestoringProfile: " (profiel: %0%)"
|
||||
info-regionNoSign: "Er is geen bordje geregistreerd voor dit gebied."
|
||||
info-regionPriceDuration: "Prijs: %0% voor elke %1%."
|
||||
info-regionPrice: "Prijs: %0%."
|
||||
info-regionRestore: "Herstellen ingeschakeld: %0%."
|
||||
info-regionRestoreProfile: "Herstel profiel: %0%."
|
||||
info-regionTPLocation: "Teleporteer locatie: &7Wereld=%0%, X=%1%, Y=%2%, Z=%3%, Helling=%4%, Draaiing=%5%."
|
||||
info-regionNoTP: "Geen teleporteer locatie ingesteld."
|
||||
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: "De herstel optie van %0% is succesvol gezet naar '%1%'."
|
||||
setrestore-successProfile: "Herstel instelling van %0% is succesvol gezet op '%1%' en het profiel naar '%2%'."
|
||||
|
||||
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 %0% is veranderd naar %1% per %2%."
|
||||
setprice-successBuy: "De prijs van het gebied %0% is veranderd naar %1%."
|
||||
|
||||
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: "Duur van het gebied %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 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 %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%)."
|
||||
setup-blacklisted: "%0% staat op de blacklist en kan niet toegevoegd worden aan AreaShop."
|
||||
|
||||
destroy-noPermissionRent: "Je hebt geen toestemming om huur gebieden te verwijderen."
|
||||
destroy-noPermissionBuy: "Je hebt geen toestemming om koop gebieden te verwijderen."
|
||||
destroy-successRent: "%0% succesvol verwijderd als huur gebied."
|
||||
destroy-successBuy: "%0% 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 naar %0% geteleporteerd."
|
||||
teleport-successSign: "Je bent geteleporteerd naar het bordje van %0%."
|
||||
teleport-noSafe: "Geen veilige plek gevonden in gebied %0%, verander het gebied of stel de teleporteer positie in."
|
||||
teleport-blocked: "Je kunt niet teleporteren omdat de positie buiten het gebied ligt en je geforceerd word erbinnen 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 %0% ingestelt."
|
||||
setteleport-notInside: "De lokatie moet zich binnen het gebied bevinden."
|
||||
setteleport-reset: "Teleporteer lokatie van %0% 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: %1%, bij het zoeken met een maximale prijs gelijk aan je saldo: %2%%3%."
|
||||
find-successMax: "Een %0% gebied is gevonden: %1%, bij het zoeken met een maximale prijs van %2%%3%."
|
||||
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-noRegion: "Het aangegeven gebied is niet geregistreerd: %0%."
|
||||
groupadd-success: "Gebied %0% is toegevoegd aan groep '%1%', deze group heeft nu %2% leden."
|
||||
groupadd-failed: "Gebied %0% is al toegevoegd aan groep '%1%'."
|
||||
groupadd-weSuccess: "Toegevoegd aan groep %0%: &7%1%."
|
||||
groupadd-weFailed: "Waren al toegevoegd aan groep %0%: &7%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-noRegion: "Het aangegeven gebied staat niet geregistreerd: %0%."
|
||||
groupdel-success: "Gebied %0% is verwijderd van groep '%1%', deze groep heeft nu %2% leden."
|
||||
groupdel-failed: "Gebied %0% is geen lid van groep '%1%'."
|
||||
groupdel-weSuccess: "Verwijderd van groep %0%: &7%1%."
|
||||
groupdel-weFailed: "Waren al niet in de groep %0%: &7%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: &7%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%: &7%1%."
|
||||
groupinfo-noMembers: "Groep %0% heeft geen leden."
|
||||
|
||||
schemevent-help: "/as schemevent <gebied> <created|deleted|rented|unrented|bought|sold>."
|
||||
schemevent-noRegion: "Het aangegeven gebied is niet geregistreerd: %0%."
|
||||
schemevent-wrongEvent: "Het aangegeven event '%0%' bestaat niet, gebruik een van de volgende: &7%1%."
|
||||
schemevent-success: "Event '%0%' succesvol getriggerd voor gebied %1%."
|
||||
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%: &7%1%."
|
||||
add-failed: "Al geregistreerd: &7%0%."
|
||||
add-blacklisted: "Op de blacklist: &7%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: "Gebied '%0%' bestaat niet in deze wereld."
|
||||
|
||||
del-noRegion: "Het aangegeven gebied is niet geregistreerd: %0%."
|
||||
del-noPermission: "Je hebt geen toestemming om gebieden te verwijderen."
|
||||
del-success: "Verwijderde gebieden: &7%0%."
|
||||
del-failed: "Geen toestemming om te verwijderen of niet geregistreerd: &7%0%."
|
||||
|
||||
addsign-help: "/as addsign [gebied] [profiel]."
|
||||
addsign-noSign: "Je kijkt niet naar een bord."
|
||||
addsign-noRegion: "Gebied '%0%' kan niet gevonden worden."
|
||||
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: %0% en %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: %0% en %1%)."
|
||||
addsign-wrongProfile: "Het aangegeven profiel bestaat niet, gebruik een van de volgende (check de config): &7%0%."
|
||||
addsign-success: "Het bord is toegevoegd aan %region%."
|
||||
addsign-successProfile: "Het bord is toegevoegd aan %region% met profiel %0%."
|
||||
addsign-alreadyRegistered: "Dat bord is al geregistreerd voor gebied %0%."
|
||||
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 %0%."
|
||||
|
||||
me-noPermission: "Je hebt geen toestemming om te zien welke gebieden je hebt."
|
||||
me-notAPlayer: "Je bent geen speler dus je kunt geen gebieden hebben."
|
||||
me-noRentRegions: "Je hebt geen huur gebieden gehuurt."
|
||||
me-noBuyRegions: "Je hebt geen koop gebieden gekocht."
|
||||
me-rentRegions: "Je hebt de volgende gebieden gehuurt:"
|
||||
me-buyRegions: "Je hebt de volgende gebieden gekocht:"
|
||||
me-rentLine: "&2&l►&r %region% tot %until% &7(%timeleft% over)."
|
||||
me-buyLine: "&2&l►&r %region%."
|
||||
me-noFriendRegions: "Je bent niet aan gebieden toegevoegd als vriend."
|
||||
me-friendRegions: "Je bent toegevoegd als vriend bij de volgende gebieden:"
|
||||
me-friendLine: "&2&l►&r %region% &7(eigenaar: %player%)."
|
||||
|
||||
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 %region% succesvol veranderd naar %player%, gehuurt tot %until% (%timeleft% over)."
|
||||
setowner-succesRentExtend: "Eigenaar was al %player%, huur verlengt met '%duration%', nu gehuurd tot %until% (%timeleft% over)."
|
||||
setowner-succesBuy: "Eigenaar van %region% succesvol veranderd naar %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-noRegionFound: "Geen AreaShop gebied gevonden op je lokatie, geeft de naam van het gebied mee als argument."
|
||||
resell-notBought: "Je kunt %region% niet doorverkopen want dit gebied is nog niet verkocht."
|
||||
resell-success: "%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-noRegionFound: "Geen AreaShop gebied gevonden op je lokatie, geeft de naam van het gebied mee als argument."
|
||||
stopresell-notResell: "Je kunt niet stoppen met doorverkopen van %region% want hij staat niet in doorverkoop mode."
|
||||
stopresell-success: "%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: "%0% is toegevoegd als vriend bij gebied %1%."
|
||||
addfriend-success: "%0% is toegevoegd als vriend bij je gebied %1%."
|
||||
addfriend-alreadyAdded: "%0% is al toegevoegd als vriend voor dit gebied."
|
||||
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: "%0% is verwijderd als vriend van gebied %1%."
|
||||
delfriend-success: "%0% is verwijderd als vriend van je gebied %1%."
|
||||
delfriend-notAdded: "%0% is niet toegevoegd als vriend voor dit gebied."
|
||||
delfriend-noOwner: "Je kunt geen vrienden verwijderen van een gebied zonder eigenaar."
|
||||
|
||||
linksigns-multipleRegions: "Meerdere gebieden gevonden: &7%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 &7(maximaal bereik 100 blokken)."
|
||||
linksigns-regionFound: "Gebied %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 &7(maximaal bereik 100 blokken)."
|
||||
linksigns-alreadyRegistered: "Dat bord is al gekoppelt aan gebied %region%, klik opnieuw om een ander bord te selecteren."
|
||||
linksigns-first: "Je bent in bord-koppel modus gegaan."
|
||||
linksigns-next: "&7Linksklik 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> <gat> <naam> <rent|buy> [groep].\n&7 <aantal> Het aantal gebieden dat word aangemaakt.\n <gat> Blokken afstand tussen de gebieden.\n <naam> Naam van de gebieden (komt een nummer achter).\n <rent|buy> Maak ze huur of koop gebieden.\n [groep] Voeg de gebieden toe aan een groep.\n 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: "&7%0% gebieden aan het toevoegen met %1% per seconde."
|
||||
stack-addComplete: "&7Toevoegen van gebieden voltooid."
|
||||
stack-unclearDirection: "Kijk precies in het noorden, oosten, zuiden of westen, op dit moment gedetecteert: %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%."
|
||||
|
||||
update-playerNotify: "&2Update van AreaShop V%0% naar %1% beschikbaar, download de laatste versie op http://dev.bukkit.org/bukkit-plugins/regionbuyandrent/."
|
||||
@@ -0,0 +1,370 @@
|
||||
# ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
|
||||
# ║ Language file of the AreaShop plugin created by NLThijs48, Github can be found at https://github.com/NLthijs48/AreaShop ║
|
||||
# ║ Language: Polish, Version: V2.2.0, Percentage translated: 88% ║
|
||||
# ║ 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 ║
|
||||
# ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
|
||||
total-maximum: "Nie mozesz kupic i wynajac wiecej niz %0% regionow na raz! (aktualnie masz %1% w grupie '%2%')."
|
||||
|
||||
cmd-notValid: "Blad komendy, wpisz '/as help'."
|
||||
cmd-onlyByPlayer: "Ta komenda jest tylko dla gracza."
|
||||
cmd-weOnlyByPlayer: "Zaznaczanie terenu jest mozliwe do zrobienia tylko w grze, dodaj nazwe regionu jako dodatkowy argument."
|
||||
cmd-noSelection: "Nic nie zaznaczyles."
|
||||
cmd-noRegionsFound: "W twoim zaznaczeniu nie ma zadnego regionu zarejestrowanego przez plugin."
|
||||
cmd-noWERegionsFound: "W twoim zaznaczeniu nie ma regionow WorldEdita."
|
||||
cmd-noRegionsAtLocation: "Tu gdzie stoisz nie ma zadnego regionu, wpisz nazwe regionu jako argument."
|
||||
cmd-moreRegionsAtLocation: "Tu gdzie stoisz jest wiecej niz jeden region, wpisz jego nazwe jako argument."
|
||||
cmd-automaticRegionOnlyByPlayer: "Automatyczne okreslanie regionu jest mozliwe tylko bedac w grze, wpisz nazwe regionu jako kolejny argument."
|
||||
|
||||
help-header: "Pomoc - Kupno, Wynajem"
|
||||
help-alias: "Aliasy komend: /areashop, /as."
|
||||
help-help: "&6/as help &7-&r Pokazuje ta strone."
|
||||
help-info: "&6/as info &7-&r Informacje na temat regionow."
|
||||
help-rent: "&6/as rent &7-&r Wynajmij region lub przedluz aktualny."
|
||||
help-buy: "&6/as buy &7-&r Kup region."
|
||||
help-unrent: "&6/as unrent &7-&r Przestan wynajmowac region."
|
||||
help-unrentOwn: "&6/as unrent &7-&r Przestan wynajmowac Twoj region."
|
||||
help-sell: "&6/as sell &7-&r Sprzedaj region."
|
||||
help-sellOwn: "&6/as sell &7-&r Sprzedaj swoj region."
|
||||
help-reload: "&6/as reload &7-&r Przeladuj."
|
||||
help-setrestore: "&6/as setrestore &7-&r Wlacza/wylacza przywracanie terenu."
|
||||
help-setprice: "&6/as setprice &7-&r Zmienia cene regionu."
|
||||
help-setduration: "&6/as setduration &7-&r Zmienia czas wynajmu."
|
||||
help-teleport: "&6/as tp &7-&r Teleport do Twoich regionow."
|
||||
help-teleportAll: "&6/as tp &7-&r Teleport do regionow."
|
||||
help-setteleport: "&6/as settp &7-&r Ustaw teleport do Twojego regionu."
|
||||
help-setteleportAll: "&6/as settp &7-&r Ustawia teleport do regionu."
|
||||
help-find: "&6/as find &7-&r Znajduje region mozliwy do kupienia lub wynajecia."
|
||||
help-groupadd: "&6/as groupadd &7-&r Dodaje region do grupy."
|
||||
help-groupdel: "&6/as groupdel &7-&r Usuwa region z grupy."
|
||||
help-grouplist: "&6/as grouplist &7-&r Wyswietla zarejestrowane grupy."
|
||||
help-groupinfo: "&6/as groupinfo &7-&r Wyswietla informacje o grupie."
|
||||
help-schemevent: "&6/as schemevent &7-&r Trigger a schematic event for a region."
|
||||
help-add: "&6/as add &7-&r Zarejestruj region do kupienia albo wynajecia."
|
||||
help-del: "&6/as del &7-&r Usun zarejestrowany region."
|
||||
help-addsign: "&6/as addsign &7-&r Dodaje tabliczke do zarejestrowanego regionu."
|
||||
help-delsign: "&6/as delsign &7-&r Usuwa tabliczke na ktora patrzysz."
|
||||
help-me: "&6/as me &7-&r Pokazuje regiony, ktore posiadasz (i czas wygasniecia)."
|
||||
help-setowner: "&6/as setowner &7-&r Ustawia wlasciciela regionu lub przedluza okres wynajecia."
|
||||
help-resell: "&6/as resell &7-&r u."
|
||||
help-resellAll: "&6/as resell &7-&r Umiesc jeden ze swoich regionow w tryb odsprzedazy."
|
||||
help-stopResell: "&6/as stopresell &7-&r Umieszcza region w tryb odsprzedazy."
|
||||
help-stopResellAll: "&6/as stopresell &7-&r Usuwa region z trybu odsprzedazy i ustawia mu status sprzedanego."
|
||||
help-addFriend: "&6/as addfriend &7-&r Dodaj gracza do swojego regionu."
|
||||
help-addFriendAll: "&6/as addfriend &7-&r Dodaje gracza do regionu."
|
||||
help-delFriend: "&6/as delfriend &7-&r Usun gracza ze swojego regionu."
|
||||
help-delFriendAll: "&6/as delfriend &7-&r Usuwa gracza z regionu."
|
||||
help-linksigns: "&6/as linksigns &7-&r Use bulk sign linking mode."
|
||||
|
||||
rent-help: "/as rent [nazwa_regionu], jesli nie wpiszesz nazwy uzyje regionu na ktorym stoisz."
|
||||
rent-noPermission: "Nie masz uprawnien, by wynajac region."
|
||||
rent-maximum: "Nie mozesz wynajac wiecej niz %0% region(y/ow) (aktualnie wynajmujesz %1% w grupie '%2%')."
|
||||
rent-payError: "Zos poszlo zle z platnascia, sprobuj pozniej."
|
||||
rent-rented: "Wynajales %0% do %1%."
|
||||
rent-extended: "Przedluzyles okres wynajmu %0% do %1%."
|
||||
rent-extend: "Mozesz przedluzyc okres wynajmu klikajac PPM na tabliczke albo wpisujac /as rent."
|
||||
rent-lowMoneyExtend: "Nie masz wystarczajacej liczby pieniedzy, zeby przedluzyc okres wynajmu (Posiadasz %0%,a potrzebujesz %1%)."
|
||||
rent-lowMoneyRent: "Nie masz wystarczajacej liczby pieniedzy, by wynajac ten region (masz %0%, a potrzebujesz %1%)."
|
||||
rent-someoneElse: "Ktos juz wynajal ten region."
|
||||
rent-notRentable: "Ten region nie jest dostepny do wynajmu."
|
||||
rent-maxExtends: "Nie mozesz juz przedluzyc okresu wynajmu (maksymalna ilosc to %0% razy), aczkolwie kiedy skonczy sie okres wynajmu mozesz wynajac ten teren znowu."
|
||||
rent-maxRentTime: "Nie mozesz wiecej razy z gory wynajac tego regionu, maksymalny czas to %0% minut, a ty wynajmujesz go przez %1% minut."
|
||||
rent-restrictedToWorld: "Musisz byc w swiecie '%0%' zeby wypozyczyc ten region (jestes w '%1%')."
|
||||
rent-restrictedToRegion: "Musisz byc na terenie '%0%' zeby wynajac ten region."
|
||||
rent-expireWarning: "Czas wynajmu %region% konczy sie. Pozostalo %timeleft%. Przedluz wynajem jesli chcesz go zatrzymac."
|
||||
|
||||
buy-help: "/as buy [nazwa_regionu], jesli nie wpiszesz nazwy uzyje regionu na ktorym stoisz."
|
||||
buy-noPermission: "Nie masz uprawnien, zeby kupic ten region."
|
||||
buy-notBuyable: "Ten region nie jest udostepiony do kupowania."
|
||||
buy-maximum: "Nie mzoesz kupic wiecej niz %0% region(y/ow) (masz juz %1% w grupie '%2%')."
|
||||
buy-payError: "Cos poszlo nie tak z platnosciami, sprobuj pozniej."
|
||||
buy-succes: "Kupiles %0%."
|
||||
buy-successResale: "Kupiles %0% od %1%."
|
||||
buy-successSeller: "Sprzedales %0% do %1% za %2%."
|
||||
buy-lowMoney: "Nie masz wystarczajacej ilosci pieniedzy, zby kupic ten region (masz %0%, a potrzebuejsz %1%)."
|
||||
buy-yours: "Juz kupiles ten region."
|
||||
buy-someoneElse: "Ktos juz kupil ten region."
|
||||
buy-restrictedToWorld: "Musisz byc na swiecie: '%0%' zeby kupic ten region (jestes w '%1%')."
|
||||
buy-restrictedToRegion: "Musisz byc na terenie '%0%' zeby kupic ten region."
|
||||
|
||||
unrent-help: "/as unrent [nazwa_regionu], jesli nie wpiszesz nazwy uzyje regionu na ktorym stoisz."
|
||||
unrent-noPermission: "Nie masz uprawnien, zeby zaprzestac wynajmu regionu."
|
||||
unrent-noPermissionOther: "Nie masz uprawnien, zeby usunac komus region."
|
||||
unrent-unrented: "Przestales wynajmowac region."
|
||||
unrent-other: "Sprawiles ze gracz %0% przestal wynajmowac ten region."
|
||||
unrent-expired: "Twoj wynajem %0% zostal przedluzony."
|
||||
|
||||
sell-help: "/as sell [nazwa_regionu], jesli nie wpiszesz nazwy uzyje regionu na ktorym stoisz."
|
||||
sell-notRegistered: "Region nie moze zostac sprzedany, poniewaz nie mozna go kupic."
|
||||
sell-notBought: "Region nie moze zostac sprzedany, poniewaz nie jest niczyja wlasnoscia."
|
||||
sell-sold: "Region zostal sprzedany graczu %0%."
|
||||
sell-soldYours: "Twoj region zostal sprzedany."
|
||||
sell-noPermission: "Nie masz uprawnien, zeby sprzedac region."
|
||||
sell-noPermissionOther: "Nie masz uprawnien, by sprzedac region, ktorego nie posiadasz."
|
||||
|
||||
reload-reloaded: "Przeladowano wszystkie pliki."
|
||||
reload-updateStart: "&7Odswiezono %0% regionow (%1%/sekunde)."
|
||||
reload-updateComplete: "&7Odswiezono wszystkie regiony."
|
||||
reload-noPermission: "Nie masz uprawnien, zeby przeladowac plugin."
|
||||
reload-updateCommandChanged: "'/as updaterents' i '/as updatebuys' zostaly usuniete, '/as reload' tez odswieza regiony, wiec uzywaj teraz tej komendy."
|
||||
|
||||
info-help: "/as info <all|rented|forrent|sold|forsale|player|region|nogroup>."
|
||||
info-noPermission: "Nie masz uprawnien, by uzyskac informacje na temat regionow."
|
||||
info-all-rents: "Regiony do wynajecia: &7%0%."
|
||||
info-all-noRents: "Aktualnie nie ma regionow do wynajecia."
|
||||
info-all-buys: "Regiony do kupienia: &7%0%."
|
||||
info-all-noBuys: "Nie ma regionow do kupienia."
|
||||
info-nogroupRents: "Regiony bez grupy do wynajecia: &7%0%."
|
||||
info-nogroupBuys: "Regiony bez grupy do wynajecia: &7%0%."
|
||||
info-nogroupNoRents: "Nie ma regionow bez grupy do wynajecia."
|
||||
info-nogroupNoBuys: "Nie ma regionow bez grupy do kupienia."
|
||||
info-rented: "Wynajmujesz: &7%0%."
|
||||
info-noRented: "Nie wynajmujesz zadnych regionow."
|
||||
info-unrented: "Niewynajete regiony: &7%0%."
|
||||
info-noUnrented: "Wszystkie regiony sa wynajete."
|
||||
info-sold: "Sprzedane regiony: &7%0%."
|
||||
info-noSold: "Nie ma sprzedanych regionow."
|
||||
info-forsale: "Regiony na sprzedaz: &7%0%."
|
||||
info-noForsale: "Wszystkie regiony sa sprzedane."
|
||||
info-playerHelp: "/as info player <nick>."
|
||||
info-playerRents: "Regiony wynajmowane przez %0%: &7%1%"
|
||||
info-playerNoRents: "%0% nie wynajmuje regionow."
|
||||
info-playerBuys: "Regiony kupione przez %0%: &7%1%."
|
||||
info-playerNoBuys: "%0% nie kupil zadnych regionow."
|
||||
info-regionHelp: "/as info region [nazwa_regionu], jesli nie wpiszesz nazwy uzyje regionu na ktorym stoisz."
|
||||
info-regionHeaderRent: "&2Informacje o %region%:"
|
||||
info-regionHeaderBuy: "&2Informacje o %region%:"
|
||||
info-regionRented: "&2&l►&r Wynajete przez %player% do: &7%until%."
|
||||
info-regionBought: "&2&l►&r Kupione przez %player%."
|
||||
info-regionReselling: "&2&l►&r Kupione przez %player%, aktualnie mozliwe jest okupienie."
|
||||
info-regionExtending: "&2&l►&r Cena za przedluzenie wynajmu: &7%price% z %duration%."
|
||||
info-regionCanBeRented: "&2&l►&r Cena za wynajem: &7%price% za %duration%."
|
||||
info-regionCanBeBought: "&2&l►&r Cena: &7%price%."
|
||||
info-regionReselPrice: "&2&l►&r Cena odsprzedazy: &7%resellprice% (mozesz kupic od %player%)."
|
||||
info-regionFriends: "&2&l►&r Dodani gracze: &7%friends%."
|
||||
info-regionMoneyBackBuy: "&2&l►&r Zwrot pieniedzy za sprzedanie: &7%moneyback% (%moneybackpercent%% ceny kupna)."
|
||||
info-regionMoneyBackRent: "&2&l►&r Zwrot pieniedzy za zakonczenie wynajmu: &7%moneyback% (%moneybackpercent%% pozostalego czasu)."
|
||||
info-regionNoExtending: "&2&l►&r Wynajem nie moze zostac przedluzony."
|
||||
info-regionMaxRentTime: "&2&l►&r Wynajem z gory: maksymalnie &7%maxrenttime%."
|
||||
info-regionNoTeleport: "&2&l►&r Teleport do regionu nie zostal jeszcze ustawiony%0%."
|
||||
info-regionTeleportHint: " &7(wpisz '/as settp' w najlepszym miejscu)"
|
||||
info-regionTeleportAt: "&2&l►&r Teleport ustawiony w: &7(%0%, %1%, %2%, %3%, Wysokosc:%4%, Kierunek:%5%)."
|
||||
info-regionSigns: "&2&l►&r Podlaczone tabliczki: &7%0%."
|
||||
info-regionSignLocation: "&7(%0%, %1%, %2%, %3%)&r"
|
||||
info-regionGroups: "&2&l►&r Przydzielone grupy: &7%0%."
|
||||
info-regionInactiveUnrent: "&2&l►&r Automatyczne zaprzestanie wynajmu: &7%inactivetime% nieobecnosci gracza na serverze."
|
||||
info-regionInactiveSell: "&2&l►&r Autosprzedaz po: &7%inactivetime% nieobecnosci gracza na serverze."
|
||||
info-regionRestoringRent: "&2&l►&r Przywracanie jest wlaczone &7(Region bedzie resetowany po skonczeniu wynajmu)%0%."
|
||||
info-regionRestoringBuy: "&2&l►&r Przywracanie jest wlaczone &7(Region bedzie resetowany po sprzedazy)%0%."
|
||||
info-regionRestoringProfile: " (profil: %0%)"
|
||||
info-regionNoSign: "Do tego regionu nie ma przypisanych tabliczek."
|
||||
info-regionPriceDuration: "Cena: &7%0% za %1%."
|
||||
info-regionPrice: "Cena: &7%0%."
|
||||
info-regionRestore: "Przywracanie wlaczone: &7%0%."
|
||||
info-regionRestoreProfile: "Profil przywracania: &7%0%."
|
||||
info-regionTPLocation: "Lokalizacja teleportu: &7wiat=%0%, X=%1%, Y=%2%, Z=%3%, Wysokosc=%4%, Kierunek=%5%."
|
||||
info-regionNoTP: "Nie ma ustawionej lokalizacji teleportu."
|
||||
|
||||
setrestore-help: "/as setrestore <region> <true|false|general> [profile]."
|
||||
setrestore-noPermission: "Nie masz uprawnien zeby zmieniac ustawienia odzyskiwania."
|
||||
setrestore-invalidSetting: "'%0%' nie jest poprawnym ustawieniem, mozesz ustawic: true, false lub general."
|
||||
setrestore-success: "Ustawiono ustawienia odzyskiwania %0% na '%1%'."
|
||||
setrestore-successProfile: "Ustawiono ustawienia odzyskiwania %0% na '%1%' i profil na '%2%'."
|
||||
|
||||
setprice-noPermission: "Nie masz uprawnien, by zmienic cene regionu."
|
||||
setprice-help: "/as setprice <price> [nazwa_regionu], jesli nie wpiszesz nazwy uzyje regionu na ktorym stoisz."
|
||||
setprice-wrongPrice: "'%0%' nie jest poprawna cena."
|
||||
setprice-successRent: "Cena %0% zmieniona na %1% per %2%."
|
||||
setprice-successBuy: "Cena %0% zmieniona na %1%."
|
||||
|
||||
setduration-noPermission: "Nie masz uprawnien by zmienic czas wynajmu."
|
||||
setduration-help: "/as setduration <amount> <identifier> [nazwa_regionu], jesli nie wpiszesz nazwy uzyje regionu na ktorym stoisz."
|
||||
setduration-wrongAmount: "'%0%' nie ejst poprawna iloscia, wpisz liczbe."
|
||||
setduration-wrongFormat: "'%0%' nie jest wlasciwym formatem czasu, sprawdz dokumentacje na Bukkicie."
|
||||
setduration-success: "Czas wynajmu %0% zmieniony na '%1%'."
|
||||
|
||||
setup-noRegion: "Nie wpisales nazwy regionu w drugiej linii."
|
||||
setup-wrongRegion: "Wpisany region nie istnieje."
|
||||
setup-alreadyRentSign: "Region, ktorego uzyles jest juz zarestrowany w pluginie jako mozliwy do wynajecia, dodaj tabliczki z [as] w pierwszej linii lub wpisz /as addsign."
|
||||
setup-alreadyBuySign: "Region, ktorego uzyles jest juz zarestrowany w pluginie jako mozliwy do kupienia, dodaj tabliczki z [as] w pierwszej linii lub wpisz /as addsign'."
|
||||
setup-noDuration: "Nie wpisales na jak dlugo wynajmuje sie region! Zrob to w trzeciej linijce."
|
||||
setup-wrongDuration: "Czas, ktory wpisales nie jest poprawnym formatem. Przyklad: 1 dzien (Ustawienia w configu)."
|
||||
setup-noPrice: "Nie wpisales ceny w czwartej linijce."
|
||||
setup-rentSuccess: "Wynajmowanie %0% ustawione poprawnie."
|
||||
setup-buySuccess: "Kupowanie %0% ustawione poprawnie."
|
||||
setup-couldNotDetect: "Znaleziono kilka regionow z takim samym pierwszenstwem lub relacja rodzice/dziecko wpisz nazwe z 2 linijce (Wykryte regiony: %0% i %1%)."
|
||||
setup-blacklisted: "%0% jest na czarnej liscie i nie moze zostac dodany."
|
||||
|
||||
teleport-help: "/as tp <region> [tabliczka]."
|
||||
teleport-noPermission: "Nie masz uprawnien, by przeniesc sie na swoj region."
|
||||
teleport-noPermissionOther: "Nie masz uprawnien, by przeniesc sie na region, ktorego nie posiadasz."
|
||||
teleport-noPermissionSign: "Nie masz uprawnien, by przeniesc sie do tabliczki z Twoim regionem."
|
||||
teleport-noPermissionOtherSign: "Nie masz uprawnien, by przesniesc sie do tabliczki z regionem, ktorego nie posiadasz."
|
||||
teleport-success: "Przeteleportowano do %0%."
|
||||
teleport-successSign: "Przeteleportowano do tabliczki %0%."
|
||||
teleport-noSafe: "Nie ma bezpiecznej lokacji w %0%, brak pozostalych miejsc w regionie lub maksymalna ilosc prob osiagnieta (%1%/%2%)."
|
||||
|
||||
setteleport-help: "/as settp [nazwa_regionu] [reset], jesli nie wpiszesz nazwy uzyje regionu na ktorym stoisz."
|
||||
setteleport-noPermission: "Nie masz uprawnien, aby ustawic teleport."
|
||||
setteleport-noPermissionOther: "Nie masz uprawnien, by ustawic teleport dla regionu, ktorego nie posiadasz."
|
||||
setteleport-success: "Teleport dla %0% zostal ustwiony."
|
||||
setteleport-notInside: "Teleport musi byc wewnatrz regionu."
|
||||
setteleport-reset: "Teleport dla %0% zostal usuniety."
|
||||
|
||||
find-help: "/as find <buy|rent> [maksymalna cena] [grupa]."
|
||||
find-noPermission: "Nie masz uprawnien do wyszukiwania regionow i teleportow do nich."
|
||||
find-success: "Znaleziono %0% : %1%, podczas wyszukiwania maksymalnej ceny dla Ciebie: %2%%3%."
|
||||
find-successMax: "Znaleziono %0% : %1%, podczas szukania z maksymalna cena %2%%3%."
|
||||
find-wrongMaxPrice: "Wpisana maksymalna cena nie jest poprawna liczba: %0%."
|
||||
find-wrongGroup: "Grupa nie istnieje: %0%."
|
||||
find-noneFound: "Nie znaleziono %0% regioow, podczas wyszukiwania z maksymalna cena dla Ciebie: %1%%2%."
|
||||
find-noneFoundMax: "Nie znaleziono %0% regionow podczas wyszukiwania z maksymalna cena: %1%%2%."
|
||||
find-onlyInGroup: ", znaleziono tylko dla grupy: %0%."
|
||||
|
||||
groupadd-help: "/as groupadd <group> [region], jesli nie wpiszesz nazwy uzyje regionu na ktorym stoisz."
|
||||
groupadd-noPermission: "Nie masz uprawnien, by dodawac regiony do grup."
|
||||
groupadd-noRegion: "Region nie jest zarejestrowany: %0%."
|
||||
groupadd-success: "Region %0% zostal dodany do grupy '%1%', ta grupa posiada teraz %2% czlonkow."
|
||||
groupadd-failed: "Region %0% jest juz czloniek grupy '%1%'."
|
||||
groupadd-weSuccess: "Dodano do grupy %0%: &7%1%."
|
||||
groupadd-weFailed: "Byl juz w grupie %0%: &7%1%."
|
||||
|
||||
groupdel-help: "/as groupdel <group> [region], jesli nie wpiszesz nazwy uzyje regionu na ktorym stoisz."
|
||||
groupdel-noPermission: "Nie masz uprawnien, by usunac region z grupy."
|
||||
groupdel-noRegion: "Region nie jest zarejestrowany: %0%."
|
||||
groupdel-success: "Region %0% zostal usuniety z grupy '%1%', ta grupa posiada teraz %2% czlonkow."
|
||||
groupdel-failed: "Region %0% nie jest czlonkiem grupy '%1%'."
|
||||
groupdel-weSuccess: "Usunieto z grupy %0%: &7%1%."
|
||||
groupdel-weFailed: "Nie byl w grupie %0%, w kazdym razie: &7%1%."
|
||||
|
||||
grouplist-noPermission: "Nie masz uprawnien, zeby wyswietlac zarejestrowane grupy."
|
||||
grouplist-noGroups: "Aktualnie nie ma zarejestrowanych grup."
|
||||
grouplist-success: "Zarejestrowane grupy: &7%0%."
|
||||
|
||||
groupinfo-help: "/as groupinfo <grupa>."
|
||||
groupinfo-noPermission: "Nie masz uprawnien, by wyswietlic informacje o grupie."
|
||||
groupinfo-noGroup: "Nie ma grupy o nazwie '%0%', wpisz /as grouplist zeby sprawdzic grupy."
|
||||
groupinfo-members: "Nastepujace regiony sa czlonkami grupy %0%: &7%1%."
|
||||
groupinfo-noMembers: "Grupa %0% nie ma czlonkow."
|
||||
|
||||
schemevent-help: "/as schemevent <region> <created|deleted|rented|unrented|bought|sold>."
|
||||
schemevent-noRegion: "Region nie jest zarejestrowany: %0%."
|
||||
schemevent-wrongEvent: "Wydarzenie '%0%' nie istnieje, sprobuj uzyc tych: &7%1%."
|
||||
schemevent-success: "Wydarzenie '%0%' zostalo przypisane do regionu %1%."
|
||||
schemevent-noPermission: "Nie masz uprawnien, by przypisywac wydarzenia."
|
||||
|
||||
add-help: "/as add <rent|buy> [region] [swiat]."
|
||||
add-noPermission: "Nie masz uprawnien, by dodawac regiony."
|
||||
add-success: "Dodano jako %0%: &7%1%."
|
||||
add-failed: "Juz zarejestrowano: &7%0%."
|
||||
add-blacklisted: "Na czarnej liscie: &7%0%."
|
||||
add-specifyWorld: "Wpisz swiat, na ktorym znajduje sie region, gdy uzywasz konsoli."
|
||||
add-incorrectWorld: "Swiat '%0%' nie zostal znaleziony, sprobuj ponownie (wielkosc liter)."
|
||||
add-noRegion: "Region '%0%' nie istnieje na tym swiecie."
|
||||
|
||||
del-noPermission: "Nie masz uprawnien, by usuwac regiony."
|
||||
del-success: "Usunieto region: &7%0%."
|
||||
del-failed: "Nie masz uprawnien, lub regin nie jest zarejestrowany: &7%0%."
|
||||
|
||||
addsign-help: "/as addsign [region] [status(profil)]."
|
||||
addsign-noSign: "Nie patrzysz na tabliczke."
|
||||
addsign-noRegion: "Nie znaleziono regionu '%0%."
|
||||
addsign-noRegions: "Nie znaleziono regionu w poblizu tabliczki."
|
||||
addsign-couldNotDetect: "W poblizu tabliczki znaleziono kilka regionow, wpisz nazwe regionu jako kolejny argument (Znalezione regiony: %0% i %1%)."
|
||||
addsign-couldNotDetectSign: "W poblizu tabliczki znaleziono kilka regionow, wpisz nazwe regionu w drugiej linijce (Znalezione regiony: %0% i %1%)."
|
||||
addsign-wrongProfile: "Status nie istnieje, wpisz ktorys z tych (sprawdz config - SignProfiles): &7%0%."
|
||||
addsign-success: "Dodano tabliczke do %region%."
|
||||
addsign-successProfile: "Dodano tabliczke do %region% ze statusem %0%."
|
||||
addsign-alreadyRegistered: "Ta tabliczka jest juz przypisana do %0%."
|
||||
addsign-noPermission: "Nie masz uprawnien, by dodac tabliczke."
|
||||
|
||||
delsign-noSign: "Nie patrzysz na tabliczke."
|
||||
delsign-noPermission: "Nie masz permisji, by usunac tabliczke."
|
||||
delsign-noRegion: "Ta tabliczka nie nalezy do regionu pluginu."
|
||||
delsign-success: "Usunieto tabliczke z regionu %0%."
|
||||
|
||||
me-noPermission: "Nie masz uprawnien, by sprawdzic jakie regiony posiadasz."
|
||||
me-notAPlayer: "Nie jestes graczem, wiec nie masz regionow."
|
||||
me-noRentRegions: "Nie wynajmujesz zadnych regionow."
|
||||
me-noBuyRegions: "Nie kupiles zadnych regionow."
|
||||
me-rentRegions: "Wynajmujesz regiony:"
|
||||
me-buyRegions: "Kupiles regiony:"
|
||||
me-rentLine: "&2&l►&r %region% do %until% &7(pozostalo %timeleft%)."
|
||||
me-buyLine: "&2&l►&r %region%."
|
||||
me-friendLine: "&2&l►&r %region% &7(wlasciciel: %player%)."
|
||||
|
||||
setowner-help: "/as setowner <player> [region], jesli nie wpiszesz nazwy uzyje regionu na ktorym stoisz."
|
||||
setowner-noPermission: "Nie masz uprawnien, by ustawiac wlasciciela regionu."
|
||||
setowner-noPermissionRent: "Nie masz uprawnien, by ustawiac wlasciciela regionow do wynajecia."
|
||||
setowner-noPermissionBuy: "Nie masz uprawnien, by ustawiac wlasciciela regionow do kupienia."
|
||||
setowner-notRegistered: "Podany region nie istnieje."
|
||||
setowner-noPlayer: "Wystapil problem z uzyskaniem UUi gracza: %0%."
|
||||
setowner-succesRent: "Wlasciciel %region% zostal zmieniony na %player%, wynajmowanie do %until% (pozostalo %timeleft%)."
|
||||
setowner-succesRentExtend: "Wlascicielem jest juz %player%, wynajecie przedluzone o '%duration%', aktualnie wynajeto do %until% (pozostalo %timeleft%)."
|
||||
setowner-succesBuy: "Wlasiciel %region% zostal zmieniony na %player%."
|
||||
|
||||
resell-help: "/as resell <price> [region], jesli nie wpiszesz nazwy uzyje regionu na ktorym stoisz."
|
||||
resell-wrongPrice: "'%0%' nie jest poprawna cena."
|
||||
resell-noRegionFound: "Nie wykryto tutaj regionu, sprobuj wpisac nazwe jako dodatkowy argument."
|
||||
resell-notBought: "Nie mozesz sprzedac %region%, poniewaz nie zostal jeszcze sprzedany."
|
||||
resell-success: "%region% zostal ustawiony do odsprzedania za %resellprice%."
|
||||
resell-noPermission: "Nie masz uprawnien, zeby odsprzedac Swoj region."
|
||||
resell-noPermissionOther: "Nie masz uprawnien, by odsprzedawac cudze regiony."
|
||||
|
||||
stopresell-help: "/as stopresell [region], jesli nie wpiszesz nazwy uzyje regionu na ktorym stoisz."
|
||||
stopresell-noRegionFound: "Nie wykryto tutaj regionu, sprobuj wpisac nazwe jako dodatkowy argument."
|
||||
stopresell-notResell: "Nie mozesz przestac odsprzedawac %region% poniewaz nie jest ustawiony jako do odsprzedania."
|
||||
stopresell-success: "Przestales odsprzedawac %region%."
|
||||
stopresell-noPermission: "Nie masz uprawnien, by przestac odsprzedawac region."
|
||||
stopresell-noPermissionOther: "Nie masz uprawnien, by zmieniac cudze regiony na sprzedane."
|
||||
|
||||
addfriend-help: "/as addfriend <player> [region], jesli nie wpiszesz nazwy uzyje regionu na ktorym stoisz."
|
||||
addfriend-noPermissionOther: "Nie masz uprawnien, by dodac graczy do regionu, ktorego nie posiadasz."
|
||||
addfriend-noPermission: "Nie masz uprawnien, by dodawac graczy dos wojego regionu."
|
||||
addfriend-successOther: "%0% zostal dodany do %1%."
|
||||
addfriend-success: "%0% zostal dodany do %1%."
|
||||
addfriend-alreadyAdded: "%0% juz jest dodany do regionu."
|
||||
addfriend-self: "Dodawanie wlasciciela do regionu jest bez sensu."
|
||||
addfriend-noOwner: "Nie masz uprawnien, by dodawac graczy do regionu bez wlasciciela."
|
||||
addfriend-notVisited: "Nie mozesz dodac %0% poniewaz nie byl on jeszcze na serverze"
|
||||
|
||||
delfriend-help: "/as delfriend <player> [region], jesli nie wpiszesz nazwy uzyje regionu na ktorym stoisz."
|
||||
delfriend-noPermissionOther: "Nie masz uprawnien, by usuwac graczy z nieswoich regionow."
|
||||
delfriend-noPermission: "Nie masz uprawnien, by usunac gracza ze swojego regionu."
|
||||
delfriend-successOther: "%0% zostal usuniety z regionu %1%."
|
||||
delfriend-success: "%0% zostal usuniety z Twojego regionu %1%."
|
||||
delfriend-notAdded: "%0% nie jest dodany do regionu."
|
||||
delfriend-noOwner: "Nie mozesz usuwac graczy z regionu bez wlasciciela."
|
||||
|
||||
linksigns-multipleRegions: "Znaleziono kilka regionow: &7%0%."
|
||||
linksigns-multipleRegionsAdvice: "Kliknij innym razem, by sprobowac ponownie lub uzyj '/as linksigns' by przestac."
|
||||
linksigns-noRegions: "Tam gdzie patrzysz nie wykryto regionow, sprawdz czy region jest zarejestrowany &7(maksymalna odleglosc to 100 blokow)."
|
||||
linksigns-regionFound: "Region %region% zostal znaleziony, teraz kliknij LPM na tabliczke."
|
||||
linksigns-signFound: "Znaleziono tabliczke (%0%, %1%, %2%), teraz popatrz na region i kliknij PPM"
|
||||
linksigns-noSign: "Tam, gdzie patrzysz nie znaleziono tabliczek, sprawdz czy patrzysz w dobrym kierunku &7(maksymalna odleglosc to 100 blokow)."
|
||||
linksigns-alreadyRegistered: "Ta tabliczka jest juz zarejestrowana do regionu %region%, kliknij znowu zeby ustawic inna tabliczke."
|
||||
linksigns-first: "Wszedles w trym podlaczania tabliczek."
|
||||
linksigns-next: "&7Lewy przycisk, by zaznaczyc tabliczke, prawy przycisk, by zaznaczyc region, uzyj /as linksigns by wylaczyc tryb."
|
||||
linksigns-noPermission: "Nie masz uprawnien, by wlaczyc tryb podlaczania tabliczek."
|
||||
linksigns-stopped: "Wyszedles z trybu."
|
||||
|
||||
timeleft-years: "%0% lat"
|
||||
timeleft-months: "%0% miesiecy"
|
||||
timeleft-days: "%0% dni"
|
||||
timeleft-hours: "%0% godzin"
|
||||
timeleft-minutes: "%0% minut"
|
||||
timeleft-second: "%0% sekunda"
|
||||
timeleft-seconds: "%0% sekund"
|
||||
timeleft-ended: "Uplynal"
|
||||
|
||||
greeting-forrent: "%region% moze zostac wynajety za %price% na %duration%."
|
||||
greeting-rented: "%region% jest wynajmowany przez %player% do %until%."
|
||||
greeting-forsale: "%region% moze zostac kupiony za %price%."
|
||||
greeting-bought: "%region% nalezy do %player%."
|
||||
greeting-resale: "%region% moze zostac odkupiony za %resaleprice% od %player%."
|
||||
|
||||
update-playerNotify: "&2Mozliwa jest aktualizacja AreaShop z V%0% do %1%, najnowsza wersja: http://dev.bukkit.org/bukkit-plugins/regionbuyandrent/."
|
||||
@@ -0,0 +1,332 @@
|
||||
# ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
|
||||
# ║ Language file of the AreaShop plugin created by NLThijs48, Github can be found at https://github.com/NLthijs48/AreaShop ║
|
||||
# ║ Language: Chinese (Taiwan), Version: V2.2.0, Percentage translated: 79% ║
|
||||
# ║ 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 ║
|
||||
# ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
|
||||
total-maximum: "你不能租賃或者購買總量超過 %0% 的土地(你已經擁有 %1% 的土地在群組 '%2%')"
|
||||
|
||||
cmd-notValid: "這個指令是無效的, 請使用 '/as help' 查詢更多資訊"
|
||||
cmd-onlyByPlayer: "這個指令只能由玩家執行"
|
||||
cmd-weOnlyByPlayer: "使用WorldEdit小木斧選擇區域只能由玩家來執行, 並指定區域名稱作為額外的參數"
|
||||
cmd-noSelection: "不存在使用WorldEdit小木斧選擇的區域"
|
||||
cmd-noRegionsFound: "在你的選擇區域中並沒有土地被本插件所註冊或紀錄"
|
||||
cmd-noWERegionsFound: "在你的選擇區域中並沒有與WorldEdit小木斧選擇的區域相交"
|
||||
cmd-noRegionsAtLocation: "你的位置並未找到任何土地, 請指定區域名稱作為額外的參數"
|
||||
cmd-moreRegionsAtLocation: "你的位置有超過一個以上的土地, 請指定區域名稱作為額外的參數"
|
||||
cmd-automaticRegionOnlyByPlayer: "只可能由玩家來執行自動確認土地的行為,請指定區域名稱作為額外的參數"
|
||||
|
||||
help-header: "幫助頁面,你可以執行的指令"
|
||||
help-alias: "指令簡寫: /areashop, /as"
|
||||
help-help: "&6/as help &7-&r 顯示幫助頁面"
|
||||
help-info: "&6/as info &7-&r 當前土地的資訊"
|
||||
help-rent: "&6/as rent &7-&r 租土地或延展你的租期"
|
||||
help-buy: "&6/as buy &7-&r 購買該土地"
|
||||
help-unrent: "&6/as unrent &7-&r 取消該土地租賃"
|
||||
help-unrentOwn: "&6/as unrent &7-&r 取消你的土地租賃"
|
||||
help-sell: "&6/as sell &7-&r 出售該土地"
|
||||
help-sellOwn: "&6/as sell &7-&r 出售你的土地"
|
||||
help-setrestore: "&6/as setrestore &7-&r 設定恢復開/關,並選擇文件"
|
||||
help-setprice: "&6/as setprice &7-&r 修改土地的價錢"
|
||||
help-setduration: "&6/as setduration &7-&r 修改該出租土地的租期"
|
||||
help-teleport: "&6/as tp &7-&r 傳送到你購買/租賃的土地"
|
||||
help-teleportAll: "&6/as tp &7-&r 傳送到該購買/租賃的土地"
|
||||
help-setteleport: "&6/as settp &7-&r 設定你購買/租賃土地的傳送位置"
|
||||
help-setteleportAll: "&6/as settp &7-&r 設定該土地的傳送位置"
|
||||
help-find: "&6/as find &7-&r 尋找未被購買/租賃的土地"
|
||||
help-groupadd: "&6/as groupadd &7-&r 增加一個土地到群組"
|
||||
help-groupdel: "&6/as groupdel &7-&r 從群組中移除一個土地"
|
||||
help-grouplist: "&6/as grouplist &7-&r 顯示所有已註冊的群組"
|
||||
help-groupinfo: "&6/as groupinfo &7-&r 顯示該群組資訊"
|
||||
help-schemevent: "&6/as schemevent &7-&r 為該土地觸發schematic"
|
||||
help-add: "&6/as add &7-&r 註冊一個用來出售或出租的土地"
|
||||
help-del: "&6/as del &7-&r 刪除一個已註冊的土地"
|
||||
help-addsign: "&6/as addsign &7-&r 新增告示牌到現存的土地"
|
||||
help-delsign: "&6/as delsign &7-&r 刪除你準心對準的告示牌"
|
||||
help-me: "&6/as me &7-&r 檢查你所擁有的土地(包括到期土地)"
|
||||
help-setowner: "&6/as setowner &7-&r 設定土地擁有人或延展租期"
|
||||
help-resell: "&6/as resell &7-&r 將你所擁有土地之一設定為再出售"
|
||||
help-resellAll: "&6/as resell &7-&r 將該土地設定為再出售"
|
||||
help-stopResell: "&6/as stopresell &7-&r 將你所擁有土地之一設定為已出售"
|
||||
help-stopResellAll: "&6/as stopresell &7-&r 將土地設定為已出售"
|
||||
help-addFriend: "&6/as addfriend &7-&r 新增朋友到你的土地"
|
||||
help-addFriendAll: "&6/as addfriend &7-&r 新增朋友到該土地"
|
||||
help-delFriend: "&6/as delfriend &7-&r 從你的土地移除朋友"
|
||||
help-delFriendAll: "&6/as delfriend &7-&r 從該土地移除朋友"
|
||||
|
||||
rent-help: "/as rent [regionname],若你不指定土地名稱,則預設為你所站立的土地"
|
||||
rent-noPermission: "你並沒有租賃土地的權限"
|
||||
rent-maximum: "你不能租總量超過%0%的土地 (你已經擁有%1%的土地在群組 '%2%')"
|
||||
rent-payError: "交易發生問題,請稍後再嘗試"
|
||||
rent-rented: "你已成功租賃%0%直到 %1%"
|
||||
rent-extended: "你已經延展你的租期%0%直到%1%"
|
||||
rent-extend: "你可以右鍵點擊告示牌來延展你的租期或者使用 /as rent"
|
||||
rent-lowMoneyExtend: "你沒有足夠的錢來延展你的租期(你擁有%0%而你還需要%1%)"
|
||||
rent-lowMoneyRent: "你沒有足夠的錢租賃該土地(你擁有%0%而你還需要%1%)"
|
||||
rent-someoneElse: "其他人已經租賃該土地"
|
||||
rent-notRentable: "該土地不能租賃"
|
||||
rent-maxExtends: "你已經無法再延展你的租期了(最大上限次數為%0%次), 然而在租期過後你可以再次租賃該土地"
|
||||
rent-maxRentTime: "你無法提前租賃該土地,最大上限時間為 %0% 分鐘,而你目前已經租賃該土地 %1% 分鐘"
|
||||
rent-restrictedToWorld: "你必須要在 '%0%'世界才能租賃該土地(你目前正在 '%1%')"
|
||||
rent-restrictedToRegion: "你必須要在 '%0%'才能租賃該土地"
|
||||
rent-expireWarning: "你的土地 %region% 還剩下%timeleft% ,如果你還想保留該土地請延展租期"
|
||||
|
||||
buy-help: "/as buy [regionname],若你不指定土地名稱,則預設為你所站立的土地"
|
||||
buy-noPermission: "你並沒有購買土地的權限"
|
||||
buy-notBuyable: "該土地不能購買"
|
||||
buy-maximum: "你不能購買超過 %0% 的土地(你已經擁有 %1% 的土地在群組 '%2%')"
|
||||
buy-payError: "交易發生問題,請稍後再嘗試"
|
||||
buy-succes: "你已成功購買 %0%"
|
||||
buy-successResale: "你已成功自%1%購買 %0%"
|
||||
buy-successSeller: "你的土地 %0% 已經出售給 %1% ,共 %2%"
|
||||
buy-lowMoney: "你沒有足夠的錢購買該土地(你擁有 %0% 而你還需要 %1%)"
|
||||
buy-yours: "你已經擁有該土地了"
|
||||
buy-someoneElse: "其他人已經購買該土地"
|
||||
buy-restrictedToWorld: "你必須要在 '%0%'世界才能購買該土地 (你目前正在 '%1%')"
|
||||
buy-restrictedToRegion: "你必須要在 '%0%'才能購買該土地"
|
||||
|
||||
unrent-help: "/as unrent [regionname],若你不指定土地名稱,則預設為你所站立的土地"
|
||||
unrent-noPermission: "你並沒有取消出租土地的權限"
|
||||
unrent-noPermissionOther: "你並沒有取消出租其他土地的權限"
|
||||
unrent-unrented: "你的土地已經被取消出租"
|
||||
unrent-other: "玩家%0%土地已經被取消出租"
|
||||
unrent-expired: "你所租賃的%0%已經過期"
|
||||
|
||||
sell-help: "/as sell [regionname],若你不指定土地名稱,則預設為你所站立的土地"
|
||||
sell-sold: "該土地已被出售,玩家 %0%"
|
||||
sell-soldYours: "你的土地已經被購買"
|
||||
sell-noPermission: "你並沒有出售土地的權限"
|
||||
sell-noPermissionOther: "你並沒有出售其他土地的權限"
|
||||
|
||||
info-noPermission: "你沒有權限查詢該土地資訊"
|
||||
info-all-rents: "已註冊為出租土地:&7%0%"
|
||||
info-all-noRents: "沒有任何註冊的出租土地"
|
||||
info-all-buys: "已註冊為出售土地:&7%0%"
|
||||
info-all-noBuys: "沒有任何註冊的出售土地"
|
||||
info-rented: "租賃土地:&7%0%"
|
||||
info-noRented: "沒有已租的土地"
|
||||
info-unrented: "未出租的土地:&7%0%"
|
||||
info-noUnrented: "所有土地已出租"
|
||||
info-sold: "已出售土地:&7%0%"
|
||||
info-noSold: "沒有已售的土地"
|
||||
info-forsale: "出售的土地:&7%0%"
|
||||
info-noForsale: "所有土地已售完"
|
||||
info-playerHelp: "/as info player <name>"
|
||||
info-playerRents: "土地已出租給%0%: &7%1%"
|
||||
info-playerNoRents: "%0%並沒有租土地"
|
||||
info-playerBuys: "土地已出售給 %0%: &7%1%"
|
||||
info-playerNoBuys: "%0% 並沒有買土地"
|
||||
info-regionHelp: "/as info region [name],若你不指定土地名稱,則預設為你所站立的土地"
|
||||
info-regionHeaderRent: "&2資訊關於 %region%:"
|
||||
info-regionHeaderBuy: "&2資訊關於 %region%:"
|
||||
info-regionRented: "&2&l►&r 出租給 %player% until: &7%until%"
|
||||
info-regionBought: "&2&l►&r 出售給 %player%"
|
||||
info-regionExtending: "&2&l►&r 延展租期價格: &7%price% per %duration%"
|
||||
info-regionCanBeRented: "&2&l►&r 租金: &7%price% per %duration%"
|
||||
info-regionCanBeBought: "&2&l►&r 購買價格: &7%price%"
|
||||
info-regionFriends: "&2&l►&r 增加朋友: &7%friends%"
|
||||
info-regionMoneyBackBuy: "&2&l►&r 再售的回收價格: &7%moneyback% (%moneybackpercent%% 價格)"
|
||||
info-regionMoneyBackRent: "&2&l►&r 取消租賃的回收價格: &7%moneyback% (%moneybackpercent%% 剩餘的出租時間)"
|
||||
info-regionNoExtending: "&2&l►&r 租期無法延展"
|
||||
info-regionMaxRentTime: "&2&l►&r 提前租賃: &7%maxrenttime% at 最大數目"
|
||||
info-regionNoTeleport: "&2&l►&r 傳送地點未設定%0%"
|
||||
info-regionTeleportHint: "&7(使用 '/as settp' 到一個更好的位置)"
|
||||
info-regionTeleportAt: "&2&l►&r 傳送地點設定在: &7(%0%, %1%, %2%, %3%, pitch:%4%, yaw:%5%)"
|
||||
info-regionSigns: "&2&l►&r 有連結的告示牌: &7%0%"
|
||||
info-regionSignLocation: "&7(%0%, %1%, %2%, %3%)&r"
|
||||
info-regionGroups: "&2&l►&r 登記群組: &7%0%"
|
||||
info-regionInactiveUnrent: "&2&l►&r 玩家閒置而自動取消租賃的時間為: &7%inactivetime% of"
|
||||
info-regionInactiveSell: "&2&l►&r 玩家閒置而自動出售的時間為: &7%inactivetime% of"
|
||||
info-regionRestoringRent: "&2&l►&r 重製啟用 &7(土地將被重新設為未被租賃)%0%"
|
||||
info-regionRestoringBuy: "&2&l►&r 重製啟用 &7(土地將被重新設為出售)%0%"
|
||||
info-regionRestoringProfile: "(資料: %0%)"
|
||||
info-regionNoSign: "該土地沒有被註冊的告示牌"
|
||||
info-regionPriceDuration: "價格:每一個 %1% 為&7%0%"
|
||||
info-regionPrice: "價格: &7%0%"
|
||||
info-regionRestore: "重製啟用: &7%0%"
|
||||
info-regionRestoreProfile: "重製資料:&7%0%"
|
||||
info-regionTPLocation: "傳送地點: &7World=%0%, X=%1%, Y=%2%, Z=%3%, Pitch=%4%, Yaw=%5%"
|
||||
info-regionNoTP: "沒有設定的傳送地點"
|
||||
|
||||
setrestore-help: "/as setrestore <region> <true|false|general> [profile]"
|
||||
setrestore-noPermission: "你沒有權限修改重製設定"
|
||||
setrestore-invalidSetting: "'%0%' 不是有效的狀態, 必須為 true, false 或 general"
|
||||
setrestore-success: "成功設定為重製設定,由 %0% 至 '%1%'"
|
||||
setrestore-successProfile: "成功設定重製由 %0% 至 '%1%' 而資料至 '%2%'"
|
||||
|
||||
setprice-noPermission: "你沒有權限修改土地價格"
|
||||
setprice-help: "/as setprice <price> [region], 若你不指定土地名稱,則預設為你所站立的土地"
|
||||
setprice-wrongPrice: "'%0%' 不是有效的價格"
|
||||
setprice-successRent: "土地價格由 %0% 修改至 %1% ,個別價格為 %2%"
|
||||
setprice-successBuy: "土地價格由 %0% 修改至 %1%"
|
||||
|
||||
setduration-noPermission: "你沒有權限修改租期"
|
||||
setduration-help: "/as setduration <amount> <identifier> [region], 若你不指定土地名稱,則預設為你所站立的土地"
|
||||
setduration-wrongAmount: "'%0%' 不是有效的總數, 請使用完整的數目"
|
||||
setduration-wrongFormat: "'%0%' 不是適當的時間格式, 請查詢官網"
|
||||
setduration-success: "土地租期由 %0% 修改至 '%1%'"
|
||||
|
||||
setup-noRegion: "你並未特定土地名稱在第二行"
|
||||
setup-wrongRegion: "你所指定的土地名稱並不存在"
|
||||
setup-noDuration: "你並未指定該土地出租期間, 請打在告示牌第三行"
|
||||
setup-wrongDuration: "你所指定的土地出租期間不是適當的時間格式, 例子: 1 day是一天"
|
||||
setup-noPrice: "你第四行並未指定該土地的價格"
|
||||
setup-rentSuccess: "出租土地 %0% 已正確設置"
|
||||
setup-buySuccess: "出售土地 %0% 已正確設置"
|
||||
setup-couldNotDetect: "已超過一個以上的區域, 為避免重複請在第二行指定一個土地 (2個區域被發現: %0% 及 %1%)"
|
||||
|
||||
teleport-help: "/as tp <region> [sign]"
|
||||
teleport-noPermission: "你沒有權限傳送到你的土地"
|
||||
teleport-noPermissionOther: "你沒有權限傳送到不屬於你的土地"
|
||||
teleport-noPermissionSign: "你沒有權限傳送到你的土地上的告示牌"
|
||||
teleport-noPermissionOtherSign: "你沒有權限傳送到不屬於你的土地上的告示牌"
|
||||
teleport-success: "你傳送至 %0%"
|
||||
teleport-successSign: "你傳送到告示牌 %0%"
|
||||
teleport-noSafe: "土地 %0%沒有安全的傳送地點, 沒有找到其餘傳送點或已超過最大的嘗試次數 (%1%/%2%)"
|
||||
|
||||
setteleport-help: "/as settp [region] [reset], 若你不指定土地名稱,則預設為你所站立的土地"
|
||||
setteleport-noPermission: "你沒有權限設置傳送地點"
|
||||
setteleport-noPermissionOther: "你沒有權限設置不屬於你的土地的傳送地點"
|
||||
setteleport-success: "傳送地點 %0% 已設置"
|
||||
setteleport-notInside: "傳送地點必須在土地範圍內"
|
||||
setteleport-reset: "傳送地點 %0% 已重新設置"
|
||||
|
||||
find-help: "/as find <buy|rent> [maxprice] [group]"
|
||||
find-noPermission: "你沒有權限搜尋土地並傳送到該土地"
|
||||
find-success: "已搜尋到 %0% 土地: %1%, 並且依你的帳戶金額與最高金額: %2%%3%"
|
||||
find-successMax: "已搜尋到 %0% 土地: %1%, 並且依最高金額 %2%%3%"
|
||||
find-wrongMaxPrice: "你特定的最高金額並非有效數目: %0%"
|
||||
find-wrongGroup: "你特定的群組並未存在: %0%"
|
||||
find-noneFound: "依你的帳戶金額與最高金額,沒有 %0% 土地符合你的搜尋條件: %1%%2%"
|
||||
find-noneFoundMax: "依最高金額,沒有 %0% 土地符合你的搜尋條件, 最高金額%1%%2%"
|
||||
find-onlyInGroup: ", 限搜尋該群組的土地: %0%"
|
||||
|
||||
groupadd-help: "/as groupadd <group> [region], 若你不指定土地名稱,則預設為小木斧所選擇的土地"
|
||||
groupadd-noPermission: "你沒有權限設置土地到群組"
|
||||
groupadd-noRegion: "該指定土地並未被註冊: %0%"
|
||||
groupadd-success: "土地 %0% 已被加入群組 '%1%', 該群組目前擁有%2% 土地(s)"
|
||||
groupadd-failed: "土地 %0% 已經是群組的土地 '%1%'"
|
||||
groupadd-weSuccess: "加入群組 %0%: &7%1%"
|
||||
groupadd-weFailed: "已經被加入群組 %0%: &7%1%"
|
||||
|
||||
groupdel-help: "/as groupdel <group> [region], 若你不指定土地名稱,則預設為小木斧所選擇的土地"
|
||||
groupdel-noPermission: "你沒有權限設置土地移出群組"
|
||||
groupdel-noRegion: "該指定土地並未被註冊: %0%"
|
||||
groupdel-success: "土地 %0% 已被移出群組 '%1%', 該群組目前擁有 %2% 土地(s)"
|
||||
groupdel-failed: "土地 %0% 不是群組的土地 '%1%'"
|
||||
groupdel-weSuccess: "被移出群組 %0%: &7%1%"
|
||||
groupdel-weFailed: "並不在群組 %0% anyway: &7%1%"
|
||||
|
||||
grouplist-noPermission: "你沒有權限查看註冊群組"
|
||||
grouplist-noGroups: "目前並無任何註冊群組"
|
||||
grouplist-success: "以下為註冊群組: &7%0%"
|
||||
|
||||
groupinfo-help: "/as groupinfo <group>"
|
||||
groupinfo-noPermission: "你沒有權限查看群組資訊"
|
||||
groupinfo-noGroup: "沒有註冊群組名稱為 '%0%', 使用 /as grouplist 查看群組列表"
|
||||
groupinfo-members: "以下土地為該群組 %0%所有: &7%1%"
|
||||
groupinfo-noMembers: "群組 %0% 沒有任何土地"
|
||||
|
||||
schemevent-help: "/as schemevent <region> <created|deleted|rented|unrented|bought|sold>"
|
||||
schemevent-noRegion: "該指定土地並未被註冊: %0%"
|
||||
schemevent-wrongEvent: "該特定事件 '%0%' 並不存在, 請使用其中之一: &7%1%"
|
||||
schemevent-success: "事件 '%0%' 已成功在該土地觸發 %1%"
|
||||
schemevent-noPermission: "你沒有權限觸發schematic"
|
||||
|
||||
add-help: "/as add <rent|buy> [region] [world]"
|
||||
add-noPermission: "你沒有權限新增土地"
|
||||
add-success: "新增為 %0%: &7%1%"
|
||||
add-failed: "已經註冊: &7%0%"
|
||||
add-specifyWorld: "當使用console操作時請指定該世界土地"
|
||||
add-incorrectWorld: "世界 '%0%' 搜尋失敗, 請再嘗試一次(依照個案)"
|
||||
add-noRegion: "土地 '%0%' 並不存在該世界"
|
||||
|
||||
del-noPermission: "你沒有權限移除土地"
|
||||
del-success: "移除土地: &7%0%"
|
||||
del-failed: "沒有權限移除土地或未被註冊: &7%0%"
|
||||
|
||||
addsign-help: "/as addsign [region] [profile]"
|
||||
addsign-noSign: "你並沒有注視一個告示牌"
|
||||
addsign-noRegion: "土地 '%0%' 並未被搜尋到"
|
||||
addsign-noRegions: "該告示牌的位置並未有任何土地存在"
|
||||
addsign-couldNotDetect: "超過一個以上的區域在告示牌的位置, 為避免重複請指定一個土地 (2個的區域被發現: %0% and %1%)"
|
||||
addsign-couldNotDetectSign: "超過一個以上的區域在告示牌的位置, 為避免重複請在第二行指定一個土地 (2個的區域被發現: %0% and %1%)"
|
||||
addsign-wrongProfile: "指定資料並不存在, 請使用以下之一 (查詢你的config檔案): &7%0%"
|
||||
addsign-alreadyRegistered: "該告示牌已經被註冊在土地 %0%"
|
||||
addsign-noPermission: "你沒有權限新增告示牌"
|
||||
|
||||
delsign-noSign: "你並沒有注視一個告示牌"
|
||||
delsign-noPermission: "你沒有權限移除告示牌"
|
||||
delsign-noRegion: "該告示牌並不屬於本插件的土地"
|
||||
delsign-success: "該告示牌已經從土地 %0%被移除"
|
||||
|
||||
me-noPermission: "你沒有權限查詢你所擁有土地"
|
||||
me-notAPlayer: "你並不能擁有土地,因為你並非玩家"
|
||||
me-noRentRegions: "你並未租賃任何出租土地"
|
||||
me-noBuyRegions: "你並未購買任何出售土地"
|
||||
me-rentRegions: "你所租賃的土地:"
|
||||
me-buyRegions: "你所購買的土地"
|
||||
me-rentLine: "&2&l►&r %region% until %until% &7(%timeleft% 剩餘時間)"
|
||||
me-buyLine: "&2&l►&r %region%"
|
||||
me-friendLine: "&2&l►&r %region% &7(所有人: %player%)"
|
||||
|
||||
setowner-help: "/as setowner <player> [region], 若你不指定土地名稱,則預設為你所站立的土地"
|
||||
setowner-noPermission: "你沒有權限設置土地擁有人"
|
||||
setowner-noPermissionRent: "你沒有權限設置出租土地擁有人"
|
||||
setowner-noPermissionBuy: "你沒有權限設置出售土地擁有人"
|
||||
setowner-notRegistered: "你指定的土地未被註冊, 因此不能設置土地擁有人"
|
||||
setowner-noPlayer: "無法取得指定玩家的UUID: %0%"
|
||||
setowner-succesRent: "%region% s擁有人成功改為 %player%, 租期直到 %until% (%timeleft% 剩餘時間)"
|
||||
setowner-succesRentExtend: "擁有人已為 %player%, 租期延長至 '%duration%', 現在租期到 %until% (%timeleft% 剩餘時間)"
|
||||
setowner-succesBuy: "%region% s擁有人成功改為 %player%"
|
||||
|
||||
resell-help: "/as resell <price> [region], 若你不指定土地名稱,則預設為你所站立的土地"
|
||||
resell-wrongPrice: "'%0%' 並不是有效價格數目"
|
||||
resell-noRegionFound: "你的位置並不存在任何土地, 請特定該土地名稱"
|
||||
resell-notBought: "你無法重新出售 %region% ,因為它並未被買走"
|
||||
resell-success: "%region% i成功的重新出售,價格為 %resellprice%"
|
||||
resell-noPermission: "你沒有權限設置你的土地重新出售"
|
||||
resell-noPermissionOther: "你沒有權限設置土地重新出售"
|
||||
|
||||
stopresell-help: "/as stopresell [region], 若你不指定土地名稱,則預設為你所站立的土地"
|
||||
stopresell-noRegionFound: "你的位置並不存在任何土地, 請特定該土地名稱"
|
||||
stopresell-notResell: "你無法停止重新出售土地 %region% 因為它並未重新出售"
|
||||
stopresell-success: "%region% 成功的設置為出售中"
|
||||
stopresell-noPermission: "你沒有權限設置你的土地為出售"
|
||||
stopresell-noPermissionOther: "你沒有權限設置土地為出售"
|
||||
|
||||
addfriend-help: "/as addfriend <player> [region], 若你不指定土地名稱,則預設為你所站立的土地"
|
||||
addfriend-noPermissionOther: "你沒有權限新增朋友到不屬於你的土地上"
|
||||
addfriend-noPermission: "你沒有權限新增朋友到屬於你的土地上"
|
||||
addfriend-successOther: "%0% 已經成功被新增為 %1%土地的朋友名單"
|
||||
addfriend-success: "%0% 已經成功被新增為你的土地 %1%的朋友名單"
|
||||
addfriend-alreadyAdded: "%0% 已經被新增到你的土地的朋友名單了"
|
||||
addfriend-self: "新增本土地擁有人到朋友名單是無意義"
|
||||
addfriend-noOwner: "沒有擁有人,你不能新增朋友到朋友名單"
|
||||
|
||||
delfriend-help: "/as delfriend <player> [region], 若你不指定土地名稱,則預設為你所站立的土地"
|
||||
delfriend-noPermissionOther: "你沒有權限在不屬於你的土地上移除其朋友"
|
||||
delfriend-noPermission: "你沒有權限在屬於你的土地上移除朋友"
|
||||
delfriend-successOther: "%0% 已經成功被移除,土地 %1%"
|
||||
delfriend-success: "%0% 已經成功被移除出你的土地 %1%的朋友名單"
|
||||
delfriend-notAdded: "%0% 從來沒被加入該土地朋友名單"
|
||||
delfriend-noOwner: "沒有擁有人,你不能移除朋友"
|
||||
|
||||
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% c可以被租賃,價格為 %price% p期間為 %duration%"
|
||||
greeting-rented: "%region% i已經租給 %player% u直到 %until%"
|
||||
greeting-forsale: "%region% c可以購買,價格為 %price%"
|
||||
greeting-bought: "%region% i已經賣給 %player%"
|
||||
greeting-resale: "%region% c可以購買,價格為 %resaleprice% f賣家為 %player%"
|
||||
@@ -0,0 +1,247 @@
|
||||
name: AreaShop
|
||||
main: nl.evolutioncoding.areashop.AreaShop
|
||||
version: ${project.version}
|
||||
description: "Selling and renting WorldGuard regions to your players, highly configurable."
|
||||
depend: [Vault, WorldGuard, WorldEdit]
|
||||
softdepend: [Multiverse-Core]
|
||||
author: NLThijs48
|
||||
website: http://dev.bukkit.org/bukkit-plugins/regionbuyandrent/
|
||||
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.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.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.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
|
||||
@@ -1,448 +0,0 @@
|
||||
package nl.evolutioncoding.AreaShop;
|
||||
|
||||
import java.util.ArrayList;
|
||||
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.plugin.Plugin;
|
||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
|
||||
|
||||
/**
|
||||
* Main class for the AreaShop plugin
|
||||
* @author NLThijs48
|
||||
*/
|
||||
public final class AreaShop extends JavaPlugin {
|
||||
/* General variables */
|
||||
private WorldGuardPlugin worldGuard = null;
|
||||
private Economy economy = null;
|
||||
private ShopManager shopManager = null;
|
||||
private LanguageManager languageManager = null;
|
||||
private boolean configOk = false;
|
||||
private boolean debug = false;
|
||||
private String chatprefix = null;
|
||||
|
||||
/* Folder where the language files will be stored */
|
||||
public final String languageFolder = "lang";
|
||||
|
||||
/* Euro tag for in the config */
|
||||
public final String currencyEuro = "%euro%";
|
||||
|
||||
/* Keys for adding things to the hashmap */
|
||||
public final String keyWorld = "world";
|
||||
public final String keyX = "x";
|
||||
public final String keyY = "y";
|
||||
public final String keyZ = "z";
|
||||
public final String keyDuration = "duration";
|
||||
public final String keyPrice = "price";
|
||||
public final String keyPlayer = "player";
|
||||
public final String keyRentedUntil = "rented";
|
||||
public final String keyName = "name";
|
||||
|
||||
/* Keys for replacing parts of flags */
|
||||
public final String tagPlayerName = "%player%";
|
||||
public final String tagRegionName = "%region%";
|
||||
public final String tagPrice = "%price%";
|
||||
public final String tagDuration = "%duration%";
|
||||
public final String tagRentedUntil = "%until%";
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Called on start or reload of the server
|
||||
*/
|
||||
public void onEnable(){
|
||||
boolean error = false;
|
||||
|
||||
/* Save a copy of the default config.yml if one is not present */
|
||||
this.saveDefaultConfig();
|
||||
|
||||
/* Check the config, loads default if errors */
|
||||
configOk = this.checkConfig();
|
||||
|
||||
/* 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 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 */
|
||||
shopManager = new ShopManager(this);
|
||||
error = error & !shopManager.loadRents();
|
||||
shopManager.checkRents();
|
||||
error = error & !shopManager.loadBuys();
|
||||
|
||||
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 RightClickListener(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 */
|
||||
getCommand("AreaShop").setExecutor(new ShopCommands(this));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called on shutdown or reload of the server
|
||||
*/
|
||||
public void onDisable() {
|
||||
|
||||
/* set variables to null to prevent memory leaks */
|
||||
worldGuard = null;
|
||||
economy = null;
|
||||
shopManager = null;
|
||||
languageManager = null;
|
||||
configOk = false;
|
||||
debug = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to get the WorldGuard plugin
|
||||
* @return WorldGuardPlugin
|
||||
*/
|
||||
public WorldGuardPlugin getWorldGuard() {
|
||||
return worldGuard;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to get the WorldGuard plugin
|
||||
* @return WorldGuardPlugin
|
||||
*/
|
||||
public LanguageManager getLanguageManager() {
|
||||
return languageManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to get the Vault plugin
|
||||
* @return Economy
|
||||
*/
|
||||
public Economy getEconomy() {
|
||||
return economy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the ShopManager
|
||||
* @return The shopManager
|
||||
*/
|
||||
public ShopManager getShopManager() {
|
||||
return shopManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 params The parameters to inject into the message string
|
||||
*/
|
||||
public void message(Object target, String key, 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(target instanceof Player) {
|
||||
((Player)target).sendMessage(this.fixColors(chatprefix) + langString);
|
||||
} else if(target instanceof CommandSender) {
|
||||
((CommandSender)target).sendMessage(langString);
|
||||
}
|
||||
else if(target instanceof Logger) {
|
||||
((Logger)target).info(langString);
|
||||
} else {
|
||||
this.getLogger().info("Could not send message, target is wrong: " + langString);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the currency character, fixes problems with euro character acting weird
|
||||
* @return Currency character
|
||||
*/
|
||||
public String getCurrencyCharacter() {
|
||||
String result = this.config().getString("moneyCharacter");
|
||||
result = result.replace(currencyEuro, "\u20ac");
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows the help page for the player
|
||||
* @param player The player to show the help to
|
||||
*/
|
||||
public void showHelp(CommandSender target) {
|
||||
/* Set up the list of messages to be sent */
|
||||
ArrayList<String> messages = new ArrayList<String>();
|
||||
messages.add(this.config().getString("chatPrefix") + languageManager.getLang("help-header"));
|
||||
messages.add(this.config().getString("chatPrefix") + languageManager.getLang("help-alias"));
|
||||
if(target.hasPermission("areashop.help")) {
|
||||
messages.add(languageManager.getLang("help-help"));
|
||||
}
|
||||
if(target.hasPermission("areashop.info")) {
|
||||
messages.add(languageManager.getLang("help-info"));
|
||||
}
|
||||
if(target.hasPermission("areashop.rent")) {
|
||||
messages.add(languageManager.getLang("help-rent"));
|
||||
}
|
||||
if(target.hasPermission("areashop.buy")) {
|
||||
messages.add(languageManager.getLang("help-buy"));
|
||||
}
|
||||
if(target.hasPermission("areashop.unrent")) {
|
||||
messages.add(languageManager.getLang("help-unrent"));
|
||||
} else if(target.hasPermission("areashop.unrentown")) {
|
||||
messages.add(languageManager.getLang("help-unrentOwn"));
|
||||
}
|
||||
if(target.hasPermission("areashop.sell")) {
|
||||
messages.add(languageManager.getLang("help-sell"));
|
||||
} else if(target.hasPermission("areashop.sellown")) {
|
||||
messages.add(languageManager.getLang("help-sellOwn"));
|
||||
}
|
||||
if(target.hasPermission("areashop.updaterentsigns")) {
|
||||
messages.add(languageManager.getLang("help-updaterentsigns"));
|
||||
}
|
||||
if(target.hasPermission("areashop.updatebuysigns")) {
|
||||
messages.add(languageManager.getLang("help-updatebuysigns"));
|
||||
}
|
||||
if(target.hasPermission("areashop.updaterentregions")) {
|
||||
messages.add(languageManager.getLang("help-updaterentregions"));
|
||||
}
|
||||
if(target.hasPermission("areashop.updatebuyregions")) {
|
||||
messages.add(languageManager.getLang("help-updatebuyregions"));
|
||||
}
|
||||
if(target.hasPermission("areashop.reload")) {
|
||||
messages.add(languageManager.getLang("help-reload"));
|
||||
}
|
||||
|
||||
/* Send them all */
|
||||
for(int i=0; i<messages.size(); i++) {
|
||||
target.sendMessage(this.fixColors(messages.get(i)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Checks the config for errors, loads default config if they occur
|
||||
*/
|
||||
public boolean checkConfig() {
|
||||
int error = 0;
|
||||
debug = this.getConfig().getString("debug").equalsIgnoreCase("true");
|
||||
|
||||
/* GENERAL */
|
||||
String chatPrefix = this.getConfig().getString("chatPrefix");
|
||||
if (chatPrefix.length() == 0) {
|
||||
this.getLogger().info("Config-Error: chatPrefix has length zero");
|
||||
error++;
|
||||
}
|
||||
String moneyCharacter = this.getCurrencyCharacter();
|
||||
if (moneyCharacter.length() > 14) {
|
||||
this.getLogger().info("Config-Error: moneyCharacter is longer than 14 characters");
|
||||
error++;
|
||||
}
|
||||
String maximumTotal = this.getConfig().getString("maximumTotal");
|
||||
try {
|
||||
int maximumTotalInt = Integer.parseInt(maximumTotal);
|
||||
if(maximumTotalInt < -1) {
|
||||
this.getLogger().info("Config-Error: maximumTotal must be -1 or higher");
|
||||
error++;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
this.getLogger().info("Config-Error: maximumTotal is not a valid number");
|
||||
error++;
|
||||
}
|
||||
|
||||
/* RENTING */
|
||||
String rentSign = this.getConfig().getString("rentSign");
|
||||
if (rentSign.length() > 15) {
|
||||
this.getLogger().info("Config-Error: rentSign is too long, maximum length is 15 characters");
|
||||
error++;
|
||||
}
|
||||
String signRentable = this.getConfig().getString("signRentable");
|
||||
if (signRentable.length() > 15) {
|
||||
this.getLogger().info("Config-Error: signRentable is too long, maximum length is 15 characters");
|
||||
error++;
|
||||
}
|
||||
String signRented = this.getConfig().getString("signRented");
|
||||
if (signRented.length() > 15) {
|
||||
this.getLogger().info("Config-Error: signRented is too long, maximum length is 15 characters");
|
||||
error++;
|
||||
}
|
||||
String maximumRents = this.getConfig().getString("maximumRents");
|
||||
try {
|
||||
int maximumRentsInt = Integer.parseInt(maximumRents);
|
||||
if(maximumRentsInt < -1) {
|
||||
this.getLogger().info("Config-Error: maximumRents must be -1 or higher");
|
||||
error++;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
this.getLogger().info("Config-Error: maximumRents is not a valid number");
|
||||
error++;
|
||||
}
|
||||
String rentMoneyBack = this.getConfig().getString("rentMoneyBack");
|
||||
try {
|
||||
int rentMoneyBackInt = Integer.parseInt(rentMoneyBack);
|
||||
if(rentMoneyBackInt < 0 || rentMoneyBackInt > 100) {
|
||||
this.getLogger().info("Config-Error: rentMoneyBack must be between 0 and 100");
|
||||
error++;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
this.getLogger().info("Config-Error: rentMoneyBack is not a valid number");
|
||||
error++;
|
||||
}
|
||||
String checkDelay = this.getConfig().getString("checkDelay");
|
||||
try {
|
||||
int checkDelayInt = Integer.parseInt(checkDelay);
|
||||
if(checkDelayInt < 1) {
|
||||
this.getLogger().info("Config-Error: checkDelay can't be below 1");
|
||||
error++;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
this.getLogger().info("Config-Error: checkDelay is not a valid number");
|
||||
error++;
|
||||
}
|
||||
|
||||
/* BUYING */
|
||||
String buySign = this.getConfig().getString("buySign");
|
||||
if (buySign.length() > 15) {
|
||||
this.getLogger().info("Config-Error: buySign is too long, maximum length is 15 characters");
|
||||
error++;
|
||||
}
|
||||
String signBuyable = this.getConfig().getString("signBuyable");
|
||||
if (signBuyable.length() > 15) {
|
||||
this.getLogger().info("Config-Error: signBuyable is too long, maximum length is 15 characters");
|
||||
error++;
|
||||
}
|
||||
String signBuyed = this.getConfig().getString("signBuyed");
|
||||
if (signBuyed.length() > 15) {
|
||||
this.getLogger().info("Config-Error: signBuyed is too long, maximum length is 15 characters");
|
||||
error++;
|
||||
}
|
||||
String maximumBuys = this.getConfig().getString("maximumBuys");
|
||||
try {
|
||||
int maximumBuysInt = Integer.parseInt(maximumBuys);
|
||||
if(maximumBuysInt < -1) {
|
||||
this.getLogger().info("Config-Error: maximumBuys must be -1 or higher");
|
||||
error++;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
this.getLogger().info("Config-Error: maximumBuys is not a valid number");
|
||||
error++;
|
||||
}
|
||||
String buyMoneyBack = this.getConfig().getString("buyMoneyBack");
|
||||
try {
|
||||
int buyMoneyBackInt = Integer.parseInt(buyMoneyBack);
|
||||
if(buyMoneyBackInt < 0 || buyMoneyBackInt > 100) {
|
||||
this.getLogger().info("Config-Error: buyMoneyBack must be between 0 and 100");
|
||||
error++;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
this.getLogger().info("Config-Error: buyMoneyBack is not a valid number");
|
||||
error++;
|
||||
}
|
||||
|
||||
/* Load default config if errors have occurred */
|
||||
if (error > 0) {
|
||||
this.getLogger().info("The plugin has " + error + " error(s) in the config, default config will be used");
|
||||
}
|
||||
|
||||
/* return true if no errors, false if there are errors */
|
||||
return (error == 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends an debug message to the console
|
||||
* @param message The message that should be printed to the console
|
||||
*/
|
||||
public void debug(String message) {
|
||||
if(this.debug) {
|
||||
this.getLogger().info("Debug: " + message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reload the config of the plugin
|
||||
*/
|
||||
public void reload() {
|
||||
this.saveDefaultConfig();
|
||||
this.reloadConfig();
|
||||
configOk = this.checkConfig();
|
||||
chatprefix = this.config().getString("chatPrefix");
|
||||
languageManager = new LanguageManager(this);
|
||||
shopManager.checkRents();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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.getShopManager().checkRents();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
package nl.evolutioncoding.AreaShop;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
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.Action;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
|
||||
public class RightClickListener implements Listener {
|
||||
AreaShop plugin;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param plugin The AreaShop plugin
|
||||
*/
|
||||
public RightClickListener(AreaShop plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a player interacts
|
||||
* @param event The event
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onRightClick(PlayerInteractEvent event) {
|
||||
Block block = event.getClickedBlock();
|
||||
/* Check for clicking a sign and rightclicking */
|
||||
if(event.getAction() == Action.RIGHT_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 */
|
||||
String regionName = ((Sign)(event.getClickedBlock().getState())).getLine(1);
|
||||
HashMap<String,String> rent = plugin.getShopManager().getRent(regionName);
|
||||
HashMap<String,String> buy = plugin.getShopManager().getBuy(regionName);
|
||||
|
||||
if(rent != null && block.getWorld().getName().equals(rent.get(plugin.keyWorld))
|
||||
&& rent.get(plugin.keyX).equals(String.valueOf(block.getX()))
|
||||
&& rent.get(plugin.keyY).equals(String.valueOf(block.getY()))
|
||||
&& rent.get(plugin.keyZ).equals(String.valueOf(block.getZ())) ) {
|
||||
|
||||
plugin.getShopManager().rent(event.getPlayer(), regionName);
|
||||
/* Cancel placing a block */
|
||||
event.setCancelled(true);
|
||||
|
||||
} else if(buy != null && block.getWorld().getName().equals(buy.get(plugin.keyWorld))
|
||||
&& buy.get(plugin.keyX).equals(String.valueOf(block.getX()))
|
||||
&& buy.get(plugin.keyY).equals(String.valueOf(block.getY()))
|
||||
&& buy.get(plugin.keyZ).equals(String.valueOf(block.getZ())) ) {
|
||||
|
||||
plugin.getShopManager().buy(event.getPlayer(), regionName);
|
||||
/* Cancel placing a block */
|
||||
event.setCancelled(true);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,406 +0,0 @@
|
||||
package nl.evolutioncoding.AreaShop;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class ShopCommands implements CommandExecutor {
|
||||
AreaShop plugin;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param plugin The AreaShop plugin
|
||||
*/
|
||||
public ShopCommands(AreaShop plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String alias, String[] args) {
|
||||
if(command.getName().equalsIgnoreCase("AreaShop")) {
|
||||
ShopManager shopManager = plugin.getShopManager();
|
||||
|
||||
/* Commands with 1 argument or more */
|
||||
if(args.length > 0 && args[0] != null) {
|
||||
/* Help command */
|
||||
if(args[0].equalsIgnoreCase("help")) {
|
||||
plugin.showHelp(sender);
|
||||
}
|
||||
|
||||
/* Renting command */
|
||||
else if(args[0].equalsIgnoreCase("rent")) {
|
||||
if (!(sender instanceof Player)) {
|
||||
plugin.message(sender, "onlyByPlayer");
|
||||
return true;
|
||||
}
|
||||
Player player = (Player)sender;
|
||||
if(args.length > 1 && args[1] != null) {
|
||||
shopManager.rent(player, args[1]);
|
||||
} else {
|
||||
plugin.message(sender, "rent-help");
|
||||
}
|
||||
}
|
||||
|
||||
/* Buying command */
|
||||
else if(args[0].equalsIgnoreCase("buy")) {
|
||||
if (!(sender instanceof Player)) {
|
||||
plugin.message(sender, "onlyByPlayer");
|
||||
return true;
|
||||
}
|
||||
Player player = (Player)sender;
|
||||
if(args.length > 1 && args[1] != null) {
|
||||
shopManager.buy(player, args[1]);
|
||||
} else {
|
||||
plugin.message(player, "buy-help");
|
||||
}
|
||||
}
|
||||
|
||||
/* Info command */
|
||||
else if(args[0].equalsIgnoreCase("info")) {
|
||||
if(args.length > 1 && args[1] != null) {
|
||||
if(args[1].equalsIgnoreCase("all")) {
|
||||
String message = "";
|
||||
/* Message for rents */
|
||||
Iterator<String> it = shopManager.getRents().keySet().iterator();
|
||||
if(it.hasNext()) {
|
||||
message = shopManager.getRent(it.next()).get(plugin.keyName);
|
||||
while(it.hasNext()) {
|
||||
message += ", " + shopManager.getRent(it.next()).get(plugin.keyName);
|
||||
}
|
||||
}
|
||||
if(message.equals("")) {
|
||||
plugin.message(sender, "info-all-noRents");
|
||||
} else {
|
||||
plugin.message(sender, "info-all-rents", message);
|
||||
}
|
||||
|
||||
/* Message for buys */
|
||||
it = shopManager.getBuys().keySet().iterator();
|
||||
if(it.hasNext()) {
|
||||
message = shopManager.getBuy(it.next()).get(plugin.keyName);
|
||||
while(it.hasNext()) {
|
||||
message += ", " + shopManager.getBuy(it.next()).get(plugin.keyName);
|
||||
}
|
||||
}
|
||||
if(message.equals("")) {
|
||||
plugin.message(sender, "info-all-noBuys");
|
||||
} else {
|
||||
plugin.message(sender, "info-all-buys", message);
|
||||
}
|
||||
}
|
||||
else if(args[1].equalsIgnoreCase("rented")) {
|
||||
String message = "";
|
||||
Iterator<String> it = shopManager.getRents().keySet().iterator();
|
||||
boolean first = true;
|
||||
while(it.hasNext()) {
|
||||
String next = shopManager.getRent(it.next()).get(plugin.keyName);
|
||||
if(shopManager.getRent(next).get(plugin.keyPlayer) != null) {
|
||||
if(!first) {
|
||||
message += ", " + next;
|
||||
} else {
|
||||
first = false;
|
||||
message = next;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(message.equals("")) {
|
||||
plugin.message(sender, "info-noRented");
|
||||
} else {
|
||||
plugin.message(sender, "info-rented", message);
|
||||
}
|
||||
} else if(args[1].equalsIgnoreCase("forrent")) {
|
||||
String message = "";
|
||||
Iterator<String> it = shopManager.getRents().keySet().iterator();
|
||||
boolean first = true;
|
||||
while(it.hasNext()) {
|
||||
String next = shopManager.getRent(it.next()).get(plugin.keyName);
|
||||
if(shopManager.getRent(next).get(plugin.keyPlayer) == null) {
|
||||
if(!first) {
|
||||
message += ", " + next;
|
||||
} else {
|
||||
first = false;
|
||||
message = next;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(message.equals("")) {
|
||||
plugin.message(sender, "info-noUnrented");
|
||||
} else {
|
||||
plugin.message(sender, "info-unrented", message);
|
||||
}
|
||||
} else if(args[1].equalsIgnoreCase("sold")) {
|
||||
String message = "";
|
||||
Iterator<String> it = shopManager.getBuys().keySet().iterator();
|
||||
boolean first = true;
|
||||
while(it.hasNext()) {
|
||||
String next = shopManager.getBuy(it.next()).get(plugin.keyName);
|
||||
if(shopManager.getBuy(next).get(plugin.keyPlayer) != null) {
|
||||
if(!first) {
|
||||
message += ", ";
|
||||
} else {
|
||||
first = false;
|
||||
}
|
||||
message += next;
|
||||
}
|
||||
}
|
||||
if(message.equals("")) {
|
||||
plugin.message(sender, "info-noSold");
|
||||
} else {
|
||||
plugin.message(sender, "info-sold", message);
|
||||
}
|
||||
} else if(args[1].equalsIgnoreCase("forsale")) {
|
||||
String message = "";
|
||||
Iterator<String> it = shopManager.getBuys().keySet().iterator();
|
||||
boolean first = true;
|
||||
while(it.hasNext()) {
|
||||
String next = shopManager.getBuy(it.next()).get(plugin.keyName);
|
||||
if(shopManager.getBuy(next).get(plugin.keyPlayer) == null) {
|
||||
if(!first) {
|
||||
message += ", " + next;
|
||||
} else {
|
||||
first = false;
|
||||
message = next;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(message.equals("")) {
|
||||
plugin.message(sender, "info-noForsale");
|
||||
} else {
|
||||
plugin.message(sender, "info-forsale", message);
|
||||
}
|
||||
} else if(args[1].equalsIgnoreCase("player")) {
|
||||
if(args.length > 2 && args[2] != null) {
|
||||
String message = "";
|
||||
Iterator<String> it = shopManager.getRents().keySet().iterator();
|
||||
boolean first = true;
|
||||
while(it.hasNext()) {
|
||||
String next = shopManager.getRent(it.next()).get(plugin.keyName);
|
||||
if(shopManager.getRent(next).get(plugin.keyPlayer) != null && shopManager.getRent(next).get(plugin.keyPlayer).equalsIgnoreCase(args[2])) {
|
||||
if(!first) {
|
||||
message += ", " + next;
|
||||
} else {
|
||||
first = false;
|
||||
message = next;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(message.equals("")) {
|
||||
plugin.message(sender, "info-playerNoRents", args[2]);
|
||||
} else {
|
||||
plugin.message(sender, "info-playerRents", args[2], message);
|
||||
}
|
||||
|
||||
message = "";
|
||||
it = shopManager.getBuys().keySet().iterator();
|
||||
first = true;
|
||||
while(it.hasNext()) {
|
||||
String next = shopManager.getBuy(it.next()).get(plugin.keyName);
|
||||
if(shopManager.getBuy(next).get(plugin.keyPlayer) != null && shopManager.getBuy(next).get(plugin.keyPlayer).equalsIgnoreCase(args[2])) {
|
||||
if(!first) {
|
||||
message += ", ";
|
||||
} else {
|
||||
first = false;
|
||||
}
|
||||
message += next;
|
||||
}
|
||||
}
|
||||
if(message.equals("")) {
|
||||
plugin.message(sender, "info-playerNoBuys", args[2]);
|
||||
} else {
|
||||
plugin.message(sender, "info-playerBuys", args[2], message);
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "info-playerHelp");
|
||||
}
|
||||
} else if(args[1].equalsIgnoreCase("region")) {
|
||||
if(args.length > 2 && args[2] != null) {
|
||||
|
||||
HashMap<String,String> rent = shopManager.getRent(args[2]);
|
||||
HashMap<String,String> buy = shopManager.getBuy(args[2]);
|
||||
|
||||
if(rent == null) {
|
||||
plugin.message(sender, "info-regionRenting", args[2]);
|
||||
plugin.message(sender, "info-regionNoRenting", args[2]);
|
||||
} else {
|
||||
plugin.message(sender, "info-regionRenting", rent.get(plugin.keyName));
|
||||
plugin.message(sender, "info-regionSign", rent.get(plugin.keyWorld), rent.get(plugin.keyX), rent.get(plugin.keyY), rent.get(plugin.keyZ));
|
||||
plugin.message(sender, "info-regionPriceDuration", plugin.getCurrencyCharacter() + rent.get(plugin.keyPrice), rent.get(plugin.keyDuration));
|
||||
if(rent.get(plugin.keyPlayer) == null) {
|
||||
plugin.message(sender, "info-regionNotRented");
|
||||
} else {
|
||||
SimpleDateFormat dateFull = new SimpleDateFormat("dd MMMMMMMMMMMMMMMMM yyyy HH:mm");
|
||||
plugin.message(sender, "info-regionRentedBy", rent.get(plugin.keyPlayer), dateFull.format(Long.parseLong(rent.get(plugin.keyRentedUntil))));
|
||||
}
|
||||
}
|
||||
|
||||
if(buy == null) {
|
||||
plugin.message(sender, "info-regionBuying", args[2]);
|
||||
plugin.message(sender, "info-regionNoBuying", args[2]);
|
||||
} else {
|
||||
plugin.message(sender, "info-regionBuying", buy.get(plugin.keyName));
|
||||
plugin.message(sender, "info-regionSign", buy.get(plugin.keyWorld), buy.get(plugin.keyX), buy.get(plugin.keyY), buy.get(plugin.keyZ));
|
||||
plugin.message(sender, "info-regionPrice", plugin.getCurrencyCharacter() + buy.get(plugin.keyPrice));
|
||||
if(buy.get(plugin.keyPlayer) == null) {
|
||||
plugin.message(sender, "info-regionNotBought");
|
||||
} else {
|
||||
plugin.message(sender, "info-regionBoughtBy", buy.get(plugin.keyPlayer));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "info-regionHelp");
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "info-help");
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "info-help");
|
||||
}
|
||||
}
|
||||
|
||||
/* Unrenting command */
|
||||
else if(args[0].equalsIgnoreCase("unrent")) {
|
||||
if(args.length > 1 && args[1] != null) {
|
||||
HashMap<String,String> rent = shopManager.getRent(args[1]);
|
||||
if(rent == null) {
|
||||
plugin.message(sender, "unrent-notRegistered");
|
||||
} else {
|
||||
if(rent.get(plugin.keyPlayer) == null) {
|
||||
plugin.message(sender, "unrent-notRented");
|
||||
} else {
|
||||
if(sender.hasPermission("areashop.unrent")) {
|
||||
plugin.message(sender, "unrent-other", rent.get(plugin.keyPlayer));
|
||||
shopManager.unRent(args[1]);
|
||||
} else {
|
||||
if(sender.hasPermission("areashop.unrentown")) {
|
||||
if(rent.get(plugin.keyPlayer).equals(sender.getName())) {
|
||||
plugin.message(sender, "unrent-unrented");
|
||||
shopManager.unRent(args[1]);
|
||||
} else {
|
||||
plugin.message(sender, "unrent-noPermissionOther");
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "unrent-noPermission");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "unrent-help");
|
||||
}
|
||||
}
|
||||
|
||||
/* Selling command */
|
||||
else if(args[0].equalsIgnoreCase("sell")) {
|
||||
if(args.length > 1 && args[1] != null) {
|
||||
HashMap<String,String> buy = shopManager.getBuy(args[1]);
|
||||
if(buy == null) {
|
||||
plugin.message(sender, "sell-notRegistered");
|
||||
} else {
|
||||
if(buy.get(plugin.keyPlayer) == null) {
|
||||
plugin.message(sender, "sell-notBought");
|
||||
} else {
|
||||
if(sender.hasPermission("areashop.sell")) {
|
||||
plugin.message(sender, "sell-sold", buy.get(plugin.keyPlayer));
|
||||
shopManager.unBuy(args[1]);
|
||||
} else {
|
||||
if(sender.hasPermission("areashop.sellown")) {
|
||||
if(buy.get(plugin.keyPlayer).equals(sender.getName())) {
|
||||
plugin.message(sender, "sell-soldYours");
|
||||
shopManager.unBuy(args[1]);
|
||||
} else {
|
||||
plugin.message(sender, "sell-noPermissionOther");
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "sell-noPermission");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "sell-help");
|
||||
}
|
||||
}
|
||||
|
||||
/* UpdateRentSigns command */
|
||||
else if(args[0].equalsIgnoreCase("updaterentsigns")) {
|
||||
|
||||
if(sender.hasPermission("areashop.updaterentsigns")) {
|
||||
boolean result = plugin.getShopManager().updateRentSigns();
|
||||
if(result) {
|
||||
plugin.message(sender, "rentsigns-updated");
|
||||
} else {
|
||||
plugin.message(sender, "rentsigns-notUpdated");
|
||||
}
|
||||
|
||||
} else {
|
||||
plugin.message(sender, "rentsigns-noPermission");
|
||||
}
|
||||
}
|
||||
|
||||
/* UpdateBuySigns command */
|
||||
else if(args[0].equalsIgnoreCase("updatebuysigns")) {
|
||||
|
||||
if(sender.hasPermission("areashop.updatebuysigns")) {
|
||||
boolean result = plugin.getShopManager().updateBuySigns();
|
||||
if(result) {
|
||||
plugin.message(sender, "buysigns-updated");
|
||||
} else {
|
||||
plugin.message(sender, "buysigns-notUpdated");
|
||||
}
|
||||
} else {
|
||||
plugin.message(sender, "buysigns-noPermission");
|
||||
}
|
||||
}
|
||||
|
||||
/* updaterentregions command */
|
||||
else if(args[0].equalsIgnoreCase("updaterentregions")) {
|
||||
|
||||
if(sender.hasPermission("areashop.updaterentregions")) {
|
||||
plugin.getShopManager().updateRentRegions();
|
||||
plugin.message(sender, "rentregions-updated");
|
||||
} else {
|
||||
plugin.message(sender, "rentregions-noPermission");
|
||||
}
|
||||
}
|
||||
|
||||
/* updatebuyregions command */
|
||||
else if(args[0].equalsIgnoreCase("updatebuyregions")) {
|
||||
|
||||
if(sender.hasPermission("areashop.updatebuyregions")) {
|
||||
plugin.getShopManager().updateBuyRegions();
|
||||
plugin.message(sender, "buyregions-updated");
|
||||
} else {
|
||||
plugin.message(sender, "buyregions-noPermission");
|
||||
}
|
||||
}
|
||||
|
||||
/* reload command */
|
||||
else if(args[0].equalsIgnoreCase("reload")) {
|
||||
|
||||
if(sender.hasPermission("areashop.reload")) {
|
||||
plugin.reload();
|
||||
plugin.message(sender, "reload-reloaded");
|
||||
} else {
|
||||
plugin.message(sender, "reload-noPermission");
|
||||
}
|
||||
}
|
||||
|
||||
/* Not a valid command */
|
||||
else {
|
||||
plugin.message(sender, "cmd-notValid");
|
||||
}
|
||||
|
||||
} else {
|
||||
plugin.showHelp(sender);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,162 +0,0 @@
|
||||
package nl.evolutioncoding.AreaShop;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.Sign;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
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) {
|
||||
Sign sign = (Sign)(block.getState());
|
||||
/* Check if the rent sign is really the same as a saved rent */
|
||||
HashMap<String,String> rent = plugin.getShopManager().getRent(sign.getLine(1));
|
||||
HashMap<String,String> buy = plugin.getShopManager().getBuy(sign.getLine(1));
|
||||
if(rent != null && rent.get(plugin.keyWorld).equals(block.getWorld().getName())
|
||||
&& rent.get(plugin.keyX).equals(String.valueOf(block.getX()))
|
||||
&& rent.get(plugin.keyY).equals(String.valueOf(block.getY()))
|
||||
&& rent.get(plugin.keyZ).equals(String.valueOf(block.getZ())) ) {
|
||||
/* Remove the rent if the player has permission */
|
||||
if(event.getPlayer().hasPermission("areashop.destroyrent")) {
|
||||
boolean result = plugin.getShopManager().removeRent(sign.getLine(1));
|
||||
if(result) {
|
||||
event.getPlayer().sendMessage(plugin.fixColors(plugin.config().getString("chatPrefix")) + "Renting of the region succesfully removed");
|
||||
}
|
||||
} else { /* Cancel the breaking of the sign */
|
||||
event.setCancelled(true);
|
||||
event.getPlayer().sendMessage(plugin.fixColors(plugin.config().getString("chatPrefix")) + "You don't have permission for destroying a sign for renting a region");
|
||||
}
|
||||
} else if(buy != null && buy.get(plugin.keyWorld).equals(block.getWorld().getName())
|
||||
&& buy.get(plugin.keyX).equals(String.valueOf(block.getX()))
|
||||
&& buy.get(plugin.keyY).equals(String.valueOf(block.getY()))
|
||||
&& buy.get(plugin.keyZ).equals(String.valueOf(block.getZ())) ) {
|
||||
/* Remove the buy if the player has permission */
|
||||
if(event.getPlayer().hasPermission("areashop.destroybuy")) {
|
||||
boolean result = plugin.getShopManager().removeBuy(sign.getLine(1));
|
||||
if(result) {
|
||||
event.getPlayer().sendMessage(plugin.fixColors(plugin.config().getString("chatPrefix")) + "Buying of the region succesfully removed");
|
||||
}
|
||||
} else { /* Cancel the breaking of the sign */
|
||||
event.setCancelled(true);
|
||||
event.getPlayer().sendMessage(plugin.fixColors(plugin.config().getString("chatPrefix")) + "You don't have permission for destroying a sign for buying a region");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 */
|
||||
HashMap<String,String> rent = plugin.getShopManager().getRent(sign.getLine(1));
|
||||
HashMap<String,String> buy = plugin.getShopManager().getBuy(sign.getLine(1));
|
||||
if(rent != null && rent.get(plugin.keyWorld).equals(block.getWorld().getName())
|
||||
&& rent.get(plugin.keyX).equals(String.valueOf(block.getX()))
|
||||
&& rent.get(plugin.keyY).equals(String.valueOf(block.getY()))
|
||||
&& rent.get(plugin.keyZ).equals(String.valueOf(block.getZ())) ) {
|
||||
/* Remove the rent */
|
||||
boolean result = plugin.getShopManager().removeRent(sign.getLine(1));
|
||||
if(result) {
|
||||
plugin.getLogger().info("Renting of region '" + sign.getLine(1) + "' has been removed by indirectly breaking the sign");
|
||||
}
|
||||
} else if(buy != null && buy.get(plugin.keyWorld).equals(block.getWorld().getName())
|
||||
&& buy.get(plugin.keyX).equals(String.valueOf(block.getX()))
|
||||
&& buy.get(plugin.keyY).equals(String.valueOf(block.getY()))
|
||||
&& buy.get(plugin.keyZ).equals(String.valueOf(block.getZ())) ) {
|
||||
/* Remove the buy */
|
||||
boolean result = plugin.getShopManager().removeBuy(sign.getLine(1));
|
||||
if(result) {
|
||||
plugin.getLogger().info("Buying of region '" + sign.getLine(1) + "' has been removed by indirectly breaking the sign");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,235 +0,0 @@
|
||||
package nl.evolutioncoding.AreaShop;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.block.SignChangeEvent;
|
||||
|
||||
import com.sk89q.worldguard.protection.managers.RegionManager;
|
||||
|
||||
/**
|
||||
* Checks for placement of signs for this plugin
|
||||
* @author NLThijs48
|
||||
*/
|
||||
public final class SignChangeListener implements Listener {
|
||||
AreaShop plugin;
|
||||
String chatPrefix;
|
||||
String rentSign;
|
||||
String buySign;
|
||||
String signRentable;
|
||||
String signBuyable;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param plugin The AreaShop plugin
|
||||
*/
|
||||
public SignChangeListener(AreaShop plugin) {
|
||||
this.plugin = plugin;
|
||||
chatPrefix = plugin.fixColors(plugin.config().getString("chatPrefix"));
|
||||
rentSign = plugin.config().getString("rentSign");
|
||||
buySign = plugin.config().getString("buySign");
|
||||
signRentable = plugin.fixColors(plugin.config().getString("signRentable"));
|
||||
signBuyable = plugin.fixColors(plugin.config().getString("signBuyable"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 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(rentSign)) {
|
||||
if(!player.hasPermission("areashop.createrent")) {
|
||||
player.sendMessage(chatPrefix + "You don't have permission for setting up renting of regions");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* Get the other lines */
|
||||
String secondLine = event.getLine(1);
|
||||
String thirdLine = event.getLine(2);
|
||||
if(!thirdLine.equals("M")) {
|
||||
thirdLine = thirdLine.toLowerCase();
|
||||
}
|
||||
String fourthLine = event.getLine(3);
|
||||
|
||||
/* Get the regionManager for accessing regions */
|
||||
RegionManager regionManager = plugin.getWorldGuard().getRegionManager(event.getPlayer().getWorld());
|
||||
|
||||
/* check if all the lines are correct */
|
||||
if(secondLine == null || secondLine.length() == 0) {
|
||||
player.sendMessage(chatPrefix + "You did not specify a region on the second line!");
|
||||
return;
|
||||
} else if(regionManager.getRegion(secondLine) == null) {
|
||||
player.sendMessage(chatPrefix + "The region you specified does not exist!");
|
||||
return;
|
||||
} else if(plugin.getShopManager().getRent(secondLine) != null) {
|
||||
player.sendMessage(chatPrefix + "The region you specified already has a sign for renting");
|
||||
return;
|
||||
} else if(thirdLine == null || thirdLine.length() == 0) {
|
||||
player.sendMessage(chatPrefix + "You did not specify how long the region can be rented, do this on the third line");
|
||||
return;
|
||||
} else if(!this.checkTimeFormat(thirdLine)) {
|
||||
player.sendMessage(chatPrefix + "The time specified is not in the correct format");
|
||||
return;
|
||||
} else if(fourthLine == null || fourthLine.length() == 0) {
|
||||
player.sendMessage(chatPrefix + "You did not specify how much the renting costs on the fourth line!");
|
||||
return;
|
||||
} else {
|
||||
/* Check the fourth line */
|
||||
try {
|
||||
Double.parseDouble(fourthLine);
|
||||
} catch (NumberFormatException e) {
|
||||
player.sendMessage(chatPrefix + "You did not specify the renting cost correctly, use a number only");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Set the first line to signRentable */
|
||||
event.setLine(0, signRentable);
|
||||
event.setLine(1, regionManager.getRegion(secondLine).getId());
|
||||
event.setLine(3, plugin.getCurrencyCharacter() + fourthLine);
|
||||
|
||||
/* Add rent to the ShopManager */
|
||||
HashMap<String,String> rent = new HashMap<String,String>();
|
||||
rent.put(plugin.keyWorld, event.getBlock().getWorld().getName());
|
||||
rent.put(plugin.keyX, String.valueOf(event.getBlock().getX()));
|
||||
rent.put(plugin.keyY, String.valueOf(event.getBlock().getY()));
|
||||
rent.put(plugin.keyZ, String.valueOf(event.getBlock().getZ()));
|
||||
rent.put(plugin.keyDuration, thirdLine);
|
||||
rent.put(plugin.keyPrice, fourthLine);
|
||||
rent.put(plugin.keyName, regionManager.getRegion(secondLine).getId());
|
||||
plugin.getShopManager().addRent(secondLine, rent);
|
||||
|
||||
/* Set the flags for the region */
|
||||
plugin.getShopManager().setRegionFlags(secondLine, plugin.config().getConfigurationSection("flagsForRent"), true);
|
||||
|
||||
player.sendMessage(chatPrefix + "Renting of the region is setup correctly");
|
||||
}
|
||||
} else if (event.getLine(0).contains(buySign)) {
|
||||
/* Check for permission */
|
||||
if(!player.hasPermission("areashop.createbuy")) {
|
||||
player.sendMessage(chatPrefix + "You don't have permission for setting up buying of regions");
|
||||
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());
|
||||
|
||||
/* Check if all the lines are correct */
|
||||
if(secondLine == null || secondLine.length() == 0) {
|
||||
player.sendMessage(chatPrefix + "You did not specify a region on the second line!");
|
||||
return;
|
||||
} else if(regionManager.getRegion(secondLine) == null) {
|
||||
player.sendMessage(chatPrefix + "The region you specified does not exist!");
|
||||
return;
|
||||
} else if(plugin.getShopManager().getBuy(secondLine) != null) {
|
||||
player.sendMessage(chatPrefix + "The region you specified already has a sign for buying");
|
||||
return;
|
||||
} else if(thirdLine == null || thirdLine.length() == 0) {
|
||||
player.sendMessage(chatPrefix + "You did not specify how much the buying costs on the fourth line!");
|
||||
return;
|
||||
} else {
|
||||
/* Check the fourth line */
|
||||
try {
|
||||
Double.parseDouble(thirdLine);
|
||||
} catch (NumberFormatException e) {
|
||||
player.sendMessage(chatPrefix + "You did not specify the buying cost correctly, use a number only");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Set the first line to signbuyable */
|
||||
event.setLine(0, signBuyable);
|
||||
event.setLine(1, regionManager.getRegion(secondLine).getId());
|
||||
event.setLine(2, plugin.getCurrencyCharacter() + thirdLine);
|
||||
|
||||
/* Add buy to the ShopManager */
|
||||
HashMap<String,String> buy = new HashMap<String,String>();
|
||||
buy.put(plugin.keyWorld, event.getBlock().getWorld().getName());
|
||||
buy.put(plugin.keyX, String.valueOf(event.getBlock().getX()));
|
||||
buy.put(plugin.keyY, String.valueOf(event.getBlock().getY()));
|
||||
buy.put(plugin.keyZ, String.valueOf(event.getBlock().getZ()));
|
||||
buy.put(plugin.keyPrice, thirdLine);
|
||||
buy.put(plugin.keyName, regionManager.getRegion(secondLine).getId());
|
||||
plugin.getShopManager().addBuy(secondLine, buy);
|
||||
|
||||
/* Set the flags for the region */
|
||||
plugin.getShopManager().setRegionFlags(secondLine, plugin.config().getConfigurationSection("flagsForSale"), false);
|
||||
|
||||
player.sendMessage(chatPrefix + "Buying of the region is setup correctly");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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[] timeValues = {"m","min","mins","minute","minutes","minuten","minuut",
|
||||
"h","hour","hours","uur","uren",
|
||||
"M", "month", "months","maanden","maand",
|
||||
"d","day","days","dag","dagen",
|
||||
"y","year","years","jaar","jaren"};
|
||||
String suffix = time.substring(time.indexOf(' ')+1, time.length());
|
||||
boolean result = false;
|
||||
for(int i=0; i<timeValues.length && !result; i++) {
|
||||
result = timeValues[i].equals(suffix);
|
||||
}
|
||||
if(!result) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* check if the part before the space is a number */
|
||||
String prefix = time.substring(0, (time.indexOf(' ')));
|
||||
return prefix.matches("\\d+");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
/target
|
||||
@@ -0,0 +1,42 @@
|
||||
<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-interface</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>AreaShop Interface</name>
|
||||
<version>AreaShopInterface</version>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<parent>
|
||||
<groupId>nl.evolutioncoding</groupId>
|
||||
<artifactId>areashop-parent</artifactId>
|
||||
<version>parent</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
<version>LATEST</version>
|
||||
<type>jar</type>
|
||||
</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>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package nl.evolutioncoding.areashop.interfaces;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
|
||||
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
|
||||
|
||||
public interface AreaShopInterface {
|
||||
public void debugI(String message);
|
||||
public YamlConfiguration getConfig();
|
||||
public WorldGuardPlugin getWorldGuard();
|
||||
public WorldEditPlugin getWorldEdit();
|
||||
public Logger getLogger();
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package nl.evolutioncoding.areashop.interfaces;
|
||||
|
||||
import org.bukkit.World;
|
||||
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
|
||||
public interface GeneralRegionInterface {
|
||||
public ProtectedRegion getRegion();
|
||||
public String getName();
|
||||
public World getWorld();
|
||||
public String getWorldName();
|
||||
public int getWidth();
|
||||
public int getDepth();
|
||||
public int getHeight();
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package nl.evolutioncoding.areashop.interfaces;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public abstract class WorldEditInterface {
|
||||
protected AreaShopInterface pluginInterface;
|
||||
|
||||
public WorldEditInterface(AreaShopInterface pluginInterface) {
|
||||
this.pluginInterface = pluginInterface;
|
||||
}
|
||||
|
||||
// Different way to restore blocks per implementation, newer ones support entities as well
|
||||
public abstract boolean restoreRegionBlocks(File file, GeneralRegionInterface regionInterface);
|
||||
// Different way to save blocks per implementation, newer ones support entities as well
|
||||
public abstract boolean saveRegionBlocks(File file, GeneralRegionInterface regionInterface);
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
package nl.evolutioncoding.areashop.interfaces;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Location;
|
||||
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
|
||||
public abstract class WorldGuardInterface {
|
||||
protected AreaShopInterface pluginInterface;
|
||||
|
||||
public WorldGuardInterface(AreaShopInterface pluginInterface) {
|
||||
this.pluginInterface = pluginInterface;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse an owner(s) string and set the players as owner of the WorldGuard region (set by UUID or name depending on implementation)
|
||||
* @param region The WorldGuard region to set the owners of
|
||||
* @param input The owner(s) string to parse and set
|
||||
*/
|
||||
public abstract void setOwners(ProtectedRegion region, String input);
|
||||
|
||||
/**
|
||||
* Parse a member(s) string and set the players as member of the WorldGuard region (set by UUID or name depending on implementation)
|
||||
* @param region The WorldGuard region to set the members of
|
||||
* @param input The member(s) string to parse and set
|
||||
*/
|
||||
public abstract void setMembers(ProtectedRegion region, String input);
|
||||
|
||||
/**
|
||||
* Get a set of ProtectedRegion's that are present on a certain location
|
||||
* @param location The location to check
|
||||
* @return A set containing all regions present at that location
|
||||
*/
|
||||
public abstract Set<ProtectedRegion> getApplicableRegionsSet(Location location);
|
||||
|
||||
/**
|
||||
* Check if a player is a member of the WorldGuard region
|
||||
* @param region The region to check
|
||||
* @param player The player to check
|
||||
* @return true if the player is a member of the region, otherwise false
|
||||
*/
|
||||
public abstract boolean containsMember(ProtectedRegion region, UUID player);
|
||||
|
||||
/**
|
||||
* Check if a player is an owner of the WorldGuard region
|
||||
* @param region The region to check
|
||||
* @param player The player to check
|
||||
* @return true if the player is an owner of the region, otherwise false
|
||||
*/
|
||||
public abstract boolean containsOwner(ProtectedRegion region, UUID player);
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
#AreaShop
|
||||
|
||||
Check the documentation at http://dev.bukkit.org/bukkit-plugins/regionbuyandrent/
|
||||
|
||||
Every time I make a change to the code that is somewhat finished and possibly tested I will push the code to GitHub, this way you can follow the commit log to see the progress.
|
||||
|
||||
# Compiling yourself OLD
|
||||
This information below is only usefull for old AreaShop versions, and not for the current version at the master branch. The current version is a Maven project and can be build like that (information below will be updated later).
|
||||
Below is some information about how to compile AreaShop, as a normal user you would not need this. You can simply download a stable and tested release here from the [releases page](https://github.com/NLthijs48/AreaShop/releases), the [BukkitDev](http://dev.bukkit.org/bukkit-plugins/regionbuyandrent/) platform or the [Spigot](http://www.spigotmc.org/resources/areashop.2991/) resources section. If you however want to compile a development build yourself (code will be pushed to GitHub after adding something, but an official release is only made after some longer time).
|
||||
|
||||
#### Cloning the repository
|
||||
You can clone the AreaShop repository here from GitHub to your local computer, if you have the GitHub Windows client installed then you can simply click the "Clone in Desktop" button on the bottom right corner fo the page. Otherwise you can use the "git clone" command. If you don't know how to use git or have no interest in using it then you can also simply click "Download ZIP" to download the project.
|
||||
|
||||
#### Creating a project
|
||||
Now you can create a project with your IDE, I use Eclipse myself, so that is what I mainly explain it for (but the same things are possible with other IDEs). If you cloned the git repository then you can create a project based on that, otherwise you can create a new empty Java project and add the files manually.
|
||||
|
||||
#### Adding dependencies
|
||||
First you need to make sure that you use the correct Java version, AreaShop is currently compiled with Java 7, but a higher version is also fine (but make sure that your Minecraft server also has that higher Java version). To compile the current master branch you will need to add the correct dependencies. I'm compiling with the lowest possible versions to make sure that everyone can use AreaShop, but compiling with higher versions is possible if you also have those versions on your server. The versions found below are recommended:
|
||||
- Bukkit 1.7.9 R0.2 (later versions should work, but might require some small changes in the code)
|
||||
- [WorldGuard](http://dev.bukkit.org/bukkit-plugins/worldguard/files/) 6.0
|
||||
- [WorldEdit](http://dev.bukkit.org/bukkit-plugins/worldedit/files/) 6.0
|
||||
- [Vault](http://dev.bukkit.org/bukkit-plugins/vault/files/) 1.4.1 (later versions should work)
|
||||
|
||||
#### Exporting
|
||||
Now your project should have no errors left (warnings can be ignored usually), if you have any then you will have to fix them or send me a message. In Eclipse you can rightclick your project, then select "Export", a window should pop up. Now select "JAR file" that is located in the "Java" folder and click "Next". Then select the "src" and "lang" folder inside you project, and make sure that "config.yml", "default.yml" and "plugin.yml" are also selected. Also select an output path as export destination, and then click "Finish". Now you should have a .jar file ready to use in your server.
|
||||
|
||||
#### Questions
|
||||
If you have any questions about how to use AreaShop or how to change the code of AreaShop then feel free to message me. You can reach me through [BukkitDev](http://dev.bukkit.org/profiles/NLThijs48/) or [Spigot](http://www.spigotmc.org/members/nlthijs48.15658/).
|
||||
|
||||
# Development tips
|
||||
Below you can find a basic overview of the structure of AreaShop, this can help you understand the plugin and make it easier to change something.
|
||||
|
||||
#### Description of packages and classes
|
||||
The following packages and classes can be found inside the AreaShop plugin:
|
||||
|
||||
**nl.evolutioncoding.areashop** (general classes):
|
||||
- **AreaShop.java**: Base class of the plugin, handles the startup and shutdown sequence, registers tasks, has useful methods to get dependancies or send messages and also contains a lot of constants.
|
||||
- **Metrics.java**: Class from MCStats, used to send some anonymous statistics to see how many people use the plugin. Check the results [here](http://mcstats.org/plugin/AreaShop).
|
||||
- **Updater.java**: Updater class to notify players about new updates, also contains code to download/install updates automatically but that is a feature of the library that is unused.
|
||||
- **Utils.java**: Contains a few methods that might be useful, currently the conversion from Location to config string and the other way around, creating a comma separated list and getting a Facing from a yaw.
|
||||
|
||||
**nl.evolutioncoding.areashop.commands** (command classes):
|
||||
- **CommandAreaShop.java**: Base abstract class for a command.
|
||||
- **All others**: A command from AreaShop, extends the CommandAreaShop class and implements the required methods (command start, execution, help entry, tabcomplete).
|
||||
|
||||
**nl.evolutioncoding.areashop.exceptions** (exceptions):
|
||||
- **RegionCreateException.java**: An exception that is thrown if a region cannot be successfully created (nonexisten world or WorldGuard region).
|
||||
|
||||
**nl.evolutioncoding.areashop.listeners** (listeners):
|
||||
- **PlayerLoginListener.java**: Notifies admins about updates, displays messages about rental regions expiring, handles name changes.
|
||||
- **SignBreakListener.java**: Handles breaking AreaShop signs, blocks it when the user does not have permission, removes the sign if they do have permission.
|
||||
- **SignChangeListener.java**: Handles placing AreaShop signs, checks if the user has permission and after that creates and adds a region to AreaShop (also triggers a bunch of events that happen when a region is added).
|
||||
- **SignClickListener.java**: Handles clicking a sign, simply gives the event to the region that the sign is attached to.
|
||||
|
||||
**nl.evolutioncoding.areashop.managers** (managers):
|
||||
- **CommandManager.java**: Entry point for all Bukkit commands, handles commands and tab completions. All command classes are registered here and will be used when a command is received for them.
|
||||
- **FileManager.java**: Handles all File IO, loads all config files (config.yml, default.yml, groups.yml), all region files and the versions file (used to determine if a file upgrade is required). Also saves all registered region in memory, and has a bunch of methods to get them (get all, get rentals, get buys, get name lists, etc). Manages region groups, these can also be asked for here. Used to add/remove regions, update them (signs and region flags), and has methods to save files (be sure you use the "saveGroupsIsRequired()" function instead of "saveGroupsNow()", files will be saved by a task later or at shutdown, also applies for region saving). Has methods to get a list of regions (AreaShop regions and WorldEdit regions) at a certain location, or those that intersect a WorldEdit selection.
|
||||
- **LanguageManager.java**: Handles loading and saving of language files. Has methods to get messages from the currently loaded and backup language file (only the selected file and the English one are loaded in memory). If you want to send a message use the "message()" method on AreaShop, that one also handles the sending itself.
|
||||
- **SignLinkerManager.java**: Handles everyting that has to do with the "/as linksigns" command, acts upon certain events.
|
||||
|
||||
**nl.evolutioncoding.areashop.regions** (regions and groups):
|
||||
- **GeneralRegion.java**: Contains all general methods that a buy and rental region share, also has a couple of enums. Has methods to ask for all properties of a region, and methods to change these properties. Most properties will first be taken from the region file itself, after that from the groups.yml file (if the region is assigned to any groups) and at last from default.yml. If you change a property it will automatically mark the region as "saveRequired", which will make sure that the region is saved to disk the next time the scheduled task comes around or at shutdown. Has commands to teleport players to the region, run events on the region or update the region (signs and region flags). This class should never be contructed, always use BuyRegion or RentRegion. Use "isRentRegion()" and "isBuyRegion()" to determine what an object of this class actually is.
|
||||
- **BuyRegion.java**: Class for buy regions, inherits everything from GeneralRegion. Adds a price to the region and adds an owner. Has methods to buy/sell the region.
|
||||
- **RentRegion.java**: Class for rental regions, inherits everything from GeneralRegion. Adds a price, duration and owner to the region. Has methods to rent/unrent the region (for extending simply rent again).
|
||||
- **RegionGroup.java**: A regiongroup which can be used to apply certain settings to with the config system. Has a list of regions that belong to it. Has methods to get settings, but these are normally not used (getting settings in a region already takes it from the region, a group or from default.yml).
|
||||
|
||||
#### TODO
|
||||
- Guide for saving custom data for the AreaShop regions
|
||||
- Starting guide, which methods to use to get regions etc.
|
||||
- -
|
||||
@@ -0,0 +1 @@
|
||||
/target
|
||||
@@ -0,0 +1,48 @@
|
||||
<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-worldedit-5</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>AreaShop WorldEdit 5</name>
|
||||
<version>WorldEdit-5</version>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<parent>
|
||||
<groupId>nl.evolutioncoding</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>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>nl.evolutioncoding</groupId>
|
||||
<artifactId>areashop-interface</artifactId>
|
||||
<version>AreaShopInterface</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q</groupId>
|
||||
<artifactId>worldedit</artifactId>
|
||||
<version>5.7-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>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,93 @@
|
||||
package nl.evolutioncoding.areashop.handlers;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import nl.evolutioncoding.areashop.interfaces.AreaShopInterface;
|
||||
import nl.evolutioncoding.areashop.interfaces.GeneralRegionInterface;
|
||||
import nl.evolutioncoding.areashop.interfaces.WorldEditInterface;
|
||||
|
||||
import org.apache.commons.lang.exception.ExceptionUtils;
|
||||
|
||||
import com.sk89q.worldedit.CuboidClipboard;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldedit.bukkit.BukkitWorld;
|
||||
import com.sk89q.worldedit.data.DataException;
|
||||
import com.sk89q.worldedit.schematic.SchematicFormat;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
|
||||
public class WorldEditHandler5 extends WorldEditInterface {
|
||||
|
||||
public WorldEditHandler5(AreaShopInterface pluginInterface) {
|
||||
super(pluginInterface);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean restoreRegionBlocks(File file, GeneralRegionInterface regionInterface) {
|
||||
boolean result = true;
|
||||
EditSession editSession = pluginInterface.getWorldEdit().getWorldEdit().getEditSessionFactory().getEditSession(new BukkitWorld(regionInterface.getWorld()), pluginInterface.getConfig().getInt("maximumBlocks"));
|
||||
// Get the origin and size of the region
|
||||
Vector origin = new Vector(regionInterface.getRegion().getMinimumPoint().getBlockX(), regionInterface.getRegion().getMinimumPoint().getBlockY(), regionInterface.getRegion().getMinimumPoint().getBlockZ());
|
||||
|
||||
editSession.enableQueue();
|
||||
Exception otherException = null;
|
||||
try {
|
||||
CuboidClipboard clipBoard = SchematicFormat.MCEDIT.load(file);
|
||||
if(clipBoard.getHeight() != regionInterface.getHeight()
|
||||
|| clipBoard.getWidth() != regionInterface.getWidth()
|
||||
|| clipBoard.getLength() != regionInterface.getDepth()) {
|
||||
pluginInterface.getLogger().warning("Size of the region " + regionInterface.getName() + " is not the same as the schematic to restore!");
|
||||
pluginInterface.debugI("schematic|region, x:" + clipBoard.getWidth() + "|" + regionInterface.getWidth() + ", y:" + clipBoard.getHeight() + "|" + regionInterface.getHeight() + ", z:" + clipBoard.getLength() + "|" + regionInterface.getDepth());
|
||||
}
|
||||
clipBoard.place(editSession, origin, false);
|
||||
} catch(MaxChangedBlocksException e) {
|
||||
pluginInterface.getLogger().warning("Exeeded the block limit while restoring schematic of " + regionInterface.getName());
|
||||
result = false;
|
||||
} catch(DataException e) {
|
||||
otherException = e;
|
||||
} catch(IOException e) {
|
||||
otherException = e;
|
||||
}
|
||||
if(otherException != null) {
|
||||
pluginInterface.getLogger().warning("Failed to restore schematic for region " + regionInterface.getName());
|
||||
pluginInterface.debugI(ExceptionUtils.getStackTrace(otherException));
|
||||
result = false;
|
||||
}
|
||||
editSession.flushQueue();
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean saveRegionBlocks(File file, GeneralRegionInterface regionInterface) {
|
||||
boolean result = true;
|
||||
ProtectedRegion region = regionInterface.getRegion();
|
||||
// Get the origin and size of the region
|
||||
Vector origin = new Vector(region.getMinimumPoint().getBlockX(), region.getMinimumPoint().getBlockY(), region.getMinimumPoint().getBlockZ());
|
||||
Vector size = (new Vector(region.getMaximumPoint().getBlockX(), region.getMaximumPoint().getBlockY(), region.getMaximumPoint().getBlockZ()).subtract(origin)).add(new Vector(1,1,1));
|
||||
EditSession editSession = new EditSession(new BukkitWorld(regionInterface.getWorld()), pluginInterface.getConfig().getInt("maximumBlocks"));
|
||||
// Save the schematic
|
||||
editSession.enableQueue();
|
||||
CuboidClipboard clipboard = new CuboidClipboard(size, origin);
|
||||
clipboard.copy(editSession);
|
||||
Exception otherException = null;
|
||||
try {
|
||||
SchematicFormat.MCEDIT.save(clipboard, file);
|
||||
} catch (DataException e) {
|
||||
otherException = e;
|
||||
} catch (IOException e) {
|
||||
otherException = e;
|
||||
}
|
||||
if(otherException != null) {
|
||||
pluginInterface.getLogger().warning("Failed to save schematic for region " + regionInterface.getName());
|
||||
pluginInterface.debugI(ExceptionUtils.getStackTrace(otherException));
|
||||
result = false;
|
||||
}
|
||||
editSession.flushQueue();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
/target
|
||||
@@ -0,0 +1,48 @@
|
||||
<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-worldedit-6</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>AreaShop WorldEdit 6</name>
|
||||
<version>WorldEdit-6</version>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<parent>
|
||||
<groupId>nl.evolutioncoding</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>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>nl.evolutioncoding</groupId>
|
||||
<artifactId>areashop-interface</artifactId>
|
||||
<version>AreaShopInterface</version>
|
||||
<type>jar</type>
|
||||
</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>
|
||||
</dependencies>
|
||||
</project>
|
||||
+163
@@ -0,0 +1,163 @@
|
||||
package nl.evolutioncoding.areashop.handlers;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import nl.evolutioncoding.areashop.interfaces.AreaShopInterface;
|
||||
import nl.evolutioncoding.areashop.interfaces.GeneralRegionInterface;
|
||||
import nl.evolutioncoding.areashop.interfaces.WorldEditInterface;
|
||||
|
||||
import org.apache.commons.lang.exception.ExceptionUtils;
|
||||
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldedit.bukkit.BukkitWorld;
|
||||
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
|
||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||
import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormat;
|
||||
import com.sk89q.worldedit.extent.clipboard.io.ClipboardReader;
|
||||
import com.sk89q.worldedit.extent.clipboard.io.ClipboardWriter;
|
||||
import com.sk89q.worldedit.function.operation.ForwardExtentCopy;
|
||||
import com.sk89q.worldedit.function.operation.Operation;
|
||||
import com.sk89q.worldedit.function.operation.Operations;
|
||||
import com.sk89q.worldedit.internal.LocalWorldAdapter;
|
||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import com.sk89q.worldedit.session.ClipboardHolder;
|
||||
import com.sk89q.worldedit.util.io.Closer;
|
||||
import com.sk89q.worldedit.world.registry.WorldData;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
|
||||
public class WorldEditHandler6 extends WorldEditInterface {
|
||||
|
||||
public WorldEditHandler6(AreaShopInterface pluginInterface) {
|
||||
super(pluginInterface);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean restoreRegionBlocks(File file, GeneralRegionInterface regionInterface) {
|
||||
com.sk89q.worldedit.world.World world = null;
|
||||
if(regionInterface.getName() != null) {
|
||||
world = LocalWorldAdapter.adapt(new BukkitWorld(regionInterface.getWorld()));
|
||||
}
|
||||
if(world == null) {
|
||||
pluginInterface.getLogger().info("Did not restore region " + regionInterface.getName() + ", world not found: " + regionInterface.getWorldName());
|
||||
return false;
|
||||
}
|
||||
EditSession editSession = pluginInterface.getWorldEdit().getWorldEdit().getEditSessionFactory().getEditSession(world, pluginInterface.getConfig().getInt("maximumBlocks"));
|
||||
editSession.enableQueue();
|
||||
ProtectedRegion region = regionInterface.getRegion();
|
||||
// Get the origin and size of the region
|
||||
Vector origin = new Vector(region.getMinimumPoint().getBlockX(), region.getMinimumPoint().getBlockY(), region.getMinimumPoint().getBlockZ());
|
||||
|
||||
// Read the schematic and paste it into the world
|
||||
Closer closer = Closer.create();
|
||||
try {
|
||||
FileInputStream fis = closer.register(new FileInputStream(file));
|
||||
BufferedInputStream bis = closer.register(new BufferedInputStream(fis));
|
||||
ClipboardReader reader = ClipboardFormat.SCHEMATIC.getReader(bis);
|
||||
|
||||
WorldData worldData = world.getWorldData();
|
||||
LocalSession session = new LocalSession(pluginInterface.getWorldEdit().getLocalConfiguration());
|
||||
Clipboard clipboard = reader.read(worldData);
|
||||
if(clipboard.getDimensions().getY() != regionInterface.getHeight()
|
||||
|| clipboard.getDimensions().getX() != regionInterface.getWidth()
|
||||
|| clipboard.getDimensions().getZ() != regionInterface.getDepth()) {
|
||||
pluginInterface.getLogger().warning("Size of the region " + regionInterface.getName() + " is not the same as the schematic to restore!");
|
||||
pluginInterface.debugI("schematic|region, x:" + clipboard.getDimensions().getX() + "|" + regionInterface.getWidth() + ", y:" + clipboard.getDimensions().getY() + "|" + regionInterface.getHeight() + ", z:" + clipboard.getDimensions().getZ() + "|" + regionInterface.getDepth());
|
||||
}
|
||||
clipboard.setOrigin(clipboard.getMinimumPoint());
|
||||
ClipboardHolder clipboardHolder = new ClipboardHolder(clipboard, worldData);
|
||||
session.setBlockChangeLimit(pluginInterface.getConfig().getInt("maximumBlocks"));
|
||||
session.setClipboard(clipboardHolder);
|
||||
Operation operation = clipboardHolder
|
||||
.createPaste(editSession, editSession.getWorld().getWorldData())
|
||||
.to(origin)
|
||||
.build();
|
||||
Operations.completeLegacy(operation);
|
||||
} catch (MaxChangedBlocksException e) {
|
||||
pluginInterface.getLogger().warning("Exeeded the block limit while restoring schematic of " + regionInterface.getName());
|
||||
return false;
|
||||
} catch (IOException e) {
|
||||
pluginInterface.getLogger().warning("An error occured while restoring schematic of " + regionInterface.getName() + ", enable debug to see the complete stacktrace");
|
||||
pluginInterface.debugI(ExceptionUtils.getStackTrace(e));
|
||||
return false;
|
||||
} finally {
|
||||
try {
|
||||
closer.close();
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
}
|
||||
editSession.flushQueue();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean saveRegionBlocks(File file, GeneralRegionInterface regionInterface) {
|
||||
// Find the correct world wrapper in WorldEdit, seems weird there is no getWorld(String name) method
|
||||
com.sk89q.worldedit.world.World world = null;
|
||||
if(regionInterface.getWorld() != null) {
|
||||
world = LocalWorldAdapter.adapt(new BukkitWorld(regionInterface.getWorld()));
|
||||
}
|
||||
if(world == null) {
|
||||
pluginInterface.getLogger().warning("Did not save region " + regionInterface.getName() + ", world not found: " + regionInterface.getWorldName());
|
||||
return false;
|
||||
}
|
||||
EditSession editSession = pluginInterface.getWorldEdit().getWorldEdit().getEditSessionFactory().getEditSession(world, pluginInterface.getConfig().getInt("maximumBlocks"));
|
||||
// Create a clipboard
|
||||
CuboidRegion selection = new CuboidRegion(world, regionInterface.getRegion().getMinimumPoint(), regionInterface.getRegion().getMaximumPoint());
|
||||
BlockArrayClipboard clipboard = new BlockArrayClipboard(selection);
|
||||
clipboard.setOrigin(regionInterface.getRegion().getMinimumPoint());
|
||||
ForwardExtentCopy copy = new ForwardExtentCopy(editSession, new CuboidRegion(world, regionInterface.getRegion().getMinimumPoint(), regionInterface.getRegion().getMaximumPoint()), clipboard, regionInterface.getRegion().getMinimumPoint());
|
||||
try {
|
||||
Operations.completeLegacy(copy);
|
||||
} catch (MaxChangedBlocksException e1) {
|
||||
pluginInterface.getLogger().warning("Exeeded the block limit while saving schematic of " + regionInterface.getName());
|
||||
return false;
|
||||
}
|
||||
Closer closer = Closer.create();
|
||||
try {
|
||||
FileOutputStream fos = closer.register(new FileOutputStream(file));
|
||||
BufferedOutputStream bos = closer.register(new BufferedOutputStream(fos));
|
||||
ClipboardWriter writer = closer.register(ClipboardFormat.SCHEMATIC.getWriter(bos));
|
||||
writer.write(clipboard, world.getWorldData());
|
||||
} catch (IOException e) {
|
||||
pluginInterface.getLogger().warning("An error occured while restoring schematic of " + regionInterface.getName() + ", enable debug to see the complete stacktrace");
|
||||
pluginInterface.debugI(ExceptionUtils.getStackTrace(e));
|
||||
return false;
|
||||
} finally {
|
||||
try {
|
||||
closer.close();
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
/target
|
||||
@@ -0,0 +1,41 @@
|
||||
<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-worldguard-5</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>AreaShop WorldGuard 5</name>
|
||||
<version>WorldGuard-5</version>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<parent>
|
||||
<groupId>nl.evolutioncoding</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>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>nl.evolutioncoding</groupId>
|
||||
<artifactId>areashop-interface</artifactId>
|
||||
<version>AreaShopInterface</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q</groupId>
|
||||
<artifactId>worldguard</artifactId>
|
||||
<version>5.9.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
+136
@@ -0,0 +1,136 @@
|
||||
package nl.evolutioncoding.areashop.handlers;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import nl.evolutioncoding.areashop.interfaces.AreaShopInterface;
|
||||
import nl.evolutioncoding.areashop.interfaces.WorldGuardInterface;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
|
||||
import com.sk89q.worldguard.domains.DefaultDomain;
|
||||
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
|
||||
public class WorldGuardHandler5 extends WorldGuardInterface {
|
||||
|
||||
public WorldGuardHandler5(AreaShopInterface pluginInterface) {
|
||||
super(pluginInterface);
|
||||
}
|
||||
|
||||
public void setOwners(ProtectedRegion region, String input) {
|
||||
// Split the string and parse all values
|
||||
String[] names = input.split(", ");
|
||||
DefaultDomain owners = region.getOwners();
|
||||
owners.removeAll();
|
||||
for(String owner : names) {
|
||||
if(owner != null && !owner.isEmpty()) {
|
||||
// Check for groups
|
||||
if(owner.startsWith("g:")) {
|
||||
if(owner.length() > 2) {
|
||||
owners.addGroup(owner.substring(2));
|
||||
}
|
||||
} else if(owner.startsWith("n:")) {
|
||||
if(owner.length() > 2) {
|
||||
owners.addPlayer(owner);
|
||||
}
|
||||
} else {
|
||||
UUID uuid;
|
||||
try {
|
||||
uuid = UUID.fromString(owner);
|
||||
} catch(IllegalArgumentException e) {
|
||||
System.out.println("Tried using '" + owner + "' as uuid for a region owner, is your flagProfiles section correct?");
|
||||
uuid = null;
|
||||
}
|
||||
if(uuid != null) {
|
||||
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(uuid);
|
||||
if(offlinePlayer != null && offlinePlayer.getName() != null) {
|
||||
owners.addPlayer(offlinePlayer.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
region.setOwners(owners);
|
||||
//System.out.println(" Flag " + flagName + " set: " + owners.toUserFriendlyString());
|
||||
}
|
||||
|
||||
public void setMembers(ProtectedRegion region, String input) {
|
||||
// Split the string and parse all values
|
||||
String[] names = input.split(", ");
|
||||
DefaultDomain members = region.getMembers();
|
||||
members.removeAll();
|
||||
for(String member : names) {
|
||||
if(member != null && !member.isEmpty()) {
|
||||
// Check for groups
|
||||
if(member.startsWith("g:")) {
|
||||
if(member.length() > 2) {
|
||||
members.addGroup(member.substring(2));
|
||||
}
|
||||
} else if(member.startsWith("n:")) {
|
||||
if(member.length() > 2) {
|
||||
members.addPlayer(member);
|
||||
}
|
||||
} else {
|
||||
UUID uuid;
|
||||
try {
|
||||
uuid = UUID.fromString(member);
|
||||
} catch(IllegalArgumentException e) {
|
||||
System.out.println("Tried using '" + member + "' as uuid for a region member, is your flagProfiles section correct?");
|
||||
uuid = null;
|
||||
}
|
||||
if(uuid != null) {
|
||||
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(uuid);
|
||||
if(offlinePlayer != null && offlinePlayer.getName() != null) {
|
||||
members.addPlayer(offlinePlayer.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
region.setMembers(members);
|
||||
//System.out.println(" Flag " + flagName + " set: " + members.toUserFriendlyString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<ProtectedRegion> getApplicableRegionsSet(Location location) {
|
||||
Set<ProtectedRegion> result = new HashSet<ProtectedRegion>();
|
||||
ApplicableRegionSet regions = pluginInterface.getWorldGuard().getRegionManager(location.getWorld()).getApplicableRegions(location);
|
||||
for(ProtectedRegion region : regions) {
|
||||
result.add(region);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsMember(ProtectedRegion region, UUID player) {
|
||||
if(player == null) {
|
||||
return false;
|
||||
} else {
|
||||
String name = Bukkit.getOfflinePlayer(player).getName();
|
||||
if(name != null) {
|
||||
return region.getMembers().contains(name);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsOwner(ProtectedRegion region, UUID player) {
|
||||
if(player == null) {
|
||||
return false;
|
||||
} else {
|
||||
String name = Bukkit.getOfflinePlayer(player).getName();
|
||||
if(name != null) {
|
||||
return region.getOwners().contains(name);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
/target
|
||||
@@ -0,0 +1,41 @@
|
||||
<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-worldguard-6</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>AreaShop WorldGuard 6</name>
|
||||
<version>WorldGuard-6</version>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<parent>
|
||||
<groupId>nl.evolutioncoding</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>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>nl.evolutioncoding</groupId>
|
||||
<artifactId>areashop-interface</artifactId>
|
||||
<version>AreaShopInterface</version>
|
||||
<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>
|
||||
</dependencies>
|
||||
</project>
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
package nl.evolutioncoding.areashop.handlers;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import nl.evolutioncoding.areashop.interfaces.AreaShopInterface;
|
||||
import nl.evolutioncoding.areashop.interfaces.WorldGuardInterface;
|
||||
|
||||
import org.bukkit.Location;
|
||||
|
||||
import com.sk89q.worldguard.domains.DefaultDomain;
|
||||
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
|
||||
public class WorldGuardHandler6 extends WorldGuardInterface {
|
||||
|
||||
public WorldGuardHandler6(AreaShopInterface pluginInterface) {
|
||||
super(pluginInterface);
|
||||
}
|
||||
|
||||
public void setOwners(ProtectedRegion region, String input) {
|
||||
// Split the string and parse all values
|
||||
String[] names = input.split(", ");
|
||||
DefaultDomain owners = region.getOwners();
|
||||
owners.removeAll();
|
||||
for(String owner : names) {
|
||||
if(owner != null && !owner.isEmpty()) {
|
||||
// Check for groups
|
||||
if(owner.startsWith("g:")) {
|
||||
if(owner.length() > 2) {
|
||||
owners.addGroup(owner.substring(2));
|
||||
}
|
||||
} else if(owner.startsWith("n:")) {
|
||||
if(owner.length() > 2) {
|
||||
owners.addPlayer(owner);
|
||||
}
|
||||
} else {
|
||||
UUID uuid;
|
||||
try {
|
||||
uuid = UUID.fromString(owner);
|
||||
} catch(IllegalArgumentException e) {
|
||||
// Don't like this but cannot access main plugin class from this module...
|
||||
System.out.println("[AreaShop] Tried using '" + owner + "' as uuid for a region owner, is your flagProfiles section correct?");
|
||||
uuid = null;
|
||||
}
|
||||
if(uuid != null) {
|
||||
owners.addPlayer(uuid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
region.setOwners(owners);
|
||||
//System.out.println(" Flag " + flagName + " set: " + owners.toUserFriendlyString());
|
||||
}
|
||||
|
||||
public void setMembers(ProtectedRegion region, String input) {
|
||||
// Split the string and parse all values
|
||||
String[] names = input.split(", ");
|
||||
DefaultDomain members = region.getMembers();
|
||||
members.removeAll();
|
||||
for(String member : names) {
|
||||
if(member != null && !member.isEmpty()) {
|
||||
// Check for groups
|
||||
if(member.startsWith("g:")) {
|
||||
if(member.length() > 2) {
|
||||
members.addGroup(member.substring(2));
|
||||
}
|
||||
} else if(member.startsWith("n:")) {
|
||||
if(member.length() > 2) {
|
||||
members.addPlayer(member);
|
||||
}
|
||||
} else {
|
||||
UUID uuid;
|
||||
try {
|
||||
uuid = UUID.fromString(member);
|
||||
} catch(IllegalArgumentException e) {
|
||||
// Don't like this but cannot access main plugin class from this module...
|
||||
System.out.println("[AreaShop] Tried using '" + member + "' as uuid for a region member, is your flagProfiles section correct?");
|
||||
uuid = null;
|
||||
}
|
||||
if(uuid != null) {
|
||||
members.addPlayer(uuid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
region.setMembers(members);
|
||||
//System.out.println(" Flag " + flagName + " set: " + members.toUserFriendlyString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<ProtectedRegion> getApplicableRegionsSet(Location location) {
|
||||
Set<ProtectedRegion> result = new HashSet<ProtectedRegion>();
|
||||
ApplicableRegionSet regions = pluginInterface.getWorldGuard().getRegionManager(location.getWorld()).getApplicableRegions(location);
|
||||
for(ProtectedRegion region : regions) {
|
||||
result.add(region);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsMember(ProtectedRegion region, UUID player) {
|
||||
return region.getMembers().contains(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsOwner(ProtectedRegion region, UUID player) {
|
||||
return region.getOwners().contains(player);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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>
|
||||
<groupId>nl.evolutioncoding</groupId>
|
||||
<artifactId>areashop-parent</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>parent</version>
|
||||
<name>AreaShop Parent</name>
|
||||
<url>http://dev.bukkit.org/bukkit-plugins/regionbuyandrent/</url>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<modules>
|
||||
<module>WorldGuard 5</module>
|
||||
<module>WorldGuard 6</module>
|
||||
<module>Interfaces</module>
|
||||
<module>WorldEdit 5</module>
|
||||
<module>WorldEdit 6</module>
|
||||
<module>AreaShop</module>
|
||||
</modules>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>bukkit-repo</id>
|
||||
<url>http://repo.bukkit.org/content/groups/public</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>sk89q-repo-wg</id>
|
||||
<url>http://maven.sk89q.com/artifactory/repo/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
</project>
|
||||
Reference in new issue
Block a user