mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 03:34:43 +02:00
MASSIVE config overhaul - most keys are now based on the "proper" name
given to a material or entity by Bukkit. This WILL wipe some custom values you may have set, so please verify that your values are what you want them to be after the new config file is generated.
This commit is contained in:
@ -17,9 +17,6 @@ public class Acrobatics {
|
||||
public static int rollXpModifier = AdvancedConfig.getInstance().getRollXPModifier();
|
||||
public static int fallXpModifier = AdvancedConfig.getInstance().getFallXPModifier();
|
||||
|
||||
public static boolean pvpEnabled = Config.getInstance().getAcrobaticsPVP();
|
||||
public static boolean pveEnabled = Config.getInstance().getAcrobaticsPVE();
|
||||
|
||||
public static boolean afkLevelingDisabled = Config.getInstance().getAcrobaticsAFKDisabled();
|
||||
public static boolean dodgeLightningDisabled = Config.getInstance().getDodgeLightningDisabled();
|
||||
}
|
@ -9,7 +9,6 @@ import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
|
||||
public class Archery {
|
||||
@ -26,9 +25,6 @@ public class Archery {
|
||||
public static double dazeMaxBonus = AdvancedConfig.getInstance().getDazeBonusMax();
|
||||
public static int dazeModifier = AdvancedConfig.getInstance().getDazeModifier();
|
||||
|
||||
public static boolean pvpEnabled = Config.getInstance().getArcheryPVP();
|
||||
public static boolean pveEnabled = Config.getInstance().getArcheryPVE();
|
||||
|
||||
public static double distanceXpModifer = 0.025;
|
||||
|
||||
protected static void incrementTrackerValue(LivingEntity livingEntity) {
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.gmail.nossr50.skills.axes;
|
||||
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
|
||||
public class Axes {
|
||||
public static int bonusDamageMaxBonus = AdvancedConfig.getInstance().getBonusDamageAxesBonusMax();
|
||||
@ -20,7 +19,4 @@ public class Axes {
|
||||
public static int greaterImpactBonusDamage = AdvancedConfig.getInstance().getGreaterImpactBonusDamage();
|
||||
|
||||
public static int skullSplitterModifier = AdvancedConfig.getInstance().getSkullSplitterModifier();
|
||||
|
||||
public static boolean pvpEnabled = Config.getInstance().getAxesPVP();
|
||||
public static boolean pveEnabled = Config.getInstance().getAxesPVE();
|
||||
}
|
||||
|
@ -28,40 +28,10 @@ public class Excavation {
|
||||
*/
|
||||
public static void excavationProcCheck(Block block, McMMOPlayer mcMMOPlayer) {
|
||||
Material material = block.getType();
|
||||
int xp;
|
||||
int xp = Config.getInstance().getXp(SkillType.EXCAVATION, material);
|
||||
|
||||
switch (material) {
|
||||
case CLAY:
|
||||
xp = Config.getInstance().getExcavationClayXP();
|
||||
break;
|
||||
|
||||
case DIRT:
|
||||
xp = Config.getInstance().getExcavationDirtXP();
|
||||
break;
|
||||
|
||||
case GRASS:
|
||||
xp = Config.getInstance().getExcavationGrassXP();
|
||||
break;
|
||||
|
||||
case GRAVEL:
|
||||
xp = Config.getInstance().getExcavationGravelXP();
|
||||
break;
|
||||
|
||||
case MYCEL:
|
||||
xp = Config.getInstance().getExcavationMycelXP();
|
||||
break;
|
||||
|
||||
case SAND:
|
||||
xp = Config.getInstance().getExcavationSandXP();
|
||||
break;
|
||||
|
||||
case SOUL_SAND:
|
||||
xp = Config.getInstance().getExcavationSoulSandXP();
|
||||
break;
|
||||
|
||||
default:
|
||||
xp = ModChecks.getCustomBlock(block).getXpGain();;
|
||||
break;
|
||||
if (xp == 0 && ModChecks.isCustomExcavationBlock(block)) {
|
||||
xp = ModChecks.getCustomBlock(block).getXpGain();
|
||||
}
|
||||
|
||||
Player player = mcMMOPlayer.getPlayer();
|
||||
|
@ -45,7 +45,6 @@ public class Herbalism {
|
||||
|
||||
public static double doubleDropsMaxChance = AdvancedConfig.getInstance().getHerbalismDoubleDropsChanceMax();
|
||||
public static int doubleDropsMaxLevel = AdvancedConfig.getInstance().getHerbalismDoubleDropsMaxLevel();
|
||||
public static boolean doubleDropsDisabled = Config.getInstance().herbalismDoubleDropsDisabled();
|
||||
|
||||
public static double hylianLuckMaxChance = AdvancedConfig.getInstance().getHylianLuckChanceMax();
|
||||
public static int hylianLuckMaxLevel = AdvancedConfig.getInstance().getHylianLucksMaxLevel();
|
||||
|
@ -8,46 +8,43 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.skills.utilities.SkillType;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
public enum HerbalismBlock {
|
||||
BROWN_MUSHROOM(Material.BROWN_MUSHROOM, Config.getInstance().getHerbalismXPMushrooms(), Config.getInstance().getBrownMushroomsDoubleDropsEnabled()),
|
||||
CACTUS(Material.CACTUS, Config.getInstance().getHerbalismXPCactus(), Config.getInstance().getCactiDoubleDropsEnabled()),
|
||||
CARROT(Material.CARROT, Material.CARROT_ITEM, Config.getInstance().getHerbalismXPCarrot(), Config.getInstance().getCarrotDoubleDropsEnabled()),
|
||||
COCOA(Material.COCOA, new ItemStack(Material.INK_SACK, 1, DyeColor.BROWN.getDyeData()), Config.getInstance().getHerbalismXPCocoa(), Config.getInstance().getCocoaDoubleDropsEnabled()),
|
||||
CROPS(Material.CROPS, Material.WHEAT, Config.getInstance().getHerbalismXPWheat(), Config.getInstance().getWheatDoubleDropsEnabled()),
|
||||
MELON_BLOCK(Material.MELON_BLOCK, Material.MELON, Config.getInstance().getHerbalismXPMelon(), Config.getInstance().getMelonsDoubleDropsEnabled()),
|
||||
NETHER_WARTS(Material.NETHER_WARTS, Material.NETHER_STALK, Config.getInstance().getHerbalismXPNetherWart(), Config.getInstance().getNetherWartsDoubleDropsEnabled()),
|
||||
POTATO(Material.POTATO, Material.POTATO_ITEM, Config.getInstance().getHerbalismXPPotato(), Config.getInstance().getPotatoDoubleDropsEnabled()),
|
||||
PUMPKIN(Material.PUMPKIN, Config.getInstance().getHerbalismXPPumpkin(), Config.getInstance().getPumpkinsDoubleDropsEnabled()),
|
||||
RED_MUSHROOM(Material.RED_MUSHROOM, Config.getInstance().getHerbalismXPMushrooms(), Config.getInstance().getRedMushroomsDoubleDropsEnabled()),
|
||||
RED_ROSE(Material.RED_ROSE, Config.getInstance().getHerbalismXPFlowers(), Config.getInstance().getRedRosesDoubleDropsEnabled()),
|
||||
SUGAR_CANE_BLOCK(Material.SUGAR_CANE_BLOCK, Material.SUGAR_CANE, Config.getInstance().getHerbalismXPSugarCane(), Config.getInstance().getSugarCaneDoubleDropsEnabled()),
|
||||
VINE(Material.VINE, Config.getInstance().getHerbalismXPVines(), Config.getInstance().getVinesDoubleDropsEnabled()),
|
||||
WATER_LILY(Material.WATER_LILY, Config.getInstance().getHerbalismXPLilyPads(), Config.getInstance().getWaterLiliesDoubleDropsEnabled()),
|
||||
YELLOW_FLOWER(Material.YELLOW_FLOWER, Config.getInstance().getHerbalismXPFlowers(), Config.getInstance().getYellowFlowersDoubleDropsEnabled());
|
||||
BROWN_MUSHROOM(Material.BROWN_MUSHROOM),
|
||||
CACTUS(Material.CACTUS),
|
||||
CARROT(Material.CARROT, Material.CARROT_ITEM),
|
||||
COCOA(Material.COCOA, new ItemStack(Material.INK_SACK, 1, DyeColor.BROWN.getDyeData())),
|
||||
CROPS(Material.CROPS, Material.WHEAT),
|
||||
MELON_BLOCK(Material.MELON_BLOCK, Material.MELON),
|
||||
NETHER_WARTS(Material.NETHER_WARTS, Material.NETHER_STALK),
|
||||
POTATO(Material.POTATO, Material.POTATO_ITEM),
|
||||
PUMPKIN(Material.PUMPKIN),
|
||||
RED_MUSHROOM(Material.RED_MUSHROOM),
|
||||
RED_ROSE(Material.RED_ROSE),
|
||||
SUGAR_CANE_BLOCK(Material.SUGAR_CANE_BLOCK, Material.SUGAR_CANE),
|
||||
VINE(Material.VINE),
|
||||
WATER_LILY(Material.WATER_LILY),
|
||||
YELLOW_FLOWER(Material.YELLOW_FLOWER);
|
||||
|
||||
private Material blockType;
|
||||
private ItemStack dropItem;
|
||||
private int xpGain;
|
||||
private boolean doubleDropsEnabled;
|
||||
private final static Map<Material, HerbalismBlock> BY_MATERIAL = Maps.newHashMap();
|
||||
|
||||
private HerbalismBlock(Material blockType, int xpGain, boolean doubleDropsEnabled) {
|
||||
this(blockType, new ItemStack(blockType), xpGain, doubleDropsEnabled);
|
||||
private HerbalismBlock(Material blockType) {
|
||||
this(blockType, new ItemStack(blockType));
|
||||
}
|
||||
|
||||
private HerbalismBlock(Material blockType, Material dropType, int xpGain, boolean doubleDropsEnabled) {
|
||||
this(blockType, new ItemStack(dropType), xpGain, doubleDropsEnabled);
|
||||
private HerbalismBlock(Material blockType, Material dropType) {
|
||||
this(blockType, new ItemStack(dropType));
|
||||
}
|
||||
|
||||
private HerbalismBlock(Material blockType, ItemStack dropItem, int xpGain, boolean doubleDropsEnabled) {
|
||||
private HerbalismBlock(Material blockType, ItemStack dropItem) {
|
||||
this.blockType = blockType;
|
||||
this.dropItem = dropItem;
|
||||
this.xpGain = xpGain;
|
||||
this.doubleDropsEnabled = doubleDropsEnabled;
|
||||
}
|
||||
|
||||
static {
|
||||
@ -61,11 +58,11 @@ public enum HerbalismBlock {
|
||||
}
|
||||
|
||||
public int getXpGain() {
|
||||
return xpGain;
|
||||
return Config.getInstance().getXp(SkillType.HERBALISM, blockType);
|
||||
}
|
||||
|
||||
public boolean canDoubleDrop() {
|
||||
return doubleDropsEnabled;
|
||||
return Config.getInstance().getDoubleDropsEnabled(SkillType.HERBALISM, blockType);
|
||||
}
|
||||
|
||||
public boolean hasGreenThumbPermission(Player player) {
|
||||
|
@ -67,7 +67,7 @@ public class HerbalismCommand extends SkillCommand {
|
||||
canGreenThumbBlocks = (Permissions.greenThumbBlock(player, Material.DIRT) || Permissions.greenThumbBlock(player, Material.COBBLESTONE) || Permissions.greenThumbBlock(player, Material.COBBLE_WALL) || Permissions.greenThumbBlock(player, Material.SMOOTH_BRICK));
|
||||
canFarmersDiet = Permissions.farmersDiet(player);
|
||||
canDoubleDrop = Permissions.doubleDrops(player, skill);
|
||||
doubleDropsDisabled = Herbalism.doubleDropsDisabled;
|
||||
doubleDropsDisabled = skill.getDoubleDropsDisabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -6,7 +6,6 @@ import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.material.MaterialData;
|
||||
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
@ -18,12 +17,9 @@ import com.gmail.nossr50.util.Misc;
|
||||
|
||||
public class Mining {
|
||||
private static AdvancedConfig advancedConfig = AdvancedConfig.getInstance();
|
||||
private static Config config = Config.getInstance();
|
||||
|
||||
public static int doubleDropsMaxLevel = advancedConfig.getMiningDoubleDropMaxLevel();
|
||||
public static double doubleDropsMaxChance = advancedConfig.getMiningDoubleDropChance();
|
||||
public static boolean doubleDropsDisabled = config.miningDoubleDropsDisabled();
|
||||
|
||||
|
||||
public static final int DIAMOND_TOOL_TIER = 4;
|
||||
public static final int IRON_TOOL_TIER = 3;
|
||||
@ -36,71 +32,13 @@ public class Mining {
|
||||
* @param block The block to award XP for
|
||||
*/
|
||||
protected static void miningXP(McMMOPlayer mcMMOPlayer, Block block, Material type) {
|
||||
int xp = 0;
|
||||
int xp = Config.getInstance().getXp(SkillType.MINING, type);
|
||||
|
||||
switch (type) {
|
||||
case COAL_ORE:
|
||||
xp += config.getMiningXPCoalOre();
|
||||
break;
|
||||
|
||||
case DIAMOND_ORE:
|
||||
xp += config.getMiningXPDiamondOre();
|
||||
break;
|
||||
|
||||
case ENDER_STONE:
|
||||
xp += config.getMiningXPEndStone();
|
||||
break;
|
||||
|
||||
case GLOWING_REDSTONE_ORE:
|
||||
case REDSTONE_ORE:
|
||||
xp += config.getMiningXPRedstoneOre();
|
||||
break;
|
||||
|
||||
case GLOWSTONE:
|
||||
xp += config.getMiningXPGlowstone();
|
||||
break;
|
||||
|
||||
case GOLD_ORE:
|
||||
xp += config.getMiningXPGoldOre();
|
||||
break;
|
||||
|
||||
case IRON_ORE:
|
||||
xp += config.getMiningXPIronOre();
|
||||
break;
|
||||
|
||||
case LAPIS_ORE:
|
||||
xp += config.getMiningXPLapisOre();
|
||||
break;
|
||||
|
||||
case MOSSY_COBBLESTONE:
|
||||
xp += config.getMiningXPMossyStone();
|
||||
break;
|
||||
|
||||
case NETHERRACK:
|
||||
xp += config.getMiningXPNetherrack();
|
||||
break;
|
||||
|
||||
case OBSIDIAN:
|
||||
xp += config.getMiningXPObsidian();
|
||||
break;
|
||||
|
||||
case SANDSTONE:
|
||||
xp += config.getMiningXPSandstone();
|
||||
break;
|
||||
|
||||
case STONE:
|
||||
xp += config.getMiningXPStone();
|
||||
break;
|
||||
|
||||
case EMERALD_ORE:
|
||||
xp += config.getMiningXPEmeraldOre();
|
||||
break;
|
||||
|
||||
default:
|
||||
if (ModChecks.isCustomMiningBlock(block)) {
|
||||
xp += ModChecks.getCustomBlock(block).getXpGain();
|
||||
}
|
||||
break;
|
||||
if (type == Material.GLOWING_REDSTONE_ORE) {
|
||||
xp = Config.getInstance().getXp(SkillType.MINING, Material.REDSTONE_ORE);
|
||||
}
|
||||
else if (xp == 0 && ModChecks.isCustomMiningBlock(block)) {
|
||||
xp = ModChecks.getCustomBlock(block).getXpGain();
|
||||
}
|
||||
|
||||
mcMMOPlayer.beginXpGain(SkillType.MINING, xp);
|
||||
@ -116,6 +54,10 @@ public class Mining {
|
||||
protected static void silkTouchDrops(Block block, Location location, Material type) {
|
||||
ItemStack item = new ItemStack(type);
|
||||
|
||||
if (type != Material.GLOWING_REDSTONE_ORE && !Config.getInstance().getDoubleDropsEnabled(SkillType.MINING, type)) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case ENDER_STONE:
|
||||
case GOLD_ORE:
|
||||
@ -127,52 +69,25 @@ public class Mining {
|
||||
miningDrops(block, location, type);
|
||||
break;
|
||||
|
||||
case COAL_ORE:
|
||||
if (config.getCoalDoubleDropsEnabled()) {
|
||||
Misc.dropItem(location, item);
|
||||
}
|
||||
break;
|
||||
|
||||
case DIAMOND_ORE:
|
||||
if (config.getDiamondDoubleDropsEnabled()) {
|
||||
Misc.dropItem(location, item);
|
||||
}
|
||||
break;
|
||||
|
||||
case GLOWING_REDSTONE_ORE:
|
||||
if (Config.getInstance().getDoubleDropsEnabled(SkillType.MINING, Material.REDSTONE_ORE)) {
|
||||
Misc.dropItem(location, item);
|
||||
}
|
||||
break;
|
||||
|
||||
case COAL_ORE:
|
||||
case DIAMOND_ORE:
|
||||
case REDSTONE_ORE:
|
||||
if (config.getRedstoneDoubleDropsEnabled()) {
|
||||
Misc.dropItem(location, item);
|
||||
}
|
||||
break;
|
||||
|
||||
case GLOWSTONE:
|
||||
if (config.getGlowstoneDoubleDropsEnabled()) {
|
||||
Misc.dropItem(location, item);
|
||||
}
|
||||
break;
|
||||
|
||||
case LAPIS_ORE:
|
||||
if (config.getLapisDoubleDropsEnabled()) {
|
||||
Misc.dropItem(location, item);
|
||||
}
|
||||
break;
|
||||
|
||||
case STONE:
|
||||
if (config.getStoneDoubleDropsEnabled()) {
|
||||
Misc.dropItem(location, item);
|
||||
}
|
||||
break;
|
||||
|
||||
case EMERALD_ORE:
|
||||
if (config.getEmeraldDoubleDropsEnabled()) {
|
||||
Misc.dropItem(location, item);
|
||||
}
|
||||
Misc.dropItem(location, item);
|
||||
break;
|
||||
|
||||
default:
|
||||
if (ModChecks.isCustomMiningBlock(block)) {
|
||||
ItemStack dropItem = (new MaterialData(block.getTypeId(), block.getData())).toItemStack(1);
|
||||
ItemStack dropItem = new ItemStack(block.getTypeId(), 1, block.getData());
|
||||
|
||||
Misc.dropItem(location, dropItem);
|
||||
}
|
||||
@ -188,33 +103,31 @@ public class Mining {
|
||||
* @param type The material type of the block
|
||||
*/
|
||||
protected static void miningDrops(Block block, Location location, Material type) {
|
||||
if (type != Material.GLOWING_REDSTONE_ORE && !Config.getInstance().getDoubleDropsEnabled(SkillType.MINING, type)) {
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack item = new ItemStack(type);
|
||||
|
||||
switch (type) {
|
||||
case COAL_ORE:
|
||||
if (config.getCoalDoubleDropsEnabled()) {
|
||||
item = (new MaterialData(Material.COAL, CoalType.COAL.getData())).toItemStack(1);
|
||||
|
||||
Misc.dropItem(location, item);
|
||||
}
|
||||
item = new ItemStack(Material.COAL, 1, CoalType.COAL.getData());
|
||||
Misc.dropItem(location, item);
|
||||
break;
|
||||
|
||||
case DIAMOND_ORE:
|
||||
if (config.getDiamondDoubleDropsEnabled()) {
|
||||
item = new ItemStack(Material.DIAMOND);
|
||||
Misc.dropItem(location, item);
|
||||
}
|
||||
item = new ItemStack(Material.DIAMOND);
|
||||
Misc.dropItem(location, item);
|
||||
break;
|
||||
|
||||
case ENDER_STONE:
|
||||
if (config.getEndStoneDoubleDropsEnabled()) {
|
||||
Misc.dropItem(location, item);
|
||||
}
|
||||
case EMERALD_ORE:
|
||||
item = new ItemStack(Material.EMERALD);
|
||||
Misc.dropItem(location, item);
|
||||
break;
|
||||
|
||||
case GLOWING_REDSTONE_ORE:
|
||||
case REDSTONE_ORE:
|
||||
if (config.getRedstoneDoubleDropsEnabled()) {
|
||||
if (Config.getInstance().getDoubleDropsEnabled(SkillType.MINING, Material.REDSTONE_ORE)) {
|
||||
item = new ItemStack(Material.REDSTONE);
|
||||
Misc.dropItems(location, item, 4);
|
||||
Misc.randomDropItem(location, item, 50);
|
||||
@ -222,69 +135,30 @@ public class Mining {
|
||||
break;
|
||||
|
||||
case GLOWSTONE:
|
||||
if (config.getGlowstoneDoubleDropsEnabled()) {
|
||||
item = new ItemStack(Material.GLOWSTONE_DUST);
|
||||
Misc.dropItems(location, item, 2);
|
||||
Misc.randomDropItems(location, item, 2);
|
||||
}
|
||||
break;
|
||||
|
||||
case GOLD_ORE:
|
||||
if (config.getGoldDoubleDropsEnabled()) {
|
||||
Misc.dropItem(location, item);
|
||||
}
|
||||
break;
|
||||
|
||||
case IRON_ORE:
|
||||
if (config.getIronDoubleDropsEnabled()) {
|
||||
Misc.dropItem(location, item);
|
||||
}
|
||||
item = new ItemStack(Material.GLOWSTONE_DUST);
|
||||
Misc.dropItems(location, item, 2);
|
||||
Misc.randomDropItems(location, item, 2);
|
||||
break;
|
||||
|
||||
case LAPIS_ORE:
|
||||
if (config.getLapisDoubleDropsEnabled()) {
|
||||
item = new ItemStack(Material.INK_SACK, 1, DyeColor.BLUE.getDyeData());
|
||||
Misc.dropItems(location, item, 4);
|
||||
Misc.randomDropItems(location, item, 4);
|
||||
}
|
||||
break;
|
||||
|
||||
case MOSSY_COBBLESTONE:
|
||||
if (config.getMossyCobblestoneDoubleDropsEnabled()) {
|
||||
Misc.dropItem(location, item);
|
||||
}
|
||||
break;
|
||||
|
||||
case NETHERRACK:
|
||||
if (config.getNetherrackDoubleDropsEnabled()) {
|
||||
Misc.dropItem(location, item);
|
||||
}
|
||||
break;
|
||||
|
||||
case OBSIDIAN:
|
||||
if (config.getObsidianDoubleDropsEnabled()) {
|
||||
Misc.dropItem(location, item);
|
||||
}
|
||||
break;
|
||||
|
||||
case SANDSTONE:
|
||||
if (config.getSandstoneDoubleDropsEnabled()) {
|
||||
Misc.dropItem(location, item);
|
||||
}
|
||||
item = new ItemStack(Material.INK_SACK, 1, DyeColor.BLUE.getDyeData());
|
||||
Misc.dropItems(location, item, 4);
|
||||
Misc.randomDropItems(location, item, 4);
|
||||
break;
|
||||
|
||||
case STONE:
|
||||
if (config.getStoneDoubleDropsEnabled()) {
|
||||
item = new ItemStack(Material.COBBLESTONE);
|
||||
Misc.dropItem(location, item);
|
||||
}
|
||||
item = new ItemStack(Material.COBBLESTONE);
|
||||
Misc.dropItem(location, item);
|
||||
break;
|
||||
|
||||
case EMERALD_ORE:
|
||||
if (config.getEmeraldDoubleDropsEnabled()) {
|
||||
item = new ItemStack(Material.EMERALD);
|
||||
Misc.dropItem(location, item);
|
||||
}
|
||||
case ENDER_STONE:
|
||||
case GOLD_ORE:
|
||||
case IRON_ORE:
|
||||
case MOSSY_COBBLESTONE:
|
||||
case NETHERRACK:
|
||||
case OBSIDIAN:
|
||||
case SANDSTONE:
|
||||
Misc.dropItem(location, item);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -92,7 +92,7 @@ public class MiningCommand extends SkillCommand {
|
||||
canDemoExpert = Permissions.demolitionsExpertise(player);
|
||||
canDoubleDrop = Permissions.doubleDrops(player, skill);
|
||||
canSuperBreaker = Permissions.superBreaker(player);
|
||||
doubleDropsDisabled = Mining.doubleDropsDisabled;
|
||||
doubleDropsDisabled = skill.getDoubleDropsDisabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -28,40 +28,10 @@ public class SmeltResourceEventHandler {
|
||||
|
||||
protected void handleXPGain() {
|
||||
Material sourceType = event.getSource().getType();
|
||||
int xp = 0;
|
||||
int xp = Config.getInstance().getXp(SkillType.SMELTING, sourceType);
|
||||
|
||||
switch (sourceType) {
|
||||
case COAL_ORE:
|
||||
xp = Config.getInstance().getSmeltingXPCoal();
|
||||
break;
|
||||
|
||||
case GLOWING_REDSTONE_ORE:
|
||||
case REDSTONE_ORE:
|
||||
xp = Config.getInstance().getSmeltingXPRedstone();
|
||||
break;
|
||||
|
||||
case IRON_ORE:
|
||||
xp = Config.getInstance().getSmeltingXPIron();
|
||||
break;
|
||||
|
||||
case GOLD_ORE:
|
||||
xp = Config.getInstance().getSmeltingXPGold();
|
||||
break;
|
||||
|
||||
case DIAMOND_ORE:
|
||||
xp = Config.getInstance().getSmeltingXPDiamond();
|
||||
break;
|
||||
|
||||
case LAPIS_ORE:
|
||||
xp = Config.getInstance().getSmeltingXPLapis();
|
||||
break;
|
||||
|
||||
case EMERALD_ORE:
|
||||
xp = Config.getInstance().getSmeltingXPEmerald();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
if (sourceType == Material.GLOWING_REDSTONE_ORE) {
|
||||
xp = Config.getInstance().getXp(SkillType.SMELTING, Material.REDSTONE_ORE);
|
||||
}
|
||||
|
||||
McMMOPlayer mcMMOPlayer = manager.getMcMMOPlayer();
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.gmail.nossr50.skills.swords;
|
||||
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
|
||||
public class Swords {
|
||||
public static double bleedMaxChance = AdvancedConfig.getInstance().getBleedChanceMax();
|
||||
@ -15,8 +14,5 @@ public class Swords {
|
||||
|
||||
public static int serratedStrikesModifier = AdvancedConfig.getInstance().getSerratedStrikesModifier();
|
||||
public static int serratedStrikesBleedTicks = AdvancedConfig.getInstance().getSerratedStrikesTicks();
|
||||
|
||||
public static boolean pvpEnabled = Config.getInstance().getSwordsPVP();
|
||||
public static boolean pveEnabled = Config.getInstance().getSwordsPVE();
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,4 @@ public class Taming {
|
||||
|
||||
public static int wolfXp = Config.getInstance().getTamingXPWolf();
|
||||
public static int ocelotXp = Config.getInstance().getTamingXPOcelot();
|
||||
|
||||
public static boolean pvpEnabled = Config.getInstance().getTamingPVP();
|
||||
public static boolean pveEnabled = Config.getInstance().getTamingPVE();
|
||||
}
|
||||
|
@ -23,9 +23,6 @@ public class Unarmed {
|
||||
|
||||
public static boolean blockCrackerSmoothBrick = Config.getInstance().getUnarmedBlockCrackerSmoothbrickToCracked();
|
||||
|
||||
public static boolean pvpEnabled = Config.getInstance().getUnarmedPVP();
|
||||
public static boolean pveEnabled = Config.getInstance().getUnarmedPVE();
|
||||
|
||||
public static double berserkDamageModifier = 1.5;
|
||||
|
||||
public static void blockCracker(Player player, Block block) {
|
||||
|
@ -12,8 +12,6 @@ import com.gmail.nossr50.util.StringUtils;
|
||||
|
||||
public enum AbilityType {
|
||||
BERSERK(
|
||||
Config.getInstance().getAbilityCooldownBerserk(),
|
||||
Config.getInstance().getAbilityMaxTicksBerserk(),
|
||||
"Unarmed.Skills.Berserk.On",
|
||||
"Unarmed.Skills.Berserk.Off",
|
||||
"Unarmed.Skills.Berserk.Other.On",
|
||||
@ -21,8 +19,6 @@ public enum AbilityType {
|
||||
"Unarmed.Skills.Berserk.Other.Off"),
|
||||
|
||||
SUPER_BREAKER(
|
||||
Config.getInstance().getAbilityCooldownSuperBreaker(),
|
||||
Config.getInstance().getAbilityMaxTicksSuperBreaker(),
|
||||
"Mining.Skills.SuperBreaker.On",
|
||||
"Mining.Skills.SuperBreaker.Off",
|
||||
"Mining.Skills.SuperBreaker.Other.On",
|
||||
@ -30,8 +26,6 @@ public enum AbilityType {
|
||||
"Mining.Skills.SuperBreaker.Other.Off"),
|
||||
|
||||
GIGA_DRILL_BREAKER(
|
||||
Config.getInstance().getAbilityCooldownGigaDrillBreaker(),
|
||||
Config.getInstance().getAbilityMaxTicksGigaDrillBreaker(),
|
||||
"Excavation.Skills.GigaDrillBreaker.On",
|
||||
"Excavation.Skills.GigaDrillBreaker.Off",
|
||||
"Excavation.Skills.GigaDrillBreaker.Other.On",
|
||||
@ -39,8 +33,6 @@ public enum AbilityType {
|
||||
"Excavation.Skills.GigaDrillBreaker.Other.Off"),
|
||||
|
||||
GREEN_TERRA(
|
||||
Config.getInstance().getAbilityCooldownGreenTerra(),
|
||||
Config.getInstance().getAbilityMaxTicksGreenTerra(),
|
||||
"Herbalism.Skills.GTe.On",
|
||||
"Herbalism.Skills.GTe.Off",
|
||||
"Herbalism.Skills.GTe.Other.On",
|
||||
@ -48,8 +40,6 @@ public enum AbilityType {
|
||||
"Herbalism.Skills.GTe.Other.Off"),
|
||||
|
||||
SKULL_SPLITTER(
|
||||
Config.getInstance().getAbilityCooldownSkullSplitter(),
|
||||
Config.getInstance().getAbilityMaxTicksSkullSplitter(),
|
||||
"Axes.Skills.SS.On",
|
||||
"Axes.Skills.SS.Off",
|
||||
"Axes.Skills.SS.Other.On",
|
||||
@ -57,8 +47,6 @@ public enum AbilityType {
|
||||
"Axes.Skills.SS.Other.Off"),
|
||||
|
||||
TREE_FELLER(
|
||||
Config.getInstance().getAbilityCooldownTreeFeller(),
|
||||
Config.getInstance().getAbilityMaxTicksTreeFeller(),
|
||||
"Woodcutting.Skills.TreeFeller.On",
|
||||
"Woodcutting.Skills.TreeFeller.Off",
|
||||
"Woodcutting.Skills.TreeFeller.Other.On",
|
||||
@ -66,8 +54,6 @@ public enum AbilityType {
|
||||
"Woodcutting.Skills.TreeFeller.Other.Off"),
|
||||
|
||||
SERRATED_STRIKES(
|
||||
Config.getInstance().getAbilityCooldownSerratedStrikes(),
|
||||
Config.getInstance().getAbilityMaxTicksSerratedStrikes(),
|
||||
"Swords.Skills.SS.On",
|
||||
"Swords.Skills.SS.Off",
|
||||
"Swords.Skills.SS.Other.On",
|
||||
@ -75,8 +61,6 @@ public enum AbilityType {
|
||||
"Swords.Skills.SS.Other.Off"),
|
||||
|
||||
BLAST_MINING(
|
||||
Config.getInstance().getAbilityCooldownBlastMining(),
|
||||
Config.getInstance().getAbilityMaxTicksBlastMining(),
|
||||
null,
|
||||
null,
|
||||
"Mining.Blast.Other.On",
|
||||
@ -84,25 +68,19 @@ public enum AbilityType {
|
||||
null),
|
||||
|
||||
LEAF_BLOWER(
|
||||
0,
|
||||
0,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null);
|
||||
|
||||
private int cooldown;
|
||||
private int maxTicks;
|
||||
private String abilityOn;
|
||||
private String abilityOff;
|
||||
private String abilityPlayer;
|
||||
private String abilityRefresh;
|
||||
private String abilityPlayerOff;
|
||||
|
||||
private AbilityType(int cooldown, int maxTicks, String abilityOn, String abilityOff, String abilityPlayer, String abilityRefresh, String abilityPlayerOff) {
|
||||
this.cooldown = cooldown;
|
||||
this.maxTicks = maxTicks;
|
||||
private AbilityType(String abilityOn, String abilityOff, String abilityPlayer, String abilityRefresh, String abilityPlayerOff) {
|
||||
this.abilityOn = abilityOn;
|
||||
this.abilityOff = abilityOff;
|
||||
this.abilityPlayer = abilityPlayer;
|
||||
@ -111,7 +89,11 @@ public enum AbilityType {
|
||||
}
|
||||
|
||||
public int getCooldown() {
|
||||
return this.cooldown;
|
||||
return Config.getInstance().getCooldown(this);
|
||||
}
|
||||
|
||||
public int getMaxTicks() {
|
||||
return Config.getInstance().getMaxTicks(this);
|
||||
}
|
||||
|
||||
public String getAbilityOn() {
|
||||
@ -134,10 +116,6 @@ public enum AbilityType {
|
||||
return LocaleLoader.getString(this.abilityRefresh);
|
||||
}
|
||||
|
||||
public int getMaxTicks() {
|
||||
return this.maxTicks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
String baseString = name();
|
||||
|
@ -31,17 +31,14 @@ import com.gmail.nossr50.mods.ModChecks;
|
||||
import com.gmail.nossr50.party.PartyManager;
|
||||
import com.gmail.nossr50.skills.acrobatics.Acrobatics;
|
||||
import com.gmail.nossr50.skills.acrobatics.AcrobaticsManager;
|
||||
import com.gmail.nossr50.skills.archery.Archery;
|
||||
import com.gmail.nossr50.skills.archery.ArcheryManager;
|
||||
import com.gmail.nossr50.skills.axes.AxeManager;
|
||||
import com.gmail.nossr50.skills.axes.Axes;
|
||||
import com.gmail.nossr50.skills.runnables.BleedTimer;
|
||||
import com.gmail.nossr50.skills.runnables.CombatXpGiver;
|
||||
import com.gmail.nossr50.skills.swords.Swords;
|
||||
import com.gmail.nossr50.skills.swords.SwordsManager;
|
||||
import com.gmail.nossr50.skills.taming.Taming;
|
||||
import com.gmail.nossr50.skills.taming.TamingManager;
|
||||
import com.gmail.nossr50.skills.unarmed.Unarmed;
|
||||
import com.gmail.nossr50.skills.unarmed.UnarmedManager;
|
||||
import com.gmail.nossr50.util.ItemChecks;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
@ -79,11 +76,11 @@ public final class CombatTools {
|
||||
|
||||
if (ItemChecks.isSword(heldItem) && damageCause == DamageCause.ENTITY_ATTACK) {
|
||||
if (targetIsPlayer || targetIsTamedPet) {
|
||||
if (!Swords.pvpEnabled) {
|
||||
if (!SkillType.SWORDS.getPVPEnabled()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (!Swords.pveEnabled) {
|
||||
else if (!SkillType.SWORDS.getPVEEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -110,11 +107,11 @@ public final class CombatTools {
|
||||
}
|
||||
else if (ItemChecks.isAxe(heldItem) && damageCause == DamageCause.ENTITY_ATTACK) {
|
||||
if (targetIsPlayer || targetIsTamedPet) {
|
||||
if (!Axes.pvpEnabled) {
|
||||
if (!SkillType.AXES.getPVPEnabled()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (!Axes.pveEnabled) {
|
||||
else if (!SkillType.AXES.getPVEEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -148,11 +145,11 @@ public final class CombatTools {
|
||||
}
|
||||
else if (heldItemType == Material.AIR && damageCause == DamageCause.ENTITY_ATTACK) {
|
||||
if (targetIsPlayer || targetIsTamedPet) {
|
||||
if (!configInstance.getUnarmedPVP()) {
|
||||
if (!SkillType.UNARMED.getPVPEnabled()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (!configInstance.getUnarmedPVE()) {
|
||||
else if (!SkillType.UNARMED.getPVEEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -202,11 +199,11 @@ public final class CombatTools {
|
||||
}
|
||||
|
||||
if (targetIsPlayer || targetIsTamedPet) {
|
||||
if (!Taming.pvpEnabled) {
|
||||
if (!SkillType.TAMING.getPVPEnabled()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (!Taming.pveEnabled) {
|
||||
else if (!SkillType.TAMING.getPVEEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -242,11 +239,11 @@ public final class CombatTools {
|
||||
}
|
||||
|
||||
if (targetIsPlayer || targetIsTamedPet) {
|
||||
if (!Archery.pvpEnabled) {
|
||||
if (!SkillType.ARCHERY.getPVPEnabled()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (!Archery.pveEnabled) {
|
||||
else if (!SkillType.ARCHERY.getPVEEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -267,23 +264,23 @@ public final class CombatTools {
|
||||
ItemStack heldItem = player.getItemInHand();
|
||||
|
||||
if (damager instanceof Player) {
|
||||
if (Swords.pvpEnabled && ItemChecks.isSword(heldItem) && Permissions.counterAttack(player)) {
|
||||
if (SkillType.SWORDS.getPVPEnabled() && ItemChecks.isSword(heldItem) && Permissions.counterAttack(player)) {
|
||||
SwordsManager swordsManager = new SwordsManager(Users.getPlayer(player));
|
||||
swordsManager.counterAttackChecks((LivingEntity) damager, event.getDamage());
|
||||
}
|
||||
|
||||
if (Acrobatics.pvpEnabled && Permissions.dodge(player)) {
|
||||
if (SkillType.ACROBATICS.getPVPEnabled() && Permissions.dodge(player)) {
|
||||
AcrobaticsManager acrobaticsManager = new AcrobaticsManager(Users.getPlayer(player));
|
||||
acrobaticsManager.dodgeCheck(event);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (Swords.pveEnabled && damager instanceof LivingEntity && ItemChecks.isSword(heldItem) && Permissions.counterAttack(player)) {
|
||||
if (SkillType.SWORDS.getPVEEnabled() && damager instanceof LivingEntity && ItemChecks.isSword(heldItem) && Permissions.counterAttack(player)) {
|
||||
SwordsManager swordsManager = new SwordsManager(Users.getPlayer(player));
|
||||
swordsManager.counterAttackChecks((LivingEntity) damager, event.getDamage());
|
||||
}
|
||||
|
||||
if (Acrobatics.pveEnabled && !(damager instanceof LightningStrike && Acrobatics.dodgeLightningDisabled) && Permissions.dodge(player)) {
|
||||
if (SkillType.ACROBATICS.getPVEEnabled() && !(damager instanceof LightningStrike && Acrobatics.dodgeLightningDisabled) && Permissions.dodge(player)) {
|
||||
AcrobaticsManager acrobaticsManager = new AcrobaticsManager(Users.getPlayer(player));
|
||||
acrobaticsManager.dodgeCheck(event);
|
||||
}
|
||||
@ -309,7 +306,7 @@ public final class CombatTools {
|
||||
archeryManager.skillShot(event);
|
||||
|
||||
if (target instanceof Player) {
|
||||
if (Unarmed.pvpEnabled && ((Player) target).getItemInHand().getType() == Material.AIR && Permissions.arrowDeflect((Player) target)) {
|
||||
if (SkillType.UNARMED.getPVPEnabled() && ((Player) target).getItemInHand().getType() == Material.AIR && Permissions.arrowDeflect((Player) target)) {
|
||||
UnarmedManager unarmedManager = new UnarmedManager(Users.getPlayer((Player) target));
|
||||
unarmedManager.deflectCheck(event);
|
||||
}
|
||||
@ -478,50 +475,26 @@ public final class CombatTools {
|
||||
break;
|
||||
|
||||
case BLAZE:
|
||||
baseXP = configInstance.getBlazeXP();
|
||||
break;
|
||||
|
||||
case CAVE_SPIDER:
|
||||
baseXP = configInstance.getCaveSpiderXP();
|
||||
break;
|
||||
|
||||
case CREEPER:
|
||||
baseXP = configInstance.getCreeperXP();
|
||||
break;
|
||||
|
||||
case ENDER_DRAGON:
|
||||
baseXP = configInstance.getEnderDragonXP();
|
||||
break;
|
||||
|
||||
case ENDERMAN:
|
||||
baseXP = configInstance.getEndermanXP();
|
||||
break;
|
||||
|
||||
case GHAST:
|
||||
baseXP = configInstance.getGhastXP();
|
||||
break;
|
||||
|
||||
case GIANT:
|
||||
baseXP = configInstance.getGiantXP();
|
||||
break;
|
||||
|
||||
case MAGMA_CUBE:
|
||||
baseXP = configInstance.getMagmaCubeXP();
|
||||
break;
|
||||
|
||||
case IRON_GOLEM:
|
||||
if (!((IronGolem) target).isPlayerCreated()) {
|
||||
baseXP = configInstance.getIronGolemXP();
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case PIG_ZOMBIE:
|
||||
baseXP = configInstance.getPigZombieXP();
|
||||
case SILVERFISH:
|
||||
case SLIME:
|
||||
case SPIDER:
|
||||
case WITCH:
|
||||
case WITHER:
|
||||
case ZOMBIE:
|
||||
baseXP = Config.getInstance().getCombatXP(type);
|
||||
break;
|
||||
|
||||
case SILVERFISH:
|
||||
baseXP = configInstance.getSilverfishXP();
|
||||
// Temporary workaround for custom entities
|
||||
case UNKNOWN:
|
||||
baseXP = 1.0;
|
||||
break;
|
||||
|
||||
case SKELETON:
|
||||
@ -530,41 +503,21 @@ public final class CombatTools {
|
||||
baseXP = configInstance.getWitherSkeletonXP();
|
||||
break;
|
||||
default:
|
||||
baseXP = configInstance.getSkeletonXP();
|
||||
baseXP = Config.getInstance().getCombatXP(type);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case SLIME:
|
||||
baseXP = configInstance.getSlimeXP();
|
||||
break;
|
||||
|
||||
case SPIDER:
|
||||
baseXP = configInstance.getSpiderXP();
|
||||
break;
|
||||
|
||||
case WITCH:
|
||||
baseXP = configInstance.getWitchXP();
|
||||
break;
|
||||
|
||||
case WITHER:
|
||||
baseXP = configInstance.getWitherXP();
|
||||
break;
|
||||
|
||||
case ZOMBIE:
|
||||
baseXP = configInstance.getZombieXP();
|
||||
break;
|
||||
|
||||
// Temporary workaround for custom entities
|
||||
case UNKNOWN:
|
||||
baseXP = 1.0;
|
||||
case IRON_GOLEM:
|
||||
if (!((IronGolem) target).isPlayerCreated()) {
|
||||
baseXP = Config.getInstance().getCombatXP(type);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
if (ModChecks.isCustomEntity(target)) {
|
||||
baseXP = ModChecks.getCustomEntity(target).getXpMultiplier();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -6,41 +6,31 @@ import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.StringUtils;
|
||||
|
||||
public enum SkillType {
|
||||
ACROBATICS(Config.getInstance().getLevelCapAcrobatics(), Config.getInstance().getFormulaMultiplierAcrobatics()),
|
||||
ARCHERY(Config.getInstance().getLevelCapArchery(), Config.getInstance().getFormulaMultiplierArchery()),
|
||||
AXES(AbilityType.SKULL_SPLITTER, Config.getInstance().getLevelCapAxes(), ToolType.AXE, Config.getInstance().getFormulaMultiplierAxes()),
|
||||
EXCAVATION(AbilityType.GIGA_DRILL_BREAKER, Config.getInstance().getLevelCapExcavation(), ToolType.SHOVEL, Config.getInstance().getFormulaMultiplierExcavation()),
|
||||
FISHING(Config.getInstance().getLevelCapFishing(), Config.getInstance().getFormulaMultiplierFishing()),
|
||||
HERBALISM(AbilityType.GREEN_TERRA, Config.getInstance().getLevelCapHerbalism(), ToolType.HOE, Config.getInstance().getFormulaMultiplierHerbalism()),
|
||||
MINING(AbilityType.SUPER_BREAKER, Config.getInstance().getLevelCapMining(), ToolType.PICKAXE, Config.getInstance().getFormulaMultiplierMining()),
|
||||
REPAIR(Config.getInstance().getLevelCapRepair(), Config.getInstance().getFormulaMultiplierRepair()),
|
||||
SMELTING(Config.getInstance().getLevelCapSmelting(), 0),
|
||||
SWORDS(AbilityType.SERRATED_STRIKES, Config.getInstance().getLevelCapSwords(), ToolType.SWORD, Config.getInstance().getFormulaMultiplierSwords()),
|
||||
TAMING(Config.getInstance().getLevelCapTaming(), Config.getInstance().getFormulaMultiplierTaming()),
|
||||
UNARMED(AbilityType.BERSERK, Config.getInstance().getLevelCapUnarmed(), ToolType.FISTS, Config.getInstance().getFormulaMultiplierUnarmed()),
|
||||
WOODCUTTING(AbilityType.TREE_FELLER, Config.getInstance().getLevelCapWoodcutting(), ToolType.AXE, Config.getInstance().getFormulaMultiplierWoodcutting());
|
||||
ACROBATICS,
|
||||
ARCHERY,
|
||||
AXES(AbilityType.SKULL_SPLITTER, ToolType.AXE),
|
||||
EXCAVATION(AbilityType.GIGA_DRILL_BREAKER, ToolType.SHOVEL),
|
||||
FISHING,
|
||||
HERBALISM(AbilityType.GREEN_TERRA, ToolType.HOE),
|
||||
MINING(AbilityType.SUPER_BREAKER, ToolType.PICKAXE),
|
||||
REPAIR,
|
||||
SMELTING,
|
||||
SWORDS(AbilityType.SERRATED_STRIKES, ToolType.SWORD),
|
||||
TAMING,
|
||||
UNARMED(AbilityType.BERSERK, ToolType.FISTS),
|
||||
WOODCUTTING(AbilityType.TREE_FELLER, ToolType.AXE);
|
||||
|
||||
private AbilityType ability;
|
||||
private int maxLevel;
|
||||
private ToolType tool;
|
||||
private double xpModifier;
|
||||
|
||||
private SkillType() {
|
||||
this.ability = null;
|
||||
this.maxLevel = 0;
|
||||
this.tool = null;
|
||||
this.xpModifier = 0;
|
||||
}
|
||||
|
||||
private SkillType(AbilityType ability, int maxLevel, ToolType tool, double xpModifier) {
|
||||
private SkillType(AbilityType ability, ToolType tool) {
|
||||
this.ability = ability;
|
||||
this.maxLevel = maxLevel;
|
||||
this.tool = tool;
|
||||
this.xpModifier = xpModifier;
|
||||
}
|
||||
|
||||
private SkillType(int maxLevel, double xpModifier) {
|
||||
this(null, maxLevel, null, xpModifier);
|
||||
}
|
||||
|
||||
public AbilityType getAbility() {
|
||||
@ -53,11 +43,19 @@ public enum SkillType {
|
||||
* @return the max level of this skill
|
||||
*/
|
||||
public int getMaxLevel() {
|
||||
if (maxLevel > 0) {
|
||||
return maxLevel;
|
||||
}
|
||||
return Config.getInstance().getLevelCap(this);
|
||||
}
|
||||
|
||||
return Integer.MAX_VALUE;
|
||||
public boolean getPVPEnabled() {
|
||||
return Config.getInstance().getPVPEnabled(this);
|
||||
}
|
||||
|
||||
public boolean getPVEEnabled() {
|
||||
return Config.getInstance().getPVEEnabled(this);
|
||||
}
|
||||
|
||||
public boolean getDoubleDropsDisabled() {
|
||||
return Config.getInstance().getDoubleDropsDisabled(this);
|
||||
}
|
||||
|
||||
public ToolType getTool() {
|
||||
@ -65,7 +63,7 @@ public enum SkillType {
|
||||
}
|
||||
|
||||
public double getXpModifier() {
|
||||
return xpModifier;
|
||||
return Config.getInstance().getForumulaMultiplier(this);
|
||||
}
|
||||
|
||||
public static SkillType getSkill(String skillName) {
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.gmail.nossr50.skills.woodcutting;
|
||||
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.skills.SkillCommand;
|
||||
import com.gmail.nossr50.skills.utilities.SkillType;
|
||||
@ -16,6 +15,7 @@ public class WoodcuttingCommand extends SkillCommand {
|
||||
private boolean canTreeFell;
|
||||
private boolean canLeafBlow;
|
||||
private boolean canDoubleDrop;
|
||||
private boolean doubleDropsDisabled;
|
||||
|
||||
public WoodcuttingCommand() {
|
||||
super(SkillType.WOODCUTTING);
|
||||
@ -40,11 +40,12 @@ public class WoodcuttingCommand extends SkillCommand {
|
||||
canTreeFell = Permissions.treeFeller(player);
|
||||
canDoubleDrop = Permissions.doubleDrops(player, skill);
|
||||
canLeafBlow = Permissions.leafBlower(player);
|
||||
doubleDropsDisabled = skill.getDoubleDropsDisabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean effectsHeaderPermissions() {
|
||||
return (canDoubleDrop && !Config.getInstance().woodcuttingDoubleDropsDisabled()) || canLeafBlow || canTreeFell;
|
||||
return (canDoubleDrop && !doubleDropsDisabled) || canLeafBlow || canTreeFell;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -59,14 +60,14 @@ public class WoodcuttingCommand extends SkillCommand {
|
||||
player.sendMessage(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Woodcutting.Effect.2"), LocaleLoader.getString("Woodcutting.Effect.3")));
|
||||
}
|
||||
|
||||
if (canDoubleDrop && !Config.getInstance().woodcuttingDoubleDropsDisabled()) {
|
||||
if (canDoubleDrop && !doubleDropsDisabled) {
|
||||
player.sendMessage(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Woodcutting.Effect.4"), LocaleLoader.getString("Woodcutting.Effect.5")));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean statsHeaderPermissions() {
|
||||
return (canDoubleDrop && !Config.getInstance().woodcuttingDoubleDropsDisabled()) || canLeafBlow || canTreeFell;
|
||||
return (canDoubleDrop && !doubleDropsDisabled) || canLeafBlow || canTreeFell;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -82,7 +83,7 @@ public class WoodcuttingCommand extends SkillCommand {
|
||||
}
|
||||
}
|
||||
|
||||
if (canDoubleDrop && !Config.getInstance().woodcuttingDoubleDropsDisabled()) {
|
||||
if (canDoubleDrop && !doubleDropsDisabled) {
|
||||
if (isLucky) {
|
||||
player.sendMessage(LocaleLoader.getString("Woodcutting.Ability.Chance.DDrop", doubleDropChance) + LocaleLoader.getString("Perks.lucky.bonus", doubleDropChanceLucky));
|
||||
}
|
||||
|
Reference in New Issue
Block a user