mirror of
https://github.com/Xiao-MoMi/Custom-Fishing.git
synced 2025-12-19 15:09:24 +00:00
2.3.1
This commit is contained in:
@@ -693,8 +693,8 @@ public class BukkitActionManager implements ActionManager<Player> {
|
||||
private void registerSoundAction() {
|
||||
registerAction((args, chance) -> {
|
||||
if (args instanceof Section section) {
|
||||
MathValue<Player> volume = MathValue.auto(section.get("volume"));
|
||||
MathValue<Player> pitch = MathValue.auto(section.get("pitch"));
|
||||
MathValue<Player> volume = MathValue.auto(section.get("volume", 1));
|
||||
MathValue<Player> pitch = MathValue.auto(section.get("pitch", 1));
|
||||
Key key = Key.key(section.getString("key"));
|
||||
Sound.Source source = Sound.Source.valueOf(section.getString("source", "PLAYER").toUpperCase(Locale.ENGLISH));
|
||||
return context -> {
|
||||
|
||||
@@ -34,6 +34,7 @@ import net.momirealms.customfishing.api.mechanic.requirement.Requirement;
|
||||
import net.momirealms.customfishing.api.mechanic.requirement.RequirementExpansion;
|
||||
import net.momirealms.customfishing.api.mechanic.requirement.RequirementFactory;
|
||||
import net.momirealms.customfishing.api.mechanic.requirement.RequirementManager;
|
||||
import net.momirealms.customfishing.api.mechanic.totem.ActiveTotemList;
|
||||
import net.momirealms.customfishing.api.util.MoonPhase;
|
||||
import net.momirealms.customfishing.bukkit.integration.VaultHook;
|
||||
import net.momirealms.customfishing.common.util.ClassUtils;
|
||||
@@ -202,6 +203,7 @@ public class BukkitRequirementManager implements RequirementManager<Player> {
|
||||
this.registerGameModeRequirement();
|
||||
this.registerEquipmentRequirement();
|
||||
this.registerLiquidDepthRequirement();
|
||||
this.registerTotemRequirement();
|
||||
}
|
||||
|
||||
private void registerImpossibleRequirement() {
|
||||
@@ -755,6 +757,22 @@ public class BukkitRequirementManager implements RequirementManager<Player> {
|
||||
}, "liquid-depth");
|
||||
}
|
||||
|
||||
private void registerTotemRequirement() {
|
||||
registerRequirement((args, actions, advanced) -> {
|
||||
List<String> totems = ListUtils.toList(args);
|
||||
return context -> {
|
||||
ActiveTotemList totemList = context.arg(ContextKeys.TOTEMS);
|
||||
if (totemList != null) {
|
||||
for (String totem : totems) {
|
||||
if (totemList.hasTotem(totem)) return true;
|
||||
}
|
||||
}
|
||||
if (advanced) ActionManager.trigger(context, actions);
|
||||
return false;
|
||||
};
|
||||
}, "totem");
|
||||
}
|
||||
|
||||
private void registerLevelRequirement() {
|
||||
registerRequirement((args, actions, runActions) -> {
|
||||
MathValue<Player> value = MathValue.auto(args);
|
||||
|
||||
Reference in New Issue
Block a user