Compare commits

..
66 Commits
Author SHA1 Message Date
Thijs Wiefferink 84e4b49bfd Update language files
English, Dutch and German are complete, others are only partially complete.
2016-03-06 00:07:31 +01:00
Thijs Wiefferink 6daaf6997d 1.9 compatibility fixes (getOnlinePlayers() method) 2016-03-05 22:15:21 +01:00
Thijs Wiefferink c445a62334 Add variable support to all messages where a region is known (mostly messages of commands were not using it yet). 2016-02-08 19:39:33 +01:00
Thijs Wiefferink 0d205b0d9e Change general.teleportLocationY to also accept a number. 2016-02-08 14:43:24 +01:00
Thijs Wiefferink 8c33826c2c Add build flag to default flagprofiles, users are often having trouble with this 2016-01-26 22:35:01 +01:00
Thijs Wiefferink 51e1dbafb7 Fix running sign commands going wrong.
Player commands are run first, which normally rents/buys a region, so when the console commands are ran after that, then it will run the commands of the wrong state (since the state just changed). Also fixed a minor WorldGuard version dependency issue.
2016-01-26 22:20:45 +01:00
Thijs Wiefferink 6edad3faff Add priority and interact flag to config.yml by default
50% of the issues are having more regions at the same place, and therefore requiring a higher priority for the AreaShop region and having chests accessible by anyone instead of only the region owner/member. This should fix these problems.
2016-01-12 21:43:04 +01:00
Thijs Wiefferink f89e0f861b Add a link to a preview server 2016-01-08 20:18:47 +01:00
Thijs Wiefferink 770b1d98df Refactoring:
- Move a bunch of utility methods from the AreaShop class to Utils
- Comments styling cleanup
- Display warning in console when region file does not load correctly (is empty)
2016-01-05 22:31:55 +01:00
Thijs Wiefferink 8e5baa47af Fix variables of sell messages 2015-12-26 20:08:01 +01:00
Thijs Wiefferink 367466735e Fix the 'n:<name>' option for member/owner region flags
Before it would keep the 'n:' part when adding the name to the region, therefore adding an incorrect name.
2015-12-26 00:45:05 +01:00
Thijs Wiefferink ade6bc3971 Add AddedRegionEvent+RemovedRegionEvent, moved sign/flags updating
- Sign updating now uses the event system
- WorldGuard region flag updating now uses the event system
- After changes made by commands/other user input it will now use update() on the region instead of the sign and region flag commands.
2015-12-13 19:55:47 +01:00
Thijs Wiefferink 05fd8c0156 Implement event system
- 'ask' type events that can be cancelled, broadcasted before the action happens
- 'notify' type events that cannot be cancelled, but only let you know that it has happened
- Events for renting (with extending flag), unrenting, buying, selling, reselling
- General 'RegionUpdateEvent' to listen to as display service (update signs, update regions flags, etc)

All messages in the GeneralRegion, RentRegion and BuyRegion classes can now use all region variables (in the future all other messages will also be worked through)

Closes #84
Closes #86
2015-12-11 20:54:12 +01:00
Thijs Wiefferink 5403472476 Cleanup/update config.yml and default.yml comments
- Add links to the wiki.
- Make things more consistent.
2015-12-10 23:16:19 +01:00
Thijs Wiefferink c4ee7bc7aa Add 'areashop.linksigns' to the 'areashop.*' permission group 2015-11-24 20:59:58 +01:00
Thijs Wiefferink 940f1969b6 Add link to dev builds on Jenkins 2015-11-24 20:43:44 +01:00
Thijs Wiefferink 07eb5477b8 Update Metrics 2015-11-17 21:21:27 +01:00
Thijs Wiefferink a4112092b5 Fix inclusion of the version specific classes of WorldGuard/WorldEdit in the final jar 2015-11-15 23:47:23 +01:00
Thijs Wiefferink 872d81b0a9 Cleanup code, fix some small bugs
Most of these things have been found with help of Intellij IDEA, preferring it over Eclipse already
2015-11-15 23:35:48 +01:00
Thijs Wiefferink b04871c553 Add rental to max when rental would go above maxRentTime otherwise
- Setting `extendToFullWhenAboveMaxRentTime` to set if AreaShop should
automatically extend to max when the player cannot rent a full duration
because of `maxRentTime`.

Fixes #94
2015-11-11 11:56:16 +01:00
Thijs Wiefferink fd1b8fba4c Fix inactiveSetting debug messages
The messages still assumed the inactiveSettings was in minutes instead
of in milliseconds.
2015-11-02 22:39:40 +01:00
Thijs Wiefferink 991e7b1961 Fix lastActive sometimes not updating correctly
- Update the lastActive time at rent/buy to ensure it is non-zero
- Ignore lastActive time of zero, give back current time
- Update lastActive time at server shutdown for players that are still
online, quit events are not fired at shutdown
2015-11-02 22:32:51 +01:00
Thijs Wiefferink aac963325a CI run :) 2015-11-01 23:03:41 +01:00
Thijs Wiefferink 3e7c7ce76b Fix message variables for '/as info player <player>' feedback 2015-10-31 23:15:11 +01:00
Thijs Wiefferink c858d30481 Add .gitignore to the repository 2015-10-19 19:07:31 +02:00
Thijs Wiefferink b090fd5577 Remove MCStats image, site is more offline than online 2015-10-17 22:10:38 +02:00
Thijs Wiefferink 8d132c66c4 Prepare for the v2.2.1 release
- Update version number
- Update language files from Transifex
2015-10-17 21:03:30 +02:00
Thijs Wiefferink 50e3e59543 Fix indentation and error message of WorldEdit 6 integration handler 2015-10-15 12:13:15 +02:00
Thijs Wiefferink eb21b9567e Change signtags from [arent] and [abuy] to [asrent] and [asbuy]
Changes #45
2015-10-08 22:49:41 +02:00
Thijs Wiefferink 4dba305f6d Change the default sign tags to something more specific
Note: Change documentation pages to include this.

Fixes #45
2015-10-06 22:41:59 +02:00
Thijs Wiefferink 7481d8287f Retrieve money from landlords when unrenting/selling a region.
Prevents exploits by giving money to landlords, and then
unrenting/selling to get money back from 'the server' (nobody). Now it
will get the money back from the landlord, or if that is not possible
then not give anything back.

Fixes #75
2015-10-06 22:15:09 +02:00
Thijs Wiefferink 4d41decbe5 Config part of week indicators 2015-10-03 21:14:24 +02:00
Thijs Wiefferink 7fc5a5af81 Add weeks time indicators, clean other indicators
The old Dutch time indicators have been removed from the lists, this
might cause problems for people if they regenerate their config but
don't add these tags again.

Added console warnings at startup to indicate incorrect duration
strings.

Fixes #32
2015-10-03 21:12:38 +02:00
Thijs Wiefferink d26fa99b95 Fix using the seconds modifier with /as setduration
AreaShop could correctly read and use all seconds modifiers that are
defined in the config, but the `/as setduration` command would not
accept it as input.

Fixes #82
2015-10-03 20:38:38 +02:00
Thijs Wiefferink 39d755d2db Make removing regions from AreaShop less destructible for region flags
First AreaShop would reset all flags, now it will only reset the
greeting and farewell flags. This is to make sure players do not get
confused about the region, if the greeting is still there then players
might think it is still connected to AreaShop.

Fixes #72
2015-10-03 20:27:19 +02:00
Thijs Wiefferink 48ab46ecf7 Fix indirect breaking of signs causing it to disconnect
If you would break a block behind/below a sign AreaShop would disconnect
it from the region, which is most of the times not the wanted behaviour.
This commit changes it to simply leave a floating sign there, so that it
is still visible and not disconnected from the region.

Fixes #15
2015-10-03 20:10:44 +02:00
Thijs Wiefferink b3fa31e1cc Remove debug message 2015-10-02 20:44:25 +02:00
Thijs Wiefferink 783085fbf7 Cache region variable replacements 2015-10-02 20:41:00 +02:00
Thijs Wiefferink aa093b0c8a Fix sign clicking still executing while event is cancelled. 2015-09-26 01:06:22 +02:00
Thijs Wiefferink 9c357fe929 Remove lastActive from region file when unrented/sold
No problems if it is there, but just keeping the region file clean.
2015-09-11 22:44:12 +02:00
Thijs Wiefferink 4d70571a23 Improve failed file loading
- Detects incorrectly loaded config.yml and default.yml
(YamlConfiguration prints errors to console and continues silently,
returning an empty configuration if something is wrong normally)
- Will go into error state when loading fails
- Improved some error handling to make sure that no extra errors are
thrown because of trying to close non-existing streams.
2015-09-10 21:58:57 +02:00
Thijs Wiefferink 29a4105ece Add Vault to the repo to make it easier to compile 2015-09-06 17:05:38 +02:00
Thijs Wiefferink edc7136063 Fix '/as info' always showing landlord line
It would always show the landlord line, if there was no actual landlord
it would show '<UNKNOWN>' as name, which is very confusing.

Fixes #46
2015-09-06 16:42:16 +02:00
Thijs Wiefferink 6fabc75be4 Fix '/as info' trying to filter by group too much
'/as info region' would also try to filter by group using the region
name, which would almost always cause an error message (group not found)
2015-09-06 16:38:23 +02:00
Thijs Wiefferink 085507bf8b Add required dependencies section 2015-08-30 00:10:12 +02:00
Thijs Wiefferink 73ed3366ae Update README.md 2015-08-29 22:27:14 +02:00
Thijs Wiefferink 9ca029176d Fix '/as find' not getting your balance correctly
- If you search with your balance (and do not give a maxprice) it would
always use 0.0 as your balance, therefore not finding any regions.
- Also fixes the incorrect feedback, it would say it searched with a
maxprice instead of your balance and the other way around if no regions
are found.
- Fixed maxprice and balance display to use correct currency symbols and
layouts (decimals, metric prefixes, separator).

Fixes #59
2015-08-29 20:06:16 +02:00
Thijs Wiefferink bf181d69d7 Update README.md 2015-08-29 19:46:05 +02:00
Thijs Wiefferink 68c57515da Update README.md 2015-08-29 19:44:54 +02:00
Thijs Wiefferink 903d6c309f Update README.md 2015-08-29 19:44:39 +02:00
Thijs Wiefferink 0a02eb3254 Update README.md 2015-08-29 19:42:57 +02:00
Thijs Wiefferink bf04589fab Merge links to issues with the top menu 2015-08-29 19:42:11 +02:00
Thijs Wiefferink 14dd094803 Update README.md 2015-08-27 22:51:49 +02:00
Thijs Wiefferink 02df35304c Update README.md 2015-08-27 22:48:11 +02:00
Thijs Wiefferink 4321667ec5 Merge branch 'master' of https://github.com/NLthijs48/AreaShop 2015-08-26 20:05:03 +02:00
Thijs Wiefferink 5cf5df78c8 Add permissions to prevent buying resell regions
- Permission 'areashop.buynormal' can be negated to only allow buying
regions that are in resell mode
- Permission 'areashop.buyresell' can be negated to only allow buying
regions that are not in resell mode

This change does not affect existing permissions setups (above
permissions are true by default)
2015-08-26 20:04:50 +02:00
Thijs Wiefferink 8608d6ce1d Update README.md 2015-08-25 17:40:08 +02:00
Thijs Wiefferink 614336862e Update README.md 2015-08-25 17:38:02 +02:00
Thijs Wiefferink a4ea175f1b Update README.md 2015-08-25 17:33:52 +02:00
Thijs Wiefferink c96043aa38 Update README.md 2015-08-25 17:30:11 +02:00
Thijs Wiefferink d5a29f6c32 Update README.MD: WIP frontpage
Frontpage like the BukkitDev and Spigot Resources section.
2015-08-25 17:29:21 +02:00
Thijs Wiefferink 5176a1c2c5 Update README.md 2015-08-21 21:45:42 +02:00
Thijs Wiefferink 89569ea182 Update README.md 2015-08-17 23:11:46 +02:00
Thijs Wiefferink f349657a59 Fix bug with teleporting to signs
Fixes #47
2015-08-13 22:04:22 +02:00
Thijs Wiefferink 40d3d4d8af Add group filtering to /as info <rented|forrent|sold|forsale>
- Filter regions by group for the mentioned subcommands of /as info
- Clean/refactor code
- Sort the output
- Add Comparable, equals() and toString() to GeneralRegion

Closes #44
2015-08-11 22:41:30 +02:00
Thijs Wiefferink 0d5db8fa4e Add option to deny extending when over rent/total limits
Turned on by default, added config setting
'allowRegionExtendsWhenAboveLimits' to disable this change. Normally
this is expected behaviour, which pushes users to let the region run out
if they should not be able to rent it anymore (was impossible to do
before).

Closes #41
2015-08-10 21:43:29 +02:00
87 changed files with 4823 additions and 4067 deletions

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
# Maven stuff
/target
*.pydevproject
.project
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# CDT-specific
.cproject
# PDT-specific
.buildpath
# IntelliJ IDEA
*.iml
+5 -8
View File
@@ -5,7 +5,7 @@
<artifactId>areashop</artifactId>
<packaging>jar</packaging>
<name>AreaShop</name>
<version>2.2.0</version> <!-- Main plugin version -->
<version>2.2.2</version> <!-- Main plugin version -->
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -90,7 +90,7 @@
<artifactId>vault</artifactId>
<version>1.4.1</version>
<scope>system</scope>
<systemPath>${basedir}/../Dependencies/Vault.jar</systemPath>
<systemPath>${basedir}/../dependencies/Vault.jar</systemPath>
</dependency>
</dependencies>
@@ -116,7 +116,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.4</version>
<version>2.4.3</version>
<executions>
<execution>
<phase>package</phase>
@@ -128,7 +128,7 @@
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<version>3.5.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
@@ -139,7 +139,7 @@
<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"/>
<copy file="./target/${project.build.finalName}.jar" tofile="C:\Games\Minecraft\Spigot\plugins\${project.build.finalName}.jar"/>
</tasks>
</configuration>
<executions>
@@ -148,9 +148,6 @@
<goals>
<goal>run</goal>
</goals>
<configuration>
<target failonerror="false"></target>
</configuration>
</execution>
</executions>
</plugin>
@@ -1,15 +1,14 @@
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 com.sk89q.worldedit.bukkit.WorldEditPlugin;
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
import net.milkbowl.vault.economy.Economy;
import nl.evolutioncoding.areashop.Updater.UpdateResult;
import nl.evolutioncoding.areashop.Updater.UpdateType;
import nl.evolutioncoding.areashop.features.DebugFeature;
import nl.evolutioncoding.areashop.features.Feature;
import nl.evolutioncoding.areashop.features.SignDisplayFeature;
import nl.evolutioncoding.areashop.features.WorldGuardRegionFlagsFeature;
import nl.evolutioncoding.areashop.interfaces.AreaShopInterface;
import nl.evolutioncoding.areashop.interfaces.WorldEditInterface;
import nl.evolutioncoding.areashop.interfaces.WorldGuardInterface;
@@ -21,28 +20,30 @@ 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 nl.evolutioncoding.areashop.regions.GeneralRegion;
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.event.Listener;
import org.bukkit.permissions.Permission;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
import java.util.HashSet;
import java.util.Set;
import java.util.logging.Logger;
/**
* Main class for the AreaShop plugin
* @author NLThijs48
*/
public final class AreaShop extends JavaPlugin implements AreaShopInterface {
/* General variables */
// General variables
private static AreaShop instance = null;
private WorldGuardPlugin worldGuard = null;
@@ -59,7 +60,7 @@ public final class AreaShop extends JavaPlugin implements AreaShopInterface {
private boolean updateAvailable = false;
private boolean ready = false;
/* Folders and file names */
// Folders and file names
public static final String languageFolder = "lang";
public static final String schematicFolder = "schem";
public static final String schematicExtension = ".schematic";
@@ -69,14 +70,14 @@ public final class AreaShop extends JavaPlugin implements AreaShopInterface {
public static final String configFile = "config.yml";
public static final String versionFile = "versions";
/* Euro tag for in the config */
// Euro tag for in the config
public static final String currencyEuro = "%euro%";
/* Constants for handling file versions */
// 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 */
// 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%";
@@ -191,7 +192,7 @@ public final class AreaShop extends JavaPlugin implements AreaShopInterface {
// Load all data from files and check versions
fileManager = new FileManager(this);
error = error & !fileManager.loadFiles();
error = error | !fileManager.loadFiles();
// Print loaded version of WG and WE in debug
if(wgVersion != null) {
@@ -212,7 +213,8 @@ public final class AreaShop extends JavaPlugin implements AreaShopInterface {
this.getServer().getPluginManager().registerEvents(new SignBreakListener(this), this);
this.getServer().getPluginManager().registerEvents(new SignClickListener(this), this);
this.getServer().getPluginManager().registerEvents(new PlayerLoginLogoutListener(this), this);
setupFeatures();
setupTasks();
// Startup the CommandManager (registers itself for the command)
@@ -243,7 +245,7 @@ public final class AreaShop extends JavaPlugin implements AreaShopInterface {
new BukkitRunnable() {
@Override
public void run() {
for(Player player : Bukkit.getOnlinePlayers()) {
for(Player player : Utils.getOnlinePlayers()) {
if(player.hasPermission("areashop.notifyupdate")) {
AreaShop.getInstance().message(player, "update-playerNotify", AreaShop.getInstance().getDescription().getVersion(), AreaShop.getInstance().getUpdater().getLatestName());
}
@@ -266,10 +268,16 @@ public final class AreaShop extends JavaPlugin implements AreaShopInterface {
* Called on shutdown or reload of the server
*/
public void onDisable() {
// Update lastactive time for players that are online now
for(GeneralRegion region : fileManager.getRegions()) {
Player player = Bukkit.getPlayer(region.getOwner());
if(player != null) {
region.updateLastActiveTime();
}
}
fileManager.saveRequiredFilesAtOnce();
Bukkit.getServer().getScheduler().cancelTasks(this);
/* set variables to null to prevent memory leaks */
worldGuard = null;
worldEdit = null;
fileManager = null;
@@ -279,7 +287,25 @@ public final class AreaShop extends JavaPlugin implements AreaShopInterface {
debug = false;
ready = false;
updater = null;
}
}
/**
* Instanciate and register all Feature classes
*/
public void setupFeatures() {
Set<Feature> features = new HashSet<>();
features.add(new DebugFeature(this));
features.add(new SignDisplayFeature(this));
features.add(new WorldGuardRegionFlagsFeature(this));
// Register as listener when necessary
for(Feature feature : features) {
if(feature instanceof Listener) {
this.getServer().getPluginManager().registerEvents((Listener)feature, this);
}
}
}
/**
* Indicates if the plugin is ready to be used
@@ -380,7 +406,7 @@ public final class AreaShop extends JavaPlugin implements AreaShopInterface {
/**
* Get the current chatPrefix
* @return
* @return The current chatPrefix
*/
public String getChatPrefix() {
return chatprefix;
@@ -437,77 +463,77 @@ public final class AreaShop extends JavaPlugin implements AreaShopInterface {
*/
public void setupTasks() {
// Rent expiration timer
long expirationCheck = Utils.millisToTicks(getDurationFromSecondsOrString("expiration.delay"));
final AreaShop finalPlugin = this;
if(expirationCheck > 0) {
long expirationCheck = Utils.millisToTicks(Utils.getDurationFromSecondsOrString("expiration.delay"));
final AreaShop finalPlugin = this;
if(expirationCheck > 0) {
new BukkitRunnable() {
@Override
public void run() {
if(isReady()) {
finalPlugin.getFileManager().checkRents();
AreaShop.debug("Checking rent expirations...");
AreaShop.debugTask("Checking rent expirations...");
} else {
AreaShop.debug("Skipped checking rent expirations, plugin not ready");
AreaShop.debugTask("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() {
long inactiveCheck = Utils.millisToTicks(Utils.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...");
AreaShop.debugTask("Checking for regions with players that are inactive too long...");
} else {
AreaShop.debug("Skipped checking for regions of inactive players, plugin not ready");
AreaShop.debugTask("Skipped checking for regions of inactive players, plugin not ready");
}
}
}.runTaskTimer(this, inactiveCheck, inactiveCheck);
}
// Periodic updating of signs for timeleft tags
long periodicUpdate = Utils.millisToTicks(getDurationFromSecondsOrString("signs.delay"));
if(periodicUpdate > 0) {
new BukkitRunnable() {
long periodicUpdate = Utils.millisToTicks(Utils.getDurationFromSecondsOrString("signs.delay"));
if(periodicUpdate > 0) {
new BukkitRunnable() {
@Override
public void run() {
if(isReady()) {
finalPlugin.getFileManager().performPeriodicSignUpdate();
AreaShop.debug("Performing periodic sign update...");
AreaShop.debugTask("Performing periodic sign update...");
} else {
AreaShop.debug("Skipped performing periodic sign update, plugin not ready");
AreaShop.debugTask("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() {
long saveFiles = Utils.millisToTicks(Utils.getDurationFromMinutesOrString("saving.delay"));
if(saveFiles > 0) {
new BukkitRunnable() {
@Override
public void run() {
if(isReady()) {
finalPlugin.getFileManager().saveRequiredFiles();
AreaShop.debug("Saving required files...");
AreaShop.debugTask("Saving required files...");
} else {
AreaShop.debug("Skipped saving required files, plugin not ready");
AreaShop.debugTask("Skipped saving required files, plugin not ready");
}
}
}.runTaskTimer(this, saveFiles, saveFiles);
}
// Sending warnings about rent regions to online players
long expireWarning = Utils.millisToTicks(getDurationFromMinutesOrString("expireWarning.delay"));
if(expireWarning > 0) {
new BukkitRunnable() {
long expireWarning = Utils.millisToTicks(Utils.getDurationFromMinutesOrString("expireWarning.delay"));
if(expireWarning > 0) {
new BukkitRunnable() {
@Override
public void run() {
if(isReady()) {
finalPlugin.getFileManager().sendRentExpireWarnings();
AreaShop.debug("Sending rent expire warnings...");
AreaShop.debugTask("Sending rent expire warnings...");
} else {
AreaShop.debug("Skipped sending rent expire warnings, plugin not ready");
AreaShop.debugTask("Skipped sending rent expire warnings, plugin not ready");
}
}
}.runTaskTimer(this, expireWarning, expireWarning);
@@ -518,7 +544,7 @@ public final class AreaShop extends JavaPlugin implements AreaShopInterface {
@Override
public void run() {
finalPlugin.getFileManager().updateAllRegions();
AreaShop.debug("Updating all regions at startup...");
AreaShop.debugTask("Updating all regions at startup...");
}
}.runTaskLater(this, 20L);
}
@@ -532,13 +558,16 @@ public final class AreaShop extends JavaPlugin implements AreaShopInterface {
* @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(target == null) {
return;
}
String langString = Utils.applyColors(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);
((Player)target).sendMessage(Utils.applyColors(chatprefix)+langString);
} else {
((Player)target).sendMessage(langString);
}
@@ -565,97 +594,10 @@ public final class AreaShop extends JavaPlugin implements AreaShopInterface {
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
* Return the config
*/
@Override
public YamlConfiguration getConfig() {
@@ -672,152 +614,9 @@ public final class AreaShop extends JavaPlugin implements AreaShopInterface {
} 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
@@ -833,7 +632,17 @@ public final class AreaShop extends JavaPlugin implements AreaShopInterface {
public void debugI(String message) {
AreaShop.debug(message);
}
/**
* Print debug message for periodic task
* @param message The message to print
*/
public static void debugTask(String message) {
if(AreaShop.getInstance().getConfig().getBoolean("debugTask")) {
AreaShop.debug(message);
}
}
/**
* Reload all files of the plugin and update all regions
* confirmationReceiver The CommandSender that should receive confirmation messages, null for nobody
@@ -841,8 +650,6 @@ public final class AreaShop extends JavaPlugin implements AreaShopInterface {
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");
@@ -856,57 +663,6 @@ public final class AreaShop extends JavaPlugin implements AreaShopInterface {
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();
}
}
}
@@ -28,29 +28,21 @@
package nl.evolutioncoding.areashop;
import org.bukkit.Bukkit;
import org.bukkit.Server;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
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.io.*;
import java.lang.reflect.Method;
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.*;
import java.util.logging.Level;
import java.util.zip.GZIPOutputStream;
@@ -117,7 +109,7 @@ public class Metrics {
private volatile BukkitTask task = null;
public Metrics(final Plugin plugin) throws IOException {
if (plugin == null) {
if(plugin == null) {
throw new IllegalArgumentException("Plugin cannot be null");
}
@@ -133,7 +125,7 @@ public class Metrics {
configuration.addDefault("debug", false);
// Do we need to create the file?
if (configuration.get("guid", null) == null) {
if(configuration.get("guid", null) == null) {
configuration.options().header("http://mcstats.org").copyDefaults(true);
configuration.save(configurationFile);
}
@@ -146,12 +138,11 @@ public class Metrics {
/**
* 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) {
if(name == null) {
throw new IllegalArgumentException("Graph name cannot be null");
}
@@ -167,11 +158,10 @@ public class Metrics {
/**
* 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) {
if(graph == null) {
throw new IllegalArgumentException("Graph cannot be null");
}
@@ -182,18 +172,17 @@ public class Metrics {
* 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) {
synchronized(optOutLock) {
// Did we opt out?
if (isOptOut()) {
if(isOptOut()) {
return false;
}
// Is metrics already running?
if (task != null) {
if(task != null) {
return true;
}
@@ -205,13 +194,13 @@ public class Metrics {
public void run() {
try {
// This has to be synchronized or it can collide with the disable method.
synchronized (optOutLock) {
synchronized(optOutLock) {
// Disable Task, if it is running and the server owner decided to opt-out
if (isOptOut() && task != null) {
if(isOptOut() && task != null) {
task.cancel();
task = null;
// Tell all plotters to stop gathering information.
for (Graph graph : graphs) {
for(Graph graph : graphs) {
graph.onOptOut();
}
}
@@ -225,8 +214,8 @@ public class Metrics {
// After the first post we set firstPost to false
// Each post thereafter will be a ping
firstPost = false;
} catch (IOException e) {
if (debug) {
} catch(IOException e) {
if(debug) {
Bukkit.getLogger().log(Level.INFO, "[Metrics] " + e.getMessage());
}
}
@@ -239,21 +228,20 @@ public class Metrics {
/**
* Has the server owner denied plugin metrics?
*
* @return true if metrics should be opted out of it
*/
public boolean isOptOut() {
synchronized (optOutLock) {
synchronized(optOutLock) {
try {
// Reload the metrics file
configuration.load(getConfigFile());
} catch (IOException ex) {
if (debug) {
} catch(IOException ex) {
if(debug) {
Bukkit.getLogger().log(Level.INFO, "[Metrics] " + ex.getMessage());
}
return true;
} catch (InvalidConfigurationException ex) {
if (debug) {
} catch(InvalidConfigurationException ex) {
if(debug) {
Bukkit.getLogger().log(Level.INFO, "[Metrics] " + ex.getMessage());
}
return true;
@@ -264,20 +252,18 @@ public class Metrics {
/**
* 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) {
synchronized(optOutLock) {
// Check if the server owner has already set opt-out, if not, set it.
if (isOptOut()) {
if(isOptOut()) {
configuration.set("opt-out", false);
configuration.save(configurationFile);
}
// Enable Task, if it is not running
if (task == null) {
if(task == null) {
start();
}
}
@@ -285,20 +271,18 @@ public class Metrics {
/**
* 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) {
synchronized(optOutLock) {
// Check if the server owner has already set opt-out, if not, set it.
if (!isOptOut()) {
if(!isOptOut()) {
configuration.set("opt-out", true);
configuration.save(configurationFile);
}
// Disable Task, if it is running
if (task != null) {
if(task != null) {
task.cancel();
task = null;
}
@@ -307,7 +291,6 @@ public class Metrics {
/**
* 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() {
@@ -322,6 +305,27 @@ public class Metrics {
return new File(new File(pluginsFolder, "PluginMetrics"), "config.yml");
}
/**
* Gets the online player (backwards compatibility)
* @return online player amount
*/
private int getOnlinePlayers() {
try {
Method onlinePlayerMethod = Server.class.getMethod("getOnlinePlayers");
if(onlinePlayerMethod.getReturnType().equals(Collection.class)) {
return ((Collection<?>)onlinePlayerMethod.invoke(Bukkit.getServer())).size();
} else {
return ((Player[])onlinePlayerMethod.invoke(Bukkit.getServer())).length;
}
} catch(Exception ex) {
if(debug) {
Bukkit.getLogger().log(Level.INFO, "[Metrics] " + ex.getMessage());
}
}
return 0;
}
/**
* Generic method that posts a plugin to the metrics website
*/
@@ -332,8 +336,7 @@ public class Metrics {
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;
int playersOnline = this.getOnlinePlayers();
// END server software specific section -- all code below does not use any code outside of this class / Java
@@ -355,7 +358,7 @@ public class Metrics {
int coreCount = Runtime.getRuntime().availableProcessors();
// normalize os arch .. amd64 -> x86_64
if (osarch.equals("amd64")) {
if(osarch.equals("amd64")) {
osarch = "x86_64";
}
@@ -367,12 +370,12 @@ public class Metrics {
appendJSONPair(json, "java_version", java_version);
// If we're pinging, append it
if (isPing) {
if(isPing) {
appendJSONPair(json, "ping", "1");
}
if (graphs.size() > 0) {
synchronized (graphs) {
if(graphs.size() > 0) {
synchronized(graphs) {
json.append(',');
json.append('"');
json.append("graphs");
@@ -384,19 +387,19 @@ public class Metrics {
final Iterator<Graph> iter = graphs.iterator();
while (iter.hasNext()) {
while(iter.hasNext()) {
Graph graph = iter.next();
StringBuilder graphJson = new StringBuilder();
graphJson.append('{');
for (Plotter plotter : graph.getPlotters()) {
for(Plotter plotter : graph.getPlotters()) {
appendJSONPair(graphJson, plotter.getColumnName(), Integer.toString(plotter.getValue()));
}
graphJson.append('}');
if (!firstGraph) {
if(!firstGraph) {
json.append(',');
}
@@ -422,7 +425,7 @@ public class Metrics {
// 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()) {
if(isMineshafterPresent()) {
connection = url.openConnection(Proxy.NO_PROXY);
} else {
connection = url.openConnection();
@@ -442,7 +445,7 @@ public class Metrics {
connection.setDoOutput(true);
if (debug) {
if(debug) {
System.out.println("[Metrics] Prepared request for " + pluginName + " uncompressed=" + uncompressed.length + " compressed=" + compressed.length);
}
@@ -459,24 +462,24 @@ public class Metrics {
os.close();
reader.close();
if (response == null || response.startsWith("ERR") || response.startsWith("7")) {
if (response == null) {
if(response == null || response.startsWith("ERR") || response.startsWith("7")) {
if(response == null) {
response = "null";
} else if (response.startsWith("7")) {
} 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) {
if(response.equals("1") || response.contains("This is your first update this hour")) {
synchronized(graphs) {
final Iterator<Graph> iter = graphs.iterator();
while (iter.hasNext()) {
while(iter.hasNext()) {
final Graph graph = iter.next();
for (Plotter plotter : graph.getPlotters()) {
for(Plotter plotter : graph.getPlotters()) {
plotter.reset();
}
}
@@ -487,9 +490,6 @@ public class Metrics {
/**
* GZip compress a string of bytes
*
* @param input
* @return
*/
public static byte[] gzip(String input) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -498,12 +498,12 @@ public class Metrics {
try {
gzos = new GZIPOutputStream(baos);
gzos.write(input.getBytes("UTF-8"));
} catch (IOException e) {
} catch(IOException e) {
e.printStackTrace();
} finally {
if (gzos != null) try {
if(gzos != null) try {
gzos.close();
} catch (IOException ignore) {
} catch(IOException ignore) {
}
}
@@ -512,46 +512,40 @@ public class Metrics {
/**
* 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) {
} 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")) {
if(value.equals("0") || !value.endsWith("0")) {
Double.parseDouble(value);
isValueNumeric = true;
}
} catch (NumberFormatException e) {
} catch(NumberFormatException e) {
isValueNumeric = false;
}
if (json.charAt(json.length() - 1) != '{') {
if(json.charAt(json.length() - 1) != '{') {
json.append(',');
}
json.append(escapeJSON(key));
json.append(':');
if (isValueNumeric) {
if(isValueNumeric) {
json.append(value);
} else {
json.append(escapeJSON(value));
@@ -560,18 +554,15 @@ public class Metrics {
/**
* 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++) {
for(int index = 0; index < text.length(); index++) {
char chr = text.charAt(index);
switch (chr) {
switch(chr) {
case '"':
case '\\':
builder.append('\\');
@@ -590,7 +581,7 @@ public class Metrics {
builder.append("\\r");
break;
default:
if (chr < ' ') {
if(chr < ' ') {
String t = "000" + Integer.toHexString(chr);
builder.append("\\u" + t.substring(t.length() - 4));
} else {
@@ -606,7 +597,6 @@ public class Metrics {
/**
* Encode text as UTF-8
*
* @param text the text to encode
* @return the encoded text, as UTF-8
*/
@@ -636,7 +626,6 @@ public class Metrics {
/**
* Gets the graph's name
*
* @return the Graph's name
*/
public String getName() {
@@ -645,7 +634,6 @@ public class Metrics {
/**
* 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) {
@@ -654,7 +642,6 @@ public class Metrics {
/**
* Remove a plotter from the graph
*
* @param plotter the plotter to remove from the graph
*/
public void removePlotter(final Plotter plotter) {
@@ -663,7 +650,6 @@ public class Metrics {
/**
* 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() {
@@ -677,11 +663,11 @@ public class Metrics {
@Override
public boolean equals(final Object object) {
if (!(object instanceof Graph)) {
if(!(object instanceof Graph)) {
return false;
}
final Graph graph = (Graph) object;
final Graph graph = (Graph)object;
return graph.name.equals(name);
}
@@ -711,7 +697,6 @@ public class Metrics {
/**
* 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) {
@@ -722,14 +707,12 @@ public class Metrics {
* 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() {
@@ -749,11 +732,11 @@ public class Metrics {
@Override
public boolean equals(final Object object) {
if (!(object instanceof Plotter)) {
if(!(object instanceof Plotter)) {
return false;
}
final Plotter plotter = (Plotter) object;
final Plotter plotter = (Plotter)object;
return plotter.name.equals(name) && plotter.getValue() == getValue();
}
}
@@ -1,34 +1,82 @@
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;
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.*;
import org.bukkit.block.BlockFace;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import java.lang.reflect.Method;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
public class Utils {
// Not used
private Utils() {}
private static YamlConfiguration config;
private static ArrayList<String> identifiers;
private static ArrayList<String> seconds;
private static ArrayList<String> minutes;
private static ArrayList<String> hours;
private static ArrayList<String> days;
private static ArrayList<String> weeks;
private static ArrayList<String> months;
private static ArrayList<String> years;
public static void initialize(YamlConfiguration pluginConfig) {
config = pluginConfig;
// Setup individual identifiers
seconds = new ArrayList<>(config.getStringList("seconds"));
minutes = new ArrayList<>(config.getStringList("minutes"));
hours = new ArrayList<>(config.getStringList("hours"));
days = new ArrayList<>(config.getStringList("days"));
weeks = new ArrayList<>(config.getStringList("weeks"));
months = new ArrayList<>(config.getStringList("months"));
years = new ArrayList<>(config.getStringList("years"));
// Setup all time identifiers
identifiers = new ArrayList<>();
identifiers.addAll(seconds);
identifiers.addAll(minutes);
identifiers.addAll(hours);
identifiers.addAll(days);
identifiers.addAll(weeks);
identifiers.addAll(months);
identifiers.addAll(years);
}
/**
* Gets the online players
* Provides backwards compatibility for 1.7- where it returns an array
* @return Online players
*/
@SuppressWarnings("unchecked")
public static Collection<? extends Player> getOnlinePlayers() {
try {
Method onlinePlayerMethod = Server.class.getMethod("getOnlinePlayers");
if(onlinePlayerMethod.getReturnType().equals(Collection.class)) {
return ((Collection<? extends Player>)onlinePlayerMethod.invoke(Bukkit.getServer()));
} else {
return Arrays.asList((Player[])onlinePlayerMethod.invoke(Bukkit.getServer()));
}
} catch(Exception ex) {
AreaShop.debug("getOnlinePlayers error: "+ex.getMessage());
}
return new HashSet<>();
}
/**
* Create a map from a location, to save it in the config
* @param location The location to transform
@@ -55,7 +103,7 @@ public class Utils {
/**
* Create a location from a map, reconstruction from the config values
* @param map The map to reconstruct from
* @param config The config section to reconstruct from
* @return The location
*/
public static Location configToLocation(ConfigurationSection config) {
@@ -68,10 +116,10 @@ public class Utils {
return null;
}
Location result = new Location(
Bukkit.getWorld(config.getString("world")),
(Double)config.getDouble("x"),
(Double)config.getDouble("y"),
(Double)config.getDouble("z"));
Bukkit.getWorld(config.getString("world")),
config.getDouble("x"),
config.getDouble("y"),
config.getDouble("z"));
if(config.isString("yaw") && config.isString("pitch")) {
result.setPitch(Float.parseFloat(config.getString("pitch")));
result.setYaw(Float.parseFloat(config.getString("yaw")));
@@ -84,7 +132,7 @@ public class Utils {
* @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) {
public static String createCommaSeparatedList(Collection<?> input) {
String result = "";
boolean first = true;
for(Object object : input) {
@@ -108,9 +156,10 @@ public class Utils {
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 };
/**
private static final BlockFace[] facings = {BlockFace.NORTH, BlockFace.NORTH_EAST, BlockFace.EAST, BlockFace.SOUTH_EAST, BlockFace.SOUTH, BlockFace.SOUTH_WEST, BlockFace.WEST, BlockFace.NORTH_WEST};
/**
* Get the facing direction based on the yaw
* @param yaw The horizontal angle that for example the player is looking
* @return The Block Face of the angle
@@ -128,7 +177,7 @@ public class Utils {
* @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>();
ArrayList<GeneralRegion> result = new ArrayList<>();
for(ProtectedRegion region : getWERegionsInSelection(selection)) {
GeneralRegion asRegion = AreaShop.getInstance().getFileManager().getRegion(region.getId());
if(asRegion != null) {
@@ -156,7 +205,7 @@ public class Utils {
// 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>();
ArrayList<ProtectedRegion> result = new ArrayList<>();
Location selectionMin = selection.getMinimumPoint();
Location selectionMax = selection.getMaximumPoint();
for(ProtectedRegion region : regionManager.getRegions().values()) {
@@ -193,7 +242,7 @@ public class Utils {
* @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>();
List<ProtectedRegion> result = new ArrayList<>();
Set<ProtectedRegion> regions = AreaShop.getInstance().getWorldGuardHandler().getApplicableRegionsSet(location);
if(regions != null) {
boolean first = true;
@@ -219,14 +268,14 @@ public class Utils {
// 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>();
List<RentRegion> result = new ArrayList<>();
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>();
List<BuyRegion> result = new ArrayList<>();
for(GeneralRegion region : getApplicableASRegions(location, RegionType.BUY)) {
result.add((BuyRegion)region);
}
@@ -236,11 +285,10 @@ public class Utils {
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
List<GeneralRegion> result = new ArrayList<>();
Set<ProtectedRegion> regions = AreaShop.getInstance().getWorldGuardHandler().getApplicableRegionsSet(location);
if(regions != null) {
List<GeneralRegion> candidates = new ArrayList<GeneralRegion>();
List<GeneralRegion> candidates = new ArrayList<>();
for(ProtectedRegion pr : regions) {
GeneralRegion region = AreaShop.getInstance().getFileManager().getRegion(pr.getId());
if(region != null && (
@@ -263,7 +311,7 @@ public class Utils {
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))) {
} else if(region.getRegion().getParent() != null && region.getRegion().getParent().equals(result.get(0).getRegion())) {
result.clear();
result.add(region);
} else {
@@ -272,9 +320,280 @@ public class Utils {
}
}
}
return new ArrayList<GeneralRegion>(result);
return new ArrayList<>(result);
}
/**
* Convert color and formatting codes to bukkit values
* @param input Start string with color and formatting codes in it
* @return String with the color and formatting codes in the bukkit format
*/
public static String applyColors(String input) {
String result = null;
if(input != null) {
result = ChatColor.translateAlternateColorCodes('&', input);
}
return result;
}
/**
* Format the currency amount with the characters before and after
* @param amount Amount of money to format
* @return Currency character format string
*/
public static String formatCurrency(double amount) {
String before = config.getString("moneyCharacter");
before = before.replace(AreaShop.currencyEuro, "\u20ac");
String after = config.getString("moneyCharacterAfter");
after = after.replace(AreaShop.currencyEuro, "\u20ac");
String result;
// Check for infinite and NaN
if(Double.isInfinite(amount)) {
result = "\u221E"; // Infinite symbol
} else if(Double.isNaN(amount)) {
result = "NaN";
} else {
// Add metric
double metricAbove = config.getDouble("metricSuffixesAbove");
if(metricAbove != -1 && amount >= metricAbove) {
if(amount >= 1000000000000000000000000.0) {
amount = amount/1000000000000000000000000.0;
after = "Y"+after;
} else if(amount >= 1000000000000000000000.0) {
amount = amount/1000000000000000000000.0;
after = "Z"+after;
} else if(amount >= 1000000000000000000.0) {
amount = amount/1000000000000000000.0;
after = "E"+after;
} else if(amount >= 1000000000000000.0) {
amount = amount/1000000000000000.0;
after = "P"+after;
} else if(amount >= 1000000000000.0) {
amount = amount/1000000000000.0;
after = "T"+after;
} else if(amount >= 1000000000.0) {
amount = amount/1000000000.0;
after = "G"+after;
} else if(amount >= 1000000.0) {
amount = amount/1000000.0;
after = "M"+after;
} else if(amount >= 1000.0) {
amount = amount/1000.0;
after = "k"+after;
}
BigDecimal bigDecimal = new BigDecimal(amount);
if(bigDecimal.toString().contains(".")) {
int frontLength = bigDecimal.toString().substring(0, bigDecimal.toString().indexOf('.')).length();
bigDecimal = bigDecimal.setScale(config.getInt("fractionalNumbers")+(3-frontLength), RoundingMode.HALF_UP);
}
result = bigDecimal.toString();
} else {
BigDecimal bigDecimal = new BigDecimal(amount);
bigDecimal = bigDecimal.setScale(config.getInt("fractionalNumbers"), RoundingMode.HALF_UP);
amount = bigDecimal.doubleValue();
result = bigDecimal.toString();
if(config.getBoolean("hideEmptyFractionalPart") && (amount%1.0) == 0.0 && result.contains(".")) {
result = result.substring(0, result.indexOf('.'));
}
}
}
result = result.replace(".", config.getString("decimalMark"));
return before+result+after;
}
/**
* Checks if the string is a correct time period
* @param time String that has to be checked
* @return true if format is correct, false if not
*/
public static boolean checkTimeFormat(String time) {
// Check if the string is not empty and check the length
if(time == null || time.length() <= 1 || time.indexOf(' ') == -1 || time.indexOf(' ') >= (time.length()-1)) {
return false;
}
// Check if the suffix is one of these values
String suffix = time.substring(time.indexOf(' ')+1, time.length());
if(!identifiers.contains(suffix)) {
return false;
}
// check if the part before the space is a number
String prefix = time.substring(0, (time.indexOf(' ')));
return prefix.matches("\\d+");
}
/**
* Methode to tranlate a duration string to a millisecond value
* @param duration The duration string
* @return The duration in milliseconds translated from the durationstring, or if it is invalid then 0
*/
public static long durationStringToLong(String duration) {
if(duration == null) {
return 0;
} else if(duration.equalsIgnoreCase("disabled") || duration.equalsIgnoreCase("unlimited")) {
return -1;
} else if(duration.indexOf(' ') == -1) {
return 0;
}
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(0);
String durationString = duration.substring(duration.indexOf(' ')+1, duration.length());
int durationInt = 0;
try {
durationInt = Integer.parseInt(duration.substring(0, duration.indexOf(' ')));
} catch(NumberFormatException exception) {
// No Number found, add zero
}
if(seconds.contains(durationString)) {
calendar.add(Calendar.SECOND, durationInt);
} else if(minutes.contains(durationString)) {
calendar.add(Calendar.MINUTE, durationInt);
} else if(hours.contains(durationString)) {
calendar.add(Calendar.HOUR, durationInt);
} else if(days.contains(durationString)) {
calendar.add(Calendar.DAY_OF_MONTH, durationInt);
} else if(weeks.contains(durationString)) {
calendar.add(Calendar.DAY_OF_MONTH, durationInt*7);
} else if(months.contains(durationString)) {
calendar.add(Calendar.MONTH, durationInt);
} else if(years.contains(durationString)) {
calendar.add(Calendar.YEAR, durationInt);
}
return calendar.getTimeInMillis();
}
// LEGACY TIME INPUT CONVERSION
/**
* Get setting from config that could be only a number indicating seconds
* or a string indicating a duration string
* @param path Path of the setting to read
* @return milliseconds that the setting indicates
*/
public static long getDurationFromSecondsOrString(String path) {
if(config.isLong(path) || config.isInt(path)) {
long setting = config.getLong(path);
if(setting != -1) {
setting = setting*1000;
}
return setting;
} else {
return durationStringToLong(config.getString(path));
}
}
/**
* Get setting from config that could be only a number indicating minutes
* or a string indicating a duration string
* @param path Path of the setting to read
* @return milliseconds that the setting indicates
*/
public static long getDurationFromMinutesOrString(String path) {
if(config.isLong(path) || config.isInt(path)) {
long setting = config.getLong(path);
if(setting != -1) {
setting = setting*60*1000;
}
return setting;
} else {
return durationStringToLong(config.getString(path));
}
}
/**
* Parse a time setting that could be minutes or a duration string
* @param input The string to parse
* @return milliseconds that the string indicates
*/
public static long getDurationFromMinutesOrStringInput(String input) {
long number;
try {
number = Long.parseLong(input);
if(number != -1) {
number = number*60*1000;
}
return number;
} catch(NumberFormatException e) {
return durationStringToLong(input);
}
}
/**
* Parse a time setting that could be seconds or a duration string
* @param input The string to parse
* @return seconds that the string indicates
*/
public static long getDurationFromSecondsOrStringInput(String input) {
long number;
try {
number = Long.parseLong(input);
if(number != -1) {
number = number*1000;
}
return number;
} catch(NumberFormatException e) {
return durationStringToLong(input);
}
}
// NAME <-> UUID CONVERSION
/**
* Conversion to name by uuid
* @param uuid The uuid in string format
* @return the name of the player
*/
public static String toName(String uuid) {
String result = "";
if(uuid != null) {
try {
UUID parsed = UUID.fromString(uuid);
result = toName(parsed);
} catch(IllegalArgumentException e) {
// Incorrect UUID
}
}
return result;
}
/**
* Conversion to name by uuid object
* @param uuid The uuid in string format
* @return the name of the player
*/
public static String toName(UUID uuid) {
if(uuid == null) {
return "";
} else {
String name = Bukkit.getOfflinePlayer(uuid).getName();
if(name != null) {
return name;
}
return "";
}
}
/**
* Conversion from name to uuid
* @param name The name of the player
* @return The uuid of the player
*/
@SuppressWarnings("deprecation") // Fake deprecation by Bukkit to inform developers, method will stay
public static String toUUID(String name) {
if(name == null) {
return null;
} else {
return Bukkit.getOfflinePlayer(name).getUniqueId().toString();
}
}
}
@@ -1,8 +1,7 @@
package nl.evolutioncoding.areashop.commands;
import java.util.ArrayList;
import java.util.List;
import com.sk89q.worldedit.bukkit.selections.Selection;
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
import nl.evolutioncoding.areashop.AreaShop;
import nl.evolutioncoding.areashop.Utils;
import nl.evolutioncoding.areashop.managers.FileManager.AddResult;
@@ -10,16 +9,14 @@ 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;
import java.util.ArrayList;
import java.util.List;
public class AddCommand extends CommandAreaShop {
@@ -41,7 +38,7 @@ public class AddCommand extends CommandAreaShop {
}
@Override
public void execute(final CommandSender sender, Command command, final String[] args) {
public void execute(final CommandSender sender, final String[] args) {
if( !sender.hasPermission("areashop.createrent")
&& !sender.hasPermission("areashop.createrent.member")
&& !sender.hasPermission("areashop.createrent.owner")
@@ -57,8 +54,8 @@ public class AddCommand extends CommandAreaShop {
plugin.message(sender, "add-help");
return;
}
List<ProtectedRegion> regions = new ArrayList<ProtectedRegion>();
World world = null;
List<ProtectedRegion> regions = new ArrayList<>();
World world;
Player player = null;
if(sender instanceof Player) {
player = (Player)sender;
@@ -116,10 +113,11 @@ public class AddCommand extends CommandAreaShop {
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>();
private ArrayList<String> namesSuccess = new ArrayList<>();
private ArrayList<String> namesAlready = new ArrayList<>();
private ArrayList<String> namesBlacklisted = new ArrayList<>();
private ArrayList<String> namesNoPermission = new ArrayList<>();
private ArrayList<String> namesExternal = new ArrayList<>();
@Override
public void run() {
@@ -128,8 +126,8 @@ public class AddCommand extends CommandAreaShop {
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;
boolean isOwner = finalPlayer != null && plugin.getWorldGuardHandler().containsMember(region, finalPlayer.getUniqueId());
String type;
if(isRent) {
type = "rent";
} else {
@@ -143,12 +141,10 @@ public class AddCommand extends CommandAreaShop {
} 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)));
|| (sender.hasPermission("areashop.create" + type + ".member") && isMember)));
if(isRent) {
RentRegion rent = new RentRegion(plugin, region.getId(), finalWorld);
// Set landlord
@@ -159,10 +155,12 @@ public class AddCommand extends CommandAreaShop {
rent.runEventCommands(RegionEvent.CREATED, true);
plugin.getFileManager().addRent(rent);
rent.handleSchematicEvent(RegionEvent.CREATED);
// Set the flags for the region
rent.updateRegionFlags();
rent.update();
// Run commands
rent.runEventCommands(RegionEvent.CREATED, false);
namesSuccess.add(region.getId());
} else {
BuyRegion buy = new BuyRegion(plugin, region.getId(), finalWorld);
// Set landlord
@@ -174,10 +172,12 @@ public class AddCommand extends CommandAreaShop {
plugin.getFileManager().addBuy(buy);
buy.handleSchematicEvent(RegionEvent.CREATED);
// Set the flags for the region
buy.updateRegionFlags();
buy.update();
// Run commands
buy.runEventCommands(RegionEvent.CREATED, false);
namesSuccess.add(region.getId());
}
}
current++;
@@ -205,7 +205,7 @@ public class AddCommand extends CommandAreaShop {
@Override
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
List<String> result = new ArrayList<String>();
List<String> result = new ArrayList<>();
if(toComplete == 2) {
if(sender.hasPermission("areashop.createrent")) {
result.add("rent");
@@ -1,20 +1,18 @@
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;
import java.util.ArrayList;
import java.util.List;
public class AddfriendCommand extends CommandAreaShop {
public AddfriendCommand(AreaShop plugin) {
@@ -38,7 +36,7 @@ public class AddfriendCommand extends CommandAreaShop {
@SuppressWarnings("deprecation")
@Override
public void execute(CommandSender sender, Command command, String[] args) {
public void execute(CommandSender sender, String[] args) {
if(!sender.hasPermission("areashop.addfriend") && !sender.hasPermission("areashop.addfriendall")) {
plugin.message(sender, "addfriend-noPermission");
return;
@@ -48,8 +46,8 @@ public class AddfriendCommand extends CommandAreaShop {
plugin.message(sender, "addfriend-help");
return;
}
GeneralRegion region = null;
GeneralRegion region;
if(args.length <= 2) {
if (sender instanceof Player) {
// get the region by location
@@ -77,60 +75,58 @@ public class AddfriendCommand extends CommandAreaShop {
if(sender.hasPermission("areashop.addfriendall")) {
if((region.isRentRegion() && !((RentRegion)region).isRented())
|| (region.isBuyRegion() && !((BuyRegion)region).isSold())) {
plugin.message(sender, "addfriend-noOwner");
plugin.message(sender, "addfriend-noOwner", region);
return;
}
OfflinePlayer friend = Bukkit.getOfflinePlayer(args[1]);
if(friend.getLastPlayed() == 0 && !plugin.getConfig().getBoolean("addFriendNotExistingPlayers")) {
plugin.message(sender, "addfriend-notVisited", args[1]);
plugin.message(sender, "addfriend-notVisited", args[1], region);
return;
}
if(region.getFriends().contains(friend.getUniqueId())) {
plugin.message(sender, "addfriend-alreadyAdded", friend.getName());
plugin.message(sender, "addfriend-alreadyAdded", friend.getName(), region);
return;
}
if(region.isOwner(friend.getUniqueId())) {
plugin.message(sender, "addfriend-self", friend.getName());
plugin.message(sender, "addfriend-self", friend.getName(), region);
return;
}
region.addFriend(friend.getUniqueId());
region.updateRegionFlags();
region.updateSigns();
plugin.message(sender, "addfriend-successOther", friend.getName(), region.getName());
region.update();
plugin.message(sender, "addfriend-successOther", friend.getName(), region);
} else {
if(sender.hasPermission("areashop.addfriend") && sender instanceof Player) {
if(region.isOwner((Player)sender)) {
OfflinePlayer friend = Bukkit.getOfflinePlayer(args[1]);
if(friend.getLastPlayed() == 0 && !plugin.getConfig().getBoolean("addFriendNotExistingPlayers")) {
plugin.message(sender, "addfriend-notVisited", args[1]);
plugin.message(sender, "addfriend-notVisited", args[1], region);
return;
}
if(region.getFriends().contains(friend.getUniqueId())) {
plugin.message(sender, "addfriend-alreadyAdded", friend.getName());
plugin.message(sender, "addfriend-alreadyAdded", friend.getName(), region);
return;
}
if(region.isOwner(friend.getUniqueId())) {
plugin.message(sender, "addfriend-self", friend.getName());
plugin.message(sender, "addfriend-self", friend.getName(), region);
return;
}
region.addFriend(friend.getUniqueId());
region.updateRegionFlags();
region.updateSigns();
plugin.message(sender, "addfriend-success", friend.getName(), region.getName());
region.update();
plugin.message(sender, "addfriend-success", friend.getName(), region);
} else {
plugin.message(sender, "addfriend-noPermissionOther");
plugin.message(sender, "addfriend-noPermissionOther", region);
}
} else {
plugin.message(sender, "addfriend-noPermission");
plugin.message(sender, "addfriend-noPermission", region);
}
}
}
@Override
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
ArrayList<String> result = new ArrayList<String>();
ArrayList<String> result = new ArrayList<>();
if(toComplete == 2) {
for(Player player : Bukkit.getOnlinePlayers()) {
for(Player player : Utils.getOnlinePlayers()) {
result.add(player.getName());
}
} else if(toComplete == 3) {
@@ -1,22 +1,19 @@
package nl.evolutioncoding.areashop.commands;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import com.sk89q.worldedit.bukkit.selections.CuboidSelection;
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;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
public class AddsignCommand extends CommandAreaShop {
@@ -38,7 +35,7 @@ public class AddsignCommand extends CommandAreaShop {
}
@Override
public void execute(CommandSender sender, Command command, String[] args) {
public void execute(CommandSender sender, String[] args) {
if(!sender.hasPermission("areashop.addsign")) {
plugin.message(sender, "addsign-noPermission");
return;
@@ -63,7 +60,7 @@ public class AddsignCommand extends CommandAreaShop {
return;
}
GeneralRegion region = null;
GeneralRegion region;
if(args.length > 1) {
// Get region by argument
region = plugin.getFileManager().getRegion(args[1]);
@@ -89,13 +86,13 @@ public class AddsignCommand extends CommandAreaShop {
profile = args[2];
Set<String> profiles = plugin.getConfig().getConfigurationSection("signProfiles").getKeys(false);
if(!profiles.contains(profile)) {
plugin.message(sender, "addsign-wrongProfile", Utils.createCommaSeparatedList(profiles));
plugin.message(sender, "addsign-wrongProfile", Utils.createCommaSeparatedList(profiles), region);
return;
}
}
GeneralRegion signRegion = plugin.getFileManager().getRegionBySignLocation(block.getLocation());
if(signRegion != null) {
plugin.message(sender, "addsign-alreadyRegistered", signRegion.getName());
plugin.message(sender, "addsign-alreadyRegistered", signRegion);
return;
}
@@ -103,14 +100,14 @@ public class AddsignCommand extends CommandAreaShop {
if(profile == null) {
plugin.message(sender, "addsign-success", region);
} else {
plugin.message(sender, "addsign-successProfile", region, profile);
plugin.message(sender, "addsign-successProfile", profile, region);
}
region.updateSigns();
region.update();
}
@Override
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
List<String> result = new ArrayList<String>();
List<String> result = new ArrayList<>();
if(toComplete == 2) {
result.addAll(plugin.getFileManager().getRegionNames());
} else if(toComplete == 3) {
@@ -1,16 +1,14 @@
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;
import java.util.ArrayList;
import java.util.List;
public class BuyCommand extends CommandAreaShop {
public BuyCommand(AreaShop plugin) {
@@ -31,7 +29,7 @@ public class BuyCommand extends CommandAreaShop {
}
@Override
public void execute(CommandSender sender, Command command, String[] args) {
public void execute(CommandSender sender, String[] args) {
if(!sender.hasPermission("areashop.buy")) {
plugin.message(sender, "buy-noPermission");
return;
@@ -53,10 +51,8 @@ public class BuyCommand extends CommandAreaShop {
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);
}
@@ -65,7 +61,7 @@ public class BuyCommand extends CommandAreaShop {
@Override
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
ArrayList<String> result = new ArrayList<String>();
ArrayList<String> result = new ArrayList<>();
if(toComplete == 2) {
for(BuyRegion region : plugin.getFileManager().getBuys()) {
if(!region.isSold()) {
@@ -1,12 +1,12 @@
package nl.evolutioncoding.areashop.commands;
import java.util.List;
import nl.evolutioncoding.areashop.AreaShop;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import java.util.ArrayList;
import java.util.List;
/**
* Abstract class for generalising command classes
*/
@@ -38,11 +38,13 @@ public abstract class CommandAreaShop {
* @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);
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
return new ArrayList<>();
}
/**
* Get the argument that comes after the base command that this command reacts to
* @return
* @return The string that should be in front of the command for this class to act
*/
public abstract String getCommandStart();
@@ -56,10 +58,9 @@ public abstract class CommandAreaShop {
/**
* 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);
public abstract void execute(CommandSender sender, String[] args);
@@ -1,19 +1,18 @@
package nl.evolutioncoding.areashop.commands;
import java.util.ArrayList;
import java.util.List;
import com.sk89q.worldedit.bukkit.selections.Selection;
import nl.evolutioncoding.areashop.AreaShop;
import nl.evolutioncoding.areashop.Utils;
import nl.evolutioncoding.areashop.events.notify.RemovedRegionEvent;
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.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.sk89q.worldedit.bukkit.selections.Selection;
import java.util.ArrayList;
import java.util.List;
public class DelCommand extends CommandAreaShop {
@@ -35,7 +34,7 @@ public class DelCommand extends CommandAreaShop {
}
@Override
public void execute(CommandSender sender, Command command, String[] args) {
public void execute(CommandSender sender, String[] args) {
if( !sender.hasPermission("areashop.destroybuy")
&& !sender.hasPermission("areashop.destroybuy.landlord")
@@ -61,11 +60,11 @@ public class DelCommand extends CommandAreaShop {
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>();
// Start removing the regions that he has permission for
ArrayList<String> namesSuccess = new ArrayList<>();
ArrayList<String> namesFailed = new ArrayList<>();
for(GeneralRegion region : regions) {
boolean isLandlord = sender instanceof Player && region.isLandlord(((Player)sender).getUniqueId());
boolean isLandlord = region.isLandlord(((Player)sender).getUniqueId());
if(region.isRentRegion()) {
if(!sender.hasPermission("areashop.destroyrent") && !(isLandlord && sender.hasPermission("areashop.destroyrent.landlord"))) {
namesFailed.add(region.getName());
@@ -80,7 +79,8 @@ public class DelCommand extends CommandAreaShop {
plugin.getFileManager().removeBuy((BuyRegion)region, true);
namesSuccess.add(region.getName());
}
}
}
Bukkit.getPluginManager().callEvent(new RemovedRegionEvent(region));
}
// send messages
if(namesSuccess.size() != 0) {
@@ -97,28 +97,29 @@ public class DelCommand extends CommandAreaShop {
}
boolean isLandlord = sender instanceof Player && region.isLandlord(((Player)sender).getUniqueId());
if(region.isRentRegion()) {
/* Remove the rent if the player has permission */
// 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());
plugin.message(sender, "destroy-successRent", region);
} else {
plugin.message(sender, "destroy-noPermissionRent");
plugin.message(sender, "destroy-noPermissionRent", region);
}
} else if(region.isBuyRegion()) {
/* Remove the buy if the player has permission */
// 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());
plugin.message(sender, "destroy-successBuy", region);
} else {
plugin.message(sender, "destroy-noPermissionBuy");
plugin.message(sender, "destroy-noPermissionBuy", region);
}
}
Bukkit.getPluginManager().callEvent(new RemovedRegionEvent(region));
}
}
@Override
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
List<String> result = new ArrayList<String>();
List<String> result = new ArrayList<>();
if(toComplete == 2) {
result = plugin.getFileManager().getRegionNames();
}
@@ -1,20 +1,18 @@
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;
import java.util.ArrayList;
import java.util.List;
public class DelfriendCommand extends CommandAreaShop {
public DelfriendCommand(AreaShop plugin) {
@@ -38,7 +36,7 @@ public class DelfriendCommand extends CommandAreaShop {
@SuppressWarnings("deprecation")
@Override
public void execute(CommandSender sender, Command command, String[] args) {
public void execute(CommandSender sender, String[] args) {
if(!sender.hasPermission("areashop.delfriend") && !sender.hasPermission("areashop.delfriendall")) {
plugin.message(sender, "delfriend-noPermission");
return;
@@ -46,8 +44,8 @@ public class DelfriendCommand extends CommandAreaShop {
if(args.length < 2) {
plugin.message(sender, "delfriend-help");
return;
}
GeneralRegion region = null;
}
GeneralRegion region;
if(args.length <= 2) {
if (sender instanceof Player) {
// get the region by location
@@ -75,44 +73,42 @@ public class DelfriendCommand extends CommandAreaShop {
if(sender.hasPermission("areashop.delfriendall")) {
if((region.isRentRegion() && !((RentRegion)region).isRented())
|| (region.isBuyRegion() && !((BuyRegion)region).isSold())) {
plugin.message(sender, "delfriend-noOwner");
plugin.message(sender, "delfriend-noOwner", region);
return;
}
OfflinePlayer friend = Bukkit.getOfflinePlayer(args[1]);
if(!region.getFriends().contains(friend.getUniqueId())) {
plugin.message(sender, "delfriend-notAdded", friend.getName());
plugin.message(sender, "delfriend-notAdded", friend.getName(), region);
return;
}
region.deleteFriend(friend.getUniqueId());
region.updateRegionFlags();
region.updateSigns();
plugin.message(sender, "delfriend-successOther", friend.getName(), region.getName());
region.update();
plugin.message(sender, "delfriend-successOther", friend.getName(), region);
} else {
if(sender.hasPermission("areashop.delfriend") && sender instanceof Player) {
if(region.isOwner((Player)sender)) {
OfflinePlayer friend = Bukkit.getOfflinePlayer(args[1]);
if(!region.getFriends().contains(friend.getUniqueId())) {
plugin.message(sender, "delfriend-notAdded", friend.getName());
plugin.message(sender, "delfriend-notAdded", friend.getName(), region);
return;
}
region.deleteFriend(friend.getUniqueId());
region.updateRegionFlags();
region.updateSigns();
plugin.message(sender, "delfriend-success", friend.getName(), region.getName());
region.update();
plugin.message(sender, "delfriend-success", friend.getName(), region);
} else {
plugin.message(sender, "delfriend-noPermissionOther");
plugin.message(sender, "delfriend-noPermissionOther", region);
}
} else {
plugin.message(sender, "delfriend-noPermission");
plugin.message(sender, "delfriend-noPermission", region);
}
}
}
@Override
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
ArrayList<String> result = new ArrayList<String>();
ArrayList<String> result = new ArrayList<>();
if(toComplete == 2) {
for(Player player : Bukkit.getOnlinePlayers()) {
for(Player player : Utils.getOnlinePlayers()) {
result.add(player.getName());
}
} else if(toComplete == 3) {
@@ -1,18 +1,16 @@
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;
import java.util.ArrayList;
import java.util.List;
public class DelsignCommand extends CommandAreaShop {
public DelsignCommand(AreaShop plugin) {
@@ -33,7 +31,7 @@ public class DelsignCommand extends CommandAreaShop {
}
@Override
public void execute(CommandSender sender, Command command, String[] args) {
public void execute(CommandSender sender, String[] args) {
if(!sender.hasPermission("areashop.delsign")) {
plugin.message(sender, "delsign-noPermission");
return;
@@ -62,14 +60,14 @@ public class DelsignCommand extends CommandAreaShop {
plugin.message(sender, "delsign-noRegion");
return;
}
plugin.message(sender, "delsign-success", region.getName());
plugin.message(sender, "delsign-success", region);
region.removeSign(block.getLocation());
region.updateSigns();
region.update();
}
@Override
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
return new ArrayList<String>();
return new ArrayList<>();
}
}
@@ -1,20 +1,17 @@
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.Utils;
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;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class FindCommand extends CommandAreaShop {
public FindCommand(AreaShop plugin) {
@@ -35,7 +32,7 @@ public class FindCommand extends CommandAreaShop {
}
@Override
public void execute(CommandSender sender, Command command, String[] args) {
public void execute(CommandSender sender, String[] args) {
if(!sender.hasPermission("areashop.find")) {
plugin.message(sender, "find-noPermission");
return;
@@ -51,7 +48,7 @@ public class FindCommand extends CommandAreaShop {
Player player = (Player)sender;
double balance = 0.0;
if(plugin.getEconomy() != null) {
plugin.getEconomy().getBalance(player);
balance = plugin.getEconomy().getBalance(player);
}
double maxPrice = 0;
boolean maxPriceSet = false;
@@ -65,7 +62,7 @@ public class FindCommand extends CommandAreaShop {
plugin.message(sender, "find-wrongMaxPrice", args[2]);
return;
}
}
}
// Parse optional group argument
if(args.length >= 4) {
group = plugin.getFileManager().getGroup(args[3]);
@@ -76,7 +73,7 @@ public class FindCommand extends CommandAreaShop {
}
if(args[1].equalsIgnoreCase("buy")) {
List<BuyRegion> regions = plugin.getFileManager().getBuys();
List<BuyRegion> results = new ArrayList<BuyRegion>();
List<BuyRegion> results = new ArrayList<>();
for(BuyRegion region : regions) {
if(!region.isSold()
&& ((region.getPrice() <= balance && !maxPriceSet) || (region.getPrice() <= maxPrice && maxPriceSet))
@@ -87,37 +84,30 @@ public class FindCommand extends CommandAreaShop {
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);
plugin.message(player, "find-successMax", "buy", Utils.formatCurrency(maxPrice), onlyInGroup, region);
} else {
plugin.message(player, "find-success", "buy", region.getName(), balance, onlyInGroup);
plugin.message(player, "find-success", "buy", Utils.formatCurrency(balance), onlyInGroup, region);
}
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);
plugin.message(player, "find-noneFoundMax", "buy", Utils.formatCurrency(maxPrice), onlyInGroup);
} else {
plugin.message(player, "find-noneFoundMax", "buy", balance, onlyInGroup);
plugin.message(player, "find-noneFound", "buy", Utils.formatCurrency(balance), onlyInGroup);
}
}
} else {
List<RentRegion> regions = plugin.getFileManager().getRents();
List<RentRegion> results = new ArrayList<RentRegion>();
List<RentRegion> results = new ArrayList<>();
for(RentRegion region : regions) {
if(!region.isRented()
&& ((region.getPrice() <= balance && !maxPriceSet) || (region.getPrice() <= maxPrice && maxPriceSet))
@@ -128,32 +118,25 @@ public class FindCommand extends CommandAreaShop {
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);
plugin.message(player, "find-successMax", "rent", Utils.formatCurrency(maxPrice), onlyInGroup, region);
} else {
plugin.message(player, "find-success", "rent", region.getName(), balance, onlyInGroup);
plugin.message(player, "find-success", "rent", Utils.formatCurrency(balance), onlyInGroup, region);
}
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);
plugin.message(player, "find-noneFoundMax", "rent", Utils.formatCurrency(maxPrice), onlyInGroup);
} else {
plugin.message(player, "find-noneFoundMax", "rent", balance, onlyInGroup);
plugin.message(player, "find-noneFound", "rent", Utils.formatCurrency(balance), onlyInGroup);
}
}
}
@@ -162,7 +145,7 @@ public class FindCommand extends CommandAreaShop {
@Override
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
ArrayList<String> result = new ArrayList<String>();
ArrayList<String> result = new ArrayList<>();
if(toComplete == 2) {
result.add("buy");
result.add("rent");
@@ -1,18 +1,15 @@
package nl.evolutioncoding.areashop.commands;
import java.util.ArrayList;
import java.util.List;
import com.sk89q.worldedit.bukkit.selections.Selection;
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;
import java.util.ArrayList;
import java.util.List;
public class GroupaddCommand extends CommandAreaShop {
@@ -34,7 +31,7 @@ public class GroupaddCommand extends CommandAreaShop {
}
@Override
public void execute(CommandSender sender, Command command, String[] args) {
public void execute(CommandSender sender, String[] args) {
if(!sender.hasPermission("areashop.groupadd")) {
plugin.message(sender, "groupadd-noPermission");
return;
@@ -63,10 +60,10 @@ public class GroupaddCommand extends CommandAreaShop {
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>();
}
ArrayList<String> namesSuccess = new ArrayList<>();
ArrayList<String> namesFailed = new ArrayList<>();
ArrayList<GeneralRegion> toUpdate = new ArrayList<>();
for(GeneralRegion region : regions) {
if(group.addMember(region)) {
namesSuccess.add(region.getName());
@@ -90,18 +87,17 @@ public class GroupaddCommand extends CommandAreaShop {
return;
}
if(group.addMember(region)) {
region.updateRegionFlags();
region.updateSigns();
plugin.message(sender, "groupadd-success", region.getName(), group.getName(), group.getMembers().size());
region.update();
plugin.message(sender, "groupadd-success", group.getName(), group.getMembers().size(), region);
} else {
plugin.message(sender, "groupadd-failed", region.getName(), group.getName());
plugin.message(sender, "groupadd-failed", group.getName(), region);
}
}
}
@Override
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
List<String> result = new ArrayList<String>();
List<String> result = new ArrayList<>();
if(toComplete == 2) {
result = plugin.getFileManager().getGroupNames();
} else if(toComplete == 3) {
@@ -1,18 +1,15 @@
package nl.evolutioncoding.areashop.commands;
import java.util.ArrayList;
import java.util.List;
import com.sk89q.worldedit.bukkit.selections.Selection;
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;
import java.util.ArrayList;
import java.util.List;
public class GroupdelCommand extends CommandAreaShop {
@@ -34,7 +31,7 @@ public class GroupdelCommand extends CommandAreaShop {
}
@Override
public void execute(CommandSender sender, Command command, String[] args) {
public void execute(CommandSender sender, String[] args) {
if(!sender.hasPermission("areashop.groupdel")) {
plugin.message(sender, "groupdel-noPermission");
return;
@@ -63,10 +60,10 @@ public class GroupdelCommand extends CommandAreaShop {
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>();
}
ArrayList<String> namesSuccess = new ArrayList<>();
ArrayList<String> namesFailed = new ArrayList<>();
ArrayList<GeneralRegion> toUpdate = new ArrayList<>();
for(GeneralRegion region : regions) {
if(group.removeMember(region)) {
namesSuccess.add(region.getName());
@@ -91,18 +88,17 @@ public class GroupdelCommand extends CommandAreaShop {
return;
}
if(group.removeMember(region)) {
region.updateRegionFlags();
region.updateSigns();
plugin.message(sender, "groupdel-success", region.getName(), group.getName(), group.getMembers().size());
region.update();
plugin.message(sender, "groupdel-success", group.getName(), group.getMembers().size(), region);
} else {
plugin.message(sender, "groupdel-failed", region.getName(), group.getName());
plugin.message(sender, "groupdel-failed", group.getName(), region);
}
}
}
@Override
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
List<String> result = new ArrayList<String>();
List<String> result = new ArrayList<>();
if(toComplete == 2) {
result = plugin.getFileManager().getGroupNames();
} else if(toComplete == 3) {
@@ -1,15 +1,13 @@
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;
import java.util.ArrayList;
import java.util.List;
public class GroupinfoCommand extends CommandAreaShop {
public GroupinfoCommand(AreaShop plugin) {
@@ -31,7 +29,7 @@ public class GroupinfoCommand extends CommandAreaShop {
@Override
public void execute(CommandSender sender, Command command, String[] args) {
public void execute(CommandSender sender, String[] args) {
if(!sender.hasPermission("areashop.groupinfo")) {
plugin.message(sender, "groupinfo-noPermission");
return;
@@ -55,7 +53,7 @@ public class GroupinfoCommand extends CommandAreaShop {
@Override
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
List<String> result = new ArrayList<String>();
List<String> result = new ArrayList<>();
if(toComplete == 2) {
result = plugin.getFileManager().getGroupNames();
}
@@ -1,14 +1,12 @@
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;
import java.util.ArrayList;
import java.util.List;
public class GrouplistCommand extends CommandAreaShop {
public GrouplistCommand(AreaShop plugin) {
@@ -29,7 +27,7 @@ public class GrouplistCommand extends CommandAreaShop {
}
@Override
public void execute(CommandSender sender, Command command, String[] args) {
public void execute(CommandSender sender, String[] args) {
if(!sender.hasPermission("areashop.grouplist")) {
plugin.message(sender, "grouplist-noPermission");
return;
@@ -44,7 +42,7 @@ public class GrouplistCommand extends CommandAreaShop {
@Override
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
return new ArrayList<String>();
return new ArrayList<>();
}
}
@@ -1,11 +1,6 @@
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 {
@@ -28,14 +23,7 @@ public class HelpCommand extends CommandAreaShop {
}
@Override
public void execute(CommandSender sender, Command command, String[] args) {
public void execute(CommandSender sender, 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;
}
}
@@ -1,24 +1,18 @@
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.apache.commons.lang.StringUtils;
import org.bukkit.Location;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import java.util.*;
public class InfoCommand extends CommandAreaShop {
public InfoCommand(AreaShop plugin) {
@@ -38,173 +32,131 @@ public class InfoCommand extends CommandAreaShop {
return null;
}
/**
* Filter group of regions, join their names and printout the correct message
* @param sender The CommandSender to receive the message
* @param regions The regions
* @param filterGroup The group to filter to the regions with
* @param keySomeFound The key of the message to display when some regions are found
* @param keyNoneFound The key of the message to display when no regions are found
*/
private void displayMessage(CommandSender sender, Set<? extends GeneralRegion> regions, RegionGroup filterGroup, String keySomeFound, String keyNoneFound) {
if(filterGroup != null) {
Iterator<? extends GeneralRegion> it = regions.iterator();
while(it.hasNext()) {
GeneralRegion region = it.next();
if(!filterGroup.isMember(region)) {
it.remove();
}
}
}
if(regions.isEmpty()) {
plugin.message(sender, keyNoneFound);
} else {
plugin.message(sender, keySomeFound, StringUtils.join(regions.iterator(), ", "));
}
}
@Override
public void execute(CommandSender sender, Command command, String[] args) {
public void execute(CommandSender sender, String[] args) {
if(!sender.hasPermission("areashop.info")) {
plugin.message(sender, "info-noPermission");
return;
}
if(args.length > 1 && args[1] != null) {
/* 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);
// Get filter group (only used by some commands)
RegionGroup filterGroup = null;
Set<String> groupFilters = new HashSet<>(Arrays.asList("all", "rented", "forrent", "sold", "forsale"));
if(groupFilters.contains(args[0].toLowerCase())) {
filterGroup = plugin.getFileManager().getGroup(args[2]);
if(filterGroup == null) {
plugin.message(sender, "info-noFiltergroup", args[2]);
return;
}
}
/* List of rented regions */
// All regions
if(args[1].equalsIgnoreCase("all")) {
Set<GeneralRegion> regions = new TreeSet<GeneralRegion>(plugin.getFileManager().getRents());
displayMessage(sender, regions, filterGroup, "info-all-rents", "info-all-noRents");
regions = new TreeSet<GeneralRegion>(plugin.getFileManager().getBuys());
displayMessage(sender, regions, filterGroup, "info-all-buys", "info-all-noBuys");
}
// 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();
}
Set<GeneralRegion> regions = new TreeSet<>();
for(RentRegion region : plugin.getFileManager().getRents()) {
if(region.isRented()) {
regions.add(region);
}
}
if(message.equals("")) {
plugin.message(sender, "info-noRented");
} else {
plugin.message(sender, "info-rented", message);
}
displayMessage(sender, regions, filterGroup, "info-rented", "info-noRented");
}
/* List of unrented regions */
// Forrent 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();
}
Set<GeneralRegion> regions = new TreeSet<>();
for(RentRegion region : plugin.getFileManager().getRents()) {
if(!region.isRented()) {
regions.add(region);
}
}
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();
displayMessage(sender, regions, filterGroup, "info-unrented", "info-noUnrented");
}
// Sold regions
else if(args[1].equalsIgnoreCase("sold")) {
Set<GeneralRegion> regions = new TreeSet<>();
for(BuyRegion region : plugin.getFileManager().getBuys()) {
if(region.isSold()) {
regions.add(region);
}
}
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();
}
displayMessage(sender, regions, filterGroup, "info-sold", "info-noSold");
}
// Forsale regions
else if(args[1].equalsIgnoreCase("forsale")) {
Set<GeneralRegion> regions = new TreeSet<>();
for(BuyRegion region : plugin.getFileManager().getBuys()) {
if(!region.isSold()) {
regions.add(region);
}
}
if(message.equals("")) {
plugin.message(sender, "info-noForsale");
} else {
plugin.message(sender, "info-forsale", message);
}
} else if(args[1].equalsIgnoreCase("player")) {
displayMessage(sender, regions, filterGroup, "info-forsale", "info-noForsale");
}
// Player regions
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();
}
// Rents
Set<GeneralRegion> regions = new TreeSet<>();
for(RentRegion region : plugin.getFileManager().getRents()) {
if(region.isRented() && region.getPlayerName().equalsIgnoreCase(args[2])) {
regions.add(region);
}
}
if(message.equals("")) {
if(regions.isEmpty()) {
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();
plugin.message(sender, "info-playerRents", args[2], StringUtils.join(regions.iterator(), ", "));
}
// Buys
regions = new TreeSet<>();
for(BuyRegion region : plugin.getFileManager().getBuys()) {
if(region.isSold() && region.getPlayerName().equalsIgnoreCase(args[2])) {
regions.add(region);
}
}
if(message.equals("")) {
if(regions.isEmpty()) {
plugin.message(sender, "info-playerNoBuys", args[2]);
} else {
plugin.message(sender, "info-playerBuys", args[2], message);
}
plugin.message(sender, "info-playerBuys", args[2], StringUtils.join(regions.iterator(), ", "));
}
} else {
plugin.message(sender, "info-playerHelp");
}
} else if(args[1].equalsIgnoreCase("region")) {
}
// Region info
else if(args[1].equalsIgnoreCase("region")) {
if(args.length > 1) {
RentRegion rent = null;
BuyRegion buy = null;
@@ -281,7 +233,7 @@ public class InfoCommand extends CommandAreaShop {
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>();
List<String> signLocations = new ArrayList<>();
for(Location location : rent.getSignLocations()) {
signLocations.add(plugin.getLanguageManager().getLang("info-regionSignLocation", location.getWorld().getName(), location.getBlockX(), location.getBlockY(), location.getBlockZ()));
}
@@ -340,7 +292,7 @@ public class InfoCommand extends CommandAreaShop {
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>();
List<String> signLocations = new ArrayList<>();
for(Location location : buy.getSignLocations()) {
signLocations.add(plugin.getLanguageManager().getLang("info-regionSignLocation", location.getWorld().getName(), location.getBlockX(), location.getBlockY(), location.getBlockZ()));
}
@@ -370,45 +322,27 @@ public class InfoCommand extends CommandAreaShop {
plugin.message(sender, "info-regionHelp");
}
}
/* List of regions without a group */
// 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
// Rental regions
Set<String> rents = new TreeSet<>(plugin.getFileManager().getRentNames());
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();
}
}
String message = StringUtils.join(rents, ", ");
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();
// Buy regions
Set<String> buys = new TreeSet<>(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();
}
}
message = StringUtils.join(buys, ", ");
if(message.equals("")) {
plugin.message(sender, "info-nogroupNoBuys");
} else {
@@ -444,12 +378,12 @@ public class InfoCommand extends CommandAreaShop {
@Override
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
List<String> result = new ArrayList<String>();
List<String> result = new ArrayList<>();
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()) {
for(Player player : Utils.getOnlinePlayers()) {
result.add(player.getName());
}
} else if(start[2].equalsIgnoreCase("region")) {
@@ -1,16 +1,14 @@
package nl.evolutioncoding.areashop.commands;
import nl.evolutioncoding.areashop.AreaShop;
import nl.evolutioncoding.areashop.Utils;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
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) {
@@ -31,7 +29,7 @@ public class LinksignsCommand extends CommandAreaShop {
}
@Override
public void execute(CommandSender sender, Command command, String[] args) {
public void execute(CommandSender sender, String[] args) {
if(!sender.hasPermission("areashop.linksigns")) {
plugin.message(sender, "linksigns-noPermission");
return;
@@ -61,7 +59,7 @@ public class LinksignsCommand extends CommandAreaShop {
@Override
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
List<String> result = new ArrayList<String>();
List<String> result = new ArrayList<>();
if(toComplete == 2) {
result.addAll(plugin.getFileManager().getRegionNames());
} else if(toComplete == 3) {
@@ -1,19 +1,15 @@
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;
import java.util.HashSet;
import java.util.Set;
public class MeCommand extends CommandAreaShop {
public MeCommand(AreaShop plugin) {
@@ -34,7 +30,7 @@ public class MeCommand extends CommandAreaShop {
}
@Override
public void execute(CommandSender sender, Command command, String[] args) {
public void execute(CommandSender sender, String[] args) {
if(!sender.hasPermission("areashop.me")) {
plugin.message(sender, "me-noPermission");
return;
@@ -45,13 +41,13 @@ public class MeCommand extends CommandAreaShop {
}
Player player = (Player)sender;
// Get the regions owned by the player
Set<RentRegion> rentRegions = new HashSet<RentRegion>();
Set<RentRegion> rentRegions = new HashSet<>();
for(RentRegion region : plugin.getFileManager().getRents()) {
if(region.isOwner(player)) {
rentRegions.add(region);
}
}
Set<BuyRegion> buyRegions = new HashSet<BuyRegion>();
Set<BuyRegion> buyRegions = new HashSet<>();
for(BuyRegion region : plugin.getFileManager().getBuys()) {
if(region.isOwner(player)) {
buyRegions.add(region);
@@ -74,7 +70,7 @@ public class MeCommand extends CommandAreaShop {
plugin.messageNoPrefix(player, "me-buyLine", region);
}
}
Set<GeneralRegion> friendRegions = new HashSet<GeneralRegion>();
Set<GeneralRegion> friendRegions = new HashSet<>();
for(GeneralRegion region : plugin.getFileManager().getRegions()) {
if(region.getFriends() != null && region.getFriends().contains(player.getUniqueId())) {
friendRegions.add(region);
@@ -90,13 +86,6 @@ public class MeCommand extends CommandAreaShop {
}
}
@Override
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
List<String> result = new ArrayList<String>();
// Nothing to complete
return result;
}
}
@@ -1,11 +1,6 @@
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 {
@@ -28,7 +23,7 @@ public class ReloadCommand extends CommandAreaShop {
}
@Override
public void execute(CommandSender sender, Command command, String[] args) {
public void execute(CommandSender sender, String[] args) {
if(sender.hasPermission("areashop.reload")) {
// Reload the configuration files and update all region flags/signs
plugin.reload(sender);
@@ -36,11 +31,4 @@ public class ReloadCommand extends CommandAreaShop {
plugin.message(sender, "reload-noPermission");
}
}
@Override
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
ArrayList<String> result = new ArrayList<String>();
return result;
}
}
@@ -1,16 +1,14 @@
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;
import java.util.ArrayList;
import java.util.List;
public class RentCommand extends CommandAreaShop {
public RentCommand(AreaShop plugin) {
@@ -31,7 +29,7 @@ public class RentCommand extends CommandAreaShop {
}
@Override
public void execute(CommandSender sender, Command command, String[] args) {
public void execute(CommandSender sender, String[] args) {
if(!sender.hasPermission("areashop.rent")) {
plugin.message(sender, "rent-noPermission");
return;
@@ -53,10 +51,8 @@ public class RentCommand extends CommandAreaShop {
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);
}
@@ -65,7 +61,7 @@ public class RentCommand extends CommandAreaShop {
@Override
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
ArrayList<String> result = new ArrayList<String>();
ArrayList<String> result = new ArrayList<>();
if(toComplete == 2) {
for(RentRegion region : plugin.getFileManager().getRents()) {
if(!region.isRented()) {
@@ -1,16 +1,14 @@
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;
import java.util.ArrayList;
import java.util.List;
public class ResellCommand extends CommandAreaShop {
public ResellCommand(AreaShop plugin) {
@@ -33,7 +31,7 @@ public class ResellCommand extends CommandAreaShop {
}
@Override
public void execute(CommandSender sender, Command command, String[] args) {
public void execute(CommandSender sender, String[] args) {
if(!sender.hasPermission("areashop.resell") && !sender.hasPermission("areashop.resellall")) {
plugin.message(sender, "resell-noPermissionOther");
return;
@@ -43,14 +41,14 @@ public class ResellCommand extends CommandAreaShop {
plugin.message(sender, "resell-help");
return;
}
double price = 0.0;
double price;
try {
price = Double.parseDouble(args[1]);
} catch(NumberFormatException e) {
plugin.message(sender, "resell-wrongPrice", args[1]);
return;
}
BuyRegion buy = null;
BuyRegion buy;
if(args.length <= 2) {
if (sender instanceof Player) {
// get the region by location
@@ -85,26 +83,24 @@ public class ResellCommand extends CommandAreaShop {
}
if(sender.hasPermission("areashop.resellall")) {
buy.enableReselling(price);
buy.update();
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);
buy.update();
plugin.message(sender, "resell-success", buy);
buy.updateSigns();
buy.updateRegionFlags();
} else {
plugin.message(sender, "resell-noPermissionOther");
plugin.message(sender, "resell-noPermissionOther", buy);
}
} else {
plugin.message(sender, "resell-noPermission");
plugin.message(sender, "resell-noPermission", buy);
}
}
@Override
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
ArrayList<String> result = new ArrayList<String>();
ArrayList<String> result = new ArrayList<>();
if(toComplete == 3) {
for(BuyRegion region : plugin.getFileManager().getBuys()) {
if(region.isSold() && !region.isInResellingMode()) {
@@ -1,17 +1,15 @@
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;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class SchematiceventCommand extends CommandAreaShop {
public SchematiceventCommand(AreaShop plugin) {
@@ -32,7 +30,7 @@ public class SchematiceventCommand extends CommandAreaShop {
}
@Override
public void execute(CommandSender sender, Command command, String[] args) {
public void execute(CommandSender sender, String[] args) {
if(!sender.hasPermission("areashop.schematicevents")) {
plugin.message(sender, "schemevent-noPermission");
return;
@@ -48,7 +46,7 @@ public class SchematiceventCommand extends CommandAreaShop {
return;
}
if(region.getRegion() == null) {
plugin.message(sender, "general-noRegion", region.getName());
plugin.message(sender, "general-noRegion", region);
return;
}
RegionEvent event = null;
@@ -60,20 +58,21 @@ public class SchematiceventCommand extends CommandAreaShop {
}
// Check for a totally wrong event or a non matching event
if(exception) {
ArrayList<String> values = new ArrayList<String>();
ArrayList<String> values = new ArrayList<>();
for(RegionEvent value : RegionEvent.values()) {
values.add(value.getValue().toLowerCase());
}
plugin.message(sender, "schemevent-wrongEvent", args[2], Utils.createCommaSeparatedList(values));
plugin.message(sender, "schemevent-wrongEvent", args[2], Utils.createCommaSeparatedList(values), region);
return;
}
region.handleSchematicEvent(event);
plugin.message(sender, "schemevent-success", args[2], region.getName());
region.update();
plugin.message(sender, "schemevent-success", args[2], region);
}
@Override
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
ArrayList<String> result = new ArrayList<String>();
ArrayList<String> result = new ArrayList<>();
if(toComplete == 2) {
result.addAll(plugin.getFileManager().getRegionNames());
} else if(toComplete == 3) {
@@ -1,16 +1,14 @@
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;
import java.util.ArrayList;
import java.util.List;
public class SellCommand extends CommandAreaShop {
public SellCommand(AreaShop plugin) {
@@ -33,12 +31,12 @@ public class SellCommand extends CommandAreaShop {
}
@Override
public void execute(CommandSender sender, Command command, String[] args) {
public void execute(CommandSender sender, String[] args) {
if(!sender.hasPermission("areashop.sell") && !sender.hasPermission("areashop.sellown")) {
plugin.message(sender, "sell-noPermission");
return;
}
BuyRegion buy = null;
BuyRegion buy;
if(args.length <= 1) {
if (sender instanceof Player) {
// get the region by location
@@ -64,29 +62,15 @@ public class SellCommand extends CommandAreaShop {
return;
}
if(!buy.isSold()) {
plugin.message(sender, "sell-notBought");
plugin.message(sender, "sell-notBought", buy);
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");
}
}
buy.sell(true, sender);
}
@Override
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
ArrayList<String> result = new ArrayList<String>();
ArrayList<String> result = new ArrayList<>();
if(toComplete == 2) {
for(BuyRegion region : plugin.getFileManager().getBuys()) {
if(region.isSold()) {
@@ -1,16 +1,14 @@
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;
import java.util.ArrayList;
import java.util.List;
public class SetdurationCommand extends CommandAreaShop {
public SetdurationCommand(AreaShop plugin) {
@@ -31,7 +29,7 @@ public class SetdurationCommand extends CommandAreaShop {
}
@Override
public void execute(CommandSender sender, Command command, String[] args) {
public void execute(CommandSender sender, String[] args) {
if(!sender.hasPermission("areashop.setduration") && (!sender.hasPermission("areashop.setduration.landlord") && sender instanceof Player)) {
plugin.message(sender, "setduration-noPermission");
return;
@@ -44,7 +42,7 @@ public class SetdurationCommand extends CommandAreaShop {
if(args.length >= 2 && ("default".equalsIgnoreCase(args[1]) || "reset".equalsIgnoreCase(args[1]))) {
regionArgument = 2;
}
RentRegion rent = null;
RentRegion rent;
if(args.length <= regionArgument) {
if (sender instanceof Player) {
// get the region by location
@@ -69,36 +67,34 @@ public class SetdurationCommand extends CommandAreaShop {
plugin.message(sender, "setduration-notRegistered", args[regionArgument]);
return;
}
if(!sender.hasPermission("areashop.setduration") && !rent.isLandlord(((Player)sender).getUniqueId())) {
if(!sender.hasPermission("areashop.setduration") && !(sender instanceof Player && rent.isLandlord(((Player)sender).getUniqueId()))) {
plugin.message(sender, "setduration-noLandlord", rent);
return;
}
if("default".equalsIgnoreCase(args[1]) || "reset".equalsIgnoreCase(args[1])) {
plugin.message(sender, "setduration-successRemoved", rent);
rent.setDuration(null);
rent.updateRegionFlags();
rent.updateSigns();
rent.update();
plugin.message(sender, "setduration-successRemoved", rent);
return;
}
try {
Integer.parseInt(args[1]);
} catch(NumberFormatException e) {
plugin.message(sender, "setduration-wrongAmount", args[1]);
plugin.message(sender, "setduration-wrongAmount", args[1], rent);
return;
}
if(!plugin.checkTimeFormat(args[1] + " " + args[2])) {
plugin.message(sender, "setduration-wrongFormat", args[1]+" "+args[2]);
if(!Utils.checkTimeFormat(args[1]+" "+args[2])) {
plugin.message(sender, "setduration-wrongFormat", args[1]+" "+args[2], rent);
return;
}
rent.setDuration(args[1]+" "+args[2]);
rent.updateRegionFlags();
rent.updateSigns();
plugin.message(sender, "setduration-success", rent.getName(), rent.getDurationString());
rent.update();
plugin.message(sender, "setduration-success", rent);
}
@Override
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
List<String> result = new ArrayList<String>();
List<String> result = new ArrayList<>();
if(toComplete == 2) {
result = plugin.getFileManager().getRentNames();
} else if(toComplete == 4) {
@@ -1,18 +1,16 @@
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;
import java.util.ArrayList;
import java.util.List;
public class SetlandlordCommand extends CommandAreaShop {
public SetlandlordCommand(AreaShop plugin) {
@@ -33,7 +31,7 @@ public class SetlandlordCommand extends CommandAreaShop {
}
@Override
public void execute(CommandSender sender, Command command, String[] args) {
public void execute(CommandSender sender, String[] args) {
if(!sender.hasPermission("areashop.setlandlord")) {
plugin.message(sender, "setlandlord-noPermission");
return;
@@ -43,8 +41,8 @@ public class SetlandlordCommand extends CommandAreaShop {
return;
}
@SuppressWarnings("deprecation")
OfflinePlayer player = Bukkit.getOfflinePlayer(args[1]);
GeneralRegion region = null;
OfflinePlayer player = Bukkit.getOfflinePlayer(args[1]);
GeneralRegion region;
if(args.length < 3) {
if (sender instanceof Player) {
// get the region by location
@@ -74,14 +72,15 @@ public class SetlandlordCommand extends CommandAreaShop {
playerName = args[1];
}
region.setLandlord(player.getUniqueId(), playerName);
plugin.message(sender, "setlandlord-success", playerName, region.getName());
region.update();
plugin.message(sender, "setlandlord-success", playerName, region);
}
@Override
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
ArrayList<String> result = new ArrayList<String>();
ArrayList<String> result = new ArrayList<>();
if(toComplete == 2) {
for(Player player : Bukkit.getOnlinePlayers()) {
for(Player player : Utils.getOnlinePlayers()) {
result.add(player.getName());
}
} else if(toComplete == 3) {
@@ -1,22 +1,20 @@
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;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.UUID;
public class SetownerCommand extends CommandAreaShop {
public SetownerCommand(AreaShop plugin) {
@@ -37,7 +35,7 @@ public class SetownerCommand extends CommandAreaShop {
}
@Override
public void execute(CommandSender sender, Command command, String[] args) {
public void execute(CommandSender sender, String[] args) {
if(!sender.hasPermission("areashop.setownerrent") && !sender.hasPermission("areashop.setownerbuy")) {
plugin.message(sender, "setowner-noPermission");
return;
@@ -73,11 +71,11 @@ public class SetownerCommand extends CommandAreaShop {
}
if(region.isRentRegion() && !sender.hasPermission("areashop.setownerrent")) {
plugin.message(sender, "setowner-noPermissionRent");
plugin.message(sender, "setowner-noPermissionRent", region);
return;
}
if(region.isBuyRegion() && !sender.hasPermission("areashop.setownerbuy")) {
plugin.message(sender, "setowner-noPermissionBuy");
plugin.message(sender, "setowner-noPermissionBuy", region);
return;
}
@@ -88,7 +86,7 @@ public class SetownerCommand extends CommandAreaShop {
uuid = player.getUniqueId();
}
if(uuid == null) {
plugin.message(sender, "setowner-noPlayer", args[1]);
plugin.message(sender, "setowner-noPlayer", args[1], region);
return;
}
@@ -100,9 +98,8 @@ public class SetownerCommand extends CommandAreaShop {
calendar.setTimeInMillis(rent.getRentedUntil() + rent.getDuration());
rent.setRentedUntil(calendar.getTimeInMillis());
rent.setRenter(uuid);
rent.update();
plugin.message(sender, "setowner-succesRentExtend", region);
rent.updateRegionFlags();
rent.updateSigns();
} else {
// change
Calendar calendar = Calendar.getInstance();
@@ -113,27 +110,23 @@ public class SetownerCommand extends CommandAreaShop {
calendar.setTimeInMillis(current + rent.getDuration());
rent.setRentedUntil(calendar.getTimeInMillis());
rent.setRenter(uuid);
rent.update();
plugin.message(sender, "setowner-succesRent", region);
rent.updateRegionFlags();
rent.updateSigns();
}
rent.updateRegionFlags();
rent.updateSigns();
}
if(region.isBuyRegion()) {
BuyRegion buy = (BuyRegion)region;
buy.setBuyer(uuid);
buy.update();
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>();
ArrayList<String> result = new ArrayList<>();
if(toComplete == 2) {
for(Player player : Bukkit.getOnlinePlayers()) {
for(Player player : Utils.getOnlinePlayers()) {
result.add(player.getName());
}
} else if(toComplete == 3) {
@@ -1,18 +1,16 @@
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 java.util.ArrayList;
import java.util.List;
public class SetpriceCommand extends CommandAreaShop {
public SetpriceCommand(AreaShop plugin) {
@@ -33,7 +31,7 @@ public class SetpriceCommand extends CommandAreaShop {
}
@Override
public void execute(CommandSender sender, Command command, String[] args) {
public void execute(CommandSender sender, String[] args) {
if(!sender.hasPermission("areashop.setprice") && (!sender.hasPermission("areashop.setprice.landlord") && sender instanceof Player)) {
plugin.message(sender, "setprice-noPermission");
return;
@@ -41,8 +39,8 @@ public class SetpriceCommand extends CommandAreaShop {
if(args.length < 2 || args[1] == null) {
plugin.message(sender, "setprice-help");
return;
}
GeneralRegion region = null;
}
GeneralRegion region;
if(args.length < 3) {
if (sender instanceof Player) {
// get the region by location
@@ -67,7 +65,7 @@ public class SetpriceCommand extends CommandAreaShop {
plugin.message(sender, "setprice-notRegistered", args[2]);
return;
}
if(!sender.hasPermission("areashop.setprice") && !region.isLandlord(((Player)sender).getUniqueId())) {
if(!sender.hasPermission("areashop.setprice") && !(sender instanceof Player && region.isLandlord(((Player)sender).getUniqueId()))) {
plugin.message(sender, "setprice-noLandlord", region);
return;
}
@@ -77,19 +75,17 @@ public class SetpriceCommand extends CommandAreaShop {
} else if(region.isBuyRegion()) {
((BuyRegion)region).removePrice();
}
region.update();
plugin.message(sender, "setprice-successRemoved", region);
region.updateSigns();
region.updateRegionFlags();
return;
}
double price = 0.0;
}
double price;
try {
price = Double.parseDouble(args[1]);
} catch(NumberFormatException e) {
plugin.message(sender, "setprice-wrongPrice", args[1]);
plugin.message(sender, "setprice-wrongPrice", args[1], region);
return;
}
AreaShop.debug("price: " + price + ", raw: " + args[1]);
if(region.isRentRegion()) {
((RentRegion)region).setPrice(price);
plugin.message(sender, "setprice-successRent", region);
@@ -97,13 +93,12 @@ public class SetpriceCommand extends CommandAreaShop {
((BuyRegion)region).setPrice(price);
plugin.message(sender, "setprice-successBuy", region);
}
region.updateSigns();
region.updateRegionFlags();
region.update();
}
@Override
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
List<String> result = new ArrayList<String>();
List<String> result = new ArrayList<>();
if(toComplete == 3) {
result = plugin.getFileManager().getRegionNames();
}
@@ -1,14 +1,12 @@
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 java.util.ArrayList;
import java.util.List;
public class SetrestoreCommand extends CommandAreaShop {
public SetrestoreCommand(AreaShop plugin) {
@@ -29,7 +27,7 @@ public class SetrestoreCommand extends CommandAreaShop {
}
@Override
public void execute(CommandSender sender, Command command, String[] args) {
public void execute(CommandSender sender, String[] args) {
if(!sender.hasPermission("areashop.setrestore")) {
plugin.message(sender, "setrestore-noPermission");
return;
@@ -56,15 +54,16 @@ public class SetrestoreCommand extends CommandAreaShop {
}
if(args.length > 3) {
region.setSchematicProfile(args[3]);
plugin.message(sender, "setrestore-successProfile", region.getName(), valueString, args[3]);
plugin.message(sender, "setrestore-successProfile", valueString, args[3], region);
} else {
plugin.message(sender, "setrestore-success", region.getName(), valueString);
plugin.message(sender, "setrestore-success", valueString, region);
}
region.update();
}
@Override
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
List<String> result = new ArrayList<String>();
List<String> result = new ArrayList<>();
if(toComplete == 2) {
result = plugin.getFileManager().getRegionNames();
} else if(toComplete == 3) {
@@ -1,19 +1,16 @@
package nl.evolutioncoding.areashop.commands;
import java.util.ArrayList;
import java.util.List;
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
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;
import java.util.ArrayList;
import java.util.List;
public class SetteleportCommand extends CommandAreaShop {
@@ -37,7 +34,7 @@ public class SetteleportCommand extends CommandAreaShop {
}
@Override
public void execute(CommandSender sender, Command command, String[] args) {
public void execute(CommandSender sender, String[] args) {
if(!sender.hasPermission("areashop.setteleport") && !sender.hasPermission("areashop.setteleportall")) {
plugin.message(sender, "setteleport-noPermission");
return;
@@ -47,29 +44,24 @@ public class SetteleportCommand extends CommandAreaShop {
return;
}
Player player = (Player)sender;
GeneralRegion region = null;
GeneralRegion region;
if(args.length < 2) {
if (sender instanceof Player) {
// get the region by location
List<GeneralRegion> regions = Utils.getAllApplicableRegions(((Player) sender).getLocation());
if (regions.isEmpty()) {
plugin.message(sender, "cmd-noRegionsAtLocation");
return;
} else if (regions.size() > 1) {
plugin.message(sender, "cmd-moreRegionsAtLocation");
return;
} else {
region = regions.get(0);
}
} else {
plugin.message(sender, "cmd-automaticRegionOnlyByPlayer");
// get the region by location
List<GeneralRegion> regions = Utils.getAllApplicableRegions(((Player)sender).getLocation());
if(regions.isEmpty()) {
plugin.message(sender, "cmd-noRegionsAtLocation");
return;
}
} else if(regions.size() > 1) {
plugin.message(sender, "cmd-moreRegionsAtLocation");
return;
} else {
region = regions.get(0);
}
} else {
region = plugin.getFileManager().getRegion(args[1]);
}
boolean owner = false;
}
boolean owner;
if(region == null) {
plugin.message(player, "setteleport-noRentOrBuy", args[1]);
@@ -81,30 +73,32 @@ public class SetteleportCommand extends CommandAreaShop {
owner = player.getUniqueId().equals(((BuyRegion)region).getBuyer());
}
if(!player.hasPermission("areashop.setteleport")) {
plugin.message(player, "setteleport-noPermission");
plugin.message(player, "setteleport-noPermission", region);
return;
} else if(!owner && !player.hasPermission("areashop.setteleportall")) {
plugin.message(player, "setteleport-noPermissionOther");
plugin.message(player, "setteleport-noPermissionOther", region);
return;
}
ProtectedRegion wgRegion = region.getRegion();
if(args.length > 2 && args[2] != null && (args[2].equalsIgnoreCase("reset") || args[2].equalsIgnoreCase("yes") || args[2].equalsIgnoreCase("true"))) {
region.setTeleport(null);
plugin.message(player, "setteleport-reset", region.getName());
region.update();
plugin.message(player, "setteleport-reset", region);
return;
}
if(!player.hasPermission("areashop.setteleportoutsideregion") && (wgRegion == null || !wgRegion.contains(player.getLocation().getBlockX(), player.getLocation().getBlockY(), player.getLocation().getBlockZ()))) {
plugin.message(player, "setteleport-notInside", region.getName());
plugin.message(player, "setteleport-notInside", region);
return;
}
region.setTeleport(player.getLocation());
plugin.message(player, "setteleport-success", region.getName());
region.update();
plugin.message(player, "setteleport-success", region);
}
@Override
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
ArrayList<String> result = new ArrayList<String>();
ArrayList<String> result = new ArrayList<>();
if(toComplete == 2) {
result.addAll(plugin.getFileManager().getRegionNames());
} else if(toComplete == 3) {
@@ -1,26 +1,23 @@
package nl.evolutioncoding.areashop.commands;
import java.util.ArrayList;
import java.util.List;
import com.sk89q.worldedit.BlockVector;
import com.sk89q.worldedit.bukkit.selections.Selection;
import com.sk89q.worldguard.protection.managers.RegionManager;
import com.sk89q.worldguard.protection.regions.ProtectedCuboidRegion;
import 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;
import java.util.ArrayList;
import java.util.List;
public class StackCommand extends CommandAreaShop {
@@ -42,7 +39,7 @@ public class StackCommand extends CommandAreaShop {
}
@Override
public void execute(CommandSender sender, Command command, String[] args) {
public void execute(CommandSender sender, String[] args) {
// Check permission
if(!sender.hasPermission("areashop.stack")) {
plugin.message(sender, "stack-noPermission");
@@ -63,13 +60,15 @@ public class StackCommand extends CommandAreaShop {
int tempAmount = -1;
try {
tempAmount = Integer.parseInt(args[1]);
} catch(NumberFormatException e) {}
} catch(NumberFormatException e) {
// Incorrect number
}
if(tempAmount <= 0) {
plugin.message(player, "stack-wrongAmount", args[1]);
return;
}
// Check gap
int gap = -1;
int gap;
try {
gap = Integer.parseInt(args[2]);
} catch(NumberFormatException e) {
@@ -119,7 +118,7 @@ public class StackCommand extends CommandAreaShop {
final boolean rentRegions = "rent".equalsIgnoreCase(args[4]);
final int amount = tempAmount;
final RegionGroup finalGroup = group;
String type = null;
String type;
if(rentRegions) {
type = "rent";
} else {
@@ -178,8 +177,8 @@ public class StackCommand extends CommandAreaShop {
rent.runEventCommands(RegionEvent.CREATED, true);
plugin.getFileManager().addRent(rent);
rent.handleSchematicEvent(RegionEvent.CREATED);
rent.updateRegionFlags();
rent.runEventCommands(RegionEvent.CREATED, false);
rent.update();
} else {
BuyRegion buy = new BuyRegion(plugin, region.getId(), selection.getWorld());
if(finalGroup != null) {
@@ -188,9 +187,9 @@ public class StackCommand extends CommandAreaShop {
buy.runEventCommands(RegionEvent.CREATED, true);
plugin.getFileManager().addBuy(buy);
buy.handleSchematicEvent(RegionEvent.CREATED);
buy.updateRegionFlags();
buy.runEventCommands(RegionEvent.CREATED, false);
}
buy.update();
}
current++;
}
}
@@ -206,7 +205,7 @@ public class StackCommand extends CommandAreaShop {
@Override
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
List<String> result = new ArrayList<String>();
List<String> result = new ArrayList<>();
if(toComplete == 5) {
result.add("rent");
result.add("buy");
@@ -1,16 +1,14 @@
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;
import java.util.ArrayList;
import java.util.List;
public class StopresellCommand extends CommandAreaShop {
public StopresellCommand(AreaShop plugin) {
@@ -33,13 +31,13 @@ public class StopresellCommand extends CommandAreaShop {
}
@Override
public void execute(CommandSender sender, Command command, String[] args) {
public void execute(CommandSender sender, String[] args) {
if(!sender.hasPermission("areashop.stopresell") && !sender.hasPermission("areashop.stopresellall")) {
plugin.message(sender, "stopresell-noPermissionOther");
return;
}
BuyRegion buy = null;
BuyRegion buy;
if(args.length <= 1) {
if (sender instanceof Player) {
// get the region by location
@@ -74,26 +72,24 @@ public class StopresellCommand extends CommandAreaShop {
}
if(sender.hasPermission("areashop.stopresellall")) {
buy.disableReselling();
buy.update();
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();
buy.update();
plugin.message(sender, "stopresell-success", buy);
buy.updateSigns();
buy.updateRegionFlags();
} else {
plugin.message(sender, "stopresell-noPermissionOther");
plugin.message(sender, "stopresell-noPermissionOther", buy);
}
} else {
plugin.message(sender, "stopresell-noPermission");
plugin.message(sender, "stopresell-noPermission", buy);
}
}
@Override
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
ArrayList<String> result = new ArrayList<String>();
ArrayList<String> result = new ArrayList<>();
if(toComplete == 2) {
for(BuyRegion region : plugin.getFileManager().getBuys()) {
if(region.isSold() && region.isInResellingMode()) {
@@ -1,15 +1,13 @@
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;
import java.util.ArrayList;
import java.util.List;
public class TeleportCommand extends CommandAreaShop {
public TeleportCommand(AreaShop plugin) {
@@ -32,7 +30,7 @@ public class TeleportCommand extends CommandAreaShop {
}
@Override
public void execute(CommandSender sender, Command command, String[] args) {
public void execute(CommandSender sender, String[] args) {
if(!sender.hasPermission("areashop.teleport") && !sender.hasPermission("areashop.teleportall") && !sender.hasPermission("areashop.teleportsign") && !sender.hasPermission("areashop.teleportsignall") && !sender.hasPermission("areashop.teleportfriend") && !sender.hasPermission("teleportfriendsign")) {
plugin.message(sender, "teleport-noPermission");
return;
@@ -61,7 +59,7 @@ public class TeleportCommand extends CommandAreaShop {
@Override
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
ArrayList<String> result = new ArrayList<String>();
ArrayList<String> result = new ArrayList<>();
if(toComplete == 2) {
result.addAll(plugin.getFileManager().getRegionNames());
} else if(toComplete == 3) {
@@ -1,16 +1,14 @@
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;
import java.util.ArrayList;
import java.util.List;
public class UnrentCommand extends CommandAreaShop {
public UnrentCommand(AreaShop plugin) {
@@ -33,12 +31,12 @@ public class UnrentCommand extends CommandAreaShop {
}
@Override
public void execute(CommandSender sender, Command command, String[] args) {
public void execute(CommandSender sender, String[] args) {
if(!sender.hasPermission("areashop.unrent") && !sender.hasPermission("areashop.unrentown")) {
plugin.message(sender, "unrent-noPermission");
return;
}
RentRegion rent = null;
RentRegion rent;
if(args.length <= 1) {
if (sender instanceof Player) {
// get the region by location
@@ -64,29 +62,15 @@ public class UnrentCommand extends CommandAreaShop {
return;
}
if(!rent.isRented()) {
plugin.message(sender, "unrent-notRented");
plugin.message(sender, "unrent-notRented", rent);
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");
}
}
}
rent.unRent(true, sender);
}
@Override
public List<String> getTabCompleteList(int toComplete, String[] start, CommandSender sender) {
ArrayList<String> result = new ArrayList<String>();
ArrayList<String> result = new ArrayList<>();
if(toComplete == 2) {
for(RentRegion region : plugin.getFileManager().getRents()) {
if(region.isRented()) {
@@ -0,0 +1,53 @@
package nl.evolutioncoding.areashop.events;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
public class CancellableAreaShopEvent extends Event {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private String reason;
@Override
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
/**
* Cancel the event from happening
* @param reason The reason of cancelling, used for display to the user, should end with a dot
*/
public void cancel(String reason) {
this.cancelled = true;
this.reason = reason;
}
/**
* Let the event continue, possible overwriting a cancel() call from another plugin
*/
public void allow() {
this.cancelled = false;
this.reason = null;
}
/**
* Check if the event has been cancelled
* @return true if the event has been cancelled, otherwise false
*/
public boolean isCancelled() {
return cancelled;
}
/**
* Get the reason why this event is cancelled
* @return null if there is no reason or the event is not cancelled, otherwise a string
*/
public String getReason() {
return reason;
}
}
@@ -0,0 +1,18 @@
package nl.evolutioncoding.areashop.events;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
public class NotifyAreaShopEvent extends Event {
private static final HandlerList handlers = new HandlerList();
@Override
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
}
@@ -0,0 +1,40 @@
package nl.evolutioncoding.areashop.events.ask;
import nl.evolutioncoding.areashop.events.CancellableAreaShopEvent;
import nl.evolutioncoding.areashop.regions.BuyRegion;
import org.bukkit.entity.Player;
/**
* Broadcasted when a player tries to buy a region.
*/
public class BuyingRegionEvent extends CancellableAreaShopEvent {
private BuyRegion region;
private Player player;
/**
* Constructor
* @param region The region that is about to get bought
* @param player The player that tries to buy the region
*/
public BuyingRegionEvent(BuyRegion region, Player player) {
this.region = region;
this.player = player;
}
/**
* Get the region that is about to be bought
* @return the region that is about to be bought
*/
public BuyRegion getRegion() {
return region;
}
/**
* Get the player that is trying to buy the region
* @return The player that is trying to buy the region
*/
public Player getPlayer() {
return player;
}
}
@@ -0,0 +1,51 @@
package nl.evolutioncoding.areashop.events.ask;
import nl.evolutioncoding.areashop.events.CancellableAreaShopEvent;
import nl.evolutioncoding.areashop.regions.RentRegion;
import org.bukkit.entity.Player;
/**
* Broadcasted when a player tries to rent a region
*/
public class RentingRegionEvent extends CancellableAreaShopEvent {
private RentRegion region;
private Player player;
private boolean extending;
/**
* Constructor
* @param region The region that is about to be rented
* @param player The player that tries to rent the region
* @param extending true if the player is extending the rental of the region, otherwise false
*/
public RentingRegionEvent(RentRegion region, Player player, boolean extending) {
this.region = region;
this.player = player;
this.extending = extending;
}
/**
* Get the region that is about to be rented
* @return the region that is about to be rented
*/
public RentRegion getRegion() {
return region;
}
/**
* Get the player that is trying to rent the region
* @return The player that is trying to rent the region
*/
public Player getPlayer() {
return player;
}
/**
* Check if the player is extending the region or renting it for the first time
* @return true if the player tries to extend the region, false if he tries to rent it the first time
*/
public boolean isExtending() {
return extending;
}
}
@@ -0,0 +1,40 @@
package nl.evolutioncoding.areashop.events.ask;
import nl.evolutioncoding.areashop.events.CancellableAreaShopEvent;
import nl.evolutioncoding.areashop.regions.BuyRegion;
import org.bukkit.entity.Player;
/**
* Broadcasted when a player tries to resell a region
*/
public class ResellingRegionEvent extends CancellableAreaShopEvent {
private BuyRegion region;
private Player player;
/**
* Contructor
* @param region The region that the player is trying to resell
* @param player The player that is trying to buy this region from the current owner
*/
public ResellingRegionEvent(BuyRegion region, Player player) {
this.region = region;
this.player = player;
}
/**
* Get the region that is about to be bought
* @return the region that is about to be bought
*/
public BuyRegion getRegion() {
return region;
}
/**
* Get the player that is trying to buy the region
* @return The player that is trying to buy the region
*/
public Player getBuyer() {
return player;
}
}
@@ -0,0 +1,28 @@
package nl.evolutioncoding.areashop.events.ask;
import nl.evolutioncoding.areashop.events.CancellableAreaShopEvent;
import nl.evolutioncoding.areashop.regions.BuyRegion;
/**
* Broadcasted when a region is about to get sold
*/
public class SellingRegionEvent extends CancellableAreaShopEvent {
private BuyRegion region;
/**
* Constructor
* @param region The region that is about to get sold
*/
public SellingRegionEvent(BuyRegion region) {
this.region = region;
}
/**
* Get the region that is about to be sold
* @return the region that is about to be sold
*/
public BuyRegion getRegion() {
return region;
}
}
@@ -0,0 +1,28 @@
package nl.evolutioncoding.areashop.events.ask;
import nl.evolutioncoding.areashop.events.CancellableAreaShopEvent;
import nl.evolutioncoding.areashop.regions.RentRegion;
/**
* Broadcasted when a region is about to be unrented
*/
public class UnrentingRegionEvent extends CancellableAreaShopEvent {
private RentRegion region;
/**
* Constructor
* @param region The region that is about to be unrented
*/
public UnrentingRegionEvent(RentRegion region) {
this.region = region;
}
/**
* Get the region that is about to be rented
* @return the region that is about to be rented
*/
public RentRegion getRegion() {
return region;
}
}
@@ -0,0 +1,28 @@
package nl.evolutioncoding.areashop.events.notify;
import nl.evolutioncoding.areashop.events.NotifyAreaShopEvent;
import nl.evolutioncoding.areashop.regions.GeneralRegion;
/**
* Broadcasted when a region has been added to AreaShop
*/
public class AddedRegionEvent extends NotifyAreaShopEvent {
private GeneralRegion region;
/**
* Constructor
* @param region The region that has been added
*/
public AddedRegionEvent(GeneralRegion region) {
this.region = region;
}
/**
* Get the region that has been added
* @return the region that has been added
*/
public GeneralRegion getRegion() {
return region;
}
}
@@ -0,0 +1,28 @@
package nl.evolutioncoding.areashop.events.notify;
import nl.evolutioncoding.areashop.events.NotifyAreaShopEvent;
import nl.evolutioncoding.areashop.regions.BuyRegion;
/**
* Broadcasted when a region has been bought
*/
public class BoughtRegionEvent extends NotifyAreaShopEvent {
private BuyRegion region;
/**
* Constructor
* @param region The region that has been bought
*/
public BoughtRegionEvent(BuyRegion region) {
this.region = region;
}
/**
* Get the region that has been bought
* @return the region that has been bought
*/
public BuyRegion getRegion() {
return region;
}
}
@@ -0,0 +1,29 @@
package nl.evolutioncoding.areashop.events.notify;
import nl.evolutioncoding.areashop.events.NotifyAreaShopEvent;
import nl.evolutioncoding.areashop.regions.GeneralRegion;
/**
* Broadcasted when the data of a region changes.
* Should be used for updating displays that use region data.
*/
public class RegionUpdateEvent extends NotifyAreaShopEvent {
private GeneralRegion region;
/**
* Contructor
* @param region The region that has been updated
*/
public RegionUpdateEvent(GeneralRegion region) {
this.region = region;
}
/**
* The region that has been updated
* @return The GeneralRegion that has been updated
*/
public GeneralRegion getRegion() {
return region;
}
}
@@ -0,0 +1,28 @@
package nl.evolutioncoding.areashop.events.notify;
import nl.evolutioncoding.areashop.events.NotifyAreaShopEvent;
import nl.evolutioncoding.areashop.regions.GeneralRegion;
/**
* Broadcasted when a region has been removed from AreaShop
*/
public class RemovedRegionEvent extends NotifyAreaShopEvent {
private GeneralRegion region;
/**
* Constructor
* @param region The region that has been removed
*/
public RemovedRegionEvent(GeneralRegion region) {
this.region = region;
}
/**
* Get the region that has been removed
* @return the region that has been removed
*/
public GeneralRegion getRegion() {
return region;
}
}
@@ -0,0 +1,39 @@
package nl.evolutioncoding.areashop.events.notify;
import nl.evolutioncoding.areashop.events.NotifyAreaShopEvent;
import nl.evolutioncoding.areashop.regions.RentRegion;
/**
* Broadcasted when a region has been rented
*/
public class RentedRegionEvent extends NotifyAreaShopEvent {
private RentRegion region;
private boolean extended;
/**
* Constructor
* @param region The region that has been rented
* @param extended true if the region has been extended, false if this is the first time buying the region
*/
public RentedRegionEvent(RentRegion region, boolean extended) {
this.region = region;
this.extended = extended;
}
/**
* Get the region that has been rented
* @return the region that has been rented
*/
public RentRegion getRegion() {
return region;
}
/**
* Check if the region was extended or rented for the first time
* @return true if the region was extended, false when rented for the first time
*/
public boolean hasExtended() {
return extended;
}
}
@@ -0,0 +1,41 @@
package nl.evolutioncoding.areashop.events.notify;
import nl.evolutioncoding.areashop.events.NotifyAreaShopEvent;
import nl.evolutioncoding.areashop.regions.BuyRegion;
import java.util.UUID;
/**
* Broadcasted when a region has been resold
*/
public class ResoldRegionEvent extends NotifyAreaShopEvent {
private BuyRegion region;
private UUID from;
/**
* Constructor
* @param region The region that has been resold
* @param from The player from who the region has been resold to the current owner
*/
public ResoldRegionEvent(BuyRegion region, UUID from) {
this.region = region;
this.from = from;
}
/**
* Get the region that has been bought
* @return the region that has been bought
*/
public BuyRegion getRegion() {
return region;
}
/**
* Get the player that the region has been bought from
* @return The UUID of the player that the region has been bought from
*/
public UUID getFromPlayer() {
return from;
}
}
@@ -0,0 +1,41 @@
package nl.evolutioncoding.areashop.events.notify;
import nl.evolutioncoding.areashop.events.NotifyAreaShopEvent;
import nl.evolutioncoding.areashop.regions.BuyRegion;
import java.util.UUID;
/**
* Broadcasted when a region is sold
*/
public class SoldRegionEvent extends NotifyAreaShopEvent {
private BuyRegion region;
private UUID oldBuyer;
/**
* Constructor
* @param region The region that has been sold
* @param oldBuyer The player for which the region has been sold
*/
public SoldRegionEvent(BuyRegion region, UUID oldBuyer) {
this.region = region;
this.oldBuyer = oldBuyer;
}
/**
* Get the region that has been sold
* @return the region that has been sold
*/
public BuyRegion getRegion() {
return region;
}
/**
* Get the player that the region is sold for
* @return The UUID of the player that the region is sold for
*/
public UUID getOldBuyer() {
return oldBuyer;
}
}
@@ -0,0 +1,41 @@
package nl.evolutioncoding.areashop.events.notify;
import nl.evolutioncoding.areashop.events.NotifyAreaShopEvent;
import nl.evolutioncoding.areashop.regions.RentRegion;
import java.util.UUID;
/**
* Broadcasted when a region has been unrented
*/
public class UnrentedRegionEvent extends NotifyAreaShopEvent {
private RentRegion region;
private UUID oldRenter;
/**
* Constructor
* @param region The region that has been unrented
* @param oldRenter The player that rented the region before it was unrented
*/
public UnrentedRegionEvent(RentRegion region, UUID oldRenter) {
this.region = region;
this.oldRenter = oldRenter;
}
/**
* Get the region that has been unrented
* @return the region that has been unrented
*/
public RentRegion getRegion() {
return region;
}
/**
* Get the player that the region was unrented for
* @return The UUID of the player that the region was unrented for
*/
public UUID getOldRenter() {
return oldRenter;
}
}
@@ -1,11 +0,0 @@
package nl.evolutioncoding.areashop.exceptions;
public class RegionCreateException extends Exception {
private static final long serialVersionUID = 1L;
public RegionCreateException(String message) {
super(message);
}
}
@@ -0,0 +1,70 @@
package nl.evolutioncoding.areashop.features;
import nl.evolutioncoding.areashop.AreaShop;
import nl.evolutioncoding.areashop.Utils;
import nl.evolutioncoding.areashop.events.ask.*;
import nl.evolutioncoding.areashop.events.notify.*;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
public class DebugFeature extends Feature implements Listener {
public DebugFeature(AreaShop plugin) {
super(plugin);
}
@EventHandler
public void buyingRegion(BuyingRegionEvent event) {
AreaShop.debug("BuyingRegionEvent: " + event.getPlayer().getName() + " is trying to buy " + event.getRegion().getName());
}
@EventHandler
public void boughtRegion(BoughtRegionEvent event) {
AreaShop.debug("BoughtRegionEvent: " + event.getRegion().getPlayerName() + " bought " + event.getRegion().getName());
}
@EventHandler
public void sellingRegion(SellingRegionEvent event) {
AreaShop.debug("SellingRegionEvent: " + event.getRegion().getName() + " is trying to sell " + event.getRegion().getName());
}
@EventHandler
public void soldRegion(SoldRegionEvent event) {
AreaShop.debug("SoldRegionEvent: "+Utils.toName(event.getOldBuyer())+" sold "+event.getRegion().getName());
}
@EventHandler
public void resellingRegion(ResellingRegionEvent event) {
AreaShop.debug("ResellingRegionEvent: " + event.getRegion().getName() + " is trying to resell " + event.getRegion().getName());
}
@EventHandler
public void resoldRegion(ResoldRegionEvent event) {
AreaShop.debug("ResoldRegionEvent: "+Utils.toName(event.getFromPlayer())+" resold "+event.getRegion().getName()+" to "+event.getRegion().getPlayerName());
}
@EventHandler
public void rentingRegion(RentingRegionEvent event) {
AreaShop.debug("RentingRegionEvent: " + event.getPlayer().getName() + " is trying to rent " + event.getRegion().getName() + ", extending=" + event.isExtending());
}
@EventHandler
public void rentedRegion(RentedRegionEvent event) {
AreaShop.debug("RentedRegionEvent: " + event.getRegion().getPlayerName() + " rented " + event.getRegion().getName() + ", extending=" + event.hasExtended());
}
@EventHandler
public void unrentingRegion(UnrentingRegionEvent event) {
AreaShop.debug("UnrentingRegionEvent: " + event.getRegion().getPlayerName() + " is trying to unrent " + event.getRegion().getName());
}
@EventHandler
public void unrentedRegion(UnrentedRegionEvent event) {
AreaShop.debug("UnrentedRegionEvent: "+Utils.toName(event.getOldRenter())+" unrented "+event.getRegion().getName());
}
@EventHandler
public void regionUpdate(RegionUpdateEvent event) {
//AreaShop.debug("RegionUpdateEvent: " + event.getRegion().getName() + " updated");
}
}
@@ -0,0 +1,12 @@
package nl.evolutioncoding.areashop.features;
import nl.evolutioncoding.areashop.AreaShop;
public class Feature {
AreaShop plugin;
public Feature(AreaShop plugin) {
this.plugin = plugin;
}
}
@@ -0,0 +1,126 @@
package nl.evolutioncoding.areashop.features;
import nl.evolutioncoding.areashop.AreaShop;
import nl.evolutioncoding.areashop.Utils;
import nl.evolutioncoding.areashop.events.notify.RegionUpdateEvent;
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.block.Sign;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import java.util.Set;
public class SignDisplayFeature extends Feature implements Listener {
public SignDisplayFeature(AreaShop plugin) {
super(plugin);
}
@EventHandler
public void regionUpdate(RegionUpdateEvent event) {
updateSigns(event.getRegion());
}
/**
* Update the signs connected to this region
* @return true if the update was successful, otherwise false
*/
public boolean updateSigns(GeneralRegion region) {
if(region.isDeleted()) {
return false;
}
YamlConfiguration config = region.getConfig();
boolean result = true;
Set<String> signs = null;
if(config.getConfigurationSection("general.signs") != null) {
signs = config.getConfigurationSection("general.signs").getKeys(false);
}
if(signs == null) {
return true;
}
for(String sign : signs) {
Location location = Utils.configToLocation(config.getConfigurationSection("general.signs." + sign + ".location"));
if(location == null) {
AreaShop.debug("Sign location incorrect region=" + region.getName() + ", signKey=" + sign);
result = false;
} else {
// Get the profile set in the config
String profile = config.getString("general.signs." + sign + ".profile");
if(profile == null || profile.length() == 0) {
profile = region.getStringSetting("general.signProfile");
}
// Get the prefix
String prefix = "signProfiles." + profile + "." + region.getState().getValue().toLowerCase() + ".";
// Get the lines
String[] signLines = new String[4];
signLines[0] = plugin.getConfig().getString(prefix + "line1");
signLines[1] = plugin.getConfig().getString(prefix + "line2");
signLines[2] = plugin.getConfig().getString(prefix + "line3");
signLines[3] = plugin.getConfig().getString(prefix + "line4");
// Check if the sign should be present
Block block = location.getBlock();
if(!plugin.getConfig().isSet(prefix)
|| ((signLines[0] == null || signLines[0].length() == 0)
&& (signLines[1] == null || signLines[1].length() == 0)
&& (signLines[2] == null || signLines[2].length() == 0)
&& (signLines[3] == null || signLines[3].length() == 0))) {
block.setType(Material.AIR);
} else {
Sign signState = null;
if(block.getType() != Material.WALL_SIGN && block.getType() != Material.SIGN_POST) {
Material signType;
try {
signType = Material.valueOf(config.getString("general.signs." + sign + ".signType"));
} catch(NullPointerException | IllegalArgumentException e) {
signType = null;
}
if(signType != Material.WALL_SIGN && signType != Material.SIGN_POST) {
AreaShop.debug(" setting sign failed");
continue;
}
block.setType(signType);
signState = (Sign)block.getState();
org.bukkit.material.Sign signData = (org.bukkit.material.Sign)signState.getData();
BlockFace signFace;
try {
signFace = BlockFace.valueOf(config.getString("general.signs." + sign + ".facing"));
} catch(NullPointerException | IllegalArgumentException e) {
signFace = null;
}
if(signFace != null) {
signData.setFacingDirection(signFace);
signState.setData(signData);
}
}
if(signState == null) {
signState = (Sign)block.getState();
}
org.bukkit.material.Sign signData = (org.bukkit.material.Sign)signState.getData();
if(!config.isString("general.signs." + sign + ".signType")) {
region.setSetting("general.signs." + sign + ".signType", signState.getType().toString());
}
if(!config.isString("general.signs." + sign + ".facing")) {
region.setSetting("general.signs." + sign + ".facing", signData.getFacing().toString());
}
// Apply replacements and color and then set it on the sign
for(int i = 0; i < signLines.length; i++) {
if(signLines[i] == null) {
signState.setLine(i, "");
continue;
}
signLines[i] = region.applyAllReplacements(signLines[i]);
signLines[i] = Utils.applyColors(signLines[i]);
signState.setLine(i, signLines[i]);
}
signState.update();
}
}
}
return result;
}
}
@@ -0,0 +1,189 @@
package nl.evolutioncoding.areashop.features;
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
import com.sk89q.worldguard.protection.flags.DefaultFlag;
import com.sk89q.worldguard.protection.flags.Flag;
import com.sk89q.worldguard.protection.flags.InvalidFlagFormat;
import com.sk89q.worldguard.protection.flags.RegionGroupFlag;
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
import nl.evolutioncoding.areashop.AreaShop;
import nl.evolutioncoding.areashop.events.notify.RegionUpdateEvent;
import nl.evolutioncoding.areashop.regions.GeneralRegion;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import java.util.Set;
public class WorldGuardRegionFlagsFeature extends Feature implements Listener {
public WorldGuardRegionFlagsFeature(AreaShop plugin) {
super(plugin);
}
@EventHandler
public void regionUpdate(RegionUpdateEvent event) {
updateRegionFlags(event.getRegion());
}
/**
* Set the region flags/options to the values of a ConfigurationSection
* @param region The region to update the flags for
* @return true if the flags have been set correctly, otherwise false
*/
protected boolean updateRegionFlags(GeneralRegion region) {
boolean result = true;
ConfigurationSection flags = plugin.getConfig().getConfigurationSection("flagProfiles." + region.getStringSetting("general.flagProfile") + "." + region.getState().getValue());
if(flags == null) {
AreaShop.debug("Flags section is null for region " + region.getName());
return false;
}
Set<String> flagNames = flags.getKeys(false);
WorldGuardPlugin worldGuard = plugin.getWorldGuard();
// Get the region
ProtectedRegion wRegion = region.getRegion();
if(wRegion == null) {
AreaShop.debug("Region '" + region.getName() + "' does not exist, setting flags failed");
return false;
}
// Loop through all flags that are set in the config
for(String flagName : flagNames) {
String value = flags.getString(flagName);
value = region.applyAllReplacements(value);
// In the config normal Bukkit color codes are used, those only need to be translated on 5.X WorldGuard versions
if(plugin.getWorldGuard().getDescription().getVersion().startsWith("5.")) {
value = translateBukkitToWorldGuardColors(value);
}
if(flagName.equalsIgnoreCase("members")) {
plugin.getWorldGuardHandler().setMembers(wRegion, value);
//AreaShop.debug(" Flag " + flagName + " set: " + members.toUserFriendlyString());
} else if(flagName.equalsIgnoreCase("owners")) {
plugin.getWorldGuardHandler().setOwners(wRegion, value);
//AreaShop.debug(" Flag " + flagName + " set: " + owners.toUserFriendlyString());
} else if(flagName.equalsIgnoreCase("priority")) {
try {
int priority = Integer.parseInt(value);
wRegion.setPriority(priority);
//AreaShop.debug(" Flag " + flagName + " set: " + value);
} catch(NumberFormatException e) {
plugin.getLogger().warning("The value of flag " + flagName + " is not a number");
result = false;
}
} else if(flagName.equalsIgnoreCase("parent")) {
if(region.getWorld() == null || worldGuard.getRegionManager(region.getWorld()) == null) {
continue;
}
ProtectedRegion parentRegion = worldGuard.getRegionManager(region.getWorld()).getRegion(value);
if(parentRegion != null) {
try {
wRegion.setParent(parentRegion);
//AreaShop.debug(" Flag " + flagName + " set: " + value);
} catch(ProtectedRegion.CircularInheritanceException e) {
plugin.getLogger().warning("The parent set in the config is not correct (circular inheritance)");
}
} else {
plugin.getLogger().warning("The parent set in the config is not correct (region does not exist)");
}
} else {
// Parse all other normal flags (groups are also handled)
String flagSetting = null;
com.sk89q.worldguard.protection.flags.RegionGroup groupValue = null;
Flag<?> foundFlag = DefaultFlag.fuzzyMatchFlag(flagName);
if(foundFlag == null) {
plugin.getLogger().warning("Found wrong flag in flagProfiles section: " + flagName + ", check if that is the correct WorldGuard flag");
continue;
}
RegionGroupFlag groupFlag = foundFlag.getRegionGroupFlag();
if(value == null || value.isEmpty()) {
wRegion.setFlag(foundFlag, null);
if(groupFlag != null) {
wRegion.setFlag(groupFlag, null);
}
//AreaShop.debug(" Flag " + flagName + " reset (+ possible group of flag)");
} else {
if(groupFlag == null) {
flagSetting = value;
} else {
for(String part : value.split(" ")) {
if(part.startsWith("g:")) {
if(part.length() > 2) {
try {
groupValue = groupFlag.parseInput(worldGuard, null, part.substring(2));
} catch(InvalidFlagFormat e) {
plugin.getLogger().warning("Found wrong group value for flag " + flagName);
}
}
} else {
if(flagSetting == null) {
flagSetting = part;
} else {
flagSetting += " " + part;
}
}
}
}
if(flagSetting != null) {
try {
setFlag(wRegion, foundFlag, flagSetting);
//AreaShop.debug(" Flag " + flagName + " set: " + flagSetting);
} catch(InvalidFlagFormat e) {
plugin.getLogger().warning("Found wrong value for flag " + flagName);
}
}
if(groupValue != null) {
if(groupValue == groupFlag.getDefault()) {
wRegion.setFlag(groupFlag, null);
//AreaShop.debug(" Group of flag " + flagName + " set to default: " + groupValue);
} else {
wRegion.setFlag(groupFlag, groupValue);
//AreaShop.debug(" Group of flag " + flagName + " set: " + groupValue);
}
}
}
}
}
// Indicate that the regions needs to be saved
plugin.getFileManager().saveIsRequiredForRegionWorld(region.getWorldName());
return result;
}
/**
* Set a WorldGuard region flag
* @param region The WorldGuard region to set
* @param flag The flag to set
* @param value The value to set the flag to
* @throws InvalidFlagFormat When the value of the flag is wrong
*/
protected static <V> void setFlag(ProtectedRegion region, Flag<V> flag, String value) throws InvalidFlagFormat {
region.setFlag(flag, flag.parseInput(WorldGuardPlugin.inst(), null, value));
}
/**
* Translate the color codes you put in greeting/farewell messages to the weird color codes of WorldGuard
* @param message The message where the color codes should be translated (this message has bukkit color codes)
* @return The string with the WorldGuard color codes
*/
public String translateBukkitToWorldGuardColors(String message) {
String result = message;
result = result.replace("&c", "&r");
result = result.replace("&4", "&R");
result = result.replace("&e", "&y");
result = result.replace("&6", "&Y");
result = result.replace("&a", "&g");
result = result.replace("&2", "&G");
result = result.replace("&b", "&c");
result = result.replace("&3", "&C");
result = result.replace("&9", "&b");
result = result.replace("&1", "&B");
result = result.replace("&d", "&p");
result = result.replace("&5", "&P");
result = result.replace("&0", "&0");
result = result.replace("&8", "&1");
result = result.replace("&7", "&2");
result = result.replace("&f", "&w");
result = result.replace("&r", "&x");
return result;
}
}
@@ -1,12 +1,9 @@
package nl.evolutioncoding.areashop.listeners;
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.RentRegion;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
@@ -17,12 +14,15 @@ import org.bukkit.event.player.PlayerLoginEvent.Result;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.scheduler.BukkitRunnable;
import java.util.ArrayList;
import java.util.List;
/**
* Checks for placement of signs for this plugin
* @author NLThijs48
*/
public final class PlayerLoginLogoutListener implements Listener {
AreaShop plugin;
private AreaShop plugin;
/**
* Constructor
@@ -65,7 +65,7 @@ public final class PlayerLoginLogoutListener implements Listener {
if(warningSetting == null || warningSetting.isEmpty()) {
continue;
}
long warningTime = plugin.durationStringToLong(warningSetting);
long warningTime = Utils.durationStringToLong(warningSetting);
if(region.getTimeLeft() < warningTime) {
// Send the warning message later to let it appear after general MOTD messages
AreaShop.getInstance().message(player, "rent-expireWarning", region);
@@ -76,7 +76,7 @@ public final class PlayerLoginLogoutListener implements Listener {
}
}.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());
final List<GeneralRegion> regions = new ArrayList<>(plugin.getFileManager().getRegions());
new BukkitRunnable() {
private int current = 0;
@@ -94,14 +94,12 @@ public final class PlayerLoginLogoutListener implements Listener {
if(region.isBuyRegion()) {
if(!player.getName().equals(region.getStringSetting("buy.buyerName"))) {
region.setSetting("buy.buyerName", player.getName());
region.updateRegionFlags();
region.updateSigns();
region.update();
}
} else if(region.isRentRegion()) {
if(!player.getName().equals(region.getStringSetting("rent.renterName"))) {
region.setSetting("rent.renterName", player.getName());
region.updateRegionFlags();
region.updateSigns();
region.update();
}
}
}
@@ -130,7 +128,7 @@ public final class PlayerLoginLogoutListener implements Listener {
* 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) {
private void updateLastActive(Player player) {
for(GeneralRegion region : plugin.getFileManager().getRegions()) {
if(region.isOwner(player)) {
region.updateLastActiveTime();
@@ -2,7 +2,6 @@ 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;
@@ -17,7 +16,7 @@ import org.bukkit.event.block.BlockPhysicsEvent;
* @author NLThijs48
*/
public final class SignBreakListener implements Listener {
AreaShop plugin;
private AreaShop plugin;
/**
* Constructor
@@ -38,20 +37,20 @@ public final class SignBreakListener implements Listener {
return;
}
Block block = event.getBlock();
/* Check if it is a sign */
// 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 */
// 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 */
// 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 */
plugin.message(event.getPlayer(), "delsign-success", region);
} else { // Cancel the breaking of the sign
event.setCancelled(true);
plugin.message(event.getPlayer(), "delsign-noPermission");
plugin.message(event.getPlayer(), "delsign-noPermission", region);
}
}
}
@@ -60,7 +59,7 @@ public final class SignBreakListener implements Listener {
* Called when the physics of a block change
* @param event The event
*/
@EventHandler(priority = EventPriority.MONITOR)
@EventHandler(priority = EventPriority.HIGHEST)
public void onIndirectSignBreak(BlockPhysicsEvent event){
Block block = event.getBlock();
if(event.isCancelled()) {
@@ -70,13 +69,12 @@ public final class SignBreakListener implements Listener {
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());
// Check if the rent sign is really the same as a saved rent
final 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)");
event.setCancelled(true); // Cancel the sign breaking, will create a floating sign but at least it is not disconnected/gone
}
}
}
@@ -1,7 +1,9 @@
package nl.evolutioncoding.areashop.listeners;
import java.util.List;
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;
import nl.evolutioncoding.areashop.AreaShop;
import nl.evolutioncoding.areashop.Utils;
import nl.evolutioncoding.areashop.managers.FileManager.AddResult;
@@ -10,7 +12,6 @@ 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;
@@ -19,17 +20,15 @@ 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;
import java.util.List;
import java.util.Set;
/**
* Checks for placement of signs for this plugin
* @author NLThijs48
*/
public final class SignChangeListener implements Listener {
AreaShop plugin;
private AreaShop plugin;
/**
* Constructor
@@ -71,8 +70,7 @@ public final class SignChangeListener implements Listener {
// 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());
Set<ProtectedRegion> regions = plugin.getWorldGuardHandler().getApplicableRegionsSet(event.getBlock().getLocation());
if(regions != null) {
boolean first = true;
ProtectedRegion candidate = null;
@@ -113,16 +111,12 @@ public final class SignChangeListener implements Listener {
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)) {
} else if(thirdLine != null && thirdLine.length() != 0 && !Utils.checkTimeFormat(thirdLine)) {
plugin.message(player, "setup-wrongDuration");
return;
} else {
double price = 0.0;
if(priceSet) {
@@ -137,8 +131,8 @@ public final class SignChangeListener implements Listener {
// 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 isMember = plugin.getWorldGuardHandler().containsMember(rent.getRegion(), player.getUniqueId());
boolean isOwner = plugin.getWorldGuardHandler().containsOwner(rent.getRegion(), player.getUniqueId());
boolean landlord = (!player.hasPermission("areashop.createrent")
&& ((player.hasPermission("areashop.createrent.owner") && isOwner)
|| (player.hasPermission("areashop.createrent.member") && isMember)));
@@ -160,17 +154,14 @@ public final class SignChangeListener implements Listener {
plugin.getFileManager().addRent(rent);
rent.handleSchematicEvent(RegionEvent.CREATED);
// Update the sign later because this event will do it first
plugin.message(player, "setup-rentSuccess", rent.getName());
// Update the region after the event has written its lines
new BukkitRunnable() {
@Override
public void run() {
rent.updateSigns();
rent.update();
}
}.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);
}
@@ -187,6 +178,9 @@ public final class SignChangeListener implements Listener {
// Get the regionManager for accessing regions
RegionManager regionManager = plugin.getWorldGuard().getRegionManager(event.getPlayer().getWorld());
if(regionManager == null) {
return;
}
// If the secondLine does not contain a name try to find the region by location
if(secondLine == null || secondLine.length() == 0) {
@@ -229,13 +223,10 @@ public final class SignChangeListener implements Listener {
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) {
@@ -250,8 +241,8 @@ public final class SignChangeListener implements Listener {
// 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 isMember = plugin.getWorldGuardHandler().containsMember(buy.getRegion(), player.getUniqueId());
boolean isOwner = plugin.getWorldGuardHandler().containsOwner(buy.getRegion(), player.getUniqueId());
boolean landlord = (!player.hasPermission("areashop.createbuy")
&& ((player.hasPermission("areashop.createbuy.owner") && isOwner)
|| (player.hasPermission("areashop.createbuy.member") && isMember)));
@@ -269,18 +260,15 @@ public final class SignChangeListener implements Listener {
plugin.getFileManager().addBuy(buy);
buy.handleSchematicEvent(RegionEvent.CREATED);
// Update the sign later because this event will do it first
plugin.message(player, "setup-buySuccess", region.getId());
// Update the region after the event has written its lines
new BukkitRunnable() {
@Override
public void run() {
buy.updateSigns();
buy.update();
}
}.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);
}
@@ -294,8 +282,8 @@ public final class SignChangeListener implements Listener {
// Get the other lines
String secondLine = event.getLine(1);
String thirdLine = event.getLine(2);
GeneralRegion region = null;
GeneralRegion region;
if(secondLine != null && secondLine.length() != 0) {
// Get region by secondLine of the sign
region = plugin.getFileManager().getRegion(secondLine);
@@ -321,18 +309,17 @@ public final class SignChangeListener implements Listener {
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);
plugin.message(player, "addsign-successProfile", thirdLine, region);
}
// Update the sign later because this event will do it first
// Update the region later because this event will do it first
final GeneralRegion regionUpdate = region;
new BukkitRunnable() {
@Override
public void run() {
regionUpdate.updateSigns();
regionUpdate.update();
}
}.runTaskLater(plugin, 1);
}
}
}
@@ -3,7 +3,6 @@ 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;
@@ -14,7 +13,7 @@ import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
public class SignClickListener implements Listener {
AreaShop plugin;
private AreaShop plugin;
/**
* Constructor
@@ -30,11 +29,14 @@ public class SignClickListener implements Listener {
*/
@EventHandler(priority = EventPriority.HIGH)
public void onSignClick(PlayerInteractEvent event) {
if(event.isCancelled()) {
return;
}
Block block = event.getClickedBlock();
/* Check for clicking a sign and rightclicking */
// 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 */
// Check if the rent sign is really the same as a saved rent
GeneralRegion result = plugin.getFileManager().getRegionBySignLocation(block.getLocation());
if(result == null) {
return;
@@ -1,44 +1,8 @@
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 nl.evolutioncoding.areashop.Utils;
import nl.evolutioncoding.areashop.commands.*;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
@@ -46,9 +10,14 @@ import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
import java.util.SortedSet;
import java.util.TreeSet;
public class CommandManager implements CommandExecutor, TabCompleter {
AreaShop plugin;
ArrayList<CommandAreaShop> commands;
private AreaShop plugin;
private ArrayList<CommandAreaShop> commands;
/**
* Constructor
@@ -56,7 +25,7 @@ public class CommandManager implements CommandExecutor, TabCompleter {
*/
public CommandManager(AreaShop plugin) {
this.plugin = plugin;
commands = new ArrayList<CommandAreaShop>();
commands = new ArrayList<>();
commands.add(new HelpCommand(plugin));
commands.add(new RentCommand(plugin));
commands.add(new UnrentCommand(plugin));
@@ -88,8 +57,8 @@ public class CommandManager implements CommandExecutor, TabCompleter {
commands.add(new LinksignsCommand(plugin));
commands.add(new StackCommand(plugin));
commands.add(new SetlandlordCommand(plugin));
/* Register commands in bukkit */
// Register commands in bukkit
plugin.getCommand("AreaShop").setExecutor(this);
plugin.getCommand("AreaShop").setTabCompleter(this);
}
@@ -107,8 +76,8 @@ public class CommandManager implements CommandExecutor, TabCompleter {
* @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>();
// Add all messages to a list
ArrayList<String> messages = new ArrayList<>();
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) {
@@ -117,13 +86,13 @@ public class CommandManager implements CommandExecutor, TabCompleter {
messages.add(help);
}
}
/* Send the messages to the target */
// 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)));
target.sendMessage(ChatColor.stripColor(Utils.applyColors(message)));
} else {
target.sendMessage(plugin.fixColors(message));
target.sendMessage(Utils.applyColors(message));
}
}
}
@@ -137,7 +106,7 @@ public class CommandManager implements CommandExecutor, TabCompleter {
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);
commands.get(i).execute(sender, args);
executed = true;
}
}
@@ -156,7 +125,7 @@ public class CommandManager implements CommandExecutor, TabCompleter {
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
List<String> result = new ArrayList<String>();
List<String> result = new ArrayList<>();
if(!sender.hasPermission("areashop.tabcomplete")) {
return result;
}
@@ -182,7 +151,7 @@ public class CommandManager implements CommandExecutor, TabCompleter {
}
// Filter and sort the results
if(result.size() > 0) {
SortedSet<String> set = new TreeSet<String>();
SortedSet<String> set = new TreeSet<>();
for(String suggestion : result) {
if(suggestion.toLowerCase().startsWith(toCompletePrefix)) {
set.add(suggestion);
@@ -1,55 +1,35 @@
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.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.google.common.base.Charsets;
import com.google.common.io.Files;
import com.sk89q.worldguard.protection.managers.RegionManager;
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
import nl.evolutioncoding.areashop.AreaShop;
import nl.evolutioncoding.areashop.Utils;
import nl.evolutioncoding.areashop.events.notify.AddedRegionEvent;
import nl.evolutioncoding.areashop.events.notify.RemovedRegionEvent;
import nl.evolutioncoding.areashop.regions.BuyRegion;
import nl.evolutioncoding.areashop.regions.GeneralRegion;
import nl.evolutioncoding.areashop.regions.GeneralRegion.RegionEvent;
import nl.evolutioncoding.areashop.regions.GeneralRegion.RegionType;
import nl.evolutioncoding.areashop.regions.RegionGroup;
import nl.evolutioncoding.areashop.regions.RentRegion;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.OfflinePlayer;
import org.bukkit.World;
import org.bukkit.*;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import com.google.common.base.Charsets;
import com.google.common.io.Files;
import com.sk89q.worldguard.protection.managers.RegionManager;
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
import java.io.*;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class FileManager {
private static FileManager instance = null;
private AreaShop plugin = null;
private ObjectInputStream input = null;
private ObjectOutputStream output = null;
private HashMap<String, GeneralRegion> regions = null;
private String regionsPath = null;
private HashMap<String, RegionGroup> groups = null;
@@ -65,8 +45,8 @@ public class FileManager {
private HashMap<String,Integer> versions = null;
private String versionPath = null;
private String schemFolder = null;
/* Enum for region types */
// Enum for region types
public enum AddResult {
BLACKLISTED("blacklisted"),
NOPERMISSION("nopermission"),
@@ -74,7 +54,8 @@ public class FileManager {
SUCCESS("success");
private final String value;
private AddResult(String value) {
AddResult(String value) {
this.value = value;
}
public String getValue() {
@@ -84,22 +65,22 @@ public class FileManager {
/**
* Constructor, initialize variabeles
* @param plugin
* @param plugin AreaShop
*/
public FileManager(AreaShop plugin) {
this.plugin = plugin;
regions = new HashMap<String, GeneralRegion>();
regions = new HashMap<>();
regionsPath = plugin.getDataFolder() + File.separator + AreaShop.regionsFolder;
configPath = plugin.getDataFolder() + File.separator + "config.yml";
groups = new HashMap<String, RegionGroup>();
groups = new HashMap<>();
groupsPath = plugin.getDataFolder() + File.separator + AreaShop.groupsFile;
defaultPath = plugin.getDataFolder() + File.separator + AreaShop.defaultFile;
versionPath = plugin.getDataFolder().getPath() + File.separator + AreaShop.versionFile;
schemFolder = plugin.getDataFolder() + File.separator + AreaShop.schematicFolder;
worldRegionsRequireSaving = new HashSet<String>();
worldRegionsRequireSaving = new HashSet<>();
File schemFile = new File(schemFolder);
if(!schemFile.exists()) {
schemFile.mkdirs();
if(!schemFile.exists() & !schemFile.mkdirs()) {
plugin.getLogger().warning("Could not create schematic files directory: " + schemFile.getAbsolutePath());
}
loadVersions();
}
@@ -161,7 +142,7 @@ public class FileManager {
}
public List<RentRegion> getRents() {
List<RentRegion> result = new ArrayList<RentRegion>();
List<RentRegion> result = new ArrayList<>();
for(GeneralRegion region : regions.values()) {
if(region.isRentRegion()) {
result.add((RentRegion)region);
@@ -171,7 +152,7 @@ public class FileManager {
}
public List<BuyRegion> getBuys() {
List<BuyRegion> result = new ArrayList<BuyRegion>();
List<BuyRegion> result = new ArrayList<>();
for(GeneralRegion region : regions.values()) {
if(region.isBuyRegion()) {
result.add((BuyRegion)region);
@@ -181,7 +162,7 @@ public class FileManager {
}
public List<GeneralRegion> getRegions() {
return new ArrayList<GeneralRegion>(regions.values());
return new ArrayList<>(regions.values());
}
/**
@@ -189,28 +170,28 @@ public class FileManager {
* @return A String list with all the names
*/
public List<String> getBuyNames() {
ArrayList<String> result = new ArrayList<String>();
ArrayList<String> result = new ArrayList<>();
for(BuyRegion region : getBuys()) {
result.add(region.getName());
}
return result;
}
public List<String> getRentNames() {
ArrayList<String> result = new ArrayList<String>();
ArrayList<String> result = new ArrayList<>();
for(RentRegion region : getRents()) {
result.add(region.getName());
}
return result;
}
public List<String> getRegionNames() {
ArrayList<String> result = new ArrayList<String>();
ArrayList<String> result = new ArrayList<>();
for(GeneralRegion region : getRegions()) {
result.add(region.getName());
}
return result;
}
public List<String> getGroupNames() {
ArrayList<String> result = new ArrayList<String>();
ArrayList<String> result = new ArrayList<>();
for(RegionGroup group : getGroups()) {
result.add(group.getName());
}
@@ -227,6 +208,7 @@ public class FileManager {
return;
}
regions.put(rent.getName().toLowerCase(), rent);
Bukkit.getPluginManager().callEvent(new AddedRegionEvent(rent));
}
/**
* Add a rent to the list and mark it as to-be-saved
@@ -247,6 +229,7 @@ public class FileManager {
return;
}
regions.put(buy.getName().toLowerCase(), buy);
Bukkit.getPluginManager().callEvent(new AddedRegionEvent(buy));
}
/**
* Add a buy to the list and mark it as to-be-saved
@@ -264,12 +247,8 @@ public class FileManager {
public void addGroup(RegionGroup group) {
groups.put(group.getName().toLowerCase(), group);
String lowGroup = group.getName().toLowerCase();
ConfigurationSection result = groupsConfig.getConfigurationSection(lowGroup);
if(result == null) {
result = groupsConfig.createSection(lowGroup);
groupsConfig.set(lowGroup + ".name", group.getName());
groupsConfig.set(lowGroup + ".priority", 0);
}
groupsConfig.set(lowGroup + ".name", group.getName());
groupsConfig.set(lowGroup + ".priority", 0);
saveGroupsIsRequired();
}
@@ -289,7 +268,7 @@ public class FileManager {
boolean isMember = player != null && plugin.getWorldGuardHandler().containsMember(region, player.getUniqueId());
boolean isOwner = player != null && plugin.getWorldGuardHandler().containsOwner(region, player.getUniqueId());
AreaShop.debug("checkRegionAdd: isOwner=" + isOwner + ", isMember=" + isMember);
String typeString = null;
String typeString;
if(type == RegionType.RENT) {
typeString = "rent";
} else {
@@ -321,13 +300,13 @@ public class FileManager {
if(rent != null) {
rent.setDeleted();
if(rent.isRented()) {
rent.unRent(giveMoneyBack);
rent.unRent(giveMoneyBack, null);
}
// Handle schematics and run commands
rent.handleSchematicEvent(RegionEvent.DELETED);
rent.runEventCommands(RegionEvent.DELETED, true);
/* Delete the signs and the variable */
// Delete the signs and the variable
if(rent.getWorld() != null) {
for(Location sign : rent.getSignLocations()) {
sign.getBlock().setType(Material.AIR);
@@ -341,7 +320,7 @@ public class FileManager {
rent.resetRegionFlags();
regions.remove(rent.getLowerCaseName());
File file = new File(plugin.getDataFolder() + File.separator + AreaShop.regionsFolder + File.separator + rent.getLowerCaseName() + ".yml");
boolean deleted = true;
boolean deleted;
if(file.exists()) {
try {
deleted = file.delete();
@@ -353,7 +332,10 @@ public class FileManager {
}
}
result = true;
// Broadcast event
Bukkit.getPluginManager().callEvent(new RemovedRegionEvent(rent));
// Run commands
rent.runEventCommands(RegionEvent.DELETED, false);
}
@@ -376,14 +358,15 @@ public class FileManager {
/**
* Remove a buy from the list
* @param regionName
* @param buy The BuyRegion to remove
* @param giveMoneyBack true if money should be given back to the player, otherwise false
*/
public boolean removeBuy(BuyRegion buy, boolean giveMoneyBack) {
boolean result = false;
if(buy != null) {
buy.setDeleted();
if(buy.isSold()) {
buy.sell(giveMoneyBack);
buy.sell(giveMoneyBack, null);
}
// Handle schematics and run commands
buy.handleSchematicEvent(RegionEvent.DELETED);
@@ -405,7 +388,7 @@ public class FileManager {
// Deleting the file
File file = new File(plugin.getDataFolder() + File.separator + AreaShop.regionsFolder + File.separator + buy.getLowerCaseName() + ".yml");
boolean deleted = true;
boolean deleted;
if(file.exists()) {
try {
deleted = file.delete();
@@ -418,7 +401,10 @@ public class FileManager {
}
result = true;
// Broadcast event
Bukkit.getPluginManager().callEvent(new RemovedRegionEvent(buy));
// Run commands
buy.runEventCommands(RegionEvent.DELETED, false);
}
@@ -439,7 +425,7 @@ public class FileManager {
* Update all signs that need periodic updating
*/
public void performPeriodicSignUpdate() {
final List<RentRegion> regions = new ArrayList<RentRegion>(getRents());
final List<RentRegion> regions = new ArrayList<>(getRents());
new BukkitRunnable() {
private int current = 0;
@@ -448,7 +434,7 @@ public class FileManager {
for(int i=0; i<plugin.getConfig().getInt("signs.regionsPerTick"); i++) {
if(current < regions.size()) {
if(regions.get(current).needsPeriodicUpdating()) {
regions.get(current).updateSigns();
regions.get(current).update();
}
current++;
}
@@ -464,7 +450,7 @@ public class FileManager {
* Send out rent expire warnings
*/
public void sendRentExpireWarnings() {
final List<RentRegion> regions = new ArrayList<RentRegion>(getRents());
final List<RentRegion> regions = new ArrayList<>(getRents());
new BukkitRunnable() {
private int current = 0;
@@ -483,73 +469,6 @@ public class FileManager {
}.runTaskTimer(plugin, 1, 1);
}
/**
* Update all rent signs
* @return true if all signs are updated, otherwise false
* @param confirmationReceiver who needs to get the confirmation message, null if nobody
*/
public void updateRentSignsAndFlags(final CommandSender confirmationReceiver) {
final List<RentRegion> regions = new ArrayList<RentRegion>(getRents());
new BukkitRunnable() {
private int current = 0;
private boolean result = true;
@Override
public void run() {
for(int i=0; i<plugin.getConfig().getInt("update.regionsPerTick"); i++) {
if(current < regions.size()) {
result = regions.get(current).updateSigns() && result;
regions.get(current).updateRegionFlags();
current++;
}
}
if(current >= regions.size()) {
if(confirmationReceiver != null) {
if(result) {
plugin.message(confirmationReceiver, "rents-updated");
} else {
plugin.message(confirmationReceiver, "rents-notUpdated");
}
}
this.cancel();
}
}
}.runTaskTimer(plugin, 1, 1);
}
/**
* Update all buy signs
* @return true if all signs are updated, otherwise false
* @param confirmationReceiver who needs to get the confirmation message, null if nobody
*/
public void updateBuySignsAndFlags(final CommandSender confirmationReceiver) {
final List<BuyRegion> regions = new ArrayList<BuyRegion>(getBuys());
new BukkitRunnable() {
private int current = 0;
private boolean result = true;
@Override
public void run() {
for(int i=0; i<plugin.getConfig().getInt("update.regionsPerTick"); i++) {
if(current < regions.size()) {
regions.get(current).updateSigns();
regions.get(current).updateRegionFlags();
current++;
}
}
if(current >= regions.size()) {
if(confirmationReceiver != null) {
if(result) {
plugin.message(confirmationReceiver, "buys-updated");
} else {
plugin.message(confirmationReceiver, "buys-notUpdated");
}
}
this.cancel();
}
}
}.runTaskTimer(plugin, 1, 1);
}
/**
* Update regions in a task to minimize lag
* @param regions Regions to update
@@ -565,8 +484,7 @@ public class FileManager {
public void run() {
for(int i=0; i<regionsPerTick; i++) {
if(current < regions.size()) {
regions.get(current).updateSigns();
regions.get(current).updateRegionFlags();
regions.get(current).update();
current++;
}
}
@@ -622,8 +540,8 @@ public class FileManager {
saveGroupsNow();
}
this.saveWorldGuardRegions();
final List<GeneralRegion> regions = new ArrayList<GeneralRegion>(getRegions());
final List<GeneralRegion> regions = new ArrayList<>(getRegions());
new BukkitRunnable() {
private int current = 0;
@@ -718,7 +636,7 @@ public class FileManager {
* Unrent regions that have no time left, regions to check per tick is in the config
*/
public void checkRents() {
final List<RentRegion> regions = new ArrayList<RentRegion>(getRents());
final List<RentRegion> regions = new ArrayList<>(getRents());
new BukkitRunnable() {
private int current = 0;
@@ -741,7 +659,7 @@ public class FileManager {
* Check all regions and unrent/sell them if the player is inactive for too long
*/
public void checkForInactiveRegions() {
final List<GeneralRegion> regions = new ArrayList<GeneralRegion>(getRegions());
final List<GeneralRegion> regions = new ArrayList<>(getRegions());
new BukkitRunnable() {
private int current = 0;
@@ -768,10 +686,10 @@ public class FileManager {
public void loadVersions() {
File file = new File(versionPath);
if(file.exists()) {
/* Load versions from the file */
// Load versions from the file
try {
input = new ObjectInputStream(new FileInputStream(versionPath));
versions = (HashMap<String,Integer>)input.readObject();
ObjectInputStream input = new ObjectInputStream(new FileInputStream(versionPath));
versions = (HashMap<String,Integer>)input.readObject();
input.close();
} catch (IOException | ClassNotFoundException | ClassCastException e) {
plugin.getLogger().warning("Something went wrong reading file: " + versionPath);
@@ -779,7 +697,7 @@ public class FileManager {
}
}
if(versions == null || versions.size() == 0) {
versions = new HashMap<String, Integer>();
versions = new HashMap<>();
versions.put(AreaShop.versionFiles, 0);
this.saveVersions();
}
@@ -793,7 +711,7 @@ public class FileManager {
plugin.getLogger().info("versions file created, this should happen only after installing or upgrading the plugin");
}
try {
output = new ObjectOutputStream(new FileOutputStream(versionPath));
ObjectOutputStream output = new ObjectOutputStream(new FileOutputStream(versionPath));
output.writeObject(versions);
output.close();
} catch (IOException e) {
@@ -803,21 +721,21 @@ public class FileManager {
/**
* Load all files from disk
* @return true
* @return true if the files are loaded correctly, otherwise false
*/
public boolean loadFiles() {
boolean result = false;
// Load config.yml + add defaults from .jar
result = result & loadConfigFile();
boolean result = loadConfigFile();
// Load default.yml + add defaults from .jar
result = result & loadDefaultFile();
// Convert old formats to the latest
result &= loadDefaultFile();
// Convert old formats to the latest (object saving to .yml saving)
preUpdateFiles();
// Load region files (regions folder)
result = result & loadRegionFiles();
loadRegionFiles();
// Convert old formats to the latest (changes in .yml saving format)
postUpdateFiles();
// Load groups.yml
result = result & loadGroupsFile();
result &= loadGroupsFile();
return result;
}
@@ -827,16 +745,15 @@ public class FileManager {
* @return true if it has been loaded successfully, otherwise false
*/
public boolean loadDefaultFile() {
boolean result = true;
File defaultFile = new File(defaultPath);
// Safe the file from the jar to disk if it does not exist
if(!defaultFile.exists()) {
InputStream input = null;
OutputStream output = null;
try {
input = plugin.getResource(AreaShop.defaultFile);
output = new FileOutputStream(defaultFile);
int read = 0;
try(
InputStream input = plugin.getResource(AreaShop.defaultFile);
OutputStream output = new FileOutputStream(defaultFile)
) {
int read;
byte[] bytes = new byte[1024];
while ((read = input.read(bytes)) != -1) {
output.write(bytes, 0, read);
@@ -845,41 +762,25 @@ public class FileManager {
output.close();
plugin.getLogger().info("File with default region settings has been saved, should only happen on first startup");
} catch(IOException e) {
try {
input.close();
output.close();
} catch (IOException e1) {} catch (NullPointerException e2) {}
plugin.getLogger().warning("Something went wrong saving the default region settings: " + defaultFile.getPath());
plugin.getLogger().warning("Something went wrong saving the default region settings: " + defaultFile.getAbsolutePath());
}
}
// Load default.yml from the plugin folder
InputStreamReader reader = null;
try {
reader = new InputStreamReader(new FileInputStream(defaultFile), Charsets.UTF_8);
} catch (FileNotFoundException e) {}
if(reader != null) {
defaultConfig = YamlConfiguration.loadConfiguration(reader);
// Load default.yml from the plugin folder, and as backup the default one
try(
InputStreamReader custom = new InputStreamReader(new FileInputStream(defaultFile), Charsets.UTF_8);
InputStreamReader normal = new InputStreamReader(plugin.getResource(AreaShop.defaultFile), Charsets.UTF_8)
) {
defaultConfig = YamlConfiguration.loadConfiguration(custom);
if(defaultConfig.getKeys(false).size() == 0) {
plugin.getLogger().warning("File 'default.yml' is empty, check for errors in the log.");
result = false;
} else {
defaultConfig.addDefaults(YamlConfiguration.loadConfiguration(normal));
}
} catch(IOException e) {
result = false;
}
try {
reader.close();
} catch (IOException e) {}
if(defaultConfig == null) {
defaultConfig = new YamlConfiguration();
}
// Addding the defaults from the normal file that is inside the jar is disabled, not nice when removing lines for things you don't want
InputStream inputStream = plugin.getResource(AreaShop.defaultFile);
if(inputStream != null) {
reader = new InputStreamReader(inputStream, Charsets.UTF_8);
}
if(reader != null) {
defaultConfig.addDefaults(YamlConfiguration.loadConfiguration(reader));
}
try {
reader.close();
} catch (IOException e) {}
return defaultConfig != null;
return result;
}
/**
@@ -887,83 +788,65 @@ public class FileManager {
* @return true if it has been loaded successfully, otherwise false
*/
public boolean loadConfigFile() {
boolean result = true;
File configFile = new File(configPath);
// Safe the file from the jar to disk if it does not exist
if(!configFile.exists()) {
InputStream input = null;
OutputStream output = null;
try {
input = plugin.getResource(AreaShop.configFile);
output = new FileOutputStream(configFile);
int read = 0;
try(
InputStream input = plugin.getResource(AreaShop.configFile);
OutputStream output = new FileOutputStream(configFile)
) {
int read;
byte[] bytes = new byte[1024];
while ((read = input.read(bytes)) != -1) {
output.write(bytes, 0, read);
}
input.close();
output.close();
}
plugin.getLogger().info("Default config file has been saved, should only happen on first startup");
} catch(IOException e) {
try {
input.close();
output.close();
} catch (IOException e1) {} catch (NullPointerException e2) {}
plugin.getLogger().warning("Something went wrong saving the config file: " + configFile.getPath());
plugin.getLogger().warning("Something went wrong saving the config file: " + configFile.getAbsolutePath());
}
}
// Load config.yml from the plugin folder
InputStreamReader reader = null;
try {
reader = new InputStreamReader(new FileInputStream(configFile), Charsets.UTF_8);
} catch (FileNotFoundException e) {}
if(reader != null) {
config = YamlConfiguration.loadConfiguration(reader);
try(
InputStreamReader custom = new InputStreamReader(new FileInputStream(configFile), Charsets.UTF_8);
InputStreamReader normal = new InputStreamReader(plugin.getResource(AreaShop.configFile), Charsets.UTF_8)
) {
config = YamlConfiguration.loadConfiguration(custom);
if(config.getKeys(false).size() == 0) {
plugin.getLogger().warning("File 'config.yml' is empty, check for errors in the log.");
result = false;
} else {
config.addDefaults(YamlConfiguration.loadConfiguration(normal));
// Set the debug and chatprefix variables
plugin.setDebug(this.getConfig().getBoolean("debug"));
plugin.setChatprefix(this.getConfig().getString("chatPrefix"));
}
} catch(IOException e) {
plugin.getLogger().warning("Something went wrong while reading the config.yml file: " + configFile.getAbsolutePath());
result = false;
}
try {
reader.close();
} catch (IOException e) {}
if(config == null) {
config = new YamlConfiguration();
}
// Add the values from the config.yml file inside of the .jar as defaults
InputStream inputStream = plugin.getResource(AreaShop.configFile);
if(inputStream != null) {
reader = new InputStreamReader(inputStream, Charsets.UTF_8);
}
if(reader != null) {
config.addDefaults(YamlConfiguration.loadConfiguration(reader));
}
try {
reader.close();
} catch (IOException e) {}
// Set the debug and chatprefix variables
plugin.setDebug(this.getConfig().getBoolean("debug"));
plugin.setChatprefix(this.getConfig().getString("chatPrefix"));
return config != null;
Utils.initialize(config);
return result;
}
/**
* Load the groups.yml file from disk
* @return
*/
public boolean loadGroupsFile() {
boolean result = true;
File groupFile = new File(groupsPath);
InputStreamReader reader = null;
if(groupFile.exists() && groupFile.isFile()) {
try {
reader = new InputStreamReader(new FileInputStream(groupFile), Charsets.UTF_8);
} catch (FileNotFoundException e) {}
if(reader != null) {
try(
InputStreamReader reader = new InputStreamReader(new FileInputStream(groupFile), Charsets.UTF_8)
) {
groupsConfig = YamlConfiguration.loadConfiguration(reader);
if(config.getKeys(false).size() == 0) {
plugin.getLogger().warning("File 'groups.yml' is empty, check for errors in the log.");
result = false;
}
} catch(IOException e) {
plugin.getLogger().warning("Could not load groups.yml file: " + groupFile.getAbsolutePath());
}
try {
reader.close();
} catch (IOException e) {}
}
if(groupsConfig == null) {
groupsConfig = new YamlConfiguration();
@@ -972,35 +855,41 @@ public class FileManager {
RegionGroup group = new RegionGroup(plugin, groupName);
groups.put(groupName, group);
}
return true;
return result;
}
/**
* Load all region files
* @return true
*/
public boolean loadRegionFiles() {
public void loadRegionFiles() {
regions.clear();
File file = new File(regionsPath);
if(!file.exists()) {
file.mkdirs();
if(!file.mkdirs()) {
plugin.getLogger().warning("Could not create region files directory: " + file.getAbsolutePath());
return;
}
plugin.setReady(true);
} else if(file.isDirectory()) {
File[] regionFiles = file.listFiles();
if(regionFiles == null) {
return;
}
for(File regionFile : regionFiles) {
if(regionFile.exists() && regionFile.isFile()) {
// Load the region file from disk in UTF8 mode
InputStreamReader reader = null;
YamlConfiguration config = null;
try {
reader = new InputStreamReader(new FileInputStream(regionFile), Charsets.UTF_8);
} catch (FileNotFoundException e) {}
if(reader != null) {
YamlConfiguration config;
try(
InputStreamReader reader = new InputStreamReader(new FileInputStream(regionFile), Charsets.UTF_8)
) {
config = YamlConfiguration.loadConfiguration(reader);
if(config.getKeys(false).size() == 0) {
plugin.getLogger().warning("Region file '"+regionFile.getName()+"' is empty, check for errors in the log.");
}
} catch(IOException e) {
plugin.getLogger().warning("Something went wrong reading region file: " + regionFile.getAbsolutePath());
continue;
}
try {
reader.close();
} catch (IOException e) {}
// Construct the correct type of region
if(RegionType.RENT.getValue().equals(config.getString("general.type"))) {
RentRegion rent = new RentRegion(plugin, config);
@@ -1015,8 +904,9 @@ public class FileManager {
new BukkitRunnable() {
@Override
public void run() {
List<GeneralRegion> noWorld = new ArrayList<GeneralRegion>();
List<GeneralRegion> noRegion = new ArrayList<GeneralRegion>();
List<GeneralRegion> noWorld = new ArrayList<>();
List<GeneralRegion> noRegion = new ArrayList<>();
List<GeneralRegion> incorrectDuration = new ArrayList<>();
for(GeneralRegion region : AreaShop.getInstance().getFileManager().getRegions()) {
// Add broken regions to a list
if(region != null) {
@@ -1026,11 +916,14 @@ public class FileManager {
if(region.getRegion() == null) {
noRegion.add(region);
}
if(region.isRentRegion() && !Utils.checkTimeFormat(((RentRegion)region).getDurationString())) {
incorrectDuration.add(region);
}
}
}
// All files are loaded, print possible problems to the console
if(!noRegion.isEmpty()) {
List<String> noRegionNames = new ArrayList<String>();
List<String> noRegionNames = new ArrayList<>();
for(GeneralRegion region : noRegion) {
noRegionNames.add(region.getName());
}
@@ -1039,7 +932,7 @@ public class FileManager {
}
boolean noWorldRegions = !noWorld.isEmpty();
while(!noWorld.isEmpty()) {
List<GeneralRegion> toDisplay = new ArrayList<GeneralRegion>();
List<GeneralRegion> toDisplay = new ArrayList<>();
String missingWorld = noWorld.get(0).getWorldName();
toDisplay.add(noWorld.get(0));
for(int i=1; i<noWorld.size(); i++) {
@@ -1047,7 +940,7 @@ public class FileManager {
toDisplay.add(noWorld.get(i));
}
}
List<String> noWorldNames = new ArrayList<String>();
List<String> noWorldNames = new ArrayList<>();
for(GeneralRegion region : noRegion) {
noWorldNames.add(region.getName());
}
@@ -1057,11 +950,16 @@ public class FileManager {
if(noWorldRegions) {
plugin.getLogger().warning("Remove these regions from AreaShop with '/as del' or load the world(s) on the server again.");
}
if(!incorrectDuration.isEmpty()) {
List<String> incorrectDurationNames = new ArrayList<>();
for(GeneralRegion region : incorrectDuration) {
incorrectDurationNames.add(region.getName());
}
plugin.getLogger().warning("The following regions have an incorrect time format as duration: "+Utils.createCommaSeparatedList(incorrectDurationNames));
}
}
}.runTask(plugin);
}
// Warnings will be printed in console, no other things can go wrong
return true;
}
@@ -1091,8 +989,8 @@ public class FileManager {
boolean buyFileFound = false, rentFileFound = false;
if(rentFile.exists()) {
rentFileFound = true;
if(!oldFolderFile.exists()) {
oldFolderFile.mkdirs();
if(!oldFolderFile.exists() & !oldFolderFile.mkdirs()) {
plugin.getLogger().warning("Could not create directory: " + oldFolderFile.getAbsolutePath());
}
if(versions.get("rents") == null) {
@@ -1110,8 +1008,12 @@ public class FileManager {
// Delete the file if it is totally wrong
if(rents == null) {
try {
rentFile.delete();
} catch(Exception e) {}
if(!rentFile.delete()) {
plugin.getLogger().warning("Could not delete file: " + rentFile.getAbsolutePath());
}
} catch(Exception e) {
plugin.getLogger().warning("Could not delete file: " + rentFile.getAbsolutePath());
}
} else {
// Move old file
try {
@@ -1120,26 +1022,26 @@ public class FileManager {
plugin.getLogger().warning(" Could not create a backup of '" + rentPath + "', check the file permissions (conversion to next version continues)");
}
// Check if conversion is needed
if(versions.get("rents") < 1) {
/* Upgrade the rent to the latest version */
if(versions.get("rents") < 1) {
// Upgrade the rent to the latest version
if(versions.get("rents") < 0) {
for(String rentName : rents.keySet()) {
HashMap<String,String> rent = rents.get(rentName);
/* Save the rentName in the hashmap and use a small caps rentName as key */
// Save the rentName in the hashmap and use a small caps rentName as key
if(rent.get("name") == null) {
rent.put("name", rentName);
rents.remove(rentName);
rents.put(rentName.toLowerCase(), rent);
}
/* Save the default setting for region restoring */
// Save the default setting for region restoring
if(rent.get("restore") == null) {
rent.put("restore", "general");
}
/* Save the default setting for the region restore profile */
// Save the default setting for the region restore profile
if(rent.get("profile") == null) {
rent.put("profile", "default");
}
/* Change to version 0 */
// Change to version 0
versions.put("rents", 0);
}
plugin.getLogger().info(" Updated version of '" + buyPath + "' from -1 to 0 (switch to using lowercase region names, adding default schematic enabling and profile)");
@@ -1152,8 +1054,8 @@ public class FileManager {
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(rent.get("player"));
rent.put("playeruuid", offlinePlayer.getUniqueId().toString());
rent.remove("player");
}
/* Change version to 1 */
}
// Change version to 1
versions.put("rents", 1);
}
plugin.getLogger().info(" Updated version of '" + rentPath + "' from 0 to 1 (switch to UUID's for player identification)");
@@ -1161,8 +1063,9 @@ public class FileManager {
}
// Save rents to new format
File regionsFile = new File(regionsPath);
if(!regionsFile.exists()) {
regionsFile.mkdirs();
if(!regionsFile.exists() & !regionsFile.mkdirs()) {
plugin.getLogger().warning("Could not create directory: " + regionsFile.getAbsolutePath());
return;
}
for(HashMap<String, String> rent : rents.values()) {
YamlConfiguration config = new YamlConfiguration();
@@ -1191,7 +1094,7 @@ public class FileManager {
}
if(rent.get("playeruuid") != null) {
config.set("rent.renter", rent.get("playeruuid"));
config.set("rent.renterName", plugin.toName(rent.get("playeruuid")));
config.set("rent.renterName", Utils.toName(rent.get("playeruuid")));
config.set("rent.rentedUntil", Long.parseLong(rent.get("rented")));
}
try {
@@ -1210,8 +1113,9 @@ public class FileManager {
}
if(buyFile.exists()) {
buyFileFound = true;
if(!oldFolderFile.exists()) {
oldFolderFile.mkdirs();
if(!oldFolderFile.exists() & !oldFolderFile.mkdirs()) {
plugin.getLogger().warning("Could not create directory: " + oldFolderFile.getAbsolutePath());
return;
}
if(versions.get("buys") == null) {
@@ -1229,8 +1133,12 @@ public class FileManager {
// Delete the file if it is totally wrong
if(buys == null) {
try {
buyFile.delete();
} catch(Exception e) {}
if(!buyFile.delete()) {
plugin.getLogger().warning("Could not delete file: " + buyFile.getAbsolutePath());
}
} catch(Exception e) {
plugin.getLogger().warning("Could not delete file: " + buyFile.getAbsolutePath());
}
} else {
// Backup current file
try {
@@ -1239,26 +1147,26 @@ public class FileManager {
plugin.getLogger().warning(" Could not create a backup of '" + buyPath + "', check the file permissions (conversion to next version continues)");
}
// Check if conversion is needed
if(versions.get("buys") < 1) {
/* Upgrade the buy to the latest version */
if(versions.get("buys") < 1) {
// Upgrade the buy to the latest version
if(versions.get("buys") < 0) {
for(String buyName : buys.keySet()) {
HashMap<String,String> buy = buys.get(buyName);
/* Save the buyName in the hashmap and use a small caps buyName as key */
// Save the buyName in the hashmap and use a small caps buyName as key
if(buy.get("name") == null) {
buy.put("name", buyName);
buys.remove(buyName);
buys.put(buyName.toLowerCase(), buy);
}
/* Save the default setting for region restoring */
// Save the default setting for region restoring
if(buy.get("restore") == null) {
buy.put("restore", "general");
}
/* Save the default setting for the region restore profile */
// Save the default setting for the region restore profile
if(buy.get("profile") == null) {
buy.put("profile", "default");
}
/* Change to version 0 */
// Change to version 0
versions.put("buys", 0);
}
plugin.getLogger().info(" Updated version of '" + buyPath + "' from -1 to 0 (switch to using lowercase region names, adding default schematic enabling and profile)");
@@ -1271,8 +1179,8 @@ public class FileManager {
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(buy.get("player"));
buy.put("playeruuid", offlinePlayer.getUniqueId().toString());
buy.remove("player");
}
/* Change version to 1 */
}
// Change version to 1
versions.put("buys", 1);
}
plugin.getLogger().info(" Updated version of '" + buyPath + "' from 0 to 1 (switch to UUID's for player identification)");
@@ -1281,8 +1189,8 @@ public class FileManager {
// Save buys to new format
File regionsFile = new File(regionsPath);
if(!regionsFile.exists()) {
regionsFile.mkdirs();
if(!regionsFile.exists() & !regionsFile.mkdirs()) {
plugin.getLogger().warning("Could not create directory: " + regionsFile.getAbsolutePath());
}
for(HashMap<String, String> buy : buys.values()) {
YamlConfiguration config = new YamlConfiguration();
@@ -1310,7 +1218,7 @@ public class FileManager {
}
if(buy.get("playeruuid") != null) {
config.set("buy.buyer", buy.get("playeruuid"));
config.set("buy.buyerName", plugin.toName(buy.get("playeruuid")));
config.set("buy.buyerName", Utils.toName(buy.get("playeruuid")));
}
try {
config.save(new File(regionsPath + File.separator + buy.get("name").toLowerCase() + ".yml"));
@@ -1328,14 +1236,20 @@ public class FileManager {
// Separate try-catch blocks to try them all individually (don't stop after 1 has failed)
try {
Files.move(new File(rentPath + ".old"), new File(oldFolderPath + "rents.old"));
} catch (Exception e) {}
} catch(Exception e) {
// Ignore
}
try {
Files.move(new File(buyPath + ".old"), new File(oldFolderPath + "buys.old"));
} catch (Exception e) {}
} catch(Exception e) {
// Ignore
}
if(buyFileFound || rentFileFound) {
try {
Files.move(new File(plugin.getDataFolder() + File.separator + "config.yml"), new File(oldFolderPath + "config.yml"));
} catch (Exception e) {}
} catch(Exception e) {
// Ignore
}
}
// Update versions file to 2
versions.put(AreaShop.versionFiles, 2);
@@ -1,27 +1,18 @@
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 com.google.common.base.Charsets;
import nl.evolutioncoding.areashop.AreaShop;
import nl.evolutioncoding.areashop.regions.GeneralRegion;
import org.bukkit.configuration.file.YamlConfiguration;
import java.io.*;
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", "FI", "DE", "FR", "PL", "ZH_TW"};
private String languages[] = {"EN", "NL", "DE", "CS", "FR", "FI", "PL"};
private HashMap<String, String> currentLanguage, defaultLanguage;
/**
@@ -45,31 +36,32 @@ public class LanguageManager {
* Saves the default language files if not already present
*/
public void saveDefaults() {
/* Create the language folder if it not exists */
// Create the language folder if it not exists
File langFolder;
langFolder = new File(plugin.getDataFolder() + File.separator + AreaShop.languageFolder);
if(!langFolder.exists()) {
langFolder.mkdirs();
if(!langFolder.mkdirs()) {
plugin.getLogger().warning("Could not create language directory: " + langFolder.getAbsolutePath());
return;
}
}
/* Create the language files, overwrites if a file already exists */
/* Overriding is necessary because otherwise with an update the new lang */
/* files would not be used, when translating your own use another */
/* file name as the default */
// Create the language files, overwrites if a file already exists
// Overriding is necessary because otherwise with an update the new lang
// files would not be used, when translating your own use another
// file name as the default
File langFile;
for(int i=0; i<languages.length; i++) {
langFile = new File(plugin.getDataFolder() + File.separator + AreaShop.languageFolder + File.separator + languages[i] + ".yml");
InputStream input = null;
OutputStream output = null;
try {
input = plugin.getResource(AreaShop.languageFolder + "/" + languages[i] + ".yml");
for(String language : languages) {
langFile = new File(plugin.getDataFolder() + File.separator + AreaShop.languageFolder + File.separator + language + ".yml");
try(
InputStream input = plugin.getResource(AreaShop.languageFolder + "/" + language + ".yml");
OutputStream output = new FileOutputStream(langFile)
) {
if(input == null) {
plugin.getLogger().warning("Could not save default language to the '" + AreaShop.languageFolder + "' folder: " + languages[i] + ".yml");
plugin.getLogger().warning("Could not save default language to the '" + AreaShop.languageFolder + "' folder: " + language + ".yml");
continue;
}
output = new FileOutputStream(langFile);
int read = 0;
int read;
byte[] bytes = new byte[1024];
while ((read = input.read(bytes)) != -1) {
output.write(bytes, 0, read);
@@ -77,11 +69,6 @@ public class LanguageManager {
input.close();
output.close();
} catch(IOException e) {
try {
input.close();
output.close();
} catch (IOException e1) {} catch (NullPointerException e2) {}
plugin.getLogger().warning("Something went wrong saving a default language file: " + langFile.getPath());
}
}
@@ -95,41 +82,42 @@ public class LanguageManager {
Map<String, Object> map;
Set<String> set;
YamlConfiguration ymlFile;
/* Save the current language file to the HashMap */
currentLanguage = new HashMap<String, String>();
// Save the current language file to the HashMap
currentLanguage = new HashMap<>();
File file = new File(plugin.getDataFolder() + File.separator + AreaShop.languageFolder + File.separator + plugin.getConfig().getString("language") + ".yml");
InputStreamReader reader = null;
try {
reader = new InputStreamReader(new FileInputStream(file), Charsets.UTF_8);
} catch (FileNotFoundException e1) {}
if(reader != null) {
try(
InputStreamReader reader = new InputStreamReader(new FileInputStream(file), Charsets.UTF_8)
) {
ymlFile = YamlConfiguration.loadConfiguration(reader);
map = ymlFile.getValues(true);
set = map.keySet();
try {
for(String key : set) {
for(String key : set) {
if(map.get(key) instanceof String) {
currentLanguage.put(key, (String)map.get(key));
}
} catch(ClassCastException e) {}
}
} catch(IOException e) {
plugin.getLogger().warning("Could not load set language file: " + file.getAbsolutePath());
}
/* Save the default strings to the HashMap */
defaultLanguage = new HashMap<String, String>();
// Save the default strings to the HashMap
defaultLanguage = new HashMap<>();
File standard = new File(plugin.getDataFolder() + File.separator + AreaShop.languageFolder + "/" + languages[0]+ ".yml");
InputStreamReader reader2 = null;
try {
reader2 = new InputStreamReader(new FileInputStream(standard), Charsets.UTF_8);
} catch (FileNotFoundException e1) {}
if(reader2 != null) {
ymlFile = YamlConfiguration.loadConfiguration(reader2);
map = ymlFile.getValues(true);
try(
InputStreamReader reader = new InputStreamReader(new FileInputStream(standard), Charsets.UTF_8)
) {
ymlFile = YamlConfiguration.loadConfiguration(reader);
map = ymlFile.getValues(true);
set = map.keySet();
try {
for(String key : set) {
for(String key : set) {
if(map.get(key) instanceof String) {
defaultLanguage.put(key, (String)map.get(key));
}
} catch(ClassCastException e) {}
}
} catch(IOException e) {
plugin.getLogger().warning("Could not load default language file: " + file.getAbsolutePath());
}
}
@@ -140,9 +128,9 @@ public class LanguageManager {
* @return String The language string specified with the key
*/
public String getLang(String key, Object... params) {
String result = null;
/* Get the language string */
String result;
// Get the language string
if(currentLanguage.containsKey(key)) {
result = currentLanguage.get(key);
} else {
@@ -152,15 +140,15 @@ public class LanguageManager {
if(result == null) {
plugin.getLogger().info("Wrong key for getting translation: " + key + ", please contact the author about this");
} else {
/* Replace all tags like %0% and if given a GeneralRegion apply all replacements */
// Replace all tags like %0% and if given a GeneralRegion apply all replacements
int number=0;
for (int i=0; i<params.length; i++) {
if(params[i] != null) {
if(params[i] instanceof GeneralRegion) {
result = ((GeneralRegion)params[i]).applyAllReplacements(result);
} else {
result = result.replace("%" + number + "%", params[i].toString());
number++;
for(Object param : params) {
if(param != null) {
if(param instanceof GeneralRegion) {
result = ((GeneralRegion)param).applyAllReplacements(result);
} else {
result = result.replace("%" + number + "%", param.toString());
number++;
}
}
}
@@ -1,16 +1,8 @@
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;
@@ -26,6 +18,8 @@ import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.material.Sign;
import org.bukkit.util.BlockIterator;
import java.util.*;
public class SignLinkerManager implements Listener {
private AreaShop plugin = null;
private Map<UUID, SignLinker> signLinkers;
@@ -33,7 +27,7 @@ public class SignLinkerManager implements Listener {
public SignLinkerManager(AreaShop plugin) {
this.plugin = plugin;
signLinkers = new HashMap<UUID, SignLinker>();
signLinkers = new HashMap<>();
eventsRegistered = false;
}
@@ -91,7 +85,7 @@ public class SignLinkerManager implements Listener {
linker.setRegion(regions.get(0));
return;
} else if(regions.size() > 1) {
Set<String> names = new HashSet<String>();
Set<String> names = new HashSet<>();
for(GeneralRegion region : regions) {
names.add(region.getName());
}
@@ -102,7 +96,6 @@ public class SignLinkerManager implements Listener {
}
// 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);
@@ -116,7 +109,7 @@ public class SignLinkerManager implements Listener {
plugin.message(player, "linksigns-noSign");
return;
}
GeneralRegion signRegion = plugin.getFileManager().getRegionBySignLocation(block.getLocation());
if(signRegion != null) {
plugin.message(player, "linksigns-alreadyRegistered", signRegion);
@@ -124,9 +117,7 @@ public class SignLinkerManager implements Listener {
}
Sign sign = (Sign)block.getState().getData();
linker.setSign(block.getLocation(), block.getType(), sign.getFacing());
return;
}
}
}
@@ -166,7 +157,7 @@ public class SignLinkerManager implements Listener {
if(!isComplete()) {
plugin.message(linker, "linksigns-regionFound", region);
}
finalize();
finish();
}
public void setSign(Location location, Material type, BlockFace facing) {
@@ -177,10 +168,10 @@ public class SignLinkerManager implements Listener {
if(!isComplete()) {
plugin.message(linker, "linksigns-signFound", location.getBlockX(), location.getBlockY(), location.getBlockZ());
}
finalize();
finish();
}
public void finalize() {
public void finish() {
if(isComplete()) {
region.addSign(location, type, facing, profile);
if(profile == null) {
@@ -188,7 +179,7 @@ public class SignLinkerManager implements Listener {
} else {
plugin.message(linker, "addsign-successProfile", region, profile);
}
region.updateSigns();
region.update();
reset();
plugin.message(linker, "linksigns-next");
@@ -1,18 +1,25 @@
package nl.evolutioncoding.areashop.regions;
import net.milkbowl.vault.economy.EconomyResponse;
import nl.evolutioncoding.areashop.AreaShop;
import nl.evolutioncoding.areashop.Utils;
import nl.evolutioncoding.areashop.events.ask.BuyingRegionEvent;
import nl.evolutioncoding.areashop.events.ask.ResellingRegionEvent;
import nl.evolutioncoding.areashop.events.ask.SellingRegionEvent;
import nl.evolutioncoding.areashop.events.notify.BoughtRegionEvent;
import nl.evolutioncoding.areashop.events.notify.ResoldRegionEvent;
import nl.evolutioncoding.areashop.events.notify.SoldRegionEvent;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import java.util.Calendar;
import java.util.HashMap;
import java.util.UUID;
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) {
@@ -48,7 +55,9 @@ public class BuyRegion extends GeneralRegion {
if(buyer != null) {
try {
return UUID.fromString(buyer);
} catch(IllegalArgumentException e) {}
} catch(IllegalArgumentException e) {
// Incorrect UUID
}
}
return null;
}
@@ -59,19 +68,11 @@ public class BuyRegion extends GeneralRegion {
* @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());
}
return player != null && isBuyer(player.getUniqueId());
}
public boolean isBuyer(UUID player) {
UUID buyer = getBuyer();
if(buyer == null || player == null) {
return false;
} else {
return buyer.equals(player);
}
return !(buyer == null || player == null) && buyer.equals(player);
}
/**
@@ -84,7 +85,7 @@ public class BuyRegion extends GeneralRegion {
setSetting("buy.buyerName", null);
} else {
setSetting("buy.buyer", buyer.toString());
setSetting("buy.buyerName", plugin.toName(buyer));
setSetting("buy.buyerName", Utils.toName(buyer));
}
}
@@ -93,7 +94,7 @@ public class BuyRegion extends GeneralRegion {
* @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());
String result = Utils.toName(getBuyer());
if(result == null || result.isEmpty()) {
result = getStringSetting("buy.buyerName");
if(result == null || result.isEmpty()) {
@@ -140,7 +141,7 @@ public class BuyRegion extends GeneralRegion {
* @return The formatted string of the price
*/
public String getFormattedPrice() {
return plugin.formatCurrency(getPrice());
return Utils.formatCurrency(getPrice());
}
/**
@@ -148,12 +149,12 @@ public class BuyRegion extends GeneralRegion {
* @return The formatted string of the resellprice
*/
public String getFormattedResellPrice() {
return plugin.formatCurrency(getResellPrice());
return Utils.formatCurrency(getResellPrice());
}
/**
* Change the price of the region
* @param price
* @param price The price to set this region to
*/
public void setPrice(double price) {
setSetting("buy.price", price);
@@ -204,13 +205,13 @@ public class BuyRegion extends GeneralRegion {
* @return String with currency symbols and proper fractional part
*/
public String getFormattedMoneyBackAmount() {
return plugin.formatCurrency(getMoneyBackAmount());
return Utils.formatCurrency(getMoneyBackAmount());
}
@Override
public HashMap<String, Object> getSpecificReplacements() {
// Fill the replacements map with things specific to a BuyRegion
HashMap<String, Object> result = new HashMap<String, Object>();
HashMap<String, Object> result = new HashMap<>();
result.put(AreaShop.tagPrice, getFormattedPrice());
result.put(AreaShop.tagRawPrice, getPrice());
result.put(AreaShop.tagPlayerName, getPlayerName());
@@ -234,7 +235,7 @@ public class BuyRegion extends GeneralRegion {
* @return The number of milliseconds until the region is unrented while player is offline
*/
public long getInactiveTimeUntilSell() {
return plugin.getDurationFromMinutesOrStringInput(getStringSetting("buy.inactiveTimeUntilSell"));
return Utils.getDurationFromMinutesOrStringInput(getStringSetting("buy.inactiveTimeUntilSell"));
}
/**
@@ -252,58 +253,78 @@ public class BuyRegion extends GeneralRegion {
*/
@SuppressWarnings("deprecation")
public boolean buy(Player player) {
/* Check if the player has permission */
// Check if the player has permission
if(player.hasPermission("areashop.buy")) {
if(plugin.getEconomy() == null) {
plugin.message(player, "general-noEconomy");
message(player, "general-noEconomy");
return false;
}
if(isInResellingMode()) {
if(!player.hasPermission("areashop.buyresell")) {
message(player, "buy-noPermissionResell");
return false;
}
} else {
if(!player.hasPermission("areashop.buynormal")) {
message(player, "buy-noPermissionNoResell");
return false;
}
}
if(getWorld() == null) {
plugin.message(player, "general-noWorld", getWorldName());
message(player, "general-noWorld");
return false;
}
if(getRegion() == null) {
plugin.message(player, "general-noRegion", getName());
message(player, "general-noRegion");
return false;
}
}
if(!isSold() || (isInResellingMode() && !isBuyer(player))) {
boolean isResell = isInResellingMode();
// Check if the players needs to be in the world or region for buying
if(restrictedToRegion() && (!player.getWorld().getName().equals(getWorldName())
|| !getRegion().contains(player.getLocation().getBlockX(), player.getLocation().getBlockY(), player.getLocation().getBlockZ()))) {
plugin.message(player, "buy-restrictedToRegion", getName());
message(player, "buy-restrictedToRegion");
return false;
}
if(restrictedToWorld() && !player.getWorld().getName().equals(getWorldName())) {
plugin.message(player, "buy-restrictedToWorld", getWorldName(), player.getWorld().getName());
message(player, "buy-restrictedToWorld", player.getWorld().getName());
return false;
}
// Check region limits
LimitResult limitResult = this.limitsAllowBuying(player);
LimitResult limitResult = this.limitsAllow(RegionType.BUY, 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());
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());
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 */
// Check if the player has enough money
if((!isResell && plugin.getEconomy().has(player, getWorldName(), getPrice())) || (isResell && plugin.getEconomy().has(player, getWorldName(), getResellPrice()))) {
UUID oldOwner = getBuyer();
if(isResell && oldOwner != null) {
// Broadcast and check event
ResellingRegionEvent event = new ResellingRegionEvent(this, player);
Bukkit.getPluginManager().callEvent(event);
if(event.isCancelled()) {
message(player, "general-cancelled", event.getReason());
return false;
}
clearFriends();
double resellPrice = getResellPrice();
/* Transfer the money to the previous owner */
// Transfer the money to the previous owner
EconomyResponse r = plugin.getEconomy().withdrawPlayer(player, getWorldName(), getResellPrice());
if(!r.transactionSuccess()) {
plugin.message(player, "buy-payError");
message(player, "buy-payError");
AreaShop.debug("Something went wrong with getting money from " + player.getName() + " while buying " + getName() + ": " + r.errorMessage);
return false;
}
r = null;
@@ -311,11 +332,12 @@ public class BuyRegion extends GeneralRegion {
String oldOwnerName = getPlayerName();
if(oldOwnerPlayer != null && oldOwnerPlayer.getName() != null) {
r = plugin.getEconomy().depositPlayer(oldOwnerPlayer, getWorldName(), getResellPrice());
oldOwnerName = oldOwnerPlayer.getName();
} else if (oldOwnerName != null) {
r = plugin.getEconomy().depositPlayer(oldOwnerName, getWorldName(), getResellPrice());
}
if(r == null || !r.transactionSuccess()) {
plugin.getLogger().warning("Something went wrong with paying '" + oldOwnerPlayer.getName() + "' " + getFormattedPrice() + " for his resell of region " + getName() + " to " + player.getName());
plugin.getLogger().warning("Something went wrong with paying '" + oldOwnerName + "' " + getFormattedPrice() + " for his resell of region " + getName() + " to " + player.getName());
}
// Resell is done, disable that now
disableReselling();
@@ -323,26 +345,35 @@ public class BuyRegion extends GeneralRegion {
this.runEventCommands(RegionEvent.RESELL, true);
// Set the owner
setBuyer(player.getUniqueId());
updateLastActiveTime();
// Update everything
handleSchematicEvent(RegionEvent.RESELL);
updateSigns();
updateRegionFlags();
// Notify about updates
this.notifyAndUpdate(new ResoldRegionEvent(this, oldOwner));
// Send message to the player
plugin.message(player, "buy-successResale", getName(), oldOwnerPlayer.getName());
message(player, "buy-successResale", oldOwnerName);
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());
message(player, "buy-successSeller", resellPrice);
}
// Run commands
this.runEventCommands(RegionEvent.RESELL, false);
} else {
// Broadcast and check event
BuyingRegionEvent event = new BuyingRegionEvent(this, player);
Bukkit.getPluginManager().callEvent(event);
if(event.isCancelled()) {
message(player, "general-cancelled", event.getReason());
return false;
}
// Substract the money from the players balance
EconomyResponse r = plugin.getEconomy().withdrawPlayer(player, getWorldName(), getPrice());
if(!r.transactionSuccess()) {
plugin.message(player, "buy-payError");
message(player, "buy-payError");
return false;
}
// Optionally give money to the landlord
@@ -351,76 +382,119 @@ public class BuyRegion extends GeneralRegion {
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(landlordName != null) {
if(landlordPlayer != null && landlordPlayer.getName() != null) {
r = plugin.getEconomy().depositPlayer(landlordPlayer, getWorldName(), getPrice());
} else {
r = plugin.getEconomy().depositPlayer(landlordName, getWorldName(), getPrice());
}
if(r != null && !r.transactionSuccess()) {
plugin.getLogger().warning("Something went wrong with paying '" + landlordName + "' " + getFormattedPrice() + " for his sell of region " + getName() + " to " + player.getName());
}
}
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());
updateLastActiveTime();
// Notify about updates
this.notifyAndUpdate(new BoughtRegionEvent(this));
// Update everything
handleSchematicEvent(RegionEvent.BOUGHT);
updateSigns();
updateRegionFlags();
// Send message to the player
plugin.message(player, "buy-succes", getName());
message(player, "buy-succes");
// Run commands
this.runEventCommands(RegionEvent.BOUGHT, false);
}
return true;
} else {
/* Player has not enough money */
String requiredMoney = "";
// Player has not enough money
if(isResell) {
requiredMoney = getFormattedResellPrice();
message(player, "buy-lowMoneyResell", Utils.formatCurrency(plugin.getEconomy().getBalance(player, getWorldName())));
} else {
requiredMoney = getFormattedPrice();
}
plugin.message(player, "buy-lowMoney", plugin.formatCurrency(plugin.getEconomy().getBalance(player, getWorldName())), requiredMoney);
message(player, "buy-lowMoney", Utils.formatCurrency(plugin.getEconomy().getBalance(player, getWorldName())));
}
}
} else {
if(isBuyer(player)) {
plugin.message(player, "buy-yours");
message(player, "buy-yours");
} else {
plugin.message(player, "buy-someoneElse");
message(player, "buy-someoneElse");
}
}
} else {
plugin.message(player, "buy-noPermission");
message(player, "buy-noPermission");
}
return false;
}
/**
* Sell a buyed region, get part of the money back
* @param regionName
* @param giveMoneyBack true if the player should be given money back, otherwise false
* @param executor CommandSender to receive a message when the sell fails, or null
*/
@SuppressWarnings("deprecation")
public void sell(boolean giveMoneyBack) {
public boolean sell(boolean giveMoneyBack, CommandSender executor) {
boolean own = executor != null && executor instanceof Player && this.isBuyer((Player)executor);
if(executor != null) {
if(!executor.hasPermission("areashop.sell") && !own) {
message(executor, "sell-noPermissionOther");
return false;
}
if(!executor.hasPermission("areashop.sell") && !executor.hasPermission("areashop.sellown") && own) {
message(executor, "sell-noPermission");
return false;
}
}
if(plugin.getEconomy() == null) {
return false;
}
// Broadcast and check event
SellingRegionEvent event = new SellingRegionEvent(this);
Bukkit.getPluginManager().callEvent(event);
if(event.isCancelled()) {
message(executor, "general-cancelled", event.getReason());
return false;
}
// Run commands
this.runEventCommands(RegionEvent.SOLD, true);
disableReselling();
/* Give part of the buying price back */
// Give part of the buying price back
double moneyBack = getMoneyBackAmount();
if(moneyBack > 0 && giveMoneyBack) {
/* Give back the money */
boolean noPayBack = false;
OfflinePlayer landlordPlayer = null;
if(getLandlord() != null) {
landlordPlayer = Bukkit.getOfflinePlayer(getLandlord());
}
String landlordName = getLandlordName();
EconomyResponse r;
if(landlordName != null) {
if(landlordPlayer != null && landlordPlayer.getName() != null) {
r = plugin.getEconomy().withdrawPlayer(landlordPlayer, getWorldName(), moneyBack);
} else {
r = plugin.getEconomy().withdrawPlayer(landlordName, getWorldName(), moneyBack);
}
if(r == null || !r.transactionSuccess()) {
noPayBack = true;
}
}
// Give back the money
OfflinePlayer player = Bukkit.getOfflinePlayer(getBuyer());
if(player != null) {
if(player != null && !noPayBack) {
EconomyResponse response = null;
boolean error = false;
try {
if(player != null && player.getName() != null) {
if(player.getName() != null) {
response = plugin.getEconomy().depositPlayer(player, getWorldName(), moneyBack);
} else if(getPlayerName() != null) {
response = plugin.getEconomy().depositPlayer(getPlayerName(), getWorldName(), moneyBack);
@@ -433,21 +507,28 @@ public class BuyRegion extends GeneralRegion {
}
}
}
/* 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 */
if(own) {
message(executor, "sell-soldYours");
} else {
message(executor, "sell-sold");
}
// Remove friends and the owner
clearFriends();
setBuyer(null);
updateSigns();
UUID oldBuyer = getBuyer();
setBuyer(null);
removeLastActiveTime();
// Notify about updates
this.notifyAndUpdate(new SoldRegionEvent(this, oldBuyer));
// Update everything
handleSchematicEvent(RegionEvent.SOLD);
// Run commands
this.runEventCommands(RegionEvent.SOLD, false);
return true;
}
@Override
@@ -461,12 +542,11 @@ public class BuyRegion extends GeneralRegion {
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);
//AreaShop.debug("currentTime=" + Calendar.getInstance().getTimeInMillis() + ", getLastPlayed()=" + lastPlayed + ", timeInactive=" + (Calendar.getInstance().getTimeInMillis()-player.getLastPlayed()) + ", inactiveSetting=" + inactiveSetting);
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;
AreaShop.debug("currentTime=" + Calendar.getInstance().getTimeInMillis() + ", getLastPlayed()=" + lastPlayed + ", timeInactive=" + (Calendar.getInstance().getTimeInMillis()-player.getLastPlayed()) + ", inactiveSetting=" + inactiveSetting);
return this.sell(true, null);
}
return false;
}
File diff suppressed because it is too large. Load diff
@@ -1,12 +1,13 @@
package nl.evolutioncoding.areashop.regions;
import java.util.ArrayList;
import java.util.List;
import nl.evolutioncoding.areashop.AreaShop;
import org.bukkit.configuration.ConfigurationSection;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class RegionGroup {
private AreaShop plugin;
@@ -24,7 +25,7 @@ public class RegionGroup {
// Delete duplicates
List<String> members = getMembers();
int previousCount = members.size();
List<String> newMembers = new ArrayList<String>();
List<String> newMembers = new ArrayList<>();
while(!members.isEmpty()) {
String member = members.remove(0);
// If the region has been deleted also clean it from the group
@@ -88,11 +89,23 @@ public class RegionGroup {
*/
public List<String> getMembers() {
if(getSettings() == null || getSettings().getStringList("regions") == null) {
return new ArrayList<String>();
return new ArrayList<>();
}
return getSettings().getStringList("regions");
}
/**
* Get all members of the group as GeneralRegions
* @return A Set with all group members
*/
public Set<GeneralRegion> getMemberRegions() {
Set<GeneralRegion> result = new HashSet<>();
for(String name : getMembers()) {
result.add(plugin.getFileManager().getRegion(name));
}
return result;
}
/**
* Get the name of the group
* @return The name of the group
File diff suppressed because it is too large. Load diff
+70 -63
View File
@@ -1,6 +1,7 @@
# ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
# ║ config.yml file of the AreaShop plugin created by NLThijs48, Github can be found at https://github.com/NLthijs48/AreaShop. ║
# ║ This file contains options to change the working of the plugin, the profiles defined here can be used in default.yml. ║
# ║ More information and tutorials can be found on the wiki: https://github.com/NLthijs48/AreaShop/wiki ║
# ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
# │ GENERAL: Options that influence the global state of the plugin │
@@ -8,28 +9,29 @@
## 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).
## More information can be found here: https://github.com/NLthijs48/AreaShop/wiki/Language-support.
language: EN
## The tags you need to write on the sign to trigger the plugin.
## The tags that need to be written on the first line of a sign to use it with AreaShop.
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 a rental region.
rent: '[asrent]'
## Add a buy region.
buy: '[asbuy]'
## Add a sign to an existing region.
add: '[as]'
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
# │ NUMBERS: Options to change the output of prices. │
# │ NUMBERS: Options to change the display of prices. │
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
## The characters displayed before a price, special characters like € can be used.
## The characters displayed before a price.
moneyCharacter: '$'
## The characters displayed after a price, special characters like € can be used.
## The characters displayed after a price.
moneyCharacterAfter: ''
## How many numbers behind the dot should be shown (2 will make numbers like '8.55', '9.01').
## How many numbers behind the dot should be shown (2 will make numbers like '8.55', '9.01', '5,20').
fractionalNumbers: 2
## Set this to true if you want to hide '.0' for a number like '15.0' ('4.50' will still stay '4.50').
hideEmptyFractionalPart: true
## Use metric suffixes if the price is above this number (use 1.00M instead of 1000000.00 etc.), use -1 for disable.
## Use metric suffixes if the price is above this number (use 1.00M instead of 1000000.00 etc.), use -1 to disable.
## Indications are used as defined on: http://en.wikipedia.org/wiki/Metric_prefix, implemented from 'k' to 'Y'.
metricSuffixesAbove: 1000000.0
## The character(s) to use as decimal mark.
@@ -46,13 +48,16 @@ timeFormatSign: 'dd-MM HH:mm'
## 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]
minutes: [m, min, mins, minute, minutes]
hours: [h, hour, hours]
days: [d, day, days]
weeks: [w, week, weeks]
months: [M, month, months]
years: [y, year, years]
## Allow or disallow extending a rental region when the player is above his limits enforced by the 'limitGroups' section below.
## false will ensure a player will eventually lose his region when he has no access anymore.
allowRegionExtendsWhenAboveLimits: false
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
@@ -60,11 +65,11 @@ years: [y, year, years, jaar, jaren]
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
## 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.
## Every player already has the group 'default', OPs bypass the limits because of the 'areashop.limitbypass' permission.
## All the groups applied to the player will be checked and only if they all allow an extra region it will be 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.
## Give players permissions globally and not world specific! This ensures renting/buying while in another world works correctly.
## More information can be found here: https://github.com/NLthijs48/AreaShop/wiki/Limitgroups-information-and-examples.
limitGroups:
default:
total: 1
@@ -75,13 +80,18 @@ limitGroups:
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
# │ 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.
## The idea of profiles is that you can make different variations of them, and then assign the different variations to different
## subsects of regions (by assigning a profile to a region group, or an individual region).
## Below is a list of tags that can be used in all settings of profiles.
## If a tag has no value (for example %player% when the region is not rented/bought) then the tag will not get replaced.
## %region% The region name (with correct capitalization).
## %player% The name of the player that rents/buys the region (with correct capitalization), 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.
## %player% The name of the player that rents/buys the region (with correct capitalization).
## %uuid% The UUID of the player that rents/buys the region.
## %friends% The names of friends added to this region separated by ', '.
## %friendsuuid% The UUID's of friends added to this region separated by ', '.
## $landlord$ The name of the landlord.
## %landlorduuid% The UUID of the landlord.
## %price% The price of the region formatted with the configured characters before and after the number.
## %rawprice% The price without formatting, like '10.0' or '7.77'.
## %duration% The duration of a rent region, for example '1 d', '4 minutes' or '2 years'.
@@ -96,9 +106,9 @@ limitGroups:
## %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).
## %moneyback% The amount of money the player will get back when unrenting/selling the region (formatted with currency layout).
## %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).
## %moneybackpercent% The percentage of the price the player will get back when unrenting the region.
## %maxextends% The maximum number of extends a player can do on the region.
## %extendsleft% The number of extends that are left (maxextends - timesextended).
## %maxrenttime% The maximum time you can rent a region in advance (human readable).
@@ -112,14 +122,14 @@ limitGroups:
## %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.
## Determines the layout and functions of the signs linked to regions.
## Set 'general.signProfile' in default.yml, groups or individual regions to set the profile.
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.
## Sections with 'Player' at the end will be run by the player that clicks the sign and 'Console' ones from the console.
forrent:
line1: '&2&l[For Rent]'
line2: '%region%'
@@ -171,17 +181,17 @@ signProfiles:
- 'areashop info region %region%'
shiftRightClickPlayer:
- 'areashop sell %region%'
## Option to run certain commands when one of these events happen.
## Option to run certain commands when a region event happens.
## Commands at a 'before' section will execute before the region details are changed in the AreaShop system
## and before any other actions occurred (changing signs, saving/loading schematics, etc.),
## and before any other actions occurred (setting the owner, 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).
## After 'before' or 'after' you can add a list of commands (see example at the created event).
eventCommandProfiles:
default:
created:
before:
after:
## - "say An AreaShop region has been created: %region%"
## - "say An AreaShop region has been created: %region%"
deleted:
before:
after:
@@ -206,8 +216,8 @@ eventCommandProfiles:
## 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.
## More information can be found here: https://github.com/NLthijs48/AreaShop/wiki/Region-blocks-save-restore.
schematicProfiles:
default:
created:
@@ -231,34 +241,45 @@ schematicProfiles:
resell:
save: ''
restore: ''
## Flag profiles to specify what flags should be set on the WorldGuard regions.
## Flag profiles to specify which flags should be set on the WorldGuard regions when the region is in a certain state.
## 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'.
## You can add groups by using 'g:<groupname>', so in total you could use: '%uuid%, %friendsuuid%, g:vip, n:coolGuy'.
## 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'
## members, non_members, owners, non_owners, all. Example, only members can enter the region:
## entry: 'deny g:non_members'
## Use '' for a flag to reset it.
flagProfiles:
default:
forrent:
members: ''
priority: 10 # Set region priority higher than default regions (it must be higher than other regions at the same place)
members: '' # Remove all members.
greeting: '%lang:prefix%%lang:greeting-forrent%'
rented:
members: '%uuid%, %friendsuuid%'
priority: 10
members: '%uuid%, %friendsuuid%' # Add the renter and added friends as region members.
greeting: '%lang:prefix%%lang:greeting-rented%'
interact: 'deny g:non_members' # Only allow region members/owners to use things in the region (chests, crafting bench, etc)
build: 'deny g:non_members' # Only allow region members/owners to build (change to 'deny' to disallow building)
forsale:
priority: 10
members: ''
greeting: '%lang:prefix%%lang:greeting-forsale%'
sold:
priority: 10
members: '%uuid%, %friendsuuid%'
greeting: '%lang:prefix%%lang:greeting-bought%'
interact: 'deny g:non_members'
build: 'deny g:non_members'
resale:
priority: 10
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.
interact: 'deny g:non_members'
build: 'deny g:non_members'
## Profiles that specify when players should get messages about their rental region that almost runs out.
## Time identifiers specify how much time before the rent is actually over the player should be notified.
## When warnPlayer is set to true a message will be send that is specified in the language file.
## All commands in the list below 'commands:' will execute together with the warning, all normal variables can be used.
expirationWarningProfiles:
@@ -266,7 +287,7 @@ expirationWarningProfiles:
"1 day":
warnPlayer: true
commands:
## - "say %region% is about to expire for %player%: %timeleft% left"
## - "say %region% is about to expire for %player%: %timeleft% left"
"1 hour":
warnPlayer: true
commands:
@@ -279,17 +300,16 @@ expirationWarningProfiles:
# │ 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.
## for 'java regex pattern' to find documentation about how to use it.
## Example: Blocking all regions that have a name like 'house_1', 'house_2', etc. would be done with 'house_\d+'.
## The '\d' represents the numerical digits 0-9, the + symbol represents 1 or more times repeated.
## This means it would also block 'house_123' and 'house_000456'. It will not block 'ahouse_1' or 'house_'.
blacklist:
- '__global__'
- '__global__' # Would give access to the complete world, and is therefore not a good idea to ever add.
## 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
# 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.
@@ -318,7 +338,7 @@ 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
## 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.
@@ -326,43 +346,30 @@ maximumTries: 50000
## 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
regionsPerTick: 5
## 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
regionsPerTick: 10
## Timings for adding regions to AreaShop ('/as stack').
adding:
## Number of regions to add per tick.
regionsPerTick: 2
+78 -79
View File
@@ -1,79 +1,78 @@
# ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
# ║ default.yml file of the AreaShop plugin created by NLThijs48, Github can be found at https://github.com/NLthijs48/AreaShop.║
# ║ All settings below are default settings and can be overridden by group settings or individual region settings. ║
# ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
# │ 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
# ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
# ║ default.yml file of the AreaShop plugin created by NLThijs48, Github can be found at https://github.com/NLthijs48/AreaShop.║
# ║ All settings below are default settings and can be overridden by group settings or individual region settings. ║
# ║ More information and tutorials can be found on the wiki: https://github.com/NLthijs48/AreaShop/wiki ║
# ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
# │ GENERAL: Options for all regions. │
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
general:
## Set to true to enable saving/restoring for regions as specified in the profile below, which is specified in the config.
enableRestore: false
## The schematic profile from the 'schematicProfiles' section in the config.
schematicProfile: 'default'
## The event commands profile from the 'eventCommandProfiles' section in the config.
eventCommandProfile: 'default'
## The profile for the format of the sign from the 'signProfiles' section in the config.
signProfile: 'default'
## The profile for the WorldGuard flags from the 'flagProfiles' section in the config.
flagProfile: 'default'
## The y location within the region to start searching for safe teleport spots (x and z will be in the middle of the region).
## Possible values: bottom, middle, top, integer.
teleportLocationY: bottom
## If true the teleportation algorithm only allows telportation to inside the region, otherwise it will expand
## a cube from the starting point to check for safe spots (then it could end outside of the region).
teleportIntoRegion: true
## Same as above, but then for when you teleport to the sign of a region instead of the region itself.
teleportToSignIntoRegion: false
## Set where the '/as find' command should teleport the player to, set to true for the first sign of the region and set to
## false to teleport to the location set by '/as settp' or the default location (if not set).
findTeleportToSign: true
## Restricts the '/as buy' and '/as rent' commands to the world of the region.
restrictedToWorld: false
## Restricts the '/as buy' and '/as rent' commands to the region itself (player needs to be inside).
restrictedToRegion: false
## The UUID of the landlord, this player will receive all money from rents/buys (but not reselling with '/as resell').
landlord: ''
## Name of the landlord, if the landlord UUID setting is not provided then the name will be used instead
landlordName: ''
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
# │ RENT: Options for rent regions. │
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
rent:
## The default price of a rental region.
price: 1000
## The default duration of a rental region, you can find all time indicators in config.yml below the RENTING header.
duration: '1 day'
## The percentage of the rent price you get back if you unrent the region (price of time left will be multiplied by this/100).
moneyBack: 100
## Maximum number of extends a player can do (-1 for infinite, 0 for no extending), if they are at this number then
## they are force to let their rent run out (and can rent it again at that point).
maxExtends: -1
## The Maximum time they can have the region rented in advance (use times like '1 day' etc, or 'unlimited' for no limit).
## This can prevent players from renting their region for a year, and to ensure they periodically have to extend their rent.
maxRentTime: 'unlimited'
## Automatically unrent the region after the specified time between the last login time of the renter and the current time.
## Use times like '1 day' etc, or 'disabled' for never.
inactiveTimeUntilUnrent: 'disabled'
## If a region of a player has less then this time left when he joins the server he will get a notice about his region.
## Use '' to disable.
warningOnLoginTime: '1 day'
## The profile for the expiration warnings from the 'expirationWarningProfiles' section in the config.
expirationWarningProfile: 'default'
## If renting the region would go above 'maxRentTIme', then extend to the maximum instead of cancelling the rent.
extendToFullWhenAboveMaxRentTime: true
# ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
# │ BUY: Options for buy regions. │
# └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
buy:
## The default price of a buy region.
price: 1000
## The percentage of the price you get back if you sell the region.
moneyBack: 100
## Automatically sell the region after the specified number of minutes between the last login time of the buyer and the current time
## Use times like '1 day' etc, or 'disabled' for never.
inactiveTimeUntilSell: 'disabled'
+381
View File
@@ -0,0 +1,381 @@
# ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
# ║ Language file of the AreaShop plugin created by NLThijs48, Github can be found at https://github.com/NLthijs48/AreaShop ║
# ║ Language: Czech, Version: V2.2.2, Percentage translated: 86% ║
# ║ This file will be overwritten at each startup/reload of the plugin, if you want to change anything then do the following: ║
# ║ 1: Make a copy of this file ║
# ║ 2: Rename it to <servername>.yml (don't use a language code as filename, could otherwise be overwritten in future updates) ║
# ║ 3: Change the 'language' setting in config.yml to '<servername>', do not include '.yml' ║
# ║ 4: Change the strings in the new file to your liking and save the file ║
# ║ 5: Use '/as reload' or reload/restart your server to see the changes ║
# ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
total-maximum: "Nemuzes pronajmout nebo koupit vice pozemku nez %0%."
general-notReady: "AreaShop neni plne nacten, pockej prosim."
general-noEconomy: "Plugin pro rizeni ekonomiky nenalezen, kontaktuj prosim A-Team."
cmd-notValid: "Prikaz neni definovan. Napis '/as help' pro napovedu."
cmd-onlyByPlayer: "Nelze spustit z konzole."
cmd-weOnlyByPlayer: "Pouziti vyberu s WorldEdit je jen pro hrace, specifikuj nazev pozemku (regionu)."
cmd-noSelection: "Zadny vyber pomoci WorldEdit."
cmd-noRegionsFound: "Neregistrovane pozemky v AreaShop byly nalezeny v Tvem vyberu."
cmd-noWERegionsFound: "Zadny pozemek (region) nesouhlasi s vyberem."
cmd-notRegistered: "Zadany pozemek neni registrovany: %0%."
cmd-noRegionsAtLocation: "V tve pozici neni zadny pozemek (region), specifikuj ho."
cmd-moreRegionsAtLocation: "Nalezeno vicero pozemku, urci ktery chces pouzit."
cmd-automaticRegionOnlyByPlayer: "Automaticke urcovani oblasti jen pro hrace, urci jej rucne."
help-header: "Napoveda, prikazy ktere muzes pouzivat."
help-alias: "Aliasy: /areashop, /as."
help-help: "&6/as help &7-&r Zobrazi tuto napovedu."
help-info: "&6/as info &7-&r Zjisti info aktualniho pozemku."
help-rent: "&6/as rent &7-&r Pronajme pozemek nebo prodlouzi pronajem."
help-buy: "&6/as buy &7-&r Koupe pozemku."
help-unrent: "&6/as unrent &7-&r Zrusi pronajem pozemku."
help-unrentOwn: "&6/as unrent &7-&r Zrusi pronajem Tveho pozemku."
help-sell: "&6/as sell &7-&r Proda pozemek."
help-sellOwn: "&6/as sell &7-&r Proda Tvuj pozemek."
help-reload: "&6/as reload &7-&r Reload vsech nastaveni a update pozemku."
help-setrestore: "&6/as setrestore &7-&r Nastaveni obnovy pozemku (on/off) a volba profilu."
help-setprice: "&6/as setprice &7-&r Zmena zakladni ceny pozemku."
help-setduration: "&6/as setduration &7-&r Zmena zakladni doby pronajmu pozemku."
help-teleport: "&6/as tp &7-&r Teleport k Tvemu pozemku."
help-teleportAll: "&6/as tp &7-&r Teleport k pozemkum."
help-setteleport: "&6/as settp &7-&r Nastaveni pozice pro teleport k pozemku."
help-setteleportAll: "&6/as settp &7-&r Nastaveni pozice pro teleport k pozemku."
help-find: "&6/as find &7-&r Najde dostupny pronajem / prodej pozemku."
help-groupadd: "&6/as groupadd &7-&r Prida pozemek do skupiny."
help-groupdel: "&6/as groupdel &7-&r Odstrani pozemek ze skupiny."
help-grouplist: "&6/as grouplist &7-&r Zobrazi vsechny registrovane skupiny."
help-groupinfo: "&6/as groupinfo &7-&r Zobrazi info o skupine."
help-schemevent: "&6/as schemevent &7-&r Triggeruje eventy schema regionu."
help-add: "&6/as add &7-&r Registruje (prida) pozemek k pronajmu / prodeji."
help-del: "&6/as del &7-&r Odstrani registrovany pozemek z AreaShop."
help-addsign: "&6/as addsign &7-&r Prida cedulku k existujicimu pozemku."
help-delsign: "&6/as delsign &7-&r Odstrani cedulku v pohledu."
help-me: "&6/as me &7-&r Kontrola vlastnenych regionu (+expiration)."
help-setowner: "&6/as setowner &7-&r Nastavi majitele pozemku."
help-resell: "&6/as resell &7-&r Vystavi nektery Tvuj pozemek k nabidce."
help-resellAll: "&6/as resell &7-&r Vystavi pozemek k nabidce."
help-stopResell: "&6/as stopresell &7-&r Vystavi Tvuj pozemek zpet do rezimu Prodano."
help-stopResellAll: "&6/as stopresell &7-&r Vysatvi pozemek zpet do rezimu Prodano."
help-addFriend: "&6/as addfriend &7-&r Prida hrace do Tveho pozemku."
help-addFriendAll: "&6/as addfriend &7-&r Prida hrace do pozemku."
help-delFriend: "&6/as delfriend &7-&r Odstrani hrace z Tveho pozemku."
help-delFriendAll: "&6/as delfriend &7-&r Odstrani hrace z pozemku."
help-linksigns: "&6/as linksigns &7-&r Pouziti hromadneho nastaveni cedulek."
help-stack: "&6/as stack &7-&r Vytvori vicero pozemku a prida je."
help-setlandlord: "&6/as setlandlord &7-&r Nastavi LandLord pozemek."
rent-help: "/as rent [pozemek], pokud neni uvedeno, bude pouzit pozemek kde stojis."
rent-noPermission: "Nemas opravneni k pronajmu pozemku."
rent-maximum: "Nemuzes mit vice nez %0% pozemek(ky) (mas %1% ve skupine '%2%')."
rent-maximumExtend: "Nemuzes prodlouzit pronajem dokud mas vice nez %0% pozemek(ku) (mas %1% ve skupine '%2%')."
rent-payError: "S platbou je neco spatne, zkus to pozdeji."
rent-extend: "Prodlouzit pronajem muzes pravym klikem na cedulku nebo prikazem /as rent."
rent-someoneElse: "Uz ses pronajmul/a tento pozemek."
rent-notRentable: "Tento pozemek neni dostupny k pronajmu."
rent-expireWarning: "Tvemu pronajmu pozemku %region% zbyva %timeleft%, prodluz pronajem k jeho zachovani."
buy-help: "/as buy [pozemek], pokud neni uvedeno, bude pouzit pozemek kde stojis."
buy-noPermission: "Nemas opravneni ke koupi pozemku."
buy-noPermissionResell: "Nemas opravneni ke koupi pozemku v rezimu Nabidky."
buy-noPermissionNoResell: "Nemas opravneni ke koupi pozemku kdyz neni v rezimu Nabidky."
buy-maximum: "Nemuzes vlastnit vice nez %0% pozemek(ky) (mas %1% ve skupine '%2%')."
buy-payError: "S platbou je neco spatne, zkus to pozdeji."
buy-yours: "Uz vlastnis tento pozemek."
buy-someoneElse: "Nekdo jiny uz koupil tento pozemek."
unrent-help: "/as unrent [pozemek], pokud neni uvedeno, bude pouzit pozemek kde stojis."
unrent-noPermission: "Nemas opravneni k ukonceni pronajmu pozemku."
unrent-noPermissionOther: "Nemas opravneni k ukonceni pronajmu cizich pozemku."
unrent-notRegistered: "U pozemku nelze ukoncit pronajem, neni totiz registrovany k pronajmu."
unrent-notRented: "U pozemku nelze ukoncit pronajem, neni totiz ani k pronajmuti."
sell-help: "/as sell [pozemek], pokud neni uvedeno, bude pouzit pozemek kde stojis."
sell-notRegistered: "Pozemek nelze prodat, protoze neni registrovany ke koupi."
sell-notBought: "Pozemek nelze prodat, protoze nikomu nepatri."
sell-noPermission: "Nemas opravneni k prodeji pozemku."
sell-noPermissionOther: "Nemas opravneni k prodeji cizich pozemku."
reload-reloading: "Reload na pohodu, kontrola vsech pronajmu a aktualizaci pozemku."
reload-updateStart: "&7Update pozemku %0% :: %1% sekund."
reload-updateComplete: "&7Update pozemku na pohodu."
reload-noPermission: "Nemas opravneni k reloadu."
reload-updateCommandChanged: "'/as updaterents' a '/as updatebuys' byly zruseny, '/as reload' provede vse potrebne..."
info-help: "/as info\n all\n pronajmute [skupina]\n kpronajmu [skupina]\n prodano [skupina]\n kprodeji [skupina]\n hrac <hrac>\n pozemek <pozemek>\n bezskupiny"
info-noPermission: "Nemas opravneni k ziskani informaci o pozemcich."
info-all-rents: "Pozemky registrovane k pronajmu: &7%0%."
info-all-noRents: "Nejsou pozemky registrovane k pronajmu."
info-all-buys: "Pozemky registrovane k prodeji: &7%0%."
info-all-noBuys: "Nejsou pozemky registrovane k prodeji."
info-nogroupRents: "Pronajmy bez skupiny: &7%0%."
info-nogroupBuys: "Prodeje bez skupiny: &7%0%."
info-nogroupNoRents: "Nejsou pronajmy bez skupiny."
info-nogroupNoBuys: "Nejsou prodeje bez skupiny."
info-rented: "Pronajate pozemky: &7%0%."
info-noRented: "Zadne pozemky."
info-unrented: "Pozemky bez pronajmu: &7%0%."
info-noUnrented: "Vsechny pozemky k pronajmu."
info-sold: "Prodane pozemky: &7%0%."
info-noSold: "Zadne pozemky."
info-forsale: "Pozemky k prodeji: &7%0%."
info-noForsale: "Vse prodane."
info-noFiltergroup: "Skupina '%0%' neexistuje, tudiz nelze pouzit k filtrovani."
info-playerHelp: "/as info player <jmeno>."
info-playerRents: "Pozemky pronajate od %0%: &7%1%"
info-playerNoRents: "%0% nema pronajmy."
info-playerBuys: "Pozemky koupene od %0%: &7%1%."
info-playerNoBuys: "%0% nema nic koupene."
info-regionHelp: "/as info region [nazev], pokud neni uvedeno, bude pouzit ten kde stojis."
info-regionHeaderRent: "&2Informace %region%:"
info-regionHeaderBuy: "&2Informace %region%:"
info-regionRented: "&2&l►&r Pronajate od %player% do: &7%until%."
info-regionBought: "&2&l►&r Koupene od %player%."
info-regionReselling: "&2&l►&r Koupene od %player%, aktualne k prodeji."
info-regionExtending: "&2&l►&r Cena prodlouzeni: &7%price% za %duration%."
info-regionCanBeRented: "&2&l►&r Cena pronajmu: &7%price% za %duration%."
info-regionCanBeBought: "&2&l►&r Cena ke koupi: &7%price%."
info-regionReselPrice: "&2&l►&r K prodeji za: &7%resellprice% (muzes koupit od %player%)."
info-regionFriends: "&2&l►&r Pridani hraci: &7%friends%."
info-regionMoneyBackBuy: "&2&l►&r Navrat z prodeje: &7%moneyback% (%moneybackpercent%% z plne ceny)."
info-regionMoneyBackRent: "&2&l►&r Navrat z pronajmu: &7%moneyback% (%moneybackpercent%% ze zbyvajici doby)."
info-regionMaxExtends: "&2&l►&r Maximalni pocet prodlouzeni: &7%maxextends%x."
info-regionNoExtending: "&2&l►&r Pronajem nelze prodlouzit."
info-regionExtendsLeft: "&2&l►&r Zbyva prodlouzeni: &7%extendsleft%x z %maxextends%."
info-regionMaxRentTime: "&2&l►&r Trvani pronajmu: &7%maxrenttime% z maxima."
info-regionNoTeleport: "&2&l►&r Misto pro teleport neni nastaveno: %0%."
info-regionTeleportHint: " &7(pouzij '/as settp' pro lepsi misto)"
info-regionTeleportAt: "&2&l►&r Teleport nastaven na: &7(%0%, %1%, %2%, %3%, roztec:%4%, vyboceni:%5%)."
info-regionSigns: "&2&l►&r Pripojene cedulky: &7%0%."
info-regionSignLocation: "&7(%0%, %1%, %2%, %3%)&r"
info-regionGroups: "&2&l►&r Pridane skupiny: &7%0%."
info-regionInactiveUnrent: "&2&l►&r Automaticke ukonceni pronajmu: &7%inactivetime% z neaktivity hrace."
info-regionInactiveSell: "&2&l►&r Automaticky prodej: &7%inactivetime% z neaktivity hrace."
info-regionRestrictedRegionRent: "&2&l►&r Musis byt uvnitr regionu k pronajmuti."
info-regionRestrictedWorldRent: "&2&l►&r Musis byt ve svete '%world%' k pronajmuti pozemku."
info-regionRestrictedRegionBuy: "&2&l►&r Musis byt uvnitr pozemku k zakoupeni."
info-regionRestrictedWorldBuy: "&2&l►&r Musis byt ve svete '%world%' k zakoupeni pozemku."
info-regionRestoringRent: "&2&l►&r Obnova pozemku ZAPNUTA &7(pozemek bude smazan a pronajem ukoncen)%0%."
info-regionRestoringBuy: "&2&l►&r Obnova pozemku ZAPNUTA &7(pozemek bude smazan a prodan)%0%."
info-regionRestoringProfile: " (profil: %0%)"
info-regionLandlord: "&2&l►&r LandLord: &7%landlord% (navrat penez)."
info-regionNotExisting: "Uvedeny region neni registrovany: %0%."
setrestore-help: "/as setrestore <pozemek> <true|false|general> [profil]."
setrestore-noPermission: "Nemas opravneni k nastaveni obnovy pozemku."
setrestore-notRegistered: "Uvedeny region neni registrovany: %0%."
setrestore-invalidSetting: "'%0%' nema platny stav, bud bude true, false nebo general."
setprice-noPermission: "Nemas opravneni ke zmene ceny pozemku."
setprice-help: "/as setprice <cena> [pozemek], pokud neni uvedeno, bude pouzit ten kde stojis."
setprice-notRegistered: "Uvedeny pozemek neni registrovany: %0%."
setprice-wrongPrice: "'%0%' neni platna cena."
setprice-successRent: "Cena pozemku %region% zmenena na %price% pro dobu %duration%."
setprice-successBuy: "Cena pozemku %region% zmenena na %price%."
setprice-successRemoved: "Cena pro %region% byla odstranena, bude nastavena zakladni cena na: %price%."
setprice-noLandlord: "Nemas opravneni ke zmene ceny, protoze neni v landlord pro %region%."
setduration-noPermission: "Nemas opravneni ke zmene doby pronajmu."
setduration-help: "/as setduration <pocet> <format> [pozemek], pokud neni uvedeno, bude pouzit ten kde stojis."
setduration-notRegistered: "%0% neni registrovany k pronajmu."
setduration-wrongAmount: "'%0%' neni platny pocet, pouzij platne CISLO."
setduration-wrongFormat: "'%0%' neni spravny format casu, radeji skukni dokumentaci."
setduration-noLandlord: "Nemas opravneni ke zmene delky trvani, protoze nejsi v landlord pro %region%."
setduration-successRemoved: "Trvani pro pozemek %region% bylo odstraneno, nyni bude nastaveno do zakladni doby: %duration%."
setup-noRegion: "Neni uveden pozemek v druhem radku."
setup-wrongRegion: "Uvedeny pozemek nexistuje."
setup-alreadyRentSign: "Uvedeny pozemek uz je pridany k pronajmu, pridej cedulku s [as] na prvnim radku nebo napis '/as addsign'."
setup-alreadyBuySign: "Uvedeny pozemek uz je pridany k prodeji, pridej cedulku s [as] na prvnim radku nebo napis '/as addsign'."
setup-noDuration: "Na tretim radku neni uvedeno jak dlouho se muze pozemek pronajimat"
setup-wrongDuration: "Uvedena doba pronajmu je chybne napsana, priklad: 1 day."
setup-noPrice: "Neni uvedena cena na ctvrtem radku."
setup-wrongPrice: "Uvedena cena je chybne napsana, musi byt pouze cisla."
setup-rentSuccess: "Nastaveni pronajmu pozemku %0% je v poradku."
setup-buySuccess: "Nastaveni prodej pozemku %0% je v poradku."
setup-noPermissionRent: "Nemas opravneni pro nastavovani pronajmu."
setup-noPermissionBuy: "Nemas opravneni pro nastavovani prodeje."
setup-couldNotDetect: "Nalezeny pozemky se stejnou prioritou nebo parent/child relaci, uved jednu z nich na druhy radek (pozemky: %0% a %1%)."
setup-blacklisted: "%0% je na cerne listine a nemuze byt pridan do AreaShop."
setup-noPermission: "Nemuzes pridat pozemek '%0%', nejsi jeho majitel/clen."
destroy-noPermissionRent: "Nemas opravneni pro zruseni pronajmu pozemku."
destroy-noPermissionBuy: "Nemas opravneni pro zruseni prodeje pozemku."
teleport-help: "/as tp <pozemek> [sign]."
teleport-noRentOrBuy: "Uvedeny pozemek neni registrovan: %0%."
teleport-noPermission: "Nemas opravneni pro teleport k Tvemu pozemku."
teleport-noPermissionOther: "Nemas opravneni pro teleport k cizim pozemkum."
teleport-noPermissionSign: "Nemas opravneni k teleportu na cedulku Tveho pozemku."
teleport-noPermissionOtherSign: "Nemas opravneni k teleportu na cedulku cizich pozemku."
teleport-noPermissionFriend: "Nemas opravneni k teleportu do pozemku."
teleport-noPermissionFriendSign: "Nemas opravneni k teleportu na cedulku."
teleport-blocked: "Nelze teleportovat, protoze pozice je mimo pozemek a je blokovana."
teleport-changedToSign: "Mas opravneni pouze pro teleport k cedulce, teleportuji."
teleport-changedToNoSign: "Zadna cedulka, zkusim teleport do pozemku."
setteleport-help: "/as settp [pozemek] [reset], pokud neni uvedeno, bude pouzit ten, kde stojis."
setteleport-noPermission: "Nemas opravneni pro nastaveni mista k teleportu."
setteleport-noPermissionOther: "Nemas opravneni pro nastaveni mista teleportu kde nejsi majitelem."
setteleport-noRentOrBuy: "Pozemek neni registrovany: %0%."
setteleport-notInside: "Misto musi byt uvnitr pozemku."
find-help: "/as find <buy|rent> [maxcena] [skupina]."
find-noPermission: "Nemas opravneni k hledani pozemku a naslednemu teleportu k nim."
find-wrongMaxPrice: "Zadana maximalni vyse ceny neni spravna: %0%."
find-wrongGroup: "Zadana skupina neexistuje: %0%."
find-noneFound: "Pozemek %0% dle Tvych maximalnich financnich moznostech nenalezen : %1%%2%."
find-noneFoundMax: "Pozemek %0% dle uvedene maximalni ceny nenalezen : %1%%2%."
find-onlyInGroup: ", hledani pouze ve skupine: %0%."
groupadd-help: "/as groupadd <skupina> [pozemek], pokud neni uvedeno, bude pouzit vyber z WorldEdit."
groupadd-noPermission: "Nemas opravneni k pridavani pozemku do skupin."
groupadd-noRegion: "Uvedeny pozemek neni registrovany: %0%."
groupadd-weSuccess: "Pridano do skupiny %0%: &7%1%."
groupadd-weFailed: "Uz je ve skupine %0%: &7%1%."
groupdel-help: "/as groupdel <group> [region], pokud neni uvedeno, bude pouzit vyber z WorldEdit."
groupdel-noPermission: "Nemas opravneni k mazani pozemku ze skupin."
groupdel-noRegion: "Uvedeny pozemek neni registrovany: %0%."
groupdel-weSuccess: "Odstranen ze skupiny %0%: &7%1%."
groupdel-weFailed: "Neni ve skupine %0% :: &7%1%."
grouplist-noPermission: "Nemas opravneni k zobrazeni registrovanych skupin."
grouplist-noGroups: "Aktualne zadne registrovane skupiny."
grouplist-success: "Nasledujici skupiny jsou registrovane: &7%0%."
groupinfo-help: "/as groupinfo <group>."
groupinfo-noPermission: "Nemas opravneni k zobrazeni informaci o skupinach."
groupinfo-noGroup: "Skupina '%0%' neni registrovana, napis /as grouplist k zobrazeni skupin."
groupinfo-members: "Nasledujici pozemky jsou cleny skupiny %0%: &7%1%."
groupinfo-noMembers: "Skupina %0% nema zadne cleny."
schemevent-help: "/as schemevent <pozemek> <created|deleted|rented|unrented|bought|sold>."
schemevent-noRegion: "Uvedeny pozemek neni registrovany: %0%."
schemevent-wrongEvent: "Uvedeny event '%0%' neexistuje, pouzij jeden z nasledujicich: &7%1%."
schemevent-noPermission: "Nemas opravneni k triggerovani eventu schemat."
add-help: "/as add <rent|buy> [pozemek] [svet]."
add-noPermission: "Nemas opravneni k pridavani pozemku do AreaShop."
add-success: "Pridano jako %0%: &7%1%."
add-failed: "Pozemek uz je registrovany: &7%0%."
add-blacklisted: "Na cerne listine: &7%0%."
add-specifyWorld: "Zadej nazev sveta pro pozemek pomoci konzole."
add-incorrectWorld: "Svet '%0%' nebyl nalezen, zkus to znovu (pozor na VELikoST pIsmeN)."
add-noRegion: "Pozemek '%0%' v tomto svete neexistuje."
add-noPermissionRegions: "Chybi prava k pridani: &7%0%."
add-noPermissionOwnerMember: "&7Bud nejsi majitelem/clenem pozemku, nebo nemas opravneni."
del-noRegion: "Uvedeny pozemek neni registrovany: %0%."
del-noPermission: "Nemas opravneni k mazani pozemku."
del-success: "Pozemek uspesne odstranen: &7%0%."
del-failed: "Chybi prava k mazani nebo neni registrovano: &7%0%."
addsign-help: "/as addsign [pozemek] [profil]."
addsign-noSign: "Nedivas se na cedulku."
addsign-noRegions: "Zadny pozemek okolo cedulky nebyl nalezen."
addsign-couldNotDetect: "Nalezeno vice pozemku okolo cedulky, uved pozemek jako extra argument (pozemky: %0% a %1%)."
addsign-couldNotDetectSign: "Nalezeno vice pozemku okolo cedulky, uved jmeno na druhy radek (pozemky: %0% a %1%)."
addsign-wrongProfile: "Uvedeny profil neexistuje, pouzij nasledujici (kontrola konfigu): &7%0%."
addsign-success: "Cedulka byla uspesne pridana pro pozemek: %region%."
addsign-successProfile: "Cedulka byla uspesne pridana pro pozemek %region% s profilem %0%."
addsign-noPermission: "Nemas opravneni pro pridani cedulek."
delsign-noSign: "Nedivas se na zadnou cedulku."
delsign-noPermission: "Nemas opravneni k odstraneni cedulek."
delsign-noRegion: "Tato cedulka nepatri k zadnemu pozemku AreaShop."
me-noPermission: "Nemas opravneni zjistovat jake mas pozemky."
me-notAPlayer: "Nehrajes, tak nic nevlastnis."
me-noRentRegions: "Nemas nic v pronajmu."
me-noBuyRegions: "Nemas zadny zakoupeny pozemek."
me-rentRegions: "Mas pronajate nasledujici pozemky:"
me-buyRegions: "Mas koupene nasledujici pozemky:"
me-rentLine: "&2&l►&r %region% do %until% &7(%timeleft% zbyva)."
me-buyLine: "&2&l►&r %region%."
me-noFriendRegions: "Zadne pratele jsi do pozemku nepridal."
me-friendRegions: "Do pozemku jsou prodani nasledujici pratele:"
me-friendLine: "&2&l►&r %region% &7(majitel: %player%)."
setowner-help: "/as setowner <hrac> [pozemek], pokud neni uvedeno, bude pouzit ten kde stojis."
setowner-noPermission: "Nemas opravneni k nastaveni majitele pozemku."
setowner-noPermissionRent: "Nemas opravneni k nastaveni majitele pozemku urceneho k pronajmu."
setowner-noPermissionBuy: "Nemas opravneni k nastaveni majitele pozemku urceneho k prodeji."
setowner-notRegistered: "Uvedeny region neni registrovany, majitel nemuze byt nastaven."
setowner-noPlayer: "Nelze zjistit UUID uvedeneho hrace: %0%."
setowner-succesRent: "Majitel pro pozemek %region% uspesne zmenen na %player%, pronajmuto do %until% (%timeleft% zbyva)."
setowner-succesRentExtend: "Majitelem je %player%, pronajem podlouzen o '%duration%', nyni je do %until% (%timeleft% zbyva)."
setowner-succesBuy: "Majitel pozemku %region% uspesne zmenen na %player%."
resell-help: "/as resell <cena> [pozemek], pokud neni uvedeno, bude pouzit ten kde stojis."
resell-wrongPrice: "'%0%' neni platna cena."
resell-notRegistered: "Uvedeny pozemek neni registrovany: %0%."
resell-noRegionFound: "Pozemek v Tve pozici nenalezen, zkus upresnit pozemek pomoci argumentu."
resell-notBought: "Nemuzes nabidnout pozemek %region%, protoze dosud nebyl koupeny."
resell-success: "%region% byl uspesne vystaven do rezimu Nabidky za cenu %resellprice%."
resell-noPermission: "Nemas opravneni k nastaveni pozemku do rezimu Nabidky."
resell-noPermissionOther: "Nemas opravneni k nastavovani reizmu Nabidek."
stopresell-help: "/as stopresell [pozemek], pokud neni uvedeno, bude pouzit ten kde stojis."
stopresell-notRegistered: "Uvedeny pozemek neni registrovany: %0%."
stopresell-noRegionFound: "Zadny pozemek v Tve pozici nenalezen, zkus upresnit pozemek pomoci argumentu."
stopresell-notResell: "Nemuzes zastavit Nabidku pozemku %region% protoze neni v rezimu Nabidky."
stopresell-success: "%region% byl uspesne vracen do rezimu Prodano."
stopresell-noPermission: "Nemas opravneni k nastaveni do rezimu Prodano."
stopresell-noPermissionOther: "Nemas opravneni k nastaveni rezimu Prodano."
addfriend-help: "/as addfriend <hrac> [pozemek], pokud neni uvedeno, bude pouzit ten kde stojis."
addfriend-noPermissionOther: "Nemas opravneni k pridavani pratel do pozemku."
addfriend-noPermission: "Nemas opravneni k pridavani pratel do pozemku."
addfriend-alreadyAdded: "%0% uz je pridan/a jako pritel do pozemku."
addfriend-self: "Pridani majitele pozemku jako pritele by bylo zbytecnym krokem :]"
addfriend-noOwner: "Nejsi majitelem pozemku, tudiz do nej nemuzes pridavat pratele."
delfriend-help: "/as delfriend <hrac> [pozemek], pokud neni uvedeno, bude pouzit ten kde stojis."
delfriend-noPermissionOther: "Nemas opravneni k odstranovani pratel z pozemku."
delfriend-noPermission: "Nemas opravneni k odstranovani pratel z pozemku."
delfriend-notAdded: "%0% neni pro tento pozemek pridan/a jako pritel."
delfriend-noOwner: "Nejsi majitelem pozemku, tudiz z nej nemuzes mazat pridane pratele."
linksigns-multipleRegions: "Nalezeno vicero pozemku: &7%0%."
linksigns-multipleRegionsAdvice: "Pokracuj ve vyberu dalsim kliknutim nebo napis '/as linksigns' k ukonceni."
linksigns-noRegions: "Zadny pozemek v Tvem pohledu, vytvor ho a pridej do AreaShop &7(maximalni vzdalenost 100 bloku)."
linksigns-regionFound: "Pozemek %region% byl nalezen, nyni koukni na cedulku a klikni levym k pripojeni."
linksigns-signFound: "Nalezena cedulka (%0%, %1%, %2%), nyni koukni na pozemek a klikni pravym k pripojeni"
linksigns-noSign: "Zadna cedulka v pohledu nenalezena, ujisti se, ze je ve vyhledu cedulka a zkus to znovu &7(maximalni vzdalenost 100 bloku)."
linksigns-alreadyRegistered: "Tato cedulka uz je registrovana pro pozemek %region%, klikni znovu pro vyber jine."
linksigns-first: "Aktivoval/a jsi mod SIGN LINKING (pripojovani cedulek k pozemku)."
linksigns-next: "&7Levym kliknutim zvol cedulku, pravym kliknutim zvol pozemek, nebo napis /as linksigns k ukonceni."
linksigns-noPermission: "Nemas opravneni na rezim SIGN LINKING."
linksigns-stopped: "Mod SIGN LINKING byl ukoncen."
stack-help: "/as stack <amount> <gap> <name> <rent|buy> [group].\n&7 <amount> Pocet pozemku k vytvoreni.\n <gap> Vzdalenost (v blocich) mezi pozemky.\n <name> Nazev pozemku (cisla budou za nazvem).\n <rent|buy> Volba mezi pronajmem/prodejem.\n [group] Skupina pro pridani novych pozemku.\n Pozemky budou vytvoreny tam, kam se budes divat."
stack-accepted: "Zahajeno vytvareni %0% %1% pozemku s rozestupy %2% bloku(y), nazvy zacinaji %3% a maji koncove cisla %4%"
stack-addToGroup: " Vytvorene pozemky byly pridany do skupiny '%0%'."
stack-noPermission: "Nemas opravneni k hromadne tvorbe pozemku."
stack-wrongAmount: "'%0%' neni platny pocet pozemku."
stack-wrongGap: "'%0%' neni spravne cislo pro pocet bloky mezi pozemky."
stack-noSelection: "Nemas opravneni k urceni prvniho pozemku pro hromadnou tvorbu."
stack-addStart: "&7Pridano %0% pozemku v case %1% sekund."
stack-addComplete: "&7Pridavani pozemku bylo USPESNE dokonceno."
stack-unclearDirection: "Prosim, koukej poradne na nekterou ze svetovych stran, zda se, ze ted koukas kamsi do podzemi >> %0%."
setlandlord-help: "/as setlandlord <hrac> [pozemek], pokud neni uvedeno, bude pouzit ten kde stojis."
setlandlord-noPermission: "Nemas opravneni k nastaveni landlord pro pozemek."
setlandlord-noRegion: "Uvedeny pozemek neni registrovany: %0%."
timeleft-years: "%0% rok(u)"
timeleft-months: "%0% mesicu"
timeleft-days: "%0% dnu"
timeleft-hours: "%0% hodin"
timeleft-minutes: "%0% minut"
timeleft-second: "%0% sekunda"
timeleft-seconds: "%0% sekund"
timeleft-ended: "Trvani"
greeting-forrent: "%region% je k pronajmu za %price% na %duration%."
greeting-rented: "%region% ma v pronajmu %player% do %until%."
greeting-forsale: "%region% k prodeji za %price%."
greeting-bought: "%region% koupeny od %player%."
greeting-resale: "%region% muze byt koupen za %resaleprice% od %player%."
+90 -68
View File
@@ -1,6 +1,6 @@
# ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
# ║ 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% ║
# ║ Language: German, Version: V2.2.2, Percentage translated: 100% ║
# ║ This file will be overwritten at each startup/reload of the plugin, if you want to change anything then do the following: ║
# ║ 1: Make a copy of this file ║
# ║ 2: Rename it to <servername>.yml (don't use a language code as filename, could otherwise be overwritten in future updates) ║
@@ -10,16 +10,22 @@
# ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
total-maximum: "Du kannst nicht mehr als %0% Region(en) mieten/kaufen (Du hast bereits %1% in Gruppe '%2%')."
general-notReady: "AreaShop ist noch nicht vollständig geladen, bitte warten."
general-noWorld: "Du kannst diese Aktion nicht durchführen, da die Welt, in der sich die Region befindet, im Moment nicht verfügbar ist. (Welt '%world%')."
general-noRegion: "Du kannst diese Aktion nicht durchführen, da die WorldGuard Region im Moment nicht verfügbar ist. (Region '%region%')."
general-noEconomy: "AreaShop kann kein (korrekt) installiertes Economy-Plugin finden, bitte informiere den Serverinhaber darüber."
general-cancelled: "%0%"
cmd-notValid: "Der Befehl ist ungültig, nutze '/as help' für weitere Informationen."
cmd-onlyByPlayer: "Dieser Befehl kann nur von einem Spieler benutzt werden."
cmd-weOnlyByPlayer: "Eine WorldEdit-Selektion kann nur von einem Spieler gewählt werden, gib die Region als extra Argument an."
cmd-noSelection: "Du hast mit WorldEdit Nichts markiert."
cmd-noRegionsFound: "In deiner Selektion wurden keine mit AreaShop registrierten Regionen gefunden."
cmd-noSelection: "Du hast mit WorldEdit nichts markiert."
cmd-noRegionsFound: "In deiner Selektion wurden keine in AreaShop registrierten Regionen gefunden."
cmd-noWERegionsFound: "Es wurden keine WorldEdit-Regionen gefunden, die sich mit deiner Selektion überschneiden."
cmd-notRegistered: "Die angegebene Region ist nicht eingetragen: %0%."
cmd-noRegionsAtLocation: "Keine Regionen an deiner Stelle gefunden, gib die Region als Argument an."
cmd-notRegistered: "Die angegebene Region ist nicht registriert: %0%."
cmd-noRegionsAtLocation: "Keine Regionen an deiner Position gefunden, gib die Region als Argument an."
cmd-moreRegionsAtLocation: "Mehr als eine Region wurde an deiner Position gefunden, gib die Region als Argument an."
cmd-automaticRegionOnlyByPlayer: "Automatische Auswahl einer Region ist nur für Spieler möglich, gibt die Region als Argument an."
cmd-automaticRegionOnlyByPlayer: "Die Automatische Auswahl einer Region ist nur für Spieler möglich, gib die Region als Argument an."
help-header: "Hilfeseite mit Befehlen, die du ausführen kannst."
help-alias: "Befehlsaliase: /areashop, /as."
@@ -49,74 +55,81 @@ help-add: "&6/as add &7-&r Definiere eine Region als zu verkaufen oder zu vermie
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-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-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-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-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-linksigns: "&6/as linksigns &7-&r Benutze Schilder Massenverlinkungsmodus."
help-stack: "&6/as stack &7-&r Erstellt mehrere Regionen und fügt sie hinzu."
help-setlandlord: "&6/as setlandlord &7-&r Setzt den Vermieter einer Region."
rent-help: "/as rent [Region], Wenn kein Regionsname angegeben wird, wird die Region genutzt, in der du dich gerade befindest."
rent-noPermission: "Du bist nicht berechtigt, diese Region zu mieten."
rent-maximum: "Du kannst nicht mehr als %0% Region(en) mieten (Du hast bereits %1% in Gruppe '%2%')."
rent-maximumExtend: "Du kannst diese Miete nicht verlängern weil du mehr als %0% Region(en) hast. (Du hast bereits %1% in Gruppe '%2%')."
rent-payError: "Die Bezahlung hat nicht funktioniert. Bitte versuche es später noch einmal."
rent-rented: "Du hast %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-rented: "Du hast die Region %region% gemietet bis zum %until%."
rent-extended: "Du hast Deine Miete von %region% bis zum %until% verlängert."
rent-extendedToMax: "Du hast Deine Miete von %region% bis zum %until% verlängert. (Das ist die maximal zulässige Mietdauer von %maxrenttime%)."
rent-extend: "Du kannst die Miete verlängern, indem du noch einen Rechtsklick auf das Schild machst oder den Befehl /as rent nutzt."
rent-lowMoneyExtend: "Du hast nicht genug Geld um die Miete zu verlängern. (Du hast %0% und benötigst %price%)."
rent-lowMoneyRent: "Du hast nicht genug Geld um diese Region zu mieten. (Du hast %0% und benötigst %price%)."
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-maxExtends: "Du kannst diese Miete nicht weiter verlängern. (Zulässig sind %maxextends% Verlängerungen). Nachdem die Miete abgelaufen ist, kannst Du die Region erneut mieten."
rent-maxRentTime: "Du kannst diese Region nicht noch mehr im Voraus mieten. Die maximale Zeit beträgt %maxrenttime% und Du hast diese Region im Moment für %timeleft% gemietet."
rent-restrictedToWorld: "Du musst dich in der Welt '%world%' befinden, um diese Region mieten zu können (Du befindest Dich in der Welt '%0%')."
rent-restrictedToRegion: "Du musst innerhalb der Region %region% sein, um diese mieten zu können."
rent-expireWarning: "Deine Region %region% hat %timeleft% übrig. Gehe sicher, dass du es rechtzeitig verlängerst, wenn du sie behalten willst."
rent-alreadyAtFull: "Die Region %region% ist bereits auf oder über der maximalen Mietzeit, Du kannst diese noch nicht verlängern."
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-noPermissionResell: "Du hast keine Berechtigung eine Region im Weiterverkaufs-Modus zu kaufen."
buy-noPermissionNoResell: "Du hast keine Berechtigung um eine Region zu kaufen, die nicht im Weiterverkaufs-Modus ist."
buy-notBuyable: "Die Region %region% ist nicht zum Kaufen verfügbar."
buy-maximum: "Du kannst nicht mehr als %0% Region(en) erwerben (Du hast bereits %1% in Gruppe '%2%')."
buy-payError: "Die Bezahlung hat nicht funktioniert. Bitte versuche es später noch einmal."
buy-succes: "Du hast %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-succes: "Du hast %region% erfolgreich gekauft."
buy-successResale: "Du hast %region% erfolgreich von %0% gekauft."
buy-successSeller: "Deine Region %region% wurde an %player% für %0% verkauft."
buy-lowMoney: "Du hast nicht genug Geld um diese Region zu kaufen. (Du hast %0% und benötigst %price%)."
buy-lowMoneyResell: "Du hast nicht genug Geld um diese Region zu kaufen. (Du hast %0% und benötigst %resellprice%)."
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."
buy-restrictedToWorld: "Du musst Dich in der Welt '%world%' befinden, um diese Region kaufen zu können. (Du befindest Dich in der Welt '%0%')."
buy-restrictedToRegion: "Du musst innerhalb der Region %region% sein, um diese kaufen zu können."
unrent-help: "/as unrent [Region], Wenn kein Regionsname angegeben wird, wird die Region genutzt, in der du dich gerade befindest."
unrent-noPermission: "Du bist nicht berechtigt, den Mietvertrag zu kündigen."
unrent-noPermissionOther: "Du bist nicht berechtigt, den Mietvertrag einer anderen Region zu kündigen."
unrent-notRegistered: "Die Region kann nicht entmietet werden, weil sie nicht für Vermietungen registriert ist."
unrent-notRented: "Die Region kann nicht entmietet werden, weil sie nicht gemietet ist."
unrent-unrented: "Der Mietvertrag wurde gekündigt."
unrent-other: "Der Mietvertrag dieser Region wurde von %0% gekündigt."
unrent-expired: "Dein Mietvertrag von %0% ist abgelaufen."
unrent-unrented: "Du hast die Region %region% nun nicht mehr gemietet."
unrent-other: "Die Region %region% ist nun nicht mehr an %player% vermietet."
unrent-expired: "Deine Miete von %region% ist abgelaufen."
sell-help: "/as sell [Region], Wenn kein Regionsname angegeben wird, wird die Region genutzt, in der du dich gerade befindest."
sell-notRegistered: "Die Region kann nicht verkauft werden, da sie nicht für den Verkauf registriert ist."
sell-notBought: "Die Region kann nicht verkauft werden, da sie keinen Eigentümer hat."
sell-sold: "Diese Region wurde verkauft an %0%."
sell-soldYours: "Region erfolgreich verkauft."
sell-sold: "%region% wurde verkauft an %player%."
sell-soldYours: "Du hast die Region %region% 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-reloading: "Alle Dateien wurden neu geladen, nun werden alle Mieten überprüft und alle Regionen aktualisiert."
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-help: "/as info\n all\n rented [Grupppe]\n forrent [Grupppe]\n sold [Grupppe]\n forsale [Grupppe]\n player <Spieler>\n region <Region>\n 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."
@@ -134,6 +147,7 @@ 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-noFiltergroup: "Gruppe '%0%' existiert nicht und kann deshalb nicht genutzt werden um die Ergebnisse zu limitieren."
info-playerHelp: "/as info player <Spielername>."
info-playerRents: "Von %0% gemietete Regionen: &7%1%."
info-playerNoRents: "%0% hat bisher keine Region(en) gemietet."
@@ -171,35 +185,33 @@ info-regionRestrictedWorldBuy: "&2&l►&r Du musst in der Welt '%world%' sein, u
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-regionLandlord: "&2&l►&r Vermieter: &7%landlord% (Erhält das Geld)."
info-regionNotExisting: "Die angegebene Region ist nicht registriert: %0%."
setrestore-help: "/as setrestore <Region> <true|false|general> [Profil]."
setrestore-noPermission: "Du bist nicht berechtigt, die Wiederherstellungs-Einstellungen zu verändern."
setrestore-notRegistered: "Die angegebene Region ist nicht registriert: %0%."
setrestore-invalidSetting: "'%0%' ist kein gültiger Status, kann true sein, false oder general."
setrestore-success: "Wiederherstellungs-Einstellungen erfolgreich von %0% zu '%1%' geändert."
setrestore-successProfile: "Wiederherstellungs-Einstellung erfolgreich von %0% zu '%1%' und das Profil zu '%2%' geändert."
setrestore-success: "Wiederherstellungs-Einstellungen von %region% erfolgreich zu '%0%' geändert."
setrestore-successProfile: "Wiederherstellungs-Einstellungen von %region% erfolgreich zu %0% geändert und das Profil zu '%1%' geändert."
setprice-noPermission: "Du bist nicht berechtigt, den Preis einer Region zu ändern."
setprice-help: "/as setprice <Preis> [Region], Wenn kein Regionsname angegeben wird, wird die Region genutzt, in der du dich gerade befindest."
setprice-notRegistered: "Die angegebene Region ist nicht registriert: %0%."
setprice-wrongPrice: "'%0%' ist kein gültiger Preis."
setprice-successRent: "Preis der Region %0% geändert auf %1% von %2%."
setprice-successBuy: "Preis der Region %0% geändert auf %1%."
setprice-successRent: "Der Preis der Region %region% änderte sich zu %price% per %duration%."
setprice-successBuy: "Der Preis der Region %region% wurde zu %price% geändert."
setprice-successRemoved: "Der Preis der Region %region% wurde entfernt, ab jetzt wird der Preis einer Gruppe oder der default.yml-Datei benutzt. Neuer Preis: %price%."
setprice-noLandlord: "Du hast keine Rechte um den Preis zu ändern, da du nicht der Vermieter der Region %region% bist."
setduration-noPermission: "Du hast keine Berechtigung, die Mietdauer zu verändern."
setduration-help: "/as setduration <Anzahl> <Zeiteinheit> [Region], wählt automatisch die Region, in der du dich gerade befindest, wenn nichts angegeben wird."
setduration-notRegistered: "%0% ist nicht als mietbar registriert."
setduration-wrongAmount: "'%0%' ist keine gültige Anzahl, gib eine ganze Zahl an."
setduration-wrongFormat: "'%0%' ist kein gültiges Zeitformat, schau in der Doku auf Bukkit nach."
setduration-success: "Dauer von Region %0% geändert zu '%1%'."
setduration-success: "Dauer von Region %region% zu '%duration%' geändert."
setduration-noLandlord: "Du hast keine Rechte um die Dauer der Miete zu ändern, da du nicht der Vermieter der Region %region% bist."
setduration-successRemoved: "Die Mietdauer der Region %region% wurde entfernt, es wird nun die Dauer von einer Gruppe oder der default.yml Datei benutzt. Neue Mietdauer: %duration%."
setup-noRegion: "Du hast in der zweiten Zeile keine Region angegeben."
setup-wrongRegion: "Die angegebene Region existiert nicht."
@@ -215,11 +227,12 @@ setup-noPermissionRent: "Du hast keine Berechtigungen um mietbare Regionen aufzu
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."
setup-noPermission: "Du kannst die Region '%0%' nicht hinzufügen, da du weder Besitzer noch Mitglied der Region bist oder keine Rechte dazu hast."
destroy-noPermissionRent: "Du hast keine Berechtigungen um eine mietbare Region zu deregistrieren. "
destroy-noPermissionBuy: "Du hast keine Berechtigungen um eine kaufbare Region zu deregistrieren. "
destroy-successRent: "%0% erfolgreich als mietbare Region abgemeldet."
destroy-successBuy: "%0% erfolgreich als kaufbare Region abgemeldet."
destroy-successRent: "%region% erfolgreich als mietbare Region abgemeldet."
destroy-successBuy: "%region% erfolgreich als kaufbare Region abgemeldet."
teleport-help: "/as tp <Region> [Schild]."
teleport-noRentOrBuy: "Die angegebene Region ist nicht registriert: %0%."
@@ -229,23 +242,25 @@ teleport-noPermissionSign: "Du hast keine Rechte um dich zu diesem Schild in dei
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-success: "Du wurdest zu %region% teleportiert."
teleport-successSign: "Du wurdest zum Schild von %region% teleportiert."
teleport-noSafe: "Keine sichere Position in %region% gefunden, kein Boden vorhanden oder maximale Anzahl an Versuchen erreicht (%0%/%1%)."
teleport-blocked: "Du kannst dich nicht teleportieren, weil sich die Position außerhalb der Region befindet und du dich nur in die Region teleportieren kannst."
teleport-changedToSign: "Du hast nur Rechte um zum Schild der Region zu teleportieren und nicht um in die Region zu teleportieren. Teleportiere zum Schild."
teleport-changedToNoSign: "Es ist kein Schild zum teleportieren verfügbar, versuche stattdessen in die Region zu teleportieren."
setteleport-help: "/as settp [Region] [reset], Wenn kein Regionsname angegeben wird, wird die Region genutzt, in der du dich gerade befindest."
setteleport-noPermission: "Du bist nicht berechtigt, einen Teleport-Punkt zu setzen."
setteleport-noPermissionOther: "Dir fehlt die Berechtigung die Teleportposition für eine Region, du du nicht besitzt, festzulegen."
setteleport-noRentOrBuy: "Die angegebene Region ist nicht registriert: %0%."
setteleport-success: "Teleport-Punkt von %0% erfolgreich gesetzt."
setteleport-success: "Teleport-Punkt von %region% erfolgreich gesetzt."
setteleport-notInside: "Der Teleportpunkt muss sich innerhalb einer Region befinden."
setteleport-reset: "Teleport-Punkt von %0% erfolgreich zurückgesetzt."
setteleport-reset: "Teleport-Punkt von %region% erfolgreich zurückgesetzt."
find-help: "/as find <buy|rent> [maximaler Preis] [Gruppe]."
find-noPermission: "Du hast keine Berechtigungen nach Regionen zu suchen und zu ihnen zu teleporten."
find-success: "%0% Region gefunden: %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-success: "%0% Region gefunden: %region%, bei Suche nach max. Preis in Höhe deines Guthabens: %1%%2%."
find-successMax: "%0% Region gefunden: %region%,, bei Suche nach max. Preis in Höhe von %1%%2%."
find-wrongMaxPrice: "Der angegebene Maximal-Preis ist kein korrekter Betrag: %0%."
find-wrongGroup: "Die angegebene Gruppe existiert nicht: %0%."
find-noneFound: "Keine %0% Region gefunden bei Suche nach max. Preis in Höhe deines Guthabens: %1%%2%."
@@ -255,16 +270,16 @@ 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-success: "Region %region% wurde zur Gruppe '%0%' hinzugefügt. Diese Gruppe hat nun %1% Mitglied(er)."
groupadd-failed: "Region %region% 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-success: "Region %region% ist aus Gruppe '%0%' entfernt worden. Diese Gruppe hat nun %1% Mitglied(er)."
groupdel-failed: "Region %region% gehört nicht zur Gruppe '%0%'."
groupdel-weSuccess: "Entfernt aus Gruppe %0%: &7%1%."
groupdel-weFailed: "Ist nicht länger in Gruppe %0%: &7%1%."
@@ -281,7 +296,7 @@ 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-success: "'%0%'-Event wurde erfolgreich für Region %region% ausgelöst."
schemevent-noPermission: "Du bist nicht berechtigt, Schematic-Events auszuführen."
add-help: "/as add <rent|buy> [Region] [Welt]."
@@ -292,6 +307,8 @@ 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."
add-noPermissionRegions: "Keine Rechte zum hinzufügen: &7%0%."
add-noPermissionOwnerMember: "&7Entweder bist du weder Mitglied noch Besitzer der Region oder hast keine Rechte um deine Regionen hinzuzufügen."
del-noRegion: "Die angegebene Region ist nicht registriert: %0%."
del-noPermission: "Du bist nicht berechtigt, Regionen zu entfernen."
@@ -300,20 +317,20 @@ del-failed: "Keine Berechtigung zum Entfernen oder nicht in AreaShop eingetragen
addsign-help: "/as addsign [Region] [Profil]."
addsign-noSign: "Du schaust gerade nicht auf ein Schild."
addsign-noRegion: "Region '%0%' nicht gefunden."
addsign-noRegion: "Region '%0%' ist in AreaShop nicht vorhanden. Bitte überprüfe, ob Du diese Region bereits zu AreaShop hinzugefügt hast."
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-alreadyRegistered: "Dieses Schild ist bereits für die Region %region% registriert."
addsign-noPermission: "Du bist nicht berechtigt, ein Schild hinzuzufügen."
delsign-noSign: "Du schaust gerade nicht auf ein Schild."
delsign-noPermission: "Du bist nicht berechtigt, ein Schild zu entfernen."
delsign-noRegion: "Dieses Schild gehört zu keiner in AreaShop eingetragenen Region."
delsign-success: "Schild von Region %0% erfolgreich entfernt."
delsign-success: "Das Schild wurde von der Region %region% 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."
@@ -357,8 +374,8 @@ stopresell-noPermissionOther: "Du hast keine Berechtigung, den Weiterverkauf ein
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-successOther: "%0% wurde als Freund zur Region %region% 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."
@@ -367,8 +384,8 @@ addfriend-notVisited: "Du kannst %0% nicht hinzufügen, weil dieser Spieler noch
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-successOther: "%0% wurde als Freund der Region %region% 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."
@@ -395,6 +412,11 @@ 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%."
setlandlord-help: "/as setlandlord <Spieler> [Region], die Region in der du stehst wird verwendet, wenn keine angegeben wird."
setlandlord-noPermission: "Du hast keine Rechte um den Vermieter einer Region zu setzen."
setlandlord-noRegion: "Die angegebene Region ist nicht registriert: %0%."
setlandlord-success: "%landlord% wurde erfolgreich als Vermieter der Region %region% gesetzt."
timeleft-years: "%0% Jahre"
timeleft-months: "%0% Monate"
timeleft-days: "%0% Tage"
@@ -410,4 +432,4 @@ 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/."
update-playerNotify: "&2Es ist ein Update von AreaShop V%0% auf %1% verfügbar, lade die neuste Version hier herunter: https://github.com/NLthijs48/AreaShop/releases."
+437 -430
View File
@@ -1,430 +1,437 @@
# ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
# ║ 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/."
# ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
# ║ Language file of the AreaShop plugin created by NLThijs48, Github can be found at https://github.com/NLthijs48/AreaShop ║
# ║ Language: English, Version: V2.2.2, Percentage translated: 100% (source), author: NLThijs48 ║
# ║ This file will be overwritten at each startup/reload of the plugin, if you want to change anything then do the following: ║
# ║ 1: Make a copy of this file ║
# ║ 2: Rename it to <servername>.yml (don't use a language code as filename, could otherwise be overwritten in future updates) ║
# ║ 3: Change the 'language' setting in config.yml to '<servername>', do not include '.yml' ║
# ║ 4: Change the strings in the new file to your liking and save the file ║
# ║ 5: Use '/as reload' or reload/restart your server to see the changes ║
# ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
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 '%world%')."
general-noRegion: "You cannot do that, the WorldGuard region is currently unavailable (region '%region%')."
general-noEconomy: "There is no Economy plugin installed or it is not setup correctly, notify the server owner about this."
general-cancelled: "%0%"
cmd-notValid: "That command is not valid, use '/as help' for info."
cmd-onlyByPlayer: "This command can only be run by a player."
cmd-weOnlyByPlayer: "Using a WorldEdit selection is only possible as a player, specify the region name as extra argument."
cmd-noSelection: "You don't have a WorldEdit selection."
cmd-noRegionsFound: "No regions registered in AreaShop are found in your selection."
cmd-noWERegionsFound: "No WorldEdit regions intersecting your selection are found."
cmd-notRegistered: "The specified region is not 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-maximumExtend: "You can't extend this rent because you have more than %0% region(s) (you already have %1% in group '%2%')."
rent-payError: "Something went wrong with paying, try again later."
rent-rented: "You rented %region% until %until%."
rent-extended: "You extended your rent of %region% until %until%."
rent-extendedToMax: "You extended your rent of %region% until %until% (which is the maximum rental time of %maxrenttime%)."
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 %price%)."
rent-lowMoneyRent: "You don't have enough money to rent this region (you have %0% and you need %price%)."
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 %maxextends% 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 %maxrenttime% and you have currently rented it for %timeleft%."
rent-restrictedToWorld: "You need to be in the '%world%' world to rent this region (you are in '%0%')."
rent-restrictedToRegion: "You need to be inside %region% to rent it."
rent-expireWarning: "Your region %region% has %timeleft% left, be sure to extend it if you want to keep it."
rent-alreadyAtFull: "%region% is already at or above the maximum rental time, you cannot extend it yet."
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-noPermissionResell: "You don't have permission to buy a region in resell mode."
buy-noPermissionNoResell: "You don't have permission to buy a region that is not in resell mode."
buy-notBuyable: "Region %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 %region%."
buy-successResale: "You successfully bought %region% from %0%."
buy-successSeller: "Your region %region% has been sold to %player% for %0%."
buy-lowMoney: "You don't have enough money to buy this region (you have %0% and you need %price%)."
buy-lowMoneyResell: "You don't have enugh money to buy this region (you have %0% and you need %resellprice%)."
buy-yours: "You already own this region."
buy-someoneElse: "Someone else already bought this region."
buy-restrictedToWorld: "You need to be in the '%world%' world to buy this region (you are in '%0%')."
buy-restrictedToRegion: "You need to be inside '%region%' 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: "You have unrented %region%."
unrent-other: "%region% has been unrented for %player%."
unrent-expired: "Your rent of %region% 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: "%region% has been sold for %player%."
sell-soldYours: "You have sold %region%."
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\n all\n rented [group]\n forrent [group]\n sold [group]\n forsale [group]\n player <player>\n region <region>\n 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-noFiltergroup: "Group '%0%' does not exist and therefore cannot be used to limit the results."
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 %region% to '%0%'."
setrestore-successProfile: "Successfully set the restore setting of %region% to '%0%' and the profile to '%1%'."
setprice-noPermission: "You don't have permission to change the price of a region."
setprice-help: "/as setprice <price> [region], the region you stand in will be used if not specified."
setprice-notRegistered: "The specified region is not registered: %0%."
setprice-wrongPrice: "'%0%' is not a valid price."
setprice-successRent: "Price of region %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 %region% changed to '%duration%'."
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: "%region% successfully deregistered as rental region."
destroy-successBuy: "%region% successfully deregistered as buy region."
teleport-help: "/as tp <region> [sign]."
teleport-noRentOrBuy: "The specified region is not registered: %0%."
teleport-noPermission: "You don't have permission to teleport to your region."
teleport-noPermissionOther: "You don't have permission to teleport to regions you do not own."
teleport-noPermissionSign: "You don't have permission to teleport to the sign of your region."
teleport-noPermissionOtherSign: "You don't have permission to teleport to signs of regions you do not own."
teleport-noPermissionFriend: "You don't have permission to teleport to regions you are added to as a friend."
teleport-noPermissionFriendSign: "You don't have permission to teleport to the sign of regions you are added to as a friend."
teleport-success: "You teleported to %region%."
teleport-successSign: "You teleported to the sign of %region%."
teleport-noSafe: "No safe position found in %region%, no spots in the region left or maximum tries exceeded (%0%/%1%)."
teleport-blocked: "You can't teleport because the position is outside the region, and you are forced to teleport inside."
teleport-changedToSign: "You only have permission to teleport to the sign and not inside the region, teleporting to sign."
teleport-changedToNoSign: "No sign available to teleport to, trying to teleport inside the region instead."
setteleport-help: "/as settp [region] [reset], the region you stand in will be used if not specified."
setteleport-noPermission: "You don't have permission to set the teleport location."
setteleport-noPermissionOther: "You don't have permission to set the teleport location for a region you do not own."
setteleport-noRentOrBuy: "The specified region is not registered: %0%."
setteleport-success: "Teleport location of %region% set."
setteleport-notInside: "The location has to be inside the region."
setteleport-reset: "Teleport location of %region% has been reset."
find-help: "/as find <buy|rent> [maxprice] [group]."
find-noPermission: "You don't have permission to search regions and teleport to them."
find-success: "Found a %0% region: %region%, while searching with a max price of your balance: %1%%2%."
find-successMax: "Found a %0% region: %region%, while searching with a max price of %1%%2%."
find-wrongMaxPrice: "The specified maximum price is not a correct number: %0%."
find-wrongGroup: "The specified group does not exist: %0%."
find-noneFound: "No %0% region found while searching with a max price of your balance: %1%%2%."
find-noneFoundMax: "No %0% region found while searching with a max price of %1%%2%."
find-onlyInGroup: ", only searched for regions in group: %0%."
groupadd-help: "/as groupadd <group> [region], if no region specified all regions from your WorldEdit selection are used."
groupadd-noPermission: "You don't have permission to add regions to groups."
groupadd-noRegion: "The specified region is not registered: %0%."
groupadd-success: "Region %region% has been added to group '%0%', this group now has %1% member(s)."
groupadd-failed: "Region %region% is already a member of group '%0%'."
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 %region% has been removed from group '%0%', this group now has %1% member(s)."
groupdel-failed: "Region %region% is not a member of group '%0%'."
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 %region%."
schemevent-noPermission: "You don't have permission to trigger schematic events."
add-help: "/as add <rent|buy> [region] [world]."
add-noPermission: "You don't have permission to add a region to AreaShop."
add-success: "Added as %0%: &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%' is not known in AreaShop, check if you added it to AreaShop already."
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 %region%."
addsign-noPermission: "You don't have permission to add a sign."
delsign-noSign: "You are not looking at a sign."
delsign-noPermission: "You don't have permission to delete a sign."
delsign-noRegion: "That sign does not belong to an AreaShop region."
delsign-success: "The sign has been removed from region %region%."
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 %region%."
addfriend-success: "%0% has been added as friend to your region %region%."
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 %region%."
delfriend-success: "%0% has been deleted as friend from your region %region%."
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-noRegion: "The specified region is not registered: %0%."
setlandlord-success: "%landlord% has successfully been set as landlord of %region%."
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 https://github.com/NLthijs48/AreaShop/releases."
+1 -59
View File
@@ -1,6 +1,6 @@
# ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
# ║ 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% ║
# ║ Language: Finnish, Version: V2.2.2, Percentage translated: 80% ║
# ║ 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) ║
@@ -66,57 +66,35 @@ rent-help: "/as rent [alueennimi], alue jolla seisot valitaan jos et käytä alu
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."
@@ -171,35 +149,23 @@ info-regionRestrictedWorldBuy: "&2&l►&r Sinun täytyy olla maailmassa '%world%
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."
@@ -218,8 +184,6 @@ 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%."
@@ -229,23 +193,16 @@ teleport-noPermissionSign: "Sinulla ei ole oikeuksia teleportata sinun alueesi k
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%."
@@ -255,16 +212,12 @@ 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%."
@@ -281,7 +234,6 @@ 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]."
@@ -300,20 +252,17 @@ 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."
@@ -357,18 +306,13 @@ stopresell-noPermissionOther: "Sinulla ei ole oikeuksia asettaa alueita takaisin
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."
@@ -409,5 +353,3 @@ 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/."
+7 -59
View File
@@ -1,6 +1,6 @@
# ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
# ║ 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% ║
# ║ Language: French, Version: V2.2.2, Percentage translated: 81% ║
# ║ 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) ║
@@ -10,6 +10,9 @@
# ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
total-maximum: "Vous ne pouvez pas louer ou acheter plus de %0% région(s) au total (vous possédez déjà %1% dans le groupe '%2%')."
general-notReady: "AreaShop n'a pas été encore lancé, merci d'attendre."
general-noEconomy: "Il n'y a pas de plugin d'économie sur votre serveur, ou bien qu'il n'est pas correctement installé. Merci de prévenir l'opérateur du serveur dès que possible."
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."
@@ -66,57 +69,36 @@ rent-help: "/as rent [regionname], Si non spécifiée, cible la région dans laq
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-reloading: "Fichiers rechargés, vérification des locations et des mises à jour des régions."
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."
@@ -171,35 +153,25 @@ info-regionRestrictedWorldBuy: "&2&l►&r Vous devez à l'intérieur du monde '%
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%."
setprice-successRent: "Le prix de la région %region% à changé pour %price% par %duration%."
setprice-successBuy: "Le prix de la région %region% a changé pour %price%"
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."
@@ -218,8 +190,6 @@ setup-blacklisted: "%0% est sur la blacklist et ne peut pas être ajouté à Are
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%."
@@ -229,23 +199,16 @@ teleport-noPermissionSign: "Vous n'avez pas la permission de vous téléporter
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%."
@@ -255,16 +218,12 @@ 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%."
@@ -281,7 +240,6 @@ 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]"
@@ -300,20 +258,17 @@ 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."
@@ -357,18 +312,13 @@ stopresell-noPermissionOther: "Vous n'avez pas la permission de retirer les rég
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."
@@ -408,5 +358,3 @@ 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/."
+79 -57
View File
@@ -1,6 +1,6 @@
# ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
# ║ 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% ║
# ║ Language: Dutch, Version: V2.2.2, Percentage translated: 100% ║
# ║ This file will be overwritten at each startup/reload of the plugin, if you want to change anything then do the following: ║
# ║ 1: Make a copy of this file ║
# ║ 2: Rename it to <servername>.yml (don't use a language code as filename, could otherwise be overwritten in future updates) ║
@@ -10,6 +10,12 @@
# ╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
total-maximum: "Je kunt niet meer dan %0% gebied(en) kopen en huren in totaal (je hebt er al %1% in groep '%2%')."
general-notReady: "AreaShop is not niet volledig geladen, even geduld."
general-noWorld: "Je kunt deze actie niet uitvoeren, het WorldGuard gebied is niet beschikbaar (gebied '%world%')."
general-noRegion: "Je kunt deze actie niet uitvoeren, de wereld van dit gebied is niet beschikbaar (wereld '%region%')."
general-noEconomy: "Er is geen Economy plugin geïnstalleerd of deze is incorrect opgezet, stel de server eigenaar hiervan op de hoogte."
general-cancelled: "%0%"
cmd-notValid: "Dat commando is niet geldig , gebruik '/as help' voor informatie."
cmd-onlyByPlayer: "Dit commando kan alleen door een speler uitgevoert worden."
cmd-weOnlyByPlayer: "Gebruikmaken van een WorldEdit selectie is alleen mogelijk als speler, geef de naam van het gebied mee als extra argument."
@@ -61,62 +67,69 @@ 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."
help-setlandlord: "&6/as setlandlord &7-&r Stel de landeigenaar in van een gebied."
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-maximumExtend: "Je kunt dit gebied niet meer verlengen omdat je meer dan %0% gebied(en) bezit (je hebt er al %1% in groep '%2%')."
rent-payError: "Er is iets mis gegaan met betalen, probeer het later opnieuw."
rent-rented: "Je hebt %0% tot %1% gehuurd."
rent-extended: "Je hebt je huur van %0% verlengt tot %1%."
rent-rented: "Je huurt %region% tot %until%."
rent-extended: "Je hebt je huur van %region% verlengt tot %until%."
rent-extendedToMax: "Je hebt je huur van %region% verlengt tot %until% (dit is de maximale huurtijd van %maxrenttime%)."
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-lowMoneyExtend: "Je hebt niet genoeg geld om het gebied te huren (je hebt %0% van de %price%)."
rent-lowMoneyRent: "Je hebt niet genoeg geld om het gebied te kopen (je hebt %0% van de %price%)."
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-maxExtends: "Je kunt de huur niet meer verlengen (het maximum is %maxextends% 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 %maxrenttime% en je hebt het al voor %timeleft% gehuurt."
rent-restrictedToWorld: "Je moet in de wereld '%world%' zijn om dit gebied te kopen (je ben in '%0%')."
rent-restrictedToRegion: "Je moet in '%region%' staan om hem te huren."
rent-expireWarning: "Je gebied %region% heeft nog %timeleft% over, verleng het als je het wilt houden.."
rent-alreadyAtFull: "%region% is al verhuurd voor de maximale tijd, je kunt hem niet verlengen."
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-noPermissionResell: "Je hebt geen toestemming om een koop gebied in doorverkoop mode te kopen."
buy-noPermissionNoResell: "Je hebt geen toestemming om een koop gebied die niet in doorverkoop mode staat te kopen."
buy-notBuyable: "Gebied %region% is niet beschikbaar om te kopen."
buy-maximum: "Je kunt niet meer dan %0% gebied(en) kopen (je hebt er al %1% in de groep '%2%')."
buy-payError: "Er is iets mis gegaan met betalen, probeer het later opnieuw."
buy-succes: "Je hebt %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-succes: "Je hebt %region% succesvol gekocht."
buy-successResale: "Je hebt %region% succesvol gekocht van %0%."
buy-successSeller: "Je gebied %region% is verkocht aan %player% voor %0%."
buy-lowMoney: "Je hebt niet genoeg geld om het gebied te kopen (je hebt %0% van de %price%)."
buy-lowMoneyResell: "Je hebt niet genoeg geld om het gebied te kopen (je hebt %0% van de %resellprice%)."
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."
buy-restrictedToWorld: "Je moet in de wereld '%world%' zijn om dit gebied te kopen (je ben in '%0%')."
buy-restrictedToRegion: "Je moet in '%region%' 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."
unrent-unrented: "Je bent gestopt met huren van %region%."
unrent-other: "Huren van %region% is gestopt voor %player%."
unrent-expired: "Je huur van %region% is afgelopen."
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-sold: "%region% is verkocht voor %player%."
sell-soldYours: "Je hebt %region% 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-reloading: "Alle bestanden zijn herladen, gebieden aan het checken en updaten."
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-help: "/as info\nall\nrented [groep]\nforrent [groep]\nsold [groep]\nforsale [groep]\nplayer <speler>\nregion <gebied>\nnogroup"
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."
@@ -134,6 +147,7 @@ info-sold: "Verkochte gebieden: %0%."
info-noSold: "Alle gebieden zijn verkocht."
info-forsale: "Gebieden te koop: %0%."
info-noForsale: "Alle gebieden zijn verkocht."
info-noFiltergroup: "Groep '%0%' bestaat niet en kan daardoor niet gebruikt worden om de resultaten te limiteren."
info-playerHelp: "/as info player <naam>."
info-playerRents: "Gebieden gehuurd door %0%: %1%."
info-playerNoRents: "%0% heeft geen gebied gehuurd."
@@ -171,35 +185,33 @@ info-regionRestrictedWorldBuy: "&2&l►&r Je moet in de wereld '%world%' staan o
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-regionLandlord: "&2&l►&r Landeigenaar: &7%landlord% (ontvangt het geld)."
info-regionNotExisting: "Het aangegeven gebied is niet geregistreerd: %0%."
setrestore-help: "/as setrestore <gebied> <true|false|general> [profiel]."
setrestore-noPermission: "Je hebt geen toestemming om de herstel opties te veranderen."
setrestore-notRegistered: "Het aangegeven gebied is niet geregistreerd: %0%."
setrestore-invalidSetting: "'%0%' is geen geldige staat, gebruik true, false of general."
setrestore-success: "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%'."
setrestore-success: "De herstel optie van %region% is succesvol gezet naar '%0%'."
setrestore-successProfile: "Herstel optie van %region% succesvol gezet naar '%0%' en het profiel naar '%1%'."
setprice-noPermission: "Je hebt geen toestemming om de prijs van een gebied te veranderen."
setprice-help: "/as setprice <prijs> [gebied], het gebied waarin je staat zal worden gebruikt als je deze niet aangeeft."
setprice-notRegistered: "Het aangegeven gebied is niet geregistreerd: %0%."
setprice-wrongPrice: "'%0%' is geen geldige prijs."
setprice-successRent: "Prijs van gebied %0% is veranderd naar %1% per %2%."
setprice-successBuy: "De prijs van het gebied %0% is veranderd naar %1%."
setprice-successRent: "Prijs van gebied %region% is veranderd naar %price% per %duration%."
setprice-successBuy: "De prijs van het gebied %region% is veranderd naar %price%."
setprice-successRemoved: "Prijs van %region% is verwijderd, hij zal nu de prijs van de groep of default.yml file gebruiken, nieuwe prijs: %price%."
setprice-noLandlord: "Je hebt geen toestemming om de prijs te veranderen omdat je niet de landeigenaar bent van %region%."
setduration-noPermission: "Je hebt geen toestemming om de duur van het huur gebied aan te passen."
setduration-help: "/as setduration <aantal> <identificator> [gebied], het gebied waarin je staat zal worden gebruikt als je niets aangeeft."
setduration-notRegistered: "%0% is niet geregistreerd voor verhuur."
setduration-wrongAmount: "'%0%' is geen geldig aantal, gebruik een geheel nummer."
setduration-wrongFormat: "'%0%' is geen goed tijdsformaat, bekijk de documentatie op Bukkit."
setduration-success: "Duur van het gebied %0% veranderd naar '%1%'."
setduration-success: "Looptijd van gebeid %region% veranderd naar '%duration%'."
setduration-noLandlord: "Je hebt geen toestemming om de tijdsduur te veranderen omdat je niet de landeigenaar bent van %region%."
setduration-successRemoved: "Tijdsduur van %region% is verwijderd, hij zal nu de tijdsduur van een group of default.yml gebruiken, nieuwe tijdsduur: %duration%."
setup-noRegion: "Je hebt geen gebied aangegeven op de tweede regel."
setup-wrongRegion: "Het aangegeven gebied bestaat niet."
@@ -215,11 +227,12 @@ 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."
setup-noPermission: "Je kunt de region '%0%' niet toevoegen, je bent geen owner/member of hebt geen toestemming."
destroy-noPermissionRent: "Je hebt geen toestemming om huur gebieden te verwijderen."
destroy-noPermissionBuy: "Je hebt geen toestemming om koop gebieden te verwijderen."
destroy-successRent: "%0% succesvol verwijderd als huur gebied."
destroy-successBuy: "%0% succesvol verwijderd als koop gebied."
destroy-successRent: "%region% succesvol verwijderd als huur gebied."
destroy-successBuy: "%region% succesvol verwijderd als koop gebied."
teleport-help: "/as tp <gebied> <aantal> <soort>."
teleport-noRentOrBuy: "Het aangegeven gebied is niet geregistreerd: %0%."
@@ -229,23 +242,25 @@ teleport-noPermissionSign: "Je hebt geen toestemming om naar het bordje van je g
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-success: "Je bent geteleporteerd naar %region%."
teleport-successSign: "Je bent geteleporteerd naar het bordje van %region%."
teleport-noSafe: "Geen veilige plek gevonden in gebied %region%, geen blokken over in het gebied of het maximum aantal pogingen overschreden (%0%%1%)."
teleport-blocked: "Je kunt niet teleporteren omdat de positie buiten het gebied ligt en je geforceerd word erbinnen te teleporteren."
teleport-changedToSign: "Je hebt alleen toestemming om te teleporteren naar het bord en niet binnen de region, teleporteren naar het bord."
teleport-changedToNoSign: "Er is geen bord beschikbaar om naar te teleporteren, proberen om naar het gebied te teleporteren."
setteleport-help: "/as settp [gebied] [reset], het gebied waar je in staat zal worden gebruikt als je deze niet aangeeft."
setteleport-noPermission: "Je hebt geen toestemming om de teleporteer lokatie in te stellen."
setteleport-noPermissionOther: "Je hebt geen toestemming om de teleporteer lokatie in te stellen voor een gebied dat niet van jou is."
setteleport-noRentOrBuy: "Het aangegeven gebied is niet geregistreerd: %0%."
setteleport-success: "Teleporteer lokatie van %0% ingestelt."
setteleport-success: "Teleporteer lokatie van %region% ingestelt."
setteleport-notInside: "De lokatie moet zich binnen het gebied bevinden."
setteleport-reset: "Teleporteer lokatie van %0% is gereset."
setteleport-reset: "Teleporteer lokatie van %region% is gereset."
find-help: "/as find <buy|rent> [maxprijs] [groep]."
find-noPermission: "Je hebt geen toestemming om te zoeken naar gebieden en naar deze te teleporteren."
find-success: "Een %0% gebied is gevonden: %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-success: "Een %0% gebied is gevonden: %region%, bij het zoeken met een maximale prijs gelijk aan je saldo: %1%%2%."
find-successMax: "Een %0% gebied is gevonden: %region%, bij het zoeken met een maximale prijs van %1%%2%."
find-wrongMaxPrice: "De aangegeven maximum prijs is geen correct nummer: %0%."
find-wrongGroup: "De aangegeven groep bestaat niet: %0%."
find-noneFound: "Geen %0% gebied gevonden bij het zoeken met een maximale prijs gelijk aan je saldo: %1%%2%."
@@ -255,16 +270,16 @@ 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-success: "Gebied %region% is toegevoegd aan groep '%0%', deze group heeft nu %1% leden."
groupadd-failed: "Gebied %region% is al toegevoegd aan groep '%0%'."
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-success: "Gebied %region% is verwijderd van groep '%0%', deze groep heeft nu %1% leden."
groupdel-failed: "Gebied %region% is geen lid van groep '%0%'."
groupdel-weSuccess: "Verwijderd van groep %0%: &7%1%."
groupdel-weFailed: "Waren al niet in de groep %0%: &7%1%."
@@ -281,7 +296,7 @@ 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-success: "Event '%0%' succesvol getriggerd voor gebied %region%."
schemevent-noPermission: "Je hebt geen toestemming om events te triggeren."
add-help: "/as add <rent|buy> [gebied] [wereld]."
@@ -292,6 +307,8 @@ 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."
add-noPermissionRegions: "Geen toestemming om toe te voegen: &7%0%."
add-noPermissionOwnerMember: "&7Je bent geen member/owner van het gebied of hebt geen toestemming om je gebieden toe te voegen."
del-noRegion: "Het aangegeven gebied is niet geregistreerd: %0%."
del-noPermission: "Je hebt geen toestemming om gebieden te verwijderen."
@@ -300,20 +317,20 @@ 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-noRegion: "Gebied '%0%' is niet bekent in AreaShop, controleer of het al is toegevoegd aan AreaShop."
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-alreadyRegistered: "Dat bord is al geregistreerd voor gebied %region%."
addsign-noPermission: "Je hebt geen toestemming om een bord toe te voegen."
delsign-noSign: "Je kijkt niet naar een bord."
delsign-noPermission: "Je hebt geen toestemming om een bord te verwijderen."
delsign-noRegion: "Dat bord hoort niet bij een AreaShop gebied."
delsign-success: "Het bord is verwijderd van gebied %0%."
delsign-success: "Het bord is verwijderd van gebied %region%."
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."
@@ -357,8 +374,8 @@ stopresell-noPermissionOther: "Je hebt geen toestemming om een gebied terug te z
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-successOther: "%0% is toegevoegd als vriend bij gebied %region%."
addfriend-success: "%0% is toegevoegd als vriend bij je gebied %region%."
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."
@@ -367,8 +384,8 @@ addfriend-notVisited: "Je kunt %0% niet toevoegen omdat hij de server nog niet h
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-successOther: "%0% is verwijderd als vriend van gebied %region%."
delfriend-success: "%0% is verwijderd als vriend van je gebied %region%."
delfriend-notAdded: "%0% is niet toegevoegd als vriend voor dit gebied."
delfriend-noOwner: "Je kunt geen vrienden verwijderen van een gebied zonder eigenaar."
@@ -395,6 +412,11 @@ 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%."
setlandlord-help: "/as setlandlord <speler> [gebied], het gebied waar je in staat zal worden gebruikt als niet aangegeven."
setlandlord-noPermission: "Je hebt geen toestemming om de landeigenaar in te stellen voor een gebied."
setlandlord-noRegion: "Het aangegeven gebied is niet geregistreerd: %0%."
setlandlord-success: "%landlord% is succesvol ingesteld als landeigenaar voor %region%."
timeleft-years: "%0% jaren"
timeleft-months: "%0% maanden"
timeleft-days: "%0% dagen"
@@ -410,4 +432,4 @@ 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/."
update-playerNotify: "&2Update van AreaShop V%0% naar %1% beschikbaar, download de laatste versie op https://github.com/NLthijs48/AreaShop/releases."
+1 -57
View File
@@ -1,6 +1,6 @@
# ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
# ║ 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% ║
# ║ Language: Polish, Version: V2.2.2, Percentage translated: 70% ║
# ║ 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) ║
@@ -64,55 +64,33 @@ rent-help: "/as rent [nazwa_regionu], jesli nie wpiszesz nazwy uzyje regionu na
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."
@@ -161,31 +139,19 @@ info-regionInactiveSell: "&2&l►&r Autosprzedaz po: &7%inactivetime% nieobecnos
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."
@@ -204,21 +170,14 @@ 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%."
@@ -228,16 +187,12 @@ 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%."
@@ -254,7 +209,6 @@ 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]."
@@ -272,20 +226,17 @@ 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."
@@ -325,18 +276,13 @@ stopresell-noPermissionOther: "Nie masz uprawnien, by zmieniac cudze regiony na
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."
@@ -366,5 +312,3 @@ 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/."
+1 -11
View File
@@ -1,6 +1,6 @@
# ╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
# ║ 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% ║
# ║ Language: Chinese (Taiwan), Version: V2.2.1, Percentage translated: 73% ║
# ║ 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) ║
@@ -70,7 +70,6 @@ rent-lowMoneyRent: "你沒有足夠的錢租賃該土地(你擁有%0%而你還
rent-someoneElse: "其他人已經租賃該土地"
rent-notRentable: "該土地不能租賃"
rent-maxExtends: "你已經無法再延展你的租期了(最大上限次數為%0%次), 然而在租期過後你可以再次租賃該土地"
rent-maxRentTime: "你無法提前租賃該土地,最大上限時間為 %0% 分鐘,而你目前已經租賃該土地 %1% 分鐘"
rent-restrictedToWorld: "你必須要在 '%0%'世界才能租賃該土地(你目前正在 '%1%')"
rent-restrictedToRegion: "你必須要在 '%0%'才能租賃該土地"
rent-expireWarning: "你的土地 %region% 還剩下%timeleft% ,如果你還想保留該土地請延展租期"
@@ -144,13 +143,6 @@ info-regionInactiveSell: "&2&l►&r 玩家閒置而自動出售的時間為: &7
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: "你沒有權限修改重製設定"
@@ -161,8 +153,6 @@ 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], 若你不指定土地名稱,則預設為你所站立的土地"
+13 -4
View File
@@ -1,11 +1,11 @@
name: AreaShop
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/
website: https://github.com/NLthijs48/AreaShop
commands:
AreaShop:
description: 'For all commands use /as help.'
@@ -22,6 +22,8 @@ permissions:
areashop.destroybuy: true
areashop.rent: true
areashop.buy: true
areashop.buyresell: true
areashop.buynormal: true
areashop.unrent: true
areashop.info: true
areashop.reload: true
@@ -53,6 +55,7 @@ permissions:
areashop.notifyupdate: true
areashop.stack: true
areashop.setlandlord: true
areashop.linksigns: true
areashop.landlord.*:
description: Give access to all landlord features
children:
@@ -71,6 +74,12 @@ permissions:
areashop.buy:
description: Allows you to buy a region
default: true
areashop.buyresell:
description: Allows you to buy a region that is in resell mode
default: true
areashop.buynormal:
description: Allows you to buy a region that is not in resell mode
default: true
areashop.unrent:
description: Allows you to unrent a specific region
default: op
@@ -227,10 +236,10 @@ permissions:
areashop.addfriendall:
description: Allows you to add friends to all regions
default: op
areashop.delfriend:
areashop.delfriend:
description: Allows you to delete friends from your regions
default: true
areashop.delfriendall:
areashop.delfriendall:
description: Allows you to delete friends from all regions
default: op
areashop.notifyupdate:
@@ -1,16 +1,15 @@
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;
import org.bukkit.configuration.file.YamlConfiguration;
import java.util.logging.Logger;
public interface AreaShopInterface {
public void debugI(String message);
public YamlConfiguration getConfig();
public WorldGuardPlugin getWorldGuard();
public WorldEditPlugin getWorldEdit();
public Logger getLogger();
void debugI(String message);
YamlConfiguration getConfig();
WorldGuardPlugin getWorldGuard();
WorldEditPlugin getWorldEdit();
Logger getLogger();
}
@@ -1,15 +1,14 @@
package nl.evolutioncoding.areashop.interfaces;
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
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();
ProtectedRegion getRegion();
String getName();
World getWorld();
String getWorldName();
int getWidth();
int getDepth();
int getHeight();
}
+71 -56
View File
@@ -1,70 +1,85 @@
#AreaShop
![AreaShop logo](https://cloud.githubusercontent.com/assets/6951068/9471294/f016d8ee-4b4f-11e5-9bda-d61b1c423ebb.png)<br/>
**Usage and configuration:**
[►Download (releases)](https://github.com/NLthijs48/AreaShop/releases)&nbsp;&nbsp;
[►Commands and Permissions](https://github.com/NLthijs48/AreaShop/wiki/Commands-and-Permissions)
<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
[►Basic regions setup](https://github.com/NLthijs48/AreaShop/wiki/Basic-regions-setup)&nbsp;&nbsp;
[►Advanced regions setup](https://github.com/NLthijs48/AreaShop/wiki/Advanced-regions-setup)&nbsp;&nbsp;
[►Configuration files](https://github.com/NLthijs48/AreaShop/wiki/The-config-system)<br/>
**Advanced features:**
[►Save/restore region blocks](https://github.com/NLthijs48/AreaShop/wiki/Region-blocks-save-restore)&nbsp;&nbsp;
[►Change the language](https://github.com/NLthijs48/AreaShop/wiki/Language-support)&nbsp;&nbsp;
[►Limitgroups](https://github.com/NLthijs48/AreaShop/wiki/Limitgroups-information-and-examples)<br/>
**Troubleshooting:**
[►Frequently Asked Questions](https://github.com/NLthijs48/AreaShop/wiki/Frequently-Asked-Questions)&nbsp;&nbsp;
[►Common errors](https://github.com/NLthijs48/AreaShop/wiki/Common-errors)<br/>
**Support:**
[►Ask question](https://github.com/NLthijs48/AreaShop/issues/new?body=Indicate%20the%20steps%20you%20did%20while%20encountering%20the%20problem,%20the%20expected%20outcome,%20and%20the%20actual%20outcome.%20Provide%20links%20to%20your%20config.yml,%20default.yml%20and%20groups.yml%20files%20(use%20pastebin.com%20or%20similar).%20Also%20provide%20a%20full%20startup%20log%20of%20your%20server%20(this%20indicates%20the%20plugin%20versions%20used).&labels=Support)&nbsp;&nbsp;
[►Request feature](https://github.com/NLthijs48/AreaShop/issues/new?body=Describe%20the%20feature%20with%20as%20much%20detail%20as%20possible:%20command,%20permissions,%20messages%20in%20chat,%20etc.%20Also%20indicate%20for%20which%20situations%20you%20would%20use%20it%20and%20why%20it%20should%20be%20added.&labels=Feature)&nbsp;&nbsp;
[►Planned features](https://github.com/NLthijs48/AreaShop/labels/Feature)&nbsp;&nbsp;
[►Report bug](https://github.com/NLthijs48/AreaShop/issues/new?body=Indicate%20the%20steps%20you%20did%20while%20encountering%20the%20problem,%20the%20expected%20outcome,%20and%20the%20actual%20outcome.%20Provide%20links%20to%20your%20config.yml,%20default.yml%20and%20groups.yml%20files%20(use%20pastebin.com%20or%20similar).%20Also%20provide%20a%20full%20startup%20log%20of%20your%20server%20(this%20indicates%20the%20plugin%20versions%20used).&labels=Bug)&nbsp;&nbsp;
[►Open bugs](https://github.com/NLthijs48/AreaShop/labels/Bug)<br/>
**Development:**
[►Changelog](https://github.com/NLthijs48/AreaShop/wiki/Changelog)&nbsp;&nbsp;
[►Compiling](https://github.com/NLthijs48/AreaShop/wiki/Compiling-AreaShop)&nbsp;&nbsp;
[►Modules, packages and classes overview](https://github.com/NLthijs48/AreaShop/wiki/Modules,-packages-and-classes-overview)<br/>
**Connections:**
[►AreaShop in Spigot Resources](http://www.spigotmc.org/resources/areashop.2991/)&nbsp;&nbsp;
[►AreaShop on BukkitDev](http://dev.bukkit.org/bukkit-plugins/regionbuyandrent/)&nbsp;&nbsp;
[►Dev builds on Jenkins](http://ci.frostcast.net/job/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.
This plugin is for giving players the option to rent or buy a region. It could be used to let them rent a jail in your Prison server or maybe a shop in the market of the Survival server. The player interacts with signs, making it easy to use. It also has a lot of commands to check the status of all regions, manage the renting and buying of a region and also features for admins. Also the plugin is capable of saving the region and restoring it later, this is very flexible and can be set general and per region, check the [config](https://github.com/NLthijs48/AreaShop/wiki/The-config-system) for more information.
# 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).
### All features in a list
* Rent and sell regions to players + Players can resell their bought regions to other players.
* [Signs](https://github.com/NLthijs48/AreaShop/wiki/Basic-regions-setup) for easy interacting and current status.
* Change the [language](https://github.com/NLthijs48/AreaShop/wiki/Language-support) of the plugin or use of of the already provided language files (check [here](https://github.com/NLthijs48/AreaShop/tree/master/AreaShop/src/main/resources/lang) for supported languages, these are already packed with the plugin, just change the language setting in `config.yml`).
* Automatically let the plugin [restore](https://github.com/NLthijs48/AreaShop/wiki/Region-blocks-save-restore) the region with schematics.
* Change which [commands](https://github.com/NLthijs48/AreaShop/wiki/Commands-and-Permissions) players can use with [permissions](https://github.com/NLthijs48/AreaShop/wiki/Commands-and-Permissions).
* Customize the plugin by changing the [config files](https://github.com/NLthijs48/AreaShop/wiki/The-config-system).
* Automatically place the region name on the sign if it is placed inside a region.
* Teleport to rent/buy regions and optionally set the teleport location (teleporting is safe and within the region).
* Adding friends to regions (which also can teleport then).
* Automatic unrent/sell for regions of which the owner is offline for a certain time.
* Warning to players when their rent is about to run out (at login and while they are online).
* [Group system](https://github.com/NLthijs48/AreaShop/wiki/The-config-system) to set options for a couple of regions instead of all of them.
* All heavy tasks are spread over time (each tick a part is executed until done), so the plugin should not cause any lag.
* Rent/buy limits can be different per permission node (player group), world or group of regions (possible situation: Normal players can buy 1 market region in survival + 1 build region in survival and 2 plots in creative, while VIPs have double limits for all those), [check these examples](https://github.com/NLthijs48/AreaShop/wiki/Limitgroups-information-and-examples).
* Supports name changes because of saving player info by UUID, for more details check the FAQ entry: [What happens when a player changes his name?](https://github.com/NLthijs48/AreaShop/wiki/Frequently-Asked-Questions#what-happens-when-a-player-changes-his-name).
#### 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.
You need to have WorldEdit, WorldGuard and Vault installed on your server, WorldGuard is used for creating and managing regions, WorldEdit for the saving and restoring the blocks in regions and Vault is used to let players pay for the regions.
#### 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.
### Preview
For a preview join 'mc.go-craft.com' and go to the Survival server, the shops around the spawn use AreaShop.
#### 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)
### Tutorial & Feature overview (AreaShop V2.0.1)
**Made by [Koz4Christ](https://www.youtube.com/user/koz4christ)**<br/>
[![Tutorial Video](https://cloud.githubusercontent.com/assets/6951068/9532789/152c33f8-4d0e-11e5-8d1c-9e80c19ceab8.png)](https://www.youtube.com/watch?v=328WrStVkzs)
#### 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.
### Prison cell setup tutorial (AreaShop V2.1.0)
**Made by [PerkulatorTime](https://www.youtube.com/user/PerkulatorTime)**<br/>
[![Tutorial Video](https://cloud.githubusercontent.com/assets/6951068/9532788/147526cc-4d0e-11e5-9672-1274faae280a.png)](https://www.youtube.com/watch?v=OQOsOG-EdNc)
#### 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/).
Old video for AreaShop v1.0: [Tutorial by VariationVault](https://www.youtube.com/watch?v=k2HMCxCCOYo)
# 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.
### Required dependencies
* Java 7 or higher (latest recommended)
* Bukkit/Spigot 1.7.9 or higher (modded servers often include Bukkit/Spigot support, so it should also work on that, but it is not specifically tested for it)
* [WorldGuard](http://dev.bukkit.org/bukkit-plugins/worldguard/): 5.9 or higher (6.0+ recommended)
* [WorldEdit](http://dev.bukkit.org/bukkit-plugins/worldedit/): 5.6.3 or higher (6.0+ recommended)
* [Vault](http://dev.bukkit.org/bukkit-plugins/vault/): 1.4.1 or higher
* An economy plugin supported by Vault (check the [Vault page](http://dev.bukkit.org/bukkit-plugins/vault/) for a list of these)
#### Description of packages and classes
The following packages and classes can be found inside the AreaShop plugin:
### Metrics
This plugin utilizes Hidendra's plugin metrics system, which means that the following information is collected and sent to mcstats.org:
**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.
*A unique identifier, the server's version of Java, whether the server is in offline or online mode, the plugin's version, the server's version, the OS version/name and architecture, the core count for the CPU, the number of players online, the Metrics version.*
**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).
This information will give me an indication how much the plugin is used and encourages me to continue development. Opting out of this service can be done by setting `sendStats` in the config of this plugin to `false`, if you want to disable Metrics for any plugin go to `plugins/Plugin Metrics/config.yml` and change `opt-out` to `true`. Check graphs of the statistics at this page: [mcstats.org/plugin/AreaShop](http://mcstats.org/plugin/AreaShop)
**nl.evolutioncoding.areashop.exceptions** (exceptions):
- **RegionCreateException.java**: An exception that is thrown if a region cannot be successfully created (nonexisten world or WorldGuard region).
### Do you want to translate AreaShop?
Help translating the plugin into different languages and to keep the translations up to date. Go to [this page](https://github.com/NLthijs48/AreaShop/wiki/Language-support#translating-on-transifex) for more information. Translating goes through the [Transifex](https://www.transifex.com/projects/p/areashop/) website and is very easy, sending files back and forth is not needed, you can translate lines online and whenever you want. Every line you translate will be saved, no need to do it all at once (this also allows for easy collaboration).
**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.
- -
[![Donate through PayPal to support development](https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?return=http%3A%2F%2Fdev.bukkit.org%2Fbukkit-plugins%2Fregionbuyandrent%2F&cn=Add+special+instructions+to+the+addon+author%28s%29&business=nlthijs48%40gmail.com&bn=PP-DonationsBF%3Abtn_donateCC_LG.gif%3ANonHosted&cancel_return=http%3A%2F%2Fdev.bukkit.org%2Fbukkit-plugins%2Fregionbuyandrent%2F&lc=US&item_name=AreaShop+%28from+Bukkit.org%29&cmd=_donations&rm=1&no_shipping=1&currency_code=USD)
@@ -34,7 +34,7 @@ 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);
}
@@ -43,7 +43,7 @@ public class WorldEditHandler6 extends WorldEditInterface {
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()));
world = LocalWorldAdapter.adapt(new BukkitWorld(regionInterface.getWorld()));
}
if(world == null) {
pluginInterface.getLogger().info("Did not restore region " + regionInterface.getName() + ", world not found: " + regionInterface.getWorldName());
@@ -57,52 +57,51 @@ public class WorldEditHandler6 extends WorldEditInterface {
// 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()
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());
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) {
}
}
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()));
world = LocalWorldAdapter.adapt(new BukkitWorld(regionInterface.getWorld()));
}
if(world == null) {
pluginInterface.getLogger().warning("Did not save region " + regionInterface.getName() + ", world not found: " + regionInterface.getWorldName());
@@ -112,32 +111,32 @@ public class WorldEditHandler6 extends WorldEditInterface {
// 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 {
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());
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());
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.getLogger().warning("An error occured while saving 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) {
}
}
try {
closer.close();
} catch (IOException ignored) {
}
}
return true;
}
}
}
@@ -1,19 +1,17 @@
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;
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 java.util.HashSet;
import java.util.Set;
import java.util.UUID;
public class WorldGuardHandler5 extends WorldGuardInterface {
@@ -35,7 +33,7 @@ public class WorldGuardHandler5 extends WorldGuardInterface {
}
} else if(owner.startsWith("n:")) {
if(owner.length() > 2) {
owners.addPlayer(owner);
owners.addPlayer(owner.substring(2));
}
} else {
UUID uuid;
@@ -72,7 +70,7 @@ public class WorldGuardHandler5 extends WorldGuardInterface {
}
} else if(member.startsWith("n:")) {
if(member.length() > 2) {
members.addPlayer(member);
members.addPlayer(member.substring(2));
}
} else {
UUID uuid;
@@ -111,11 +109,7 @@ public class WorldGuardHandler5 extends WorldGuardInterface {
return false;
} else {
String name = Bukkit.getOfflinePlayer(player).getName();
if(name != null) {
return region.getMembers().contains(name);
} else {
return false;
}
return name != null && region.getMembers().contains(name);
}
}
@@ -125,11 +119,7 @@ public class WorldGuardHandler5 extends WorldGuardInterface {
return false;
} else {
String name = Bukkit.getOfflinePlayer(player).getName();
if(name != null) {
return region.getOwners().contains(name);
} else {
return false;
}
return name != null && region.getOwners().contains(name);
}
}
@@ -1,17 +1,15 @@
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;
import nl.evolutioncoding.areashop.interfaces.AreaShopInterface;
import nl.evolutioncoding.areashop.interfaces.WorldGuardInterface;
import org.bukkit.Location;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
public class WorldGuardHandler6 extends WorldGuardInterface {
@@ -33,7 +31,7 @@ public class WorldGuardHandler6 extends WorldGuardInterface {
}
} else if(owner.startsWith("n:")) {
if(owner.length() > 2) {
owners.addPlayer(owner);
owners.addPlayer(owner.substring(2));
}
} else {
UUID uuid;
@@ -68,7 +66,7 @@ public class WorldGuardHandler6 extends WorldGuardInterface {
}
} else if(member.startsWith("n:")) {
if(member.length() > 2) {
members.addPlayer(member);
members.addPlayer(member.substring(2));
}
} else {
UUID uuid;
BIN
View File
Binary file not shown.