mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 05:36:46 +01:00
Custom mod support refactoring.
This commit is contained in:
parent
62a037a4fd
commit
852872f55c
@ -6,13 +6,13 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.datatypes.mods.CustomTool;
|
|
||||||
import com.gmail.nossr50.events.experience.McMMOPlayerXpGainEvent;
|
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.Party;
|
||||||
import com.gmail.nossr50.party.PartyManager;
|
import com.gmail.nossr50.party.PartyManager;
|
||||||
import com.gmail.nossr50.skills.SkillType;
|
import com.gmail.nossr50.skills.SkillType;
|
||||||
import com.gmail.nossr50.spout.huds.SpoutHud;
|
import com.gmail.nossr50.spout.huds.SpoutHud;
|
||||||
import com.gmail.nossr50.util.ModChecks;
|
|
||||||
import com.gmail.nossr50.util.Permissions;
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
|
||||||
public class McMMOPlayer {
|
public class McMMOPlayer {
|
||||||
|
@ -34,9 +34,6 @@ import com.gmail.nossr50.config.AdvancedConfig;
|
|||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.config.HiddenConfig;
|
import com.gmail.nossr50.config.HiddenConfig;
|
||||||
import com.gmail.nossr50.config.TreasuresConfig;
|
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.Database;
|
||||||
import com.gmail.nossr50.database.commands.McpurgeCommand;
|
import com.gmail.nossr50.database.commands.McpurgeCommand;
|
||||||
import com.gmail.nossr50.database.commands.McremoveCommand;
|
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.PlayerListener;
|
||||||
import com.gmail.nossr50.listeners.WorldListener;
|
import com.gmail.nossr50.listeners.WorldListener;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
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.PartyManager;
|
||||||
import com.gmail.nossr50.party.commands.ACommand;
|
import com.gmail.nossr50.party.commands.ACommand;
|
||||||
import com.gmail.nossr50.party.commands.PCommand;
|
import com.gmail.nossr50.party.commands.PCommand;
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
package com.gmail.nossr50.util;
|
package com.gmail.nossr50.mods;
|
||||||
|
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.material.MaterialData;
|
import org.bukkit.material.MaterialData;
|
||||||
|
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.config.mods.CustomArmorConfig;
|
import com.gmail.nossr50.mods.config.CustomArmorConfig;
|
||||||
import com.gmail.nossr50.config.mods.CustomBlocksConfig;
|
import com.gmail.nossr50.mods.config.CustomBlocksConfig;
|
||||||
import com.gmail.nossr50.config.mods.CustomToolsConfig;
|
import com.gmail.nossr50.mods.config.CustomToolsConfig;
|
||||||
import com.gmail.nossr50.datatypes.mods.CustomBlock;
|
import com.gmail.nossr50.mods.datatypes.CustomBlock;
|
||||||
import com.gmail.nossr50.datatypes.mods.CustomItem;
|
import com.gmail.nossr50.mods.datatypes.CustomItem;
|
||||||
import com.gmail.nossr50.datatypes.mods.CustomTool;
|
import com.gmail.nossr50.mods.datatypes.CustomTool;
|
||||||
|
|
||||||
public final class ModChecks {
|
public final class ModChecks {
|
||||||
private static Config configInstance = Config.getInstance();
|
private static Config configInstance = Config.getInstance();
|
@ -1,4 +1,4 @@
|
|||||||
package com.gmail.nossr50.config.mods;
|
package com.gmail.nossr50.mods.config;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -8,7 +8,7 @@ import java.util.Set;
|
|||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
|
|
||||||
import com.gmail.nossr50.config.ConfigLoader;
|
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.Repairable;
|
||||||
import com.gmail.nossr50.skills.repair.RepairableFactory;
|
import com.gmail.nossr50.skills.repair.RepairableFactory;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.gmail.nossr50.config.mods;
|
package com.gmail.nossr50.mods.config;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -9,7 +9,7 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
import org.bukkit.material.MaterialData;
|
import org.bukkit.material.MaterialData;
|
||||||
|
|
||||||
import com.gmail.nossr50.config.ConfigLoader;
|
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 {
|
public class CustomBlocksConfig extends ConfigLoader {
|
||||||
private static CustomBlocksConfig instance;
|
private static CustomBlocksConfig instance;
|
@ -1,4 +1,4 @@
|
|||||||
package com.gmail.nossr50.config.mods;
|
package com.gmail.nossr50.mods.config;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -8,7 +8,7 @@ import java.util.Set;
|
|||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
|
|
||||||
import com.gmail.nossr50.config.ConfigLoader;
|
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.Repairable;
|
||||||
import com.gmail.nossr50.skills.repair.RepairableFactory;
|
import com.gmail.nossr50.skills.repair.RepairableFactory;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.gmail.nossr50.datatypes.mods;
|
package com.gmail.nossr50.mods.datatypes;
|
||||||
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.gmail.nossr50.datatypes.mods;
|
package com.gmail.nossr50.mods.datatypes;
|
||||||
|
|
||||||
public class CustomItem {
|
public class CustomItem {
|
||||||
protected int itemID;
|
protected int itemID;
|
@ -1,4 +1,4 @@
|
|||||||
package com.gmail.nossr50.datatypes.mods;
|
package com.gmail.nossr50.mods.datatypes;
|
||||||
|
|
||||||
public class CustomTool extends CustomItem {
|
public class CustomTool extends CustomItem {
|
||||||
private double xpMultiplier;
|
private double xpMultiplier;
|
@ -16,11 +16,11 @@ public class ShareHandler {
|
|||||||
public static double partyShareRange = Config.getInstance().getPartyShareRange();
|
public static double partyShareRange = Config.getInstance().getPartyShareRange();
|
||||||
public static double partyShareBonus = Config.getInstance().getPartyShareBonus();
|
public static double partyShareBonus = Config.getInstance().getPartyShareBonus();
|
||||||
|
|
||||||
protected enum PartyShareType {
|
// protected enum PartyShareType {
|
||||||
NO_SHARE,
|
// NO_SHARE,
|
||||||
RANDOM,
|
// RANDOM,
|
||||||
EQUAL,
|
// EQUAL,
|
||||||
};
|
// };
|
||||||
|
|
||||||
public static double checkXpSharing(int oldExp, Player player, Party party) {
|
public static double checkXpSharing(int oldExp, Player player, Party party) {
|
||||||
int newExp = oldExp;
|
int newExp = oldExp;
|
||||||
|
@ -14,11 +14,11 @@ import com.gmail.nossr50.config.Config;
|
|||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.events.experience.McMMOPlayerLevelUpEvent;
|
import com.gmail.nossr50.events.experience.McMMOPlayerLevelUpEvent;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
|
import com.gmail.nossr50.mods.ModChecks;
|
||||||
import com.gmail.nossr50.party.ShareHandler;
|
import com.gmail.nossr50.party.ShareHandler;
|
||||||
import com.gmail.nossr50.spout.SpoutConfig;
|
import com.gmail.nossr50.spout.SpoutConfig;
|
||||||
import com.gmail.nossr50.spout.SpoutTools;
|
import com.gmail.nossr50.spout.SpoutTools;
|
||||||
import com.gmail.nossr50.util.Misc;
|
import com.gmail.nossr50.util.Misc;
|
||||||
import com.gmail.nossr50.util.ModChecks;
|
|
||||||
import com.gmail.nossr50.util.Permissions;
|
import com.gmail.nossr50.util.Permissions;
|
||||||
import com.gmail.nossr50.util.Users;
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
|
@ -16,10 +16,10 @@ import com.gmail.nossr50.config.TreasuresConfig;
|
|||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.treasure.ExcavationTreasure;
|
import com.gmail.nossr50.datatypes.treasure.ExcavationTreasure;
|
||||||
import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent;
|
import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent;
|
||||||
|
import com.gmail.nossr50.mods.ModChecks;
|
||||||
import com.gmail.nossr50.skills.SkillType;
|
import com.gmail.nossr50.skills.SkillType;
|
||||||
import com.gmail.nossr50.skills.SkillTools;
|
import com.gmail.nossr50.skills.SkillTools;
|
||||||
import com.gmail.nossr50.util.Misc;
|
import com.gmail.nossr50.util.Misc;
|
||||||
import com.gmail.nossr50.util.ModChecks;
|
|
||||||
import com.gmail.nossr50.util.Permissions;
|
import com.gmail.nossr50.util.Permissions;
|
||||||
import com.gmail.nossr50.util.Users;
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
|
@ -19,15 +19,15 @@ import com.gmail.nossr50.config.AdvancedConfig;
|
|||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.config.TreasuresConfig;
|
import com.gmail.nossr50.config.TreasuresConfig;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.mods.CustomBlock;
|
|
||||||
import com.gmail.nossr50.datatypes.treasure.HylianTreasure;
|
import com.gmail.nossr50.datatypes.treasure.HylianTreasure;
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
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.runnables.GreenThumbTimer;
|
||||||
import com.gmail.nossr50.skills.AbilityType;
|
import com.gmail.nossr50.skills.AbilityType;
|
||||||
import com.gmail.nossr50.skills.SkillType;
|
import com.gmail.nossr50.skills.SkillType;
|
||||||
import com.gmail.nossr50.skills.SkillTools;
|
import com.gmail.nossr50.skills.SkillTools;
|
||||||
import com.gmail.nossr50.util.Misc;
|
import com.gmail.nossr50.util.Misc;
|
||||||
import com.gmail.nossr50.util.ModChecks;
|
|
||||||
import com.gmail.nossr50.util.Permissions;
|
import com.gmail.nossr50.util.Permissions;
|
||||||
import com.gmail.nossr50.util.Users;
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
|
@ -12,11 +12,11 @@ import org.bukkit.material.MaterialData;
|
|||||||
import com.gmail.nossr50.config.AdvancedConfig;
|
import com.gmail.nossr50.config.AdvancedConfig;
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
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.SkillType;
|
||||||
import com.gmail.nossr50.skills.SkillTools;
|
import com.gmail.nossr50.skills.SkillTools;
|
||||||
import com.gmail.nossr50.util.Misc;
|
import com.gmail.nossr50.util.Misc;
|
||||||
import com.gmail.nossr50.util.ModChecks;
|
|
||||||
|
|
||||||
public class Mining {
|
public class Mining {
|
||||||
private static AdvancedConfig advancedConfig = AdvancedConfig.getInstance();
|
private static AdvancedConfig advancedConfig = AdvancedConfig.getInstance();
|
||||||
|
@ -8,9 +8,9 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent;
|
import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent;
|
||||||
|
import com.gmail.nossr50.mods.ModChecks;
|
||||||
import com.gmail.nossr50.skills.SkillTools;
|
import com.gmail.nossr50.skills.SkillTools;
|
||||||
import com.gmail.nossr50.util.Misc;
|
import com.gmail.nossr50.util.Misc;
|
||||||
import com.gmail.nossr50.util.ModChecks;
|
|
||||||
|
|
||||||
public class SuperBreakerEventHandler {
|
public class SuperBreakerEventHandler {
|
||||||
private MiningManager manager;
|
private MiningManager manager;
|
||||||
|
@ -12,15 +12,15 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.datatypes.mods.CustomBlock;
|
|
||||||
import com.gmail.nossr50.locale.LocaleLoader;
|
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.Combat;
|
||||||
import com.gmail.nossr50.skills.SkillType;
|
import com.gmail.nossr50.skills.SkillType;
|
||||||
import com.gmail.nossr50.skills.SkillTools;
|
import com.gmail.nossr50.skills.SkillTools;
|
||||||
import com.gmail.nossr50.skills.woodcutting.Woodcutting.ExperienceGainMethod;
|
import com.gmail.nossr50.skills.woodcutting.Woodcutting.ExperienceGainMethod;
|
||||||
import com.gmail.nossr50.util.BlockChecks;
|
import com.gmail.nossr50.util.BlockChecks;
|
||||||
import com.gmail.nossr50.util.Misc;
|
import com.gmail.nossr50.util.Misc;
|
||||||
import com.gmail.nossr50.util.ModChecks;
|
|
||||||
import com.gmail.nossr50.util.Users;
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public final class TreeFeller {
|
public final class TreeFeller {
|
||||||
|
@ -12,12 +12,12 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.config.AdvancedConfig;
|
import com.gmail.nossr50.config.AdvancedConfig;
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.datatypes.mods.CustomBlock;
|
|
||||||
import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent;
|
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.SkillType;
|
||||||
import com.gmail.nossr50.skills.SkillTools;
|
import com.gmail.nossr50.skills.SkillTools;
|
||||||
import com.gmail.nossr50.util.Misc;
|
import com.gmail.nossr50.util.Misc;
|
||||||
import com.gmail.nossr50.util.ModChecks;
|
|
||||||
import com.gmail.nossr50.util.Permissions;
|
import com.gmail.nossr50.util.Permissions;
|
||||||
import com.gmail.nossr50.util.Users;
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
|
@ -9,7 +9,8 @@ import org.bukkit.material.MaterialData;
|
|||||||
import org.bukkit.material.CocoaPlant.CocoaPlantSize;
|
import org.bukkit.material.CocoaPlant.CocoaPlantSize;
|
||||||
|
|
||||||
import com.gmail.nossr50.config.Config;
|
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 {
|
public final class BlockChecks {
|
||||||
private static Config configInstance = Config.getInstance();
|
private static Config configInstance = Config.getInstance();
|
||||||
|
@ -7,8 +7,8 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.api.SpoutToolsAPI;
|
import com.gmail.nossr50.api.SpoutToolsAPI;
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.config.mods.CustomArmorConfig;
|
import com.gmail.nossr50.mods.config.CustomArmorConfig;
|
||||||
import com.gmail.nossr50.config.mods.CustomToolsConfig;
|
import com.gmail.nossr50.mods.config.CustomToolsConfig;
|
||||||
|
|
||||||
public class ItemChecks {
|
public class ItemChecks {
|
||||||
private static Config configInstance = Config.getInstance();
|
private static Config configInstance = Config.getInstance();
|
||||||
|
@ -23,6 +23,7 @@ import com.gmail.nossr50.events.fake.FakeBlockBreakEvent;
|
|||||||
import com.gmail.nossr50.events.fake.FakeBlockDamageEvent;
|
import com.gmail.nossr50.events.fake.FakeBlockDamageEvent;
|
||||||
import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent;
|
import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent;
|
||||||
import com.gmail.nossr50.events.items.McMMOItemSpawnEvent;
|
import com.gmail.nossr50.events.items.McMMOItemSpawnEvent;
|
||||||
|
import com.gmail.nossr50.mods.ModChecks;
|
||||||
import com.gmail.nossr50.party.PartyManager;
|
import com.gmail.nossr50.party.PartyManager;
|
||||||
|
|
||||||
public final class Misc {
|
public final class Misc {
|
||||||
|
Loading…
Reference in New Issue
Block a user