Custom mod support refactoring.

This commit is contained in:
GJ 2013-01-30 11:35:33 -05:00
parent 62a037a4fd
commit 852872f55c
20 changed files with 42 additions and 40 deletions

View File

@ -6,13 +6,13 @@ import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.mods.CustomTool;
import com.gmail.nossr50.events.experience.McMMOPlayerXpGainEvent;
import com.gmail.nossr50.mods.ModChecks;
import com.gmail.nossr50.mods.datatypes.CustomTool;
import com.gmail.nossr50.party.Party;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.skills.SkillType;
import com.gmail.nossr50.spout.huds.SpoutHud;
import com.gmail.nossr50.util.ModChecks;
import com.gmail.nossr50.util.Permissions;
public class McMMOPlayer {

View File

@ -34,9 +34,6 @@ import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.config.HiddenConfig;
import com.gmail.nossr50.config.TreasuresConfig;
import com.gmail.nossr50.config.mods.CustomArmorConfig;
import com.gmail.nossr50.config.mods.CustomBlocksConfig;
import com.gmail.nossr50.config.mods.CustomToolsConfig;
import com.gmail.nossr50.database.Database;
import com.gmail.nossr50.database.commands.McpurgeCommand;
import com.gmail.nossr50.database.commands.McremoveCommand;
@ -49,6 +46,9 @@ import com.gmail.nossr50.listeners.InventoryListener;
import com.gmail.nossr50.listeners.PlayerListener;
import com.gmail.nossr50.listeners.WorldListener;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mods.config.CustomArmorConfig;
import com.gmail.nossr50.mods.config.CustomBlocksConfig;
import com.gmail.nossr50.mods.config.CustomToolsConfig;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.party.commands.ACommand;
import com.gmail.nossr50.party.commands.PCommand;

View File

@ -1,16 +1,16 @@
package com.gmail.nossr50.util;
package com.gmail.nossr50.mods;
import org.bukkit.block.Block;
import org.bukkit.inventory.ItemStack;
import org.bukkit.material.MaterialData;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.config.mods.CustomArmorConfig;
import com.gmail.nossr50.config.mods.CustomBlocksConfig;
import com.gmail.nossr50.config.mods.CustomToolsConfig;
import com.gmail.nossr50.datatypes.mods.CustomBlock;
import com.gmail.nossr50.datatypes.mods.CustomItem;
import com.gmail.nossr50.datatypes.mods.CustomTool;
import com.gmail.nossr50.mods.config.CustomArmorConfig;
import com.gmail.nossr50.mods.config.CustomBlocksConfig;
import com.gmail.nossr50.mods.config.CustomToolsConfig;
import com.gmail.nossr50.mods.datatypes.CustomBlock;
import com.gmail.nossr50.mods.datatypes.CustomItem;
import com.gmail.nossr50.mods.datatypes.CustomTool;
public final class ModChecks {
private static Config configInstance = Config.getInstance();

View File

@ -1,4 +1,4 @@
package com.gmail.nossr50.config.mods;
package com.gmail.nossr50.mods.config;
import java.util.ArrayList;
import java.util.HashMap;
@ -8,7 +8,7 @@ import java.util.Set;
import org.bukkit.configuration.ConfigurationSection;
import com.gmail.nossr50.config.ConfigLoader;
import com.gmail.nossr50.datatypes.mods.CustomItem;
import com.gmail.nossr50.mods.datatypes.CustomItem;
import com.gmail.nossr50.skills.repair.Repairable;
import com.gmail.nossr50.skills.repair.RepairableFactory;

View File

@ -1,4 +1,4 @@
package com.gmail.nossr50.config.mods;
package com.gmail.nossr50.mods.config;
import java.util.ArrayList;
import java.util.List;
@ -9,7 +9,7 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.material.MaterialData;
import com.gmail.nossr50.config.ConfigLoader;
import com.gmail.nossr50.datatypes.mods.CustomBlock;
import com.gmail.nossr50.mods.datatypes.CustomBlock;
public class CustomBlocksConfig extends ConfigLoader {
private static CustomBlocksConfig instance;

View File

@ -1,4 +1,4 @@
package com.gmail.nossr50.config.mods;
package com.gmail.nossr50.mods.config;
import java.util.ArrayList;
import java.util.HashMap;
@ -8,7 +8,7 @@ import java.util.Set;
import org.bukkit.configuration.ConfigurationSection;
import com.gmail.nossr50.config.ConfigLoader;
import com.gmail.nossr50.datatypes.mods.CustomTool;
import com.gmail.nossr50.mods.datatypes.CustomTool;
import com.gmail.nossr50.skills.repair.Repairable;
import com.gmail.nossr50.skills.repair.RepairableFactory;

View File

@ -1,4 +1,4 @@
package com.gmail.nossr50.datatypes.mods;
package com.gmail.nossr50.mods.datatypes;
import org.bukkit.inventory.ItemStack;

View File

@ -1,4 +1,4 @@
package com.gmail.nossr50.datatypes.mods;
package com.gmail.nossr50.mods.datatypes;
public class CustomItem {
protected int itemID;

View File

@ -1,4 +1,4 @@
package com.gmail.nossr50.datatypes.mods;
package com.gmail.nossr50.mods.datatypes;
public class CustomTool extends CustomItem {
private double xpMultiplier;

View File

@ -16,11 +16,11 @@ public class ShareHandler {
public static double partyShareRange = Config.getInstance().getPartyShareRange();
public static double partyShareBonus = Config.getInstance().getPartyShareBonus();
protected enum PartyShareType {
NO_SHARE,
RANDOM,
EQUAL,
};
// protected enum PartyShareType {
// NO_SHARE,
// RANDOM,
// EQUAL,
// };
public static double checkXpSharing(int oldExp, Player player, Party party) {
int newExp = oldExp;

View File

@ -14,11 +14,11 @@ import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.events.experience.McMMOPlayerLevelUpEvent;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mods.ModChecks;
import com.gmail.nossr50.party.ShareHandler;
import com.gmail.nossr50.spout.SpoutConfig;
import com.gmail.nossr50.spout.SpoutTools;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.ModChecks;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.Users;

View File

@ -16,10 +16,10 @@ import com.gmail.nossr50.config.TreasuresConfig;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.treasure.ExcavationTreasure;
import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent;
import com.gmail.nossr50.mods.ModChecks;
import com.gmail.nossr50.skills.SkillType;
import com.gmail.nossr50.skills.SkillTools;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.ModChecks;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.Users;

View File

@ -19,15 +19,15 @@ import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.config.TreasuresConfig;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.mods.CustomBlock;
import com.gmail.nossr50.datatypes.treasure.HylianTreasure;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mods.ModChecks;
import com.gmail.nossr50.mods.datatypes.CustomBlock;
import com.gmail.nossr50.runnables.GreenThumbTimer;
import com.gmail.nossr50.skills.AbilityType;
import com.gmail.nossr50.skills.SkillType;
import com.gmail.nossr50.skills.SkillTools;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.ModChecks;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.Users;

View File

@ -12,11 +12,11 @@ import org.bukkit.material.MaterialData;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.mods.CustomBlock;
import com.gmail.nossr50.mods.ModChecks;
import com.gmail.nossr50.mods.datatypes.CustomBlock;
import com.gmail.nossr50.skills.SkillType;
import com.gmail.nossr50.skills.SkillTools;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.ModChecks;
public class Mining {
private static AdvancedConfig advancedConfig = AdvancedConfig.getInstance();

View File

@ -8,9 +8,9 @@ import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent;
import com.gmail.nossr50.mods.ModChecks;
import com.gmail.nossr50.skills.SkillTools;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.ModChecks;
public class SuperBreakerEventHandler {
private MiningManager manager;

View File

@ -12,15 +12,15 @@ import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.datatypes.mods.CustomBlock;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mods.ModChecks;
import com.gmail.nossr50.mods.datatypes.CustomBlock;
import com.gmail.nossr50.skills.Combat;
import com.gmail.nossr50.skills.SkillType;
import com.gmail.nossr50.skills.SkillTools;
import com.gmail.nossr50.skills.woodcutting.Woodcutting.ExperienceGainMethod;
import com.gmail.nossr50.util.BlockChecks;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.ModChecks;
import com.gmail.nossr50.util.Users;
public final class TreeFeller {

View File

@ -12,12 +12,12 @@ import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.mods.CustomBlock;
import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent;
import com.gmail.nossr50.mods.ModChecks;
import com.gmail.nossr50.mods.datatypes.CustomBlock;
import com.gmail.nossr50.skills.SkillType;
import com.gmail.nossr50.skills.SkillTools;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.ModChecks;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.Users;

View File

@ -9,7 +9,8 @@ import org.bukkit.material.MaterialData;
import org.bukkit.material.CocoaPlant.CocoaPlantSize;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.config.mods.CustomBlocksConfig;
import com.gmail.nossr50.mods.ModChecks;
import com.gmail.nossr50.mods.config.CustomBlocksConfig;
public final class BlockChecks {
private static Config configInstance = Config.getInstance();

View File

@ -7,8 +7,8 @@ import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.api.SpoutToolsAPI;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.config.mods.CustomArmorConfig;
import com.gmail.nossr50.config.mods.CustomToolsConfig;
import com.gmail.nossr50.mods.config.CustomArmorConfig;
import com.gmail.nossr50.mods.config.CustomToolsConfig;
public class ItemChecks {
private static Config configInstance = Config.getInstance();

View File

@ -23,6 +23,7 @@ import com.gmail.nossr50.events.fake.FakeBlockBreakEvent;
import com.gmail.nossr50.events.fake.FakeBlockDamageEvent;
import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent;
import com.gmail.nossr50.events.items.McMMOItemSpawnEvent;
import com.gmail.nossr50.mods.ModChecks;
import com.gmail.nossr50.party.PartyManager;
public final class Misc {