mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 06:36:45 +01:00
Add PVP/PVE settings to core skill config
This commit is contained in:
parent
3e75026281
commit
51a57429b6
@ -0,0 +1,30 @@
|
|||||||
|
package com.gmail.nossr50.config.hocon.skills.coreskills;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||||
|
import ninja.leaping.configurate.objectmapping.Setting;
|
||||||
|
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
@ConfigSerializable
|
||||||
|
public class ConfigCoreSkillCombatMap {
|
||||||
|
|
||||||
|
private static final HashMap<PrimarySkillType, Boolean> COMBAT_TOGGLE_DEFAULT;
|
||||||
|
|
||||||
|
static {
|
||||||
|
COMBAT_TOGGLE_DEFAULT = new HashMap<>();
|
||||||
|
|
||||||
|
for (PrimarySkillType primarySkillType : PrimarySkillType.values()) {
|
||||||
|
|
||||||
|
COMBAT_TOGGLE_DEFAULT.put(primarySkillType, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Setting(value = "Combat-Toggles")
|
||||||
|
private HashMap<PrimarySkillType, Boolean> combatToggleMap = COMBAT_TOGGLE_DEFAULT;
|
||||||
|
|
||||||
|
public HashMap<PrimarySkillType, Boolean> getCombatToggleMap() {
|
||||||
|
return combatToggleMap;
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +1,6 @@
|
|||||||
package com.gmail.nossr50.config.hocon.skills.coreskills;
|
package com.gmail.nossr50.config.hocon.skills.coreskills;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||||
import ninja.leaping.configurate.objectmapping.Setting;
|
import ninja.leaping.configurate.objectmapping.Setting;
|
||||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||||
|
|
||||||
@ -10,6 +11,10 @@ public class ConfigCoreSkills {
|
|||||||
"\nCore skills are ones built into mcMMO")
|
"\nCore skills are ones built into mcMMO")
|
||||||
private ConfigCoreSkillsAcrobatics configCoreSkillsAcrobatics = new ConfigCoreSkillsAcrobatics();
|
private ConfigCoreSkillsAcrobatics configCoreSkillsAcrobatics = new ConfigCoreSkillsAcrobatics();
|
||||||
|
|
||||||
|
@Setting(value = "Combat-Settings", comment = "Determine whether or not a skills effects can activate in PVP or PVE" +
|
||||||
|
"\nIf a skill has no combat interactions, the toggle for it will still exists in case I ever do add combat interactions for the skill.")
|
||||||
|
private ConfigCoreSkillsCombatToggles combatToggles = new ConfigCoreSkillsCombatToggles();
|
||||||
|
|
||||||
public boolean isRollEnabled() {
|
public boolean isRollEnabled() {
|
||||||
return configCoreSkillsAcrobatics.isRollEnabled();
|
return configCoreSkillsAcrobatics.isRollEnabled();
|
||||||
}
|
}
|
||||||
@ -21,4 +26,24 @@ public class ConfigCoreSkills {
|
|||||||
public boolean isAcrobaticsEnabled() {
|
public boolean isAcrobaticsEnabled() {
|
||||||
return getConfigCoreSkillsAcrobatics().isAcrobaticsEnabled();
|
return getConfigCoreSkillsAcrobatics().isAcrobaticsEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ConfigCoreSkillsCombatToggles getCombatToggles() {
|
||||||
|
return combatToggles;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ConfigCoreSkillCombatMap getPve() {
|
||||||
|
return combatToggles.getPve();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ConfigCoreSkillCombatMap getPvp() {
|
||||||
|
return combatToggles.getPvp();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isPVEEnabled(PrimarySkillType primarySkillType) {
|
||||||
|
return combatToggles.isPVEEnabled(primarySkillType);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isPVPEnabled(PrimarySkillType primarySkillType) {
|
||||||
|
return combatToggles.isPVPEnabled(primarySkillType);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,34 @@
|
|||||||
|
package com.gmail.nossr50.config.hocon.skills.coreskills;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||||
|
import ninja.leaping.configurate.objectmapping.Setting;
|
||||||
|
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||||
|
|
||||||
|
@ConfigSerializable
|
||||||
|
public class ConfigCoreSkillsCombatToggles {
|
||||||
|
|
||||||
|
@Setting(value = "PVE-Toggles", comment = "When set to false, offensive combat related abilities from a skill will not trigger in PVE." +
|
||||||
|
"\nPVE = Player Versus Environment" +
|
||||||
|
"\nEnvironment is stuff like Monsters, Animals")
|
||||||
|
private ConfigCoreSkillCombatMap pve = new ConfigCoreSkillCombatMap();
|
||||||
|
|
||||||
|
@Setting(value = "PVE-Toggles", comment = "When set to false, offensive combat related abilities from a skill will not trigger in PVP." +
|
||||||
|
"\nPVP = Player Versus Player")
|
||||||
|
private ConfigCoreSkillCombatMap pvp = new ConfigCoreSkillCombatMap();
|
||||||
|
|
||||||
|
public ConfigCoreSkillCombatMap getPve() {
|
||||||
|
return pve;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ConfigCoreSkillCombatMap getPvp() {
|
||||||
|
return pvp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isPVEEnabled(PrimarySkillType primarySkillType) {
|
||||||
|
return pve.getCombatToggleMap().get(primarySkillType);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isPVPEnabled(PrimarySkillType primarySkillType) {
|
||||||
|
return pvp.getCombatToggleMap().get(primarySkillType);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user