Annotation instead of pom registration, with Configuration-Default generation

This commit is contained in:
Jascha Starke 2013-09-25 23:52:43 +02:00
parent ea1921935e
commit 49b528e352
19 changed files with 83 additions and 25 deletions

14
pom.xml
View file

@ -158,20 +158,6 @@
<custom> <custom>
<dev-url>http://dev.bukkit.org/server-mods/limited-creative/</dev-url> <dev-url>http://dev.bukkit.org/server-mods/limited-creative/</dev-url>
</custom> </custom>
<registeredPermissions>
<param>de.jaschastarke.minecraft.limitedcreative.Permissions:CONTAINER</param>
<param>de.jaschastarke.minecraft.limitedcreative.SwitchGameModePermissions:ALL</param>
<param>de.jaschastarke.minecraft.limitedcreative.inventories.InventoryPermissions</param>
<param>de.jaschastarke.minecraft.limitedcreative.limits.NoLimitPermissions:PARENT</param>
<param>de.jaschastarke.minecraft.limitedcreative.cmdblocker.CmdBlockPermissions:CONTAINER</param>
<param>de.jaschastarke.minecraft.limitedcreative.regions.RegionPermissions:REGION</param>
<param>de.jaschastarke.minecraft.limitedcreative.blockstate.BlockStatePermissions:PARENT</param>
</registeredPermissions>
<registeredCommands>
<param>de.jaschastarke.minecraft.limitedcreative.MainCommand</param>
<param>de.jaschastarke.minecraft.limitedcreative.regions.RegionsCommand</param>
<param>de.jaschastarke.minecraft.limitedcreative.blockstate.BlockStateCommand</param>
</registeredCommands>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>

View file

@ -3,11 +3,13 @@ package de.jaschastarke.minecraft.limitedcreative;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
import de.jaschastarke.bukkit.lib.Core; import de.jaschastarke.bukkit.lib.Core;
import de.jaschastarke.bukkit.lib.configuration.ConfigurationContainer;
import de.jaschastarke.bukkit.lib.configuration.PluginConfiguration; import de.jaschastarke.bukkit.lib.configuration.PluginConfiguration;
import de.jaschastarke.configuration.IConfigurationNode; import de.jaschastarke.configuration.IConfigurationNode;
import de.jaschastarke.configuration.InvalidValueException; import de.jaschastarke.configuration.InvalidValueException;
import de.jaschastarke.configuration.annotations.IsConfigurationNode; import de.jaschastarke.configuration.annotations.IsConfigurationNode;
import de.jaschastarke.maven.ArchiveDocComments; import de.jaschastarke.maven.ArchiveDocComments;
import de.jaschastarke.maven.PluginConfigurations;
import de.jaschastarke.modularize.IModule; import de.jaschastarke.modularize.IModule;
import de.jaschastarke.modularize.ModuleEntry; import de.jaschastarke.modularize.ModuleEntry;
import de.jaschastarke.modularize.ModuleEntry.ModuleState; import de.jaschastarke.modularize.ModuleEntry.ModuleState;
@ -21,7 +23,11 @@ import de.jaschastarke.modularize.ModuleEntry.ModuleState;
* removed. * removed.
*/ */
@ArchiveDocComments @ArchiveDocComments
@PluginConfigurations
public class Config extends PluginConfiguration { public class Config extends PluginConfiguration {
public Config(ConfigurationContainer container) {
super(container);
}
public Config(Core plugin) { public Config(Core plugin) {
super(plugin); super(plugin);
} }
@ -30,9 +36,8 @@ public class Config extends PluginConfiguration {
public void setValues(ConfigurationSection sect) { public void setValues(ConfigurationSection sect) {
super.setValues(sect); super.setValues(sect);
if (plugin.getModules().size() > 0) { if (plugin.getModules().size() > 0)
setModuleStates(); setModuleStates();
}
} }
public void setModuleStates() { public void setModuleStates() {

View file

@ -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.IsCommand;
import de.jaschastarke.bukkit.lib.commands.annotations.NeedsPermission; import de.jaschastarke.bukkit.lib.commands.annotations.NeedsPermission;
import de.jaschastarke.maven.ArchiveDocComments; import de.jaschastarke.maven.ArchiveDocComments;
import de.jaschastarke.maven.PluginCommand;
import de.jaschastarke.minecraft.lib.permissions.IAbstractPermission; import de.jaschastarke.minecraft.lib.permissions.IAbstractPermission;
import de.jaschastarke.minecraft.lib.permissions.IPermission; import de.jaschastarke.minecraft.lib.permissions.IPermission;
@ -18,6 +19,7 @@ import de.jaschastarke.minecraft.lib.permissions.IPermission;
* @permission limitedcreative.command * @permission limitedcreative.command
*/ */
@ArchiveDocComments @ArchiveDocComments
@PluginCommand
public class MainCommand extends BukkitCommand implements IHelpDescribed, IMethodCommandContainer { public class MainCommand extends BukkitCommand implements IHelpDescribed, IMethodCommandContainer {
private LimitedCreative plugin; private LimitedCreative plugin;

View file

@ -20,6 +20,7 @@ package de.jaschastarke.minecraft.limitedcreative;
import org.bukkit.permissions.PermissionDefault; import org.bukkit.permissions.PermissionDefault;
import de.jaschastarke.maven.ArchiveDocComments; import de.jaschastarke.maven.ArchiveDocComments;
import de.jaschastarke.maven.PluginPermissions;
import de.jaschastarke.minecraft.lib.permissions.BasicPermission; import de.jaschastarke.minecraft.lib.permissions.BasicPermission;
import de.jaschastarke.minecraft.lib.permissions.IPermission; import de.jaschastarke.minecraft.lib.permissions.IPermission;
import de.jaschastarke.minecraft.lib.permissions.SimplePermissionContainerNode; import de.jaschastarke.minecraft.lib.permissions.SimplePermissionContainerNode;
@ -30,6 +31,7 @@ public class Permissions extends SimplePermissionContainerNode {
super(name); super(name);
} }
@PluginPermissions
public final static Permissions CONTAINER = new Permissions("limitedcreative"); public final static Permissions CONTAINER = new Permissions("limitedcreative");
/** /**

View file

@ -3,6 +3,7 @@ package de.jaschastarke.minecraft.limitedcreative;
import org.bukkit.permissions.PermissionDefault; import org.bukkit.permissions.PermissionDefault;
import de.jaschastarke.maven.ArchiveDocComments; import de.jaschastarke.maven.ArchiveDocComments;
import de.jaschastarke.maven.PluginPermissions;
import de.jaschastarke.minecraft.lib.permissions.BasicPermission; import de.jaschastarke.minecraft.lib.permissions.BasicPermission;
import de.jaschastarke.minecraft.lib.permissions.IAbstractPermission; import de.jaschastarke.minecraft.lib.permissions.IAbstractPermission;
import de.jaschastarke.minecraft.lib.permissions.IsChildPermission; 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 * Allows switching of own game mode to creative/adventure and back
*/ */
@PluginPermissions
public final static SwitchGameModePermissions ALL = new SwitchGameModePermissions(Permissions.CONTAINER, "switch_gamemode"); public final static SwitchGameModePermissions ALL = new SwitchGameModePermissions(Permissions.CONTAINER, "switch_gamemode");
protected SwitchGameModePermissions(IAbstractPermission parent, String name) { protected SwitchGameModePermissions(IAbstractPermission parent, String name) {

View file

@ -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.IsCommand;
import de.jaschastarke.bukkit.lib.commands.annotations.Usages; import de.jaschastarke.bukkit.lib.commands.annotations.Usages;
import de.jaschastarke.maven.ArchiveDocComments; import de.jaschastarke.maven.ArchiveDocComments;
import de.jaschastarke.maven.PluginCommand;
import de.jaschastarke.minecraft.lib.permissions.IAbstractPermission; import de.jaschastarke.minecraft.lib.permissions.IAbstractPermission;
import de.jaschastarke.minecraft.limitedcreative.ModBlockStates; import de.jaschastarke.minecraft.limitedcreative.ModBlockStates;
import de.jaschastarke.minecraft.limitedcreative.blockstate.BlockState.Source; import de.jaschastarke.minecraft.limitedcreative.blockstate.BlockState.Source;
@ -33,6 +34,7 @@ import de.jaschastarke.minecraft.limitedcreative.blockstate.DBModel.DBTransactio
* @permission limitedcreative.blockstate.command * @permission limitedcreative.blockstate.command
*/ */
@ArchiveDocComments @ArchiveDocComments
@PluginCommand
public class BlockStateCommand extends BukkitCommand implements IHelpDescribed { public class BlockStateCommand extends BukkitCommand implements IHelpDescribed {
private ModBlockStates mod; private ModBlockStates mod;
private HelpCommand help; private HelpCommand help;

View file

@ -4,12 +4,15 @@ import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
import de.jaschastarke.bukkit.lib.configuration.Configuration; import de.jaschastarke.bukkit.lib.configuration.Configuration;
import de.jaschastarke.bukkit.lib.configuration.ConfigurationContainer;
import de.jaschastarke.bukkit.lib.configuration.StringList; import de.jaschastarke.bukkit.lib.configuration.StringList;
import de.jaschastarke.configuration.IConfigurationNode; import de.jaschastarke.configuration.IConfigurationNode;
import de.jaschastarke.configuration.IConfigurationSubGroup; import de.jaschastarke.configuration.IConfigurationSubGroup;
import de.jaschastarke.configuration.InvalidValueException; import de.jaschastarke.configuration.InvalidValueException;
import de.jaschastarke.configuration.annotations.IsConfigurationNode; import de.jaschastarke.configuration.annotations.IsConfigurationNode;
import de.jaschastarke.maven.ArchiveDocComments; 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.minecraft.limitedcreative.ModBlockStates;
import de.jaschastarke.modularize.IModule; import de.jaschastarke.modularize.IModule;
import de.jaschastarke.modularize.ModuleEntry; 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/ * http://dev.bukkit.org/server-mods/limited-creative/pages/features/blockstate/
*/ */
@ArchiveDocComments @ArchiveDocComments
@PluginConfigurations(parent = Config.class)
public class BlockStateConfig extends Configuration implements IConfigurationSubGroup { public class BlockStateConfig extends Configuration implements IConfigurationSubGroup {
protected ModBlockStates mod; protected ModBlockStates mod;
protected ModuleEntry<IModule> entry; protected ModuleEntry<IModule> entry;
public BlockStateConfig(ConfigurationContainer container) {
super(container);
}
public BlockStateConfig(ModBlockStates mod, ModuleEntry<IModule> modEntry) { public BlockStateConfig(ModBlockStates mod, ModuleEntry<IModule> modEntry) {
super(mod.getPlugin()); super(mod.getPlugin().getDocCommentStorage());
this.mod = mod; this.mod = mod;
entry = modEntry; entry = modEntry;
} }

View file

@ -20,6 +20,7 @@ package de.jaschastarke.minecraft.limitedcreative.blockstate;
import org.bukkit.permissions.PermissionDefault; import org.bukkit.permissions.PermissionDefault;
import de.jaschastarke.maven.ArchiveDocComments; import de.jaschastarke.maven.ArchiveDocComments;
import de.jaschastarke.maven.PluginPermissions;
import de.jaschastarke.minecraft.lib.permissions.BasicPermission; import de.jaschastarke.minecraft.lib.permissions.BasicPermission;
import de.jaschastarke.minecraft.lib.permissions.IAbstractPermission; import de.jaschastarke.minecraft.lib.permissions.IAbstractPermission;
import de.jaschastarke.minecraft.lib.permissions.IPermission; import de.jaschastarke.minecraft.lib.permissions.IPermission;
@ -33,7 +34,7 @@ public class BlockStatePermissions extends SimplePermissionContainerNode {
super(parent, name); super(parent, name);
} }
@PluginPermissions
public static final IPermissionContainer PARENT = new BlockStatePermissions(Permissions.CONTAINER, "blockstate"); public static final IPermissionContainer PARENT = new BlockStatePermissions(Permissions.CONTAINER, "blockstate");
/** /**

View file

@ -5,6 +5,7 @@ import java.util.Collection;
import org.bukkit.permissions.PermissionDefault; import org.bukkit.permissions.PermissionDefault;
import de.jaschastarke.maven.ArchiveDocComments; import de.jaschastarke.maven.ArchiveDocComments;
import de.jaschastarke.maven.PluginPermissions;
import de.jaschastarke.minecraft.lib.permissions.BasicPermission; import de.jaschastarke.minecraft.lib.permissions.BasicPermission;
import de.jaschastarke.minecraft.lib.permissions.DynamicPermission; import de.jaschastarke.minecraft.lib.permissions.DynamicPermission;
import de.jaschastarke.minecraft.lib.permissions.IAbstractPermission; import de.jaschastarke.minecraft.lib.permissions.IAbstractPermission;
@ -19,6 +20,7 @@ public class CmdBlockPermissions extends SimplePermissionContainerNode {
super(parent, name); super(parent, name);
} }
@PluginPermissions
public static final SimplePermissionContainerNode CONTAINER = new CmdBlockPermissions(Permissions.CONTAINER, "cmdblock"); public static final SimplePermissionContainerNode CONTAINER = new CmdBlockPermissions(Permissions.CONTAINER, "cmdblock");
/** /**

View file

@ -3,11 +3,14 @@ package de.jaschastarke.minecraft.limitedcreative.cmdblocker;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
import de.jaschastarke.bukkit.lib.configuration.Configuration; import de.jaschastarke.bukkit.lib.configuration.Configuration;
import de.jaschastarke.bukkit.lib.configuration.ConfigurationContainer;
import de.jaschastarke.configuration.IConfigurationNode; import de.jaschastarke.configuration.IConfigurationNode;
import de.jaschastarke.configuration.IConfigurationSubGroup; import de.jaschastarke.configuration.IConfigurationSubGroup;
import de.jaschastarke.configuration.InvalidValueException; import de.jaschastarke.configuration.InvalidValueException;
import de.jaschastarke.configuration.annotations.IsConfigurationNode; import de.jaschastarke.configuration.annotations.IsConfigurationNode;
import de.jaschastarke.maven.ArchiveDocComments; 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.minecraft.limitedcreative.ModCmdBlocker;
import de.jaschastarke.modularize.IModule; import de.jaschastarke.modularize.IModule;
import de.jaschastarke.modularize.ModuleEntry; 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/ * http://dev.bukkit.org/server-mods/limited-creative/pages/features/command-blocker/
*/ */
@ArchiveDocComments @ArchiveDocComments
@PluginConfigurations(parent = Config.class)
public class CmdBlockerConfig extends Configuration implements IConfigurationSubGroup { public class CmdBlockerConfig extends Configuration implements IConfigurationSubGroup {
protected ModCmdBlocker mod; protected ModCmdBlocker mod;
protected ModuleEntry<IModule> entry; protected ModuleEntry<IModule> entry;
public CmdBlockerConfig(ConfigurationContainer container) {
super(container);
}
public CmdBlockerConfig(ModCmdBlocker modCmdBlocker, ModuleEntry<IModule> modEntry) { public CmdBlockerConfig(ModCmdBlocker modCmdBlocker, ModuleEntry<IModule> modEntry) {
super(modCmdBlocker.getPlugin()); super(modCmdBlocker.getPlugin().getDocCommentStorage());
mod = modCmdBlocker; mod = modCmdBlocker;
entry = modEntry; entry = modEntry;
} }

View file

@ -3,11 +3,14 @@ package de.jaschastarke.minecraft.limitedcreative.gmperm;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
import de.jaschastarke.bukkit.lib.configuration.Configuration; import de.jaschastarke.bukkit.lib.configuration.Configuration;
import de.jaschastarke.bukkit.lib.configuration.ConfigurationContainer;
import de.jaschastarke.configuration.IConfigurationNode; import de.jaschastarke.configuration.IConfigurationNode;
import de.jaschastarke.configuration.IConfigurationSubGroup; import de.jaschastarke.configuration.IConfigurationSubGroup;
import de.jaschastarke.configuration.InvalidValueException; import de.jaschastarke.configuration.InvalidValueException;
import de.jaschastarke.configuration.annotations.IsConfigurationNode; import de.jaschastarke.configuration.annotations.IsConfigurationNode;
import de.jaschastarke.maven.ArchiveDocComments; 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.minecraft.limitedcreative.ModGameModePerm;
import de.jaschastarke.modularize.IModule; import de.jaschastarke.modularize.IModule;
import de.jaschastarke.modularize.ModuleEntry; 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/ * http://dev.bukkit.org/server-mods/limited-creative/pages/features/gmperm/
*/ */
@ArchiveDocComments @ArchiveDocComments
@PluginConfigurations(parent = Config.class)
public class GMPermConfig extends Configuration implements IConfigurationSubGroup { public class GMPermConfig extends Configuration implements IConfigurationSubGroup {
protected ModGameModePerm mod; protected ModGameModePerm mod;
protected ModuleEntry<IModule> entry; protected ModuleEntry<IModule> entry;
public GMPermConfig(ConfigurationContainer container) {
super(container);
}
public GMPermConfig(ModGameModePerm modGameModePerm, ModuleEntry<IModule> modEntry) { public GMPermConfig(ModGameModePerm modGameModePerm, ModuleEntry<IModule> modEntry) {
super(modGameModePerm.getPlugin()); super(modGameModePerm.getPlugin().getDocCommentStorage());
mod = modGameModePerm; mod = modGameModePerm;
entry = modEntry; entry = modEntry;
} }

View file

@ -9,12 +9,14 @@ import org.bukkit.material.MaterialData;
import de.jaschastarke.bukkit.lib.ModuleLogger; import de.jaschastarke.bukkit.lib.ModuleLogger;
import de.jaschastarke.bukkit.lib.configuration.Configuration; 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.MaterialDataNotRecognizedException;
import de.jaschastarke.bukkit.lib.items.MaterialNotRecognizedException; import de.jaschastarke.bukkit.lib.items.MaterialNotRecognizedException;
import de.jaschastarke.bukkit.lib.items.ItemUtils; import de.jaschastarke.bukkit.lib.items.ItemUtils;
import de.jaschastarke.configuration.IConfigurationSubGroup; import de.jaschastarke.configuration.IConfigurationSubGroup;
import de.jaschastarke.configuration.annotations.IsConfigurationNode; import de.jaschastarke.configuration.annotations.IsConfigurationNode;
import de.jaschastarke.maven.ArchiveDocComments; import de.jaschastarke.maven.ArchiveDocComments;
import de.jaschastarke.maven.PluginConfigurations;
import de.jaschastarke.minecraft.limitedcreative.ModInventories; 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. * When set, all creative Player automatically wears the given items as Armor. So they are better seen by other Players.
*/ */
@ArchiveDocComments @ArchiveDocComments
@PluginConfigurations(parent = InventoryConfig.class)
public class ArmoryConfig extends Configuration implements IConfigurationSubGroup { public class ArmoryConfig extends Configuration implements IConfigurationSubGroup {
protected ModInventories mod; protected ModInventories mod;
public ArmoryConfig(ConfigurationContainer container) {
super(container);
}
public ArmoryConfig(ModInventories modInventories) { public ArmoryConfig(ModInventories modInventories) {
super(modInventories.getPlugin()); super(modInventories.getPlugin().getDocCommentStorage());
mod = modInventories; mod = modInventories;
} }

View file

@ -3,11 +3,14 @@ package de.jaschastarke.minecraft.limitedcreative.inventories;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
import de.jaschastarke.bukkit.lib.configuration.Configuration; import de.jaschastarke.bukkit.lib.configuration.Configuration;
import de.jaschastarke.bukkit.lib.configuration.ConfigurationContainer;
import de.jaschastarke.configuration.IConfigurationNode; import de.jaschastarke.configuration.IConfigurationNode;
import de.jaschastarke.configuration.IConfigurationSubGroup; import de.jaschastarke.configuration.IConfigurationSubGroup;
import de.jaschastarke.configuration.InvalidValueException; import de.jaschastarke.configuration.InvalidValueException;
import de.jaschastarke.configuration.annotations.IsConfigurationNode; import de.jaschastarke.configuration.annotations.IsConfigurationNode;
import de.jaschastarke.maven.ArchiveDocComments; 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.minecraft.limitedcreative.ModInventories;
import de.jaschastarke.modularize.IModule; import de.jaschastarke.modularize.IModule;
import de.jaschastarke.modularize.ModuleEntry; 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/ * http://dev.bukkit.org/server-mods/limited-creative/pages/features/inventory/
*/ */
@ArchiveDocComments @ArchiveDocComments
@PluginConfigurations(parent = Config.class)
public class InventoryConfig extends Configuration implements IConfigurationSubGroup { public class InventoryConfig extends Configuration implements IConfigurationSubGroup {
protected ModInventories mod; protected ModInventories mod;
protected ModuleEntry<IModule> entry; protected ModuleEntry<IModule> entry;
public InventoryConfig(ConfigurationContainer container) {
super(container);
}
public InventoryConfig(ModInventories modInventories, ModuleEntry<IModule> modEntry) { public InventoryConfig(ModInventories modInventories, ModuleEntry<IModule> modEntry) {
super(modInventories.getPlugin()); super(modInventories.getPlugin());
mod = modInventories; mod = modInventories;

View file

@ -20,6 +20,7 @@ package de.jaschastarke.minecraft.limitedcreative.inventories;
import org.bukkit.permissions.PermissionDefault; import org.bukkit.permissions.PermissionDefault;
import de.jaschastarke.maven.ArchiveDocComments; import de.jaschastarke.maven.ArchiveDocComments;
import de.jaschastarke.maven.PluginPermissions;
import de.jaschastarke.minecraft.lib.permissions.BasicPermission; import de.jaschastarke.minecraft.lib.permissions.BasicPermission;
import de.jaschastarke.minecraft.lib.permissions.IPermission; import de.jaschastarke.minecraft.lib.permissions.IPermission;
import de.jaschastarke.minecraft.lib.permissions.SimplePermissionContainer; import de.jaschastarke.minecraft.lib.permissions.SimplePermissionContainer;
@ -31,6 +32,7 @@ import de.jaschastarke.minecraft.limitedcreative.Permissions;
* *
*/ */
@ArchiveDocComments @ArchiveDocComments
@PluginPermissions
public class InventoryPermissions extends SimplePermissionContainer { public class InventoryPermissions extends SimplePermissionContainer {
/** /**

View file

@ -5,12 +5,15 @@ import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import de.jaschastarke.bukkit.lib.configuration.Configuration; import de.jaschastarke.bukkit.lib.configuration.Configuration;
import de.jaschastarke.bukkit.lib.configuration.ConfigurationContainer;
import de.jaschastarke.bukkit.lib.configuration.IToGeneric; import de.jaschastarke.bukkit.lib.configuration.IToGeneric;
import de.jaschastarke.configuration.IConfigurationNode; import de.jaschastarke.configuration.IConfigurationNode;
import de.jaschastarke.configuration.IConfigurationSubGroup; import de.jaschastarke.configuration.IConfigurationSubGroup;
import de.jaschastarke.configuration.InvalidValueException; import de.jaschastarke.configuration.InvalidValueException;
import de.jaschastarke.configuration.annotations.IsConfigurationNode; import de.jaschastarke.configuration.annotations.IsConfigurationNode;
import de.jaschastarke.maven.ArchiveDocComments; 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.minecraft.limitedcreative.ModCreativeLimits;
import de.jaschastarke.modularize.IModule; import de.jaschastarke.modularize.IModule;
import de.jaschastarke.modularize.ModuleEntry; 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/ * http://dev.bukkit.org/server-mods/limited-creative/pages/features/limit/
*/ */
@ArchiveDocComments @ArchiveDocComments
@PluginConfigurations(parent = Config.class)
public class LimitConfig extends Configuration implements IConfigurationSubGroup { public class LimitConfig extends Configuration implements IConfigurationSubGroup {
protected ModCreativeLimits mod; protected ModCreativeLimits mod;
protected ModuleEntry<IModule> entry; protected ModuleEntry<IModule> entry;
public LimitConfig(ConfigurationContainer container) {
super(container);
}
public LimitConfig(ModCreativeLimits modCreativeLimits, ModuleEntry<IModule> modEntry) { public LimitConfig(ModCreativeLimits modCreativeLimits, ModuleEntry<IModule> modEntry) {
super(modCreativeLimits.getPlugin()); super(modCreativeLimits.getPlugin().getDocCommentStorage());
mod = modCreativeLimits; mod = modCreativeLimits;
entry = modEntry; entry = modEntry;
} }

View file

@ -26,6 +26,7 @@ import org.bukkit.material.MaterialData;
import org.bukkit.permissions.PermissionDefault; import org.bukkit.permissions.PermissionDefault;
import de.jaschastarke.maven.ArchiveDocComments; import de.jaschastarke.maven.ArchiveDocComments;
import de.jaschastarke.maven.PluginPermissions;
import de.jaschastarke.minecraft.lib.permissions.BasicPermission; import de.jaschastarke.minecraft.lib.permissions.BasicPermission;
import de.jaschastarke.minecraft.lib.permissions.DynamicPermission; import de.jaschastarke.minecraft.lib.permissions.DynamicPermission;
import de.jaschastarke.minecraft.lib.permissions.IAbstractPermission; import de.jaschastarke.minecraft.lib.permissions.IAbstractPermission;
@ -43,7 +44,7 @@ public class NoLimitPermissions extends SimplePermissionContainerNode {
super(parent, name); super(parent, name);
} }
@PluginPermissions
public static final IPermissionContainer PARENT = new NoLimitPermissions(Permissions.CONTAINER, "nolimit"); public static final IPermissionContainer PARENT = new NoLimitPermissions(Permissions.CONTAINER, "nolimit");
/** /**

View file

@ -3,11 +3,14 @@ package de.jaschastarke.minecraft.limitedcreative.regions;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
import de.jaschastarke.bukkit.lib.configuration.Configuration; import de.jaschastarke.bukkit.lib.configuration.Configuration;
import de.jaschastarke.bukkit.lib.configuration.ConfigurationContainer;
import de.jaschastarke.configuration.IConfigurationNode; import de.jaschastarke.configuration.IConfigurationNode;
import de.jaschastarke.configuration.IConfigurationSubGroup; import de.jaschastarke.configuration.IConfigurationSubGroup;
import de.jaschastarke.configuration.InvalidValueException; import de.jaschastarke.configuration.InvalidValueException;
import de.jaschastarke.configuration.annotations.IsConfigurationNode; import de.jaschastarke.configuration.annotations.IsConfigurationNode;
import de.jaschastarke.maven.ArchiveDocComments; 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.ModRegions;
import de.jaschastarke.minecraft.limitedcreative.limits.BlackList; import de.jaschastarke.minecraft.limitedcreative.limits.BlackList;
import de.jaschastarke.modularize.IModule; 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/ * http://dev.bukkit.org/server-mods/limited-creative/pages/features/region/
*/ */
@ArchiveDocComments @ArchiveDocComments
@PluginConfigurations(parent = Config.class)
public class RegionConfig extends Configuration implements IConfigurationSubGroup { public class RegionConfig extends Configuration implements IConfigurationSubGroup {
protected ModRegions mod; protected ModRegions mod;
protected ModuleEntry<IModule> entry; protected ModuleEntry<IModule> entry;
public RegionConfig(ConfigurationContainer container) {
super(container);
}
public RegionConfig(ModRegions modRegions, ModuleEntry<IModule> modEntry) { public RegionConfig(ModRegions modRegions, ModuleEntry<IModule> modEntry) {
super(modRegions.getPlugin()); super(modRegions.getPlugin().getDocCommentStorage());
mod = modRegions; mod = modRegions;
entry = modEntry; entry = modEntry;
} }

View file

@ -3,6 +3,7 @@ package de.jaschastarke.minecraft.limitedcreative.regions;
import org.bukkit.permissions.PermissionDefault; import org.bukkit.permissions.PermissionDefault;
import de.jaschastarke.maven.ArchiveDocComments; import de.jaschastarke.maven.ArchiveDocComments;
import de.jaschastarke.maven.PluginPermissions;
import de.jaschastarke.minecraft.lib.permissions.BasicPermission; import de.jaschastarke.minecraft.lib.permissions.BasicPermission;
import de.jaschastarke.minecraft.lib.permissions.IAbstractPermission; import de.jaschastarke.minecraft.lib.permissions.IAbstractPermission;
import de.jaschastarke.minecraft.lib.permissions.IPermission; 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 * 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"); public static final RegionPermissions REGION = new RegionPermissions(Permissions.CONTAINER, "region");
/** /**

View file

@ -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.annotations.Usages;
import de.jaschastarke.bukkit.lib.commands.parser.DefinedParameterParser; import de.jaschastarke.bukkit.lib.commands.parser.DefinedParameterParser;
import de.jaschastarke.maven.ArchiveDocComments; import de.jaschastarke.maven.ArchiveDocComments;
import de.jaschastarke.maven.PluginCommand;
import de.jaschastarke.minecraft.lib.permissions.IAbstractPermission; import de.jaschastarke.minecraft.lib.permissions.IAbstractPermission;
import de.jaschastarke.minecraft.limitedcreative.ModRegions; import de.jaschastarke.minecraft.limitedcreative.ModRegions;
import de.jaschastarke.minecraft.limitedcreative.regions.worldguard.FlagList; import de.jaschastarke.minecraft.limitedcreative.regions.worldguard.FlagList;
@ -36,6 +37,7 @@ import de.jaschastarke.minecraft.limitedcreative.regions.worldguard.Region;
* @permission limitedcreative.region * @permission limitedcreative.region
*/ */
@ArchiveDocComments @ArchiveDocComments
@PluginCommand
public class RegionsCommand extends BukkitCommand implements IHelpDescribed { public class RegionsCommand extends BukkitCommand implements IHelpDescribed {
private final static String GLOBAL_REGION = "__global__"; private final static String GLOBAL_REGION = "__global__";
private ModRegions mod; private ModRegions mod;