From 49b528e3522114334ab86038a0b7ea6d9a03625d Mon Sep 17 00:00:00 2001 From: Jascha Starke Date: Wed, 25 Sep 2013 23:52:43 +0200 Subject: [PATCH] Annotation instead of pom registration, with Configuration-Default generation --- pom.xml | 14 -------------- .../minecraft/limitedcreative/Config.java | 9 +++++++-- .../minecraft/limitedcreative/MainCommand.java | 2 ++ .../minecraft/limitedcreative/Permissions.java | 2 ++ .../limitedcreative/SwitchGameModePermissions.java | 2 ++ .../blockstate/BlockStateCommand.java | 2 ++ .../blockstate/BlockStateConfig.java | 11 +++++++++-- .../blockstate/BlockStatePermissions.java | 3 ++- .../cmdblocker/CmdBlockPermissions.java | 2 ++ .../cmdblocker/CmdBlockerConfig.java | 9 ++++++++- .../limitedcreative/gmperm/GMPermConfig.java | 9 ++++++++- .../limitedcreative/inventories/ArmoryConfig.java | 9 ++++++++- .../inventories/InventoryConfig.java | 7 +++++++ .../inventories/InventoryPermissions.java | 2 ++ .../limitedcreative/limits/LimitConfig.java | 9 ++++++++- .../limitedcreative/limits/NoLimitPermissions.java | 3 ++- .../limitedcreative/regions/RegionConfig.java | 9 ++++++++- .../limitedcreative/regions/RegionPermissions.java | 2 ++ .../limitedcreative/regions/RegionsCommand.java | 2 ++ 19 files changed, 83 insertions(+), 25 deletions(-) diff --git a/pom.xml b/pom.xml index a47cf0d..a09a2dc 100644 --- a/pom.xml +++ b/pom.xml @@ -158,20 +158,6 @@ http://dev.bukkit.org/server-mods/limited-creative/ - - de.jaschastarke.minecraft.limitedcreative.Permissions:CONTAINER - de.jaschastarke.minecraft.limitedcreative.SwitchGameModePermissions:ALL - de.jaschastarke.minecraft.limitedcreative.inventories.InventoryPermissions - de.jaschastarke.minecraft.limitedcreative.limits.NoLimitPermissions:PARENT - de.jaschastarke.minecraft.limitedcreative.cmdblocker.CmdBlockPermissions:CONTAINER - de.jaschastarke.minecraft.limitedcreative.regions.RegionPermissions:REGION - de.jaschastarke.minecraft.limitedcreative.blockstate.BlockStatePermissions:PARENT - - - de.jaschastarke.minecraft.limitedcreative.MainCommand - de.jaschastarke.minecraft.limitedcreative.regions.RegionsCommand - de.jaschastarke.minecraft.limitedcreative.blockstate.BlockStateCommand - diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/Config.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/Config.java index d0b36ad..d62e9ab 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/Config.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/Config.java @@ -3,11 +3,13 @@ package de.jaschastarke.minecraft.limitedcreative; import org.bukkit.configuration.ConfigurationSection; import de.jaschastarke.bukkit.lib.Core; +import de.jaschastarke.bukkit.lib.configuration.ConfigurationContainer; import de.jaschastarke.bukkit.lib.configuration.PluginConfiguration; import de.jaschastarke.configuration.IConfigurationNode; import de.jaschastarke.configuration.InvalidValueException; import de.jaschastarke.configuration.annotations.IsConfigurationNode; import de.jaschastarke.maven.ArchiveDocComments; +import de.jaschastarke.maven.PluginConfigurations; import de.jaschastarke.modularize.IModule; import de.jaschastarke.modularize.ModuleEntry; import de.jaschastarke.modularize.ModuleEntry.ModuleState; @@ -21,7 +23,11 @@ import de.jaschastarke.modularize.ModuleEntry.ModuleState; * removed. */ @ArchiveDocComments +@PluginConfigurations public class Config extends PluginConfiguration { + public Config(ConfigurationContainer container) { + super(container); + } public Config(Core plugin) { super(plugin); } @@ -30,9 +36,8 @@ public class Config extends PluginConfiguration { public void setValues(ConfigurationSection sect) { super.setValues(sect); - if (plugin.getModules().size() > 0) { + if (plugin.getModules().size() > 0) setModuleStates(); - } } public void setModuleStates() { diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/MainCommand.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/MainCommand.java index 43347d7..f52571e 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/MainCommand.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/MainCommand.java @@ -9,6 +9,7 @@ import de.jaschastarke.bukkit.lib.commands.annotations.Description; import de.jaschastarke.bukkit.lib.commands.annotations.IsCommand; import de.jaschastarke.bukkit.lib.commands.annotations.NeedsPermission; import de.jaschastarke.maven.ArchiveDocComments; +import de.jaschastarke.maven.PluginCommand; import de.jaschastarke.minecraft.lib.permissions.IAbstractPermission; import de.jaschastarke.minecraft.lib.permissions.IPermission; @@ -18,6 +19,7 @@ import de.jaschastarke.minecraft.lib.permissions.IPermission; * @permission limitedcreative.command */ @ArchiveDocComments +@PluginCommand public class MainCommand extends BukkitCommand implements IHelpDescribed, IMethodCommandContainer { private LimitedCreative plugin; diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/Permissions.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/Permissions.java index 3753a07..674b8d4 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/Permissions.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/Permissions.java @@ -20,6 +20,7 @@ package de.jaschastarke.minecraft.limitedcreative; import org.bukkit.permissions.PermissionDefault; import de.jaschastarke.maven.ArchiveDocComments; +import de.jaschastarke.maven.PluginPermissions; import de.jaschastarke.minecraft.lib.permissions.BasicPermission; import de.jaschastarke.minecraft.lib.permissions.IPermission; import de.jaschastarke.minecraft.lib.permissions.SimplePermissionContainerNode; @@ -30,6 +31,7 @@ public class Permissions extends SimplePermissionContainerNode { super(name); } + @PluginPermissions public final static Permissions CONTAINER = new Permissions("limitedcreative"); /** diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/SwitchGameModePermissions.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/SwitchGameModePermissions.java index 935c157..015e15a 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/SwitchGameModePermissions.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/SwitchGameModePermissions.java @@ -3,6 +3,7 @@ package de.jaschastarke.minecraft.limitedcreative; import org.bukkit.permissions.PermissionDefault; import de.jaschastarke.maven.ArchiveDocComments; +import de.jaschastarke.maven.PluginPermissions; import de.jaschastarke.minecraft.lib.permissions.BasicPermission; import de.jaschastarke.minecraft.lib.permissions.IAbstractPermission; import de.jaschastarke.minecraft.lib.permissions.IsChildPermission; @@ -13,6 +14,7 @@ public class SwitchGameModePermissions extends ParentPermissionContainerNode { /** * Allows switching of own game mode to creative/adventure and back */ + @PluginPermissions public final static SwitchGameModePermissions ALL = new SwitchGameModePermissions(Permissions.CONTAINER, "switch_gamemode"); protected SwitchGameModePermissions(IAbstractPermission parent, String name) { diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/blockstate/BlockStateCommand.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/blockstate/BlockStateCommand.java index 7a2bd5a..21b3be4 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/blockstate/BlockStateCommand.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/blockstate/BlockStateCommand.java @@ -21,6 +21,7 @@ import de.jaschastarke.bukkit.lib.commands.MissingPermissionCommandException; import de.jaschastarke.bukkit.lib.commands.annotations.IsCommand; import de.jaschastarke.bukkit.lib.commands.annotations.Usages; import de.jaschastarke.maven.ArchiveDocComments; +import de.jaschastarke.maven.PluginCommand; import de.jaschastarke.minecraft.lib.permissions.IAbstractPermission; import de.jaschastarke.minecraft.limitedcreative.ModBlockStates; import de.jaschastarke.minecraft.limitedcreative.blockstate.BlockState.Source; @@ -33,6 +34,7 @@ import de.jaschastarke.minecraft.limitedcreative.blockstate.DBModel.DBTransactio * @permission limitedcreative.blockstate.command */ @ArchiveDocComments +@PluginCommand public class BlockStateCommand extends BukkitCommand implements IHelpDescribed { private ModBlockStates mod; private HelpCommand help; diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/blockstate/BlockStateConfig.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/blockstate/BlockStateConfig.java index bf78547..b89f0a9 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/blockstate/BlockStateConfig.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/blockstate/BlockStateConfig.java @@ -4,12 +4,15 @@ import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; import de.jaschastarke.bukkit.lib.configuration.Configuration; +import de.jaschastarke.bukkit.lib.configuration.ConfigurationContainer; import de.jaschastarke.bukkit.lib.configuration.StringList; 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.maven.PluginConfigurations; +import de.jaschastarke.minecraft.limitedcreative.Config; import de.jaschastarke.minecraft.limitedcreative.ModBlockStates; import de.jaschastarke.modularize.IModule; import de.jaschastarke.modularize.ModuleEntry; @@ -21,12 +24,16 @@ import de.jaschastarke.modularize.ModuleEntry.ModuleState; * http://dev.bukkit.org/server-mods/limited-creative/pages/features/blockstate/ */ @ArchiveDocComments +@PluginConfigurations(parent = Config.class) public class BlockStateConfig extends Configuration implements IConfigurationSubGroup { protected ModBlockStates mod; protected ModuleEntry entry; - + + public BlockStateConfig(ConfigurationContainer container) { + super(container); + } public BlockStateConfig(ModBlockStates mod, ModuleEntry modEntry) { - super(mod.getPlugin()); + super(mod.getPlugin().getDocCommentStorage()); this.mod = mod; entry = modEntry; } diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/blockstate/BlockStatePermissions.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/blockstate/BlockStatePermissions.java index 51d394d..e4d66d7 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/blockstate/BlockStatePermissions.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/blockstate/BlockStatePermissions.java @@ -20,6 +20,7 @@ package de.jaschastarke.minecraft.limitedcreative.blockstate; import org.bukkit.permissions.PermissionDefault; import de.jaschastarke.maven.ArchiveDocComments; +import de.jaschastarke.maven.PluginPermissions; import de.jaschastarke.minecraft.lib.permissions.BasicPermission; import de.jaschastarke.minecraft.lib.permissions.IAbstractPermission; import de.jaschastarke.minecraft.lib.permissions.IPermission; @@ -33,7 +34,7 @@ public class BlockStatePermissions extends SimplePermissionContainerNode { super(parent, name); } - + @PluginPermissions public static final IPermissionContainer PARENT = new BlockStatePermissions(Permissions.CONTAINER, "blockstate"); /** diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/cmdblocker/CmdBlockPermissions.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/cmdblocker/CmdBlockPermissions.java index b59f5ca..ffcc3c6 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/cmdblocker/CmdBlockPermissions.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/cmdblocker/CmdBlockPermissions.java @@ -5,6 +5,7 @@ import java.util.Collection; import org.bukkit.permissions.PermissionDefault; import de.jaschastarke.maven.ArchiveDocComments; +import de.jaschastarke.maven.PluginPermissions; import de.jaschastarke.minecraft.lib.permissions.BasicPermission; import de.jaschastarke.minecraft.lib.permissions.DynamicPermission; import de.jaschastarke.minecraft.lib.permissions.IAbstractPermission; @@ -19,6 +20,7 @@ public class CmdBlockPermissions extends SimplePermissionContainerNode { super(parent, name); } + @PluginPermissions public static final SimplePermissionContainerNode CONTAINER = new CmdBlockPermissions(Permissions.CONTAINER, "cmdblock"); /** 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 c3c95b0..4c98810 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/cmdblocker/CmdBlockerConfig.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/cmdblocker/CmdBlockerConfig.java @@ -3,11 +3,14 @@ package de.jaschastarke.minecraft.limitedcreative.cmdblocker; import org.bukkit.configuration.ConfigurationSection; import de.jaschastarke.bukkit.lib.configuration.Configuration; +import de.jaschastarke.bukkit.lib.configuration.ConfigurationContainer; 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.maven.PluginConfigurations; +import de.jaschastarke.minecraft.limitedcreative.Config; import de.jaschastarke.minecraft.limitedcreative.ModCmdBlocker; import de.jaschastarke.modularize.IModule; import de.jaschastarke.modularize.ModuleEntry; @@ -19,12 +22,16 @@ import de.jaschastarke.modularize.ModuleEntry.ModuleState; * http://dev.bukkit.org/server-mods/limited-creative/pages/features/command-blocker/ */ @ArchiveDocComments +@PluginConfigurations(parent = Config.class) public class CmdBlockerConfig extends Configuration implements IConfigurationSubGroup { protected ModCmdBlocker mod; protected ModuleEntry entry; + public CmdBlockerConfig(ConfigurationContainer container) { + super(container); + } public CmdBlockerConfig(ModCmdBlocker modCmdBlocker, ModuleEntry modEntry) { - super(modCmdBlocker.getPlugin()); + super(modCmdBlocker.getPlugin().getDocCommentStorage()); mod = modCmdBlocker; entry = modEntry; } diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/gmperm/GMPermConfig.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/gmperm/GMPermConfig.java index 227f8bc..1637818 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/gmperm/GMPermConfig.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/gmperm/GMPermConfig.java @@ -3,11 +3,14 @@ package de.jaschastarke.minecraft.limitedcreative.gmperm; import org.bukkit.configuration.ConfigurationSection; import de.jaschastarke.bukkit.lib.configuration.Configuration; +import de.jaschastarke.bukkit.lib.configuration.ConfigurationContainer; 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.maven.PluginConfigurations; +import de.jaschastarke.minecraft.limitedcreative.Config; import de.jaschastarke.minecraft.limitedcreative.ModGameModePerm; import de.jaschastarke.modularize.IModule; import de.jaschastarke.modularize.ModuleEntry; @@ -21,12 +24,16 @@ import de.jaschastarke.modularize.ModuleEntry.ModuleState; * http://dev.bukkit.org/server-mods/limited-creative/pages/features/gmperm/ */ @ArchiveDocComments +@PluginConfigurations(parent = Config.class) public class GMPermConfig extends Configuration implements IConfigurationSubGroup { protected ModGameModePerm mod; protected ModuleEntry entry; + public GMPermConfig(ConfigurationContainer container) { + super(container); + } public GMPermConfig(ModGameModePerm modGameModePerm, ModuleEntry modEntry) { - super(modGameModePerm.getPlugin()); + super(modGameModePerm.getPlugin().getDocCommentStorage()); mod = modGameModePerm; entry = modEntry; } diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/inventories/ArmoryConfig.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/inventories/ArmoryConfig.java index f5c8092..4af6e2d 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/inventories/ArmoryConfig.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/inventories/ArmoryConfig.java @@ -9,12 +9,14 @@ import org.bukkit.material.MaterialData; import de.jaschastarke.bukkit.lib.ModuleLogger; import de.jaschastarke.bukkit.lib.configuration.Configuration; +import de.jaschastarke.bukkit.lib.configuration.ConfigurationContainer; import de.jaschastarke.bukkit.lib.items.MaterialDataNotRecognizedException; import de.jaschastarke.bukkit.lib.items.MaterialNotRecognizedException; import de.jaschastarke.bukkit.lib.items.ItemUtils; import de.jaschastarke.configuration.IConfigurationSubGroup; import de.jaschastarke.configuration.annotations.IsConfigurationNode; import de.jaschastarke.maven.ArchiveDocComments; +import de.jaschastarke.maven.PluginConfigurations; import de.jaschastarke.minecraft.limitedcreative.ModInventories; /** @@ -23,10 +25,15 @@ import de.jaschastarke.minecraft.limitedcreative.ModInventories; * When set, all creative Player automatically wears the given items as Armor. So they are better seen by other Players. */ @ArchiveDocComments +@PluginConfigurations(parent = InventoryConfig.class) public class ArmoryConfig extends Configuration implements IConfigurationSubGroup { protected ModInventories mod; + + public ArmoryConfig(ConfigurationContainer container) { + super(container); + } public ArmoryConfig(ModInventories modInventories) { - super(modInventories.getPlugin()); + super(modInventories.getPlugin().getDocCommentStorage()); mod = modInventories; } diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/inventories/InventoryConfig.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/inventories/InventoryConfig.java index 5413419..6f05a80 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/inventories/InventoryConfig.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/inventories/InventoryConfig.java @@ -3,11 +3,14 @@ package de.jaschastarke.minecraft.limitedcreative.inventories; import org.bukkit.configuration.ConfigurationSection; import de.jaschastarke.bukkit.lib.configuration.Configuration; +import de.jaschastarke.bukkit.lib.configuration.ConfigurationContainer; 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.maven.PluginConfigurations; +import de.jaschastarke.minecraft.limitedcreative.Config; import de.jaschastarke.minecraft.limitedcreative.ModInventories; import de.jaschastarke.modularize.IModule; import de.jaschastarke.modularize.ModuleEntry; @@ -19,10 +22,14 @@ import de.jaschastarke.modularize.ModuleEntry.ModuleState; * http://dev.bukkit.org/server-mods/limited-creative/pages/features/inventory/ */ @ArchiveDocComments +@PluginConfigurations(parent = Config.class) public class InventoryConfig extends Configuration implements IConfigurationSubGroup { protected ModInventories mod; protected ModuleEntry entry; + public InventoryConfig(ConfigurationContainer container) { + super(container); + } public InventoryConfig(ModInventories modInventories, ModuleEntry modEntry) { super(modInventories.getPlugin()); mod = modInventories; diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/inventories/InventoryPermissions.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/inventories/InventoryPermissions.java index b889a8b..1249c47 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/inventories/InventoryPermissions.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/inventories/InventoryPermissions.java @@ -20,6 +20,7 @@ package de.jaschastarke.minecraft.limitedcreative.inventories; import org.bukkit.permissions.PermissionDefault; import de.jaschastarke.maven.ArchiveDocComments; +import de.jaschastarke.maven.PluginPermissions; import de.jaschastarke.minecraft.lib.permissions.BasicPermission; import de.jaschastarke.minecraft.lib.permissions.IPermission; import de.jaschastarke.minecraft.lib.permissions.SimplePermissionContainer; @@ -31,6 +32,7 @@ import de.jaschastarke.minecraft.limitedcreative.Permissions; * */ @ArchiveDocComments +@PluginPermissions public class InventoryPermissions extends SimplePermissionContainer { /** diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/LimitConfig.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/LimitConfig.java index 295312b..dd0bfcd 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/LimitConfig.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/LimitConfig.java @@ -5,12 +5,15 @@ import org.bukkit.configuration.ConfigurationSection; import org.bukkit.entity.EntityType; import de.jaschastarke.bukkit.lib.configuration.Configuration; +import de.jaschastarke.bukkit.lib.configuration.ConfigurationContainer; import de.jaschastarke.bukkit.lib.configuration.IToGeneric; 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.maven.PluginConfigurations; +import de.jaschastarke.minecraft.limitedcreative.Config; import de.jaschastarke.minecraft.limitedcreative.ModCreativeLimits; import de.jaschastarke.modularize.IModule; import de.jaschastarke.modularize.ModuleEntry; @@ -22,12 +25,16 @@ import de.jaschastarke.modularize.ModuleEntry.ModuleState; * http://dev.bukkit.org/server-mods/limited-creative/pages/features/limit/ */ @ArchiveDocComments +@PluginConfigurations(parent = Config.class) public class LimitConfig extends Configuration implements IConfigurationSubGroup { protected ModCreativeLimits mod; protected ModuleEntry entry; + public LimitConfig(ConfigurationContainer container) { + super(container); + } public LimitConfig(ModCreativeLimits modCreativeLimits, ModuleEntry modEntry) { - super(modCreativeLimits.getPlugin()); + super(modCreativeLimits.getPlugin().getDocCommentStorage()); mod = modCreativeLimits; entry = modEntry; } diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/NoLimitPermissions.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/NoLimitPermissions.java index ae64272..383e370 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/NoLimitPermissions.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/NoLimitPermissions.java @@ -26,6 +26,7 @@ import org.bukkit.material.MaterialData; import org.bukkit.permissions.PermissionDefault; import de.jaschastarke.maven.ArchiveDocComments; +import de.jaschastarke.maven.PluginPermissions; import de.jaschastarke.minecraft.lib.permissions.BasicPermission; import de.jaschastarke.minecraft.lib.permissions.DynamicPermission; import de.jaschastarke.minecraft.lib.permissions.IAbstractPermission; @@ -43,7 +44,7 @@ public class NoLimitPermissions extends SimplePermissionContainerNode { super(parent, name); } - + @PluginPermissions public static final IPermissionContainer PARENT = new NoLimitPermissions(Permissions.CONTAINER, "nolimit"); /** 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 34a4c1f..03fa1cd 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/regions/RegionConfig.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/regions/RegionConfig.java @@ -3,11 +3,14 @@ package de.jaschastarke.minecraft.limitedcreative.regions; import org.bukkit.configuration.ConfigurationSection; import de.jaschastarke.bukkit.lib.configuration.Configuration; +import de.jaschastarke.bukkit.lib.configuration.ConfigurationContainer; 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.maven.PluginConfigurations; +import de.jaschastarke.minecraft.limitedcreative.Config; import de.jaschastarke.minecraft.limitedcreative.ModRegions; import de.jaschastarke.minecraft.limitedcreative.limits.BlackList; import de.jaschastarke.modularize.IModule; @@ -20,12 +23,16 @@ import de.jaschastarke.modularize.ModuleEntry.ModuleState; * http://dev.bukkit.org/server-mods/limited-creative/pages/features/region/ */ @ArchiveDocComments +@PluginConfigurations(parent = Config.class) public class RegionConfig extends Configuration implements IConfigurationSubGroup { protected ModRegions mod; protected ModuleEntry entry; + public RegionConfig(ConfigurationContainer container) { + super(container); + } public RegionConfig(ModRegions modRegions, ModuleEntry modEntry) { - super(modRegions.getPlugin()); + super(modRegions.getPlugin().getDocCommentStorage()); mod = modRegions; entry = modEntry; } diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/regions/RegionPermissions.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/regions/RegionPermissions.java index 9a8f990..1ad9043 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/regions/RegionPermissions.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/regions/RegionPermissions.java @@ -3,6 +3,7 @@ package de.jaschastarke.minecraft.limitedcreative.regions; import org.bukkit.permissions.PermissionDefault; import de.jaschastarke.maven.ArchiveDocComments; +import de.jaschastarke.maven.PluginPermissions; import de.jaschastarke.minecraft.lib.permissions.BasicPermission; import de.jaschastarke.minecraft.lib.permissions.IAbstractPermission; import de.jaschastarke.minecraft.lib.permissions.IPermission; @@ -26,6 +27,7 @@ final public class RegionPermissions extends SimplePermissionContainerNode imple /** * Grants access to the /lcr command, which allows to define Limited Creatives region-flags */ + @PluginPermissions public static final RegionPermissions REGION = new RegionPermissions(Permissions.CONTAINER, "region"); /** diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/regions/RegionsCommand.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/regions/RegionsCommand.java index 2d1be6d..703081f 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/regions/RegionsCommand.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/regions/RegionsCommand.java @@ -24,6 +24,7 @@ import de.jaschastarke.bukkit.lib.commands.annotations.IsCommand; import de.jaschastarke.bukkit.lib.commands.annotations.Usages; import de.jaschastarke.bukkit.lib.commands.parser.DefinedParameterParser; import de.jaschastarke.maven.ArchiveDocComments; +import de.jaschastarke.maven.PluginCommand; import de.jaschastarke.minecraft.lib.permissions.IAbstractPermission; import de.jaschastarke.minecraft.limitedcreative.ModRegions; import de.jaschastarke.minecraft.limitedcreative.regions.worldguard.FlagList; @@ -36,6 +37,7 @@ import de.jaschastarke.minecraft.limitedcreative.regions.worldguard.Region; * @permission limitedcreative.region */ @ArchiveDocComments +@PluginCommand public class RegionsCommand extends BukkitCommand implements IHelpDescribed { private final static String GLOBAL_REGION = "__global__"; private ModRegions mod;