mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-07-15 20:14:42 +02:00
Wire up Super Ability config pt 1
This commit is contained in:
@ -1,7 +1,18 @@
|
||||
package com.gmail.nossr50.config.hocon.notifications;
|
||||
|
||||
import ninja.leaping.configurate.objectmapping.Setting;
|
||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
|
||||
@ConfigSerializable
|
||||
public class ConfigNotifications {
|
||||
|
||||
public static final boolean SUPER_ABILITY_TOOL_NOTIFICATION_DEFAULT = true;
|
||||
|
||||
@Setting(value = "Super-Ability-Tool-Raising-Lowering-Notification",
|
||||
comment = "Notifies the player when they go into the tool readying state for super abilities.")
|
||||
private boolean superAbilityToolMessage = SUPER_ABILITY_TOOL_NOTIFICATION_DEFAULT;
|
||||
|
||||
public boolean isSuperAbilityToolMessage() {
|
||||
return superAbilityToolMessage;
|
||||
}
|
||||
}
|
||||
|
@ -13,4 +13,11 @@ public class ConfigSectionSuperAbilityLimits {
|
||||
"\nDefault value: "+TOOL_DURABILITY_DAMAGE_DEFAULT)
|
||||
private int toolDurabilityDamage = TOOL_DURABILITY_DAMAGE_DEFAULT;
|
||||
|
||||
public ConfigSectionTreeFeller getTreeFeller() {
|
||||
return treeFeller;
|
||||
}
|
||||
|
||||
public int getToolDurabilityDamage() {
|
||||
return toolDurabilityDamage;
|
||||
}
|
||||
}
|
@ -53,4 +53,5 @@ public class ConfigSectionSuperAbilityMaxLength {
|
||||
public int getTreeFeller() {
|
||||
return treeFeller;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -12,4 +12,8 @@ public class ConfigSectionTreeFeller {
|
||||
"\nLower this number to improve performance." +
|
||||
"\nDefault value: "+TREE_FELLER_LIMIT_DEFAULT)
|
||||
private int treeFellerLimit = TREE_FELLER_LIMIT_DEFAULT;
|
||||
|
||||
public int getTreeFellerLimit() {
|
||||
return treeFellerLimit;
|
||||
}
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
package com.gmail.nossr50.config.hocon.superabilities;
|
||||
|
||||
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import ninja.leaping.configurate.objectmapping.Setting;
|
||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
|
||||
@ -30,4 +32,74 @@ public class ConfigSuperAbilities {
|
||||
|
||||
@Setting(value = "Super-Ability-Settings", comment = "Change specific parameters for super abilities.")
|
||||
private ConfigSectionSuperAbilityLimits superAbilityLimits = new ConfigSectionSuperAbilityLimits();
|
||||
|
||||
public boolean isSuperAbilitiesEnabled() {
|
||||
return superAbilitiesEnabled;
|
||||
}
|
||||
|
||||
public boolean isMustSneakToActivate() {
|
||||
return mustSneakToActivate;
|
||||
}
|
||||
|
||||
public ConfigSectionSuperAbilityCooldowns getSuperAbilityCooldowns() {
|
||||
return superAbilityCooldowns;
|
||||
}
|
||||
|
||||
public ConfigSectionSuperAbilityMaxLength getSuperAbilityMaxLength() {
|
||||
return superAbilityMaxLength;
|
||||
}
|
||||
|
||||
public ConfigSectionSuperAbilityLimits getSuperAbilityLimits() {
|
||||
return superAbilityLimits;
|
||||
}
|
||||
|
||||
public int getCooldownForSuper(SuperAbilityType superAbilityType)
|
||||
{
|
||||
switch(superAbilityType)
|
||||
{
|
||||
case BERSERK:
|
||||
return superAbilityCooldowns.getBerserk();
|
||||
case GREEN_TERRA:
|
||||
return superAbilityCooldowns.getGreenTerra();
|
||||
case TREE_FELLER:
|
||||
return superAbilityCooldowns.getTreeFeller();
|
||||
case BLAST_MINING:
|
||||
return superAbilityCooldowns.getBlastMining();
|
||||
case SUPER_BREAKER:
|
||||
return superAbilityCooldowns.getSuperBreaker();
|
||||
case SKULL_SPLITTER:
|
||||
return superAbilityCooldowns.getSkullSplitter();
|
||||
case SERRATED_STRIKES:
|
||||
return superAbilityCooldowns.getSerratedStrikes();
|
||||
case GIGA_DRILL_BREAKER:
|
||||
return superAbilityCooldowns.getGigaDrillBreaker();
|
||||
default:
|
||||
mcMMO.p.getLogger().severe("Cooldown Parameter not found for "+superAbilityType.toString());
|
||||
return 240;
|
||||
}
|
||||
}
|
||||
|
||||
public int getMaxLengthForSuper(SuperAbilityType superAbilityType)
|
||||
{
|
||||
switch(superAbilityType)
|
||||
{
|
||||
case BERSERK:
|
||||
return superAbilityMaxLength.getBerserk();
|
||||
case GREEN_TERRA:
|
||||
return superAbilityMaxLength.getGreenTerra();
|
||||
case TREE_FELLER:
|
||||
return superAbilityMaxLength.getTreeFeller();
|
||||
case SUPER_BREAKER:
|
||||
return superAbilityMaxLength.getSuperBreaker();
|
||||
case SKULL_SPLITTER:
|
||||
return superAbilityMaxLength.getSkullSplitter();
|
||||
case SERRATED_STRIKES:
|
||||
return superAbilityMaxLength.getSerratedStrikes();
|
||||
case GIGA_DRILL_BREAKER:
|
||||
return superAbilityMaxLength.getGigaDrillBreaker();
|
||||
default:
|
||||
mcMMO.p.getLogger().severe("Max Length Parameter not found for "+superAbilityType.toString());
|
||||
return 60;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user