9
0
mirror of https://github.com/Xiao-MoMi/Custom-Fishing.git synced 2026-01-06 15:51:50 +00:00

use my TriConsumer

This commit is contained in:
XiaoMoMi
2024-06-16 05:09:12 +08:00
parent 919fde3f49
commit 53a6dc20bb
9 changed files with 21 additions and 15 deletions

View File

@@ -10,6 +10,7 @@ import net.momirealms.customfishing.api.BukkitCustomFishingPlugin;
import net.momirealms.customfishing.api.mechanic.config.function.*;
import net.momirealms.customfishing.api.mechanic.context.Context;
import net.momirealms.customfishing.api.mechanic.effect.EffectModifier;
import net.momirealms.customfishing.api.mechanic.effect.LootBaseEffect;
import net.momirealms.customfishing.api.mechanic.entity.EntityConfig;
import net.momirealms.customfishing.api.mechanic.event.EventCarrier;
import net.momirealms.customfishing.api.mechanic.hook.HookConfig;
@@ -190,6 +191,10 @@ public abstract class ConfigManager implements ConfigLoader, Reloadable {
registerNodeFunction(nodes, new EventParserFunction(function));
}
public void registerBaseEffectParser(Function<Object, Consumer<LootBaseEffect.Builder>> function, String... nodes) {
registerNodeFunction(nodes, new BaseEffectParserFunction(function));
}
public void unregisterNodeFunction(String... nodes) {
Map<String, Node<ConfigParserFunction>> functionMap = formatFunctions;
for (int i = 0; i < nodes.length; i++) {

View File

@@ -3,7 +3,7 @@ package net.momirealms.customfishing.api.mechanic.effect;
import net.momirealms.customfishing.api.mechanic.context.Context;
import net.momirealms.customfishing.api.mechanic.item.MechanicType;
import net.momirealms.customfishing.api.mechanic.requirement.Requirement;
import org.apache.logging.log4j.util.TriConsumer;
import net.momirealms.customfishing.common.util.TriConsumer;
import org.bukkit.entity.Player;
import java.util.List;

View File

@@ -3,7 +3,7 @@ package net.momirealms.customfishing.api.mechanic.effect;
import net.momirealms.customfishing.api.mechanic.context.Context;
import net.momirealms.customfishing.api.mechanic.item.MechanicType;
import net.momirealms.customfishing.api.mechanic.requirement.Requirement;
import org.apache.logging.log4j.util.TriConsumer;
import net.momirealms.customfishing.common.util.TriConsumer;
import org.bukkit.entity.Player;
import java.util.ArrayList;

View File

@@ -7,7 +7,7 @@ import net.momirealms.customfishing.api.mechanic.effect.EffectModifier;
import net.momirealms.customfishing.api.mechanic.fishing.hook.HookMechanic;
import net.momirealms.customfishing.api.mechanic.loot.Loot;
import net.momirealms.customfishing.common.plugin.scheduler.SchedulerTask;
import org.apache.logging.log4j.util.TriConsumer;
import net.momirealms.customfishing.common.util.TriConsumer;
import org.bukkit.entity.FishHook;
import org.bukkit.entity.Player;