From 139bfc7d54c945645b134327aa66e6d9b63f8e5b Mon Sep 17 00:00:00 2001 From: Paul Schulze Date: Sun, 30 Sep 2012 12:41:02 +0200 Subject: [PATCH] mavenization gitignore added maven target/ and intellij project stuff simplified a return statement in PluginPlayerListener added TODO in LocationSerializer (creating a world should not be done there) --- .gitignore | 7 ++++ pom.xml | 42 +++++++++++++++++++ .../listeners/PluginPlayerListener.java | 12 +----- .../ancientgates/util/LocationSerializer.java | 5 ++- src/{ => resources}/plugin.yml | 6 +-- 5 files changed, 57 insertions(+), 15 deletions(-) create mode 100644 pom.xml rename src/{ => resources}/plugin.yml (87%) diff --git a/.gitignore b/.gitignore index c7ff59a..ca4b531 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,13 @@ # netbeans /nbproject +# intelliJ +.idea/ +*.iml + +# maven +target/ + # vim .*.sw[a-p] diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..0a64890 --- /dev/null +++ b/pom.xml @@ -0,0 +1,42 @@ + + + 4.0.0 + de.craftinc + AncientGates + jar + 1.1.1 + + + UTF-8 + + + + + org.bukkit + bukkit + RELEASE + jar + compile + + + + + target + target/classes + ${project.artifactId} + src + + + src/resources + + + + + + + bukkit-repo + http://repo.bukkit.org/content/groups/public + + + diff --git a/src/org/mcteam/ancientgates/listeners/PluginPlayerListener.java b/src/org/mcteam/ancientgates/listeners/PluginPlayerListener.java index e9975f9..fec7985 100644 --- a/src/org/mcteam/ancientgates/listeners/PluginPlayerListener.java +++ b/src/org/mcteam/ancientgates/listeners/PluginPlayerListener.java @@ -72,14 +72,6 @@ public class PluginPlayerListener extends BaseLocationListener implements Listen protected boolean hasPermission(Player player) { - if (player.hasPermission(Plugin.permissionUse)) { - return true; - } - - if (player.hasPermission(Plugin.permissionAll)) { - return true; - } - - return false; - } + return player.hasPermission(Plugin.permissionUse) || player.hasPermission(Plugin.permissionAll); + } } diff --git a/src/org/mcteam/ancientgates/util/LocationSerializer.java b/src/org/mcteam/ancientgates/util/LocationSerializer.java index 85447d1..bd533ef 100644 --- a/src/org/mcteam/ancientgates/util/LocationSerializer.java +++ b/src/org/mcteam/ancientgates/util/LocationSerializer.java @@ -24,7 +24,10 @@ public class LocationSerializer protected static World getWorld(String name) { World world = Plugin.instance.getServer().getWorld(name); - + + // TODO: Creating a world silently in the background is not a good thing I think. No one expects a Gate + // Plugin to do that. It would be better to handle gates which point to non-existing worlds safely (not + // teleporting at all) if (world == null) { world = Plugin.instance.getServer().createWorld(new WorldCreator(name).environment(Environment.NORMAL)); } diff --git a/src/plugin.yml b/src/resources/plugin.yml similarity index 87% rename from src/plugin.yml rename to src/resources/plugin.yml index af69b33..4aef5a3 100644 --- a/src/plugin.yml +++ b/src/resources/plugin.yml @@ -3,7 +3,7 @@ version: 1.1.1 description: A plugin to create gates for fast traveling. author: tomco authors: [oloflarsson, locutus, DrAgonmoray, s1m0ne, tomco] -website: http://www.craftinc.de/blog/?p=255 +website: http://www.craftinc.de/ancient-gates/ main: org.mcteam.ancientgates.Plugin database: false @@ -25,6 +25,4 @@ permissions: ancientgates.use: description: Allows you to use open gates. acientgates.manage: - description: Gives access to commands manipulating gates. - - + description: Gives access to commands manipulating gates. \ No newline at end of file