Hack to disable supers that aren't ready yet

This commit is contained in:
nossr50 2024-01-14 08:51:23 -08:00
parent 826d16d916
commit fdc308762c
2 changed files with 21 additions and 3 deletions

View File

@ -168,7 +168,12 @@ public final class Permissions {
public static boolean skillEnabled(Permissible permissible, PrimarySkillType skill) {return permissible.hasPermission("mcmmo.skills." + skill.toString().toLowerCase(Locale.ENGLISH)); } public static boolean skillEnabled(Permissible permissible, PrimarySkillType skill) {return permissible.hasPermission("mcmmo.skills." + skill.toString().toLowerCase(Locale.ENGLISH)); }
public static boolean vanillaXpBoost(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.ability." + skill.toString().toLowerCase(Locale.ENGLISH) + ".vanillaxpboost"); } public static boolean vanillaXpBoost(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.ability." + skill.toString().toLowerCase(Locale.ENGLISH) + ".vanillaxpboost"); }
public static boolean isSubSkillEnabled(Permissible permissible, SubSkillType subSkillType) { return permissible.hasPermission(subSkillType.getPermissionNodeAddress()); } public static boolean isSubSkillEnabled(Permissible permissible, SubSkillType subSkillType) {
// hack to disable supers that aren't coded yet
if(subSkillType == SubSkillType.TRIDENTS_SUPER || subSkillType == SubSkillType.CROSSBOWS_SUPER_SHOTGUN)
return false;
return permissible.hasPermission(subSkillType.getPermissionNodeAddress());
}
/* ACROBATICS */ /* ACROBATICS */
public static boolean dodge(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.acrobatics.dodge"); } public static boolean dodge(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.acrobatics.dodge"); }
@ -227,12 +232,18 @@ public final class Permissions {
/* WOODCUTTING */ /* WOODCUTTING */
public static boolean treeFeller(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.woodcutting.treefeller"); } public static boolean treeFeller(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.woodcutting.treefeller"); }
/* CROSSBOWS */ /* CROSSBOWS */
public static boolean superShotgun(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.crossbows.supershotgun"); } public static boolean superShotgun(Permissible permissible) {
return false;
// return permissible.hasPermission("mcmmo.ability.crossbows.supershotgun");
}
public static boolean trickShot(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.crossbows.trickshot"); } public static boolean trickShot(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.crossbows.trickshot"); }
public static boolean poweredShot(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.crossbows.poweredshot"); } public static boolean poweredShot(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.crossbows.poweredshot"); }
/* TRIDENTS */ /* TRIDENTS */
public static boolean tridentsSuper(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.tridents.superability"); } public static boolean tridentsSuper(Permissible permissible) {
return false;
// return permissible.hasPermission("mcmmo.ability.tridents.superability");
}
public static boolean tridentsLimitBreak(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.tridents.superability"); } public static boolean tridentsLimitBreak(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.tridents.superability"); }
/* /*

View File

@ -34,6 +34,8 @@ import org.jetbrains.annotations.Nullable;
import java.util.Iterator; import java.util.Iterator;
import static java.util.Objects.requireNonNull;
public final class SkillUtils { public final class SkillUtils {
/** /**
* This is a static utility class, therefore we don't want any instances of * This is a static utility class, therefore we don't want any instances of
@ -362,6 +364,11 @@ public final class SkillUtils {
*/ */
public static boolean canUseSubskill(Player player, SubSkillType subSkillType) public static boolean canUseSubskill(Player player, SubSkillType subSkillType)
{ {
requireNonNull(subSkillType, "subSkillType cannot be null");
// hack to disable supers that aren't coded yet
if(subSkillType == SubSkillType.TRIDENTS_SUPER || subSkillType == SubSkillType.CROSSBOWS_SUPER_SHOTGUN)
return false;
return Permissions.isSubSkillEnabled(player, subSkillType) && RankUtils.hasUnlockedSubskill(player, subSkillType); return Permissions.isSubSkillEnabled(player, subSkillType) && RankUtils.hasUnlockedSubskill(player, subSkillType);
} }
} }