mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 14:46:46 +01:00
Add config toggle for breaking glass with Berserk.
This commit is contained in:
parent
7d05c9d8e6
commit
37280856d5
@ -1,9 +1,5 @@
|
|||||||
package com.gmail.nossr50.config;
|
package com.gmail.nossr50.config;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
|
import com.gmail.nossr50.datatypes.skills.SecondaryAbility;
|
||||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||||
import com.gmail.nossr50.skills.alchemy.Alchemy;
|
import com.gmail.nossr50.skills.alchemy.Alchemy;
|
||||||
@ -14,6 +10,10 @@ import com.gmail.nossr50.skills.salvage.Salvage;
|
|||||||
import com.gmail.nossr50.skills.smelting.Smelting;
|
import com.gmail.nossr50.skills.smelting.Smelting;
|
||||||
import com.gmail.nossr50.util.StringUtils;
|
import com.gmail.nossr50.util.StringUtils;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class AdvancedConfig extends AutoUpdateConfigLoader {
|
public class AdvancedConfig extends AutoUpdateConfigLoader {
|
||||||
private static AdvancedConfig instance;
|
private static AdvancedConfig instance;
|
||||||
|
|
||||||
@ -842,6 +842,7 @@ public class AdvancedConfig extends AutoUpdateConfigLoader {
|
|||||||
public double getIronArmMaxBonus() { return config.getDouble("Skills.Unarmed.IronArm.BonusMax", 8.0D); }
|
public double getIronArmMaxBonus() { return config.getDouble("Skills.Unarmed.IronArm.BonusMax", 8.0D); }
|
||||||
public int getIronArmIncreaseLevel() { return config.getInt("Skills.Unarmed.IronArm.IncreaseLevel", 50); }
|
public int getIronArmIncreaseLevel() { return config.getInt("Skills.Unarmed.IronArm.IncreaseLevel", 50); }
|
||||||
public boolean getDisarmProtected() { return config.getBoolean("Skills.Unarmed.Disarm.AntiTheft", false); }
|
public boolean getDisarmProtected() { return config.getBoolean("Skills.Unarmed.Disarm.AntiTheft", false); }
|
||||||
|
public boolean getBerserkBreakGlass() { return config.getBoolean("Skills.Unarmed.Berserk.BreakGlass", false); }
|
||||||
|
|
||||||
/* WOODCUTTING */
|
/* WOODCUTTING */
|
||||||
public int getLeafBlowUnlockLevel() { return config.getInt("Skills.Woodcutting.LeafBlower.UnlockLevel", 100); }
|
public int getLeafBlowUnlockLevel() { return config.getInt("Skills.Woodcutting.LeafBlower.UnlockLevel", 100); }
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.gmail.nossr50.datatypes.skills;
|
package com.gmail.nossr50.datatypes.skills;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.config.AdvancedConfig;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.BlockState;
|
import org.bukkit.block.BlockState;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -184,7 +185,11 @@ public enum AbilityType {
|
|||||||
public boolean blockCheck(BlockState blockState) {
|
public boolean blockCheck(BlockState blockState) {
|
||||||
switch (this) {
|
switch (this) {
|
||||||
case BERSERK:
|
case BERSERK:
|
||||||
return (BlockUtils.affectedByGigaDrillBreaker(blockState) || blockState.getType() == Material.SNOW);
|
return (BlockUtils.affectedByGigaDrillBreaker(blockState) || blockState.getType() == Material.SNOW
|
||||||
|
|| (AdvancedConfig.getInstance().getBerserkBreakGlass() && ( blockState.getType() == Material.GLASS
|
||||||
|
|| blockState.getType() == Material.THIN_GLASS
|
||||||
|
|| blockState.getType() == Material.STAINED_GLASS
|
||||||
|
|| blockState.getType() == Material.STAINED_GLASS_PANE)));
|
||||||
|
|
||||||
case GIGA_DRILL_BREAKER:
|
case GIGA_DRILL_BREAKER:
|
||||||
return BlockUtils.affectedByGigaDrillBreaker(blockState);
|
return BlockUtils.affectedByGigaDrillBreaker(blockState);
|
||||||
|
@ -560,6 +560,9 @@ Skills:
|
|||||||
BonusMin: 3.0
|
BonusMin: 3.0
|
||||||
BonusMax: 8.0
|
BonusMax: 8.0
|
||||||
IncreaseLevel: 50
|
IncreaseLevel: 50
|
||||||
|
Berserk:
|
||||||
|
# BreakGlass: Toggles whether berserk breaks glass in addition to "soft" blocks
|
||||||
|
BreakGlass: true
|
||||||
#
|
#
|
||||||
# Settings for Woodcutting
|
# Settings for Woodcutting
|
||||||
###
|
###
|
||||||
|
Loading…
Reference in New Issue
Block a user