From 89318a36581498c1754de6761b5cc59e11ba7f1b Mon Sep 17 00:00:00 2001 From: Jascha Starke Date: Wed, 20 Mar 2013 21:33:52 +0100 Subject: [PATCH] Going for 1.5 Fixed missing strings Fixed region interact --- pom.xml | 8 ++++---- .../minecraft/limitedcreative/FeatureMetrics.java | 4 +++- .../cmdblocker/CmdBlockerConfig.java | 7 +++++++ .../limitedcreative/regions/BlockListener.java | 14 +++++++------- .../limitedcreative/regions/Listener.java | 9 +++++---- .../limitedcreative/regions/PlayerListener.java | 6 +++--- .../limitedcreative/regions/RegionConfig.java | 2 ++ src/main/resources/lang/messages.properties | 2 ++ 8 files changed, 33 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index 79fd30f..12df94f 100644 --- a/pom.xml +++ b/pom.xml @@ -77,26 +77,26 @@ org.bukkit bukkit - 1.4.7-R1.0 + 1.4.7-R0.1-SNAPSHOT com.sk89q worldedit - 5.4.5 + 5.5.4 compile com.sk89q worldguard - 5.6.6-SNAPSHOT + 5.7.3 uk.org.whoami authme - 2.7.7 + 2.7.12 diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/FeatureMetrics.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/FeatureMetrics.java index 14e0a8c..649583b 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/FeatureMetrics.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/FeatureMetrics.java @@ -1,5 +1,7 @@ package de.jaschastarke.minecraft.limitedcreative; +import java.io.IOException; + import org.bukkit.event.Listener; import de.jaschastarke.bukkit.lib.CoreModule; @@ -33,7 +35,7 @@ public class FeatureMetrics extends CoreModule implements Liste metric.unregister(); } - public void track(String event) { + public void track(String event) throws IOException { if (metric == null) throw new IllegalAccessError("The feature hasn't been enabled"); metric.trackEvent(event); diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/cmdblocker/CmdBlockerConfig.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/cmdblocker/CmdBlockerConfig.java index 3e5bbdb..2af84df 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/cmdblocker/CmdBlockerConfig.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/cmdblocker/CmdBlockerConfig.java @@ -5,10 +5,17 @@ import de.jaschastarke.configuration.IConfigurationNode; import de.jaschastarke.configuration.IConfigurationSubGroup; import de.jaschastarke.configuration.InvalidValueException; import de.jaschastarke.configuration.annotations.IsConfigurationNode; +import de.jaschastarke.maven.ArchiveDocComments; import de.jaschastarke.minecraft.limitedcreative.ModCmdBlocker; import de.jaschastarke.modularize.IModule; import de.jaschastarke.modularize.ModuleEntry; +/** + * CommandBlocker-Feature + * + * http://dev.bukkit.org/server-mods/limited-creative/pages/features/command-blocker/ + */ +@ArchiveDocComments public class CmdBlockerConfig extends Configuration implements IConfigurationSubGroup { protected ModCmdBlocker mod; protected ModuleEntry entry; diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/regions/BlockListener.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/regions/BlockListener.java index 534ca7d..3baa30b 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/regions/BlockListener.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/regions/BlockListener.java @@ -38,26 +38,26 @@ public class BlockListener extends Listener { } private void whenBlockBreak(Cancellable event, Block block, Player player) { - boolean diffrent_region = rm.isDiffrentRegion(player, block.getLocation()); + boolean diffrent_region = getRM().isDiffrentRegion(player, block.getLocation()); PlayerMeta pdata = new PlayerMeta(player); if (pdata.isActiveRegionGameMode() && diffrent_region) { // do not break outside of "gamemod-change-region" when in the region - if (rm.getRegionSet(block).getFlag(Flags.GAMEMODE, player) != pdata.getActiveRegionGameMode()) { + if (getRM().getRegionSet(block).getFlag(Flags.GAMEMODE, player) != pdata.getActiveRegionGameMode()) { player.sendMessage(L("blocked.outside_break")); event.setCancelled(true); } } else if (diffrent_region) { // do not break inside of "survial-region in creative world" when outside - if (rm.getRegionSet(block).getFlag(Flags.GAMEMODE) != null) { + if (getRM().getRegionSet(block).getFlag(Flags.GAMEMODE) != null) { player.sendMessage(L("blocked.inside_break")); event.setCancelled(true); } } if (!event.isCancelled()) { // prevent any drops for survival players in creative regions - if (player.getGameMode() != GameMode.CREATIVE && rm.getRegionSet(block).getFlag(Flags.GAMEMODE) == GameMode.CREATIVE) { + if (player.getGameMode() != GameMode.CREATIVE && getRM().getRegionSet(block).getFlag(Flags.GAMEMODE) == GameMode.CREATIVE) { mod.getBlockSpawn().block(block, player); } } @@ -69,17 +69,17 @@ public class BlockListener extends Listener { return; PlayerMeta pdata = new PlayerMeta(event.getPlayer()); - boolean diffrent_region = rm.isDiffrentRegion(event.getPlayer(), event.getBlock().getLocation()); + boolean diffrent_region = getRM().isDiffrentRegion(event.getPlayer(), event.getBlock().getLocation()); if (pdata.isActiveRegionGameMode() && diffrent_region) { // do not build outside of "gamemod-change-region" when in the region - if (rm.getRegionSet(event.getBlock()).getFlag(Flags.GAMEMODE, event.getPlayer()) != pdata.getActiveRegionGameMode()) { + if (getRM().getRegionSet(event.getBlock()).getFlag(Flags.GAMEMODE, event.getPlayer()) != pdata.getActiveRegionGameMode()) { event.getPlayer().sendMessage(L("blocked.outside_place")); event.setCancelled(true); } } else if (diffrent_region) { // do not build inside of "survial-region in creative world" when outside - if (rm.getRegionSet(event.getBlock()).getFlag(Flags.GAMEMODE) != null) { + if (getRM().getRegionSet(event.getBlock()).getFlag(Flags.GAMEMODE) != null) { event.getPlayer().sendMessage(L("blocked.inside_place")); event.setCancelled(true); } diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/regions/Listener.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/regions/Listener.java index ca597b3..e253876 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/regions/Listener.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/regions/Listener.java @@ -13,11 +13,9 @@ import de.jaschastarke.minecraft.limitedcreative.regions.worldguard.CustomRegion abstract public class Listener implements org.bukkit.event.Listener { protected ModRegions mod; - protected CustomRegionManager rm; public Listener(ModRegions mod) { this.mod = mod; - rm = mod.getRegionManager(); } /** @@ -31,10 +29,13 @@ abstract public class Listener implements org.bukkit.event.Listener { } protected ApplicableRegions regionSet(Location loc) { - return rm.getRegionSet(loc); + return getRM().getRegionSet(loc); } protected ApplicableRegions regionSet(Block block) { - return rm.getRegionSet(block); + return getRM().getRegionSet(block); + } + protected CustomRegionManager getRM() { + return mod.getRegionManager(); } class PlayerMeta { diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/regions/PlayerListener.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/regions/PlayerListener.java index a4b9b14..c494944 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/regions/PlayerListener.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/regions/PlayerListener.java @@ -39,17 +39,17 @@ public class PlayerListener extends Listener { block.getType() == Material.WORKBENCH || block.getType() == Material.ANVIL) { PlayerMeta pmeta = new PlayerMeta(event.getPlayer()); - boolean diffrent_region = rm.isDiffrentRegion(event.getPlayer(), block.getLocation()); + boolean diffrent_region = getRM().isDiffrentRegion(event.getPlayer(), block.getLocation()); if (pmeta.isActiveRegionGameMode() && diffrent_region) { // do not break outside of "gamemod-change-region" when in the region - if (rm.getRegionSet(block).getFlag(Flags.GAMEMODE, event.getPlayer()) != pmeta.getActiveRegionGameMode()) { + if (getRM().getRegionSet(block).getFlag(Flags.GAMEMODE, event.getPlayer()) != pmeta.getActiveRegionGameMode()) { event.getPlayer().sendMessage(L("blocked.outside_interact")); event.setCancelled(true); } } else if (diffrent_region) { // do not break inside of "survial-region in creative world" when outside - if (rm.getRegionSet(block).getFlag(Flags.GAMEMODE) != null) { + if (getRM().getRegionSet(block).getFlag(Flags.GAMEMODE) != null) { event.getPlayer().sendMessage(L("blocked.inside_interact")); event.setCancelled(true); } diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/regions/RegionConfig.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/regions/RegionConfig.java index 6ae02dc..8b8ea53 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/regions/RegionConfig.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/regions/RegionConfig.java @@ -7,6 +7,7 @@ import de.jaschastarke.configuration.IConfigurationNode; import de.jaschastarke.configuration.IConfigurationSubGroup; import de.jaschastarke.configuration.InvalidValueException; import de.jaschastarke.configuration.annotations.IsConfigurationNode; +import de.jaschastarke.maven.ArchiveDocComments; import de.jaschastarke.minecraft.limitedcreative.ModRegions; import de.jaschastarke.minecraft.limitedcreative.limits.BlackList; import de.jaschastarke.modularize.IModule; @@ -17,6 +18,7 @@ import de.jaschastarke.modularize.ModuleEntry; * * http://dev.bukkit.org/server-mods/limited-creative/pages/features/region/ */ +@ArchiveDocComments public class RegionConfig extends Configuration implements IConfigurationSubGroup { protected ModRegions mod; protected ModuleEntry entry; diff --git a/src/main/resources/lang/messages.properties b/src/main/resources/lang/messages.properties index 40b931b..c475f8e 100644 --- a/src/main/resources/lang/messages.properties +++ b/src/main/resources/lang/messages.properties @@ -30,8 +30,10 @@ blocked.chest: Access to chests is not allowed in creative mode blocked.survival_flying: You should stay on ground, when leaving a creative-area blocked.outside_place: You can not place blocks outside of the gamemode-area blocked.outside_break: You can not destroy blocks outside of the gamemode-area +blocked.outside_interact: You can not interact with those blocks outside of the gamemode-area blocked.inside_place: You can not place blocks inside of the gamemode-area blocked.inside_break: You can not destroy blocks inside of the gamemode-area +blocked.inside_interact: You can not interact with those blocks inside of the gamemode-area blocked.interact: You are not allowed to interact with this type of blocks blocked.use: You are not allowed to use this type of item blocked.place: You are not allowed to place this type of block