9
0
mirror of https://github.com/Xiao-MoMi/Custom-Fishing.git synced 2025-12-30 04:19:30 +00:00
This commit is contained in:
XiaoMoMi
2023-09-28 23:22:54 +08:00
parent e224a4de5e
commit a354578958
10 changed files with 62 additions and 25 deletions

View File

@@ -94,7 +94,7 @@ public interface MarketManager {
*
* @return The earning limit
*/
double getEarningLimit();
double getEarningLimit(Player player);
/**
* Is market enabled

View File

@@ -41,6 +41,7 @@ import java.util.List;
public class FishingPreparation extends Condition {
private boolean hasBait = false;
private boolean hasHook = false;
private @Nullable ItemStack baitItemStack;
private final @NotNull ItemStack rodItemStack;
private final List<EffectCarrier> effects;
@@ -66,6 +67,7 @@ public class FishingPreparation extends Condition {
if (cfCompound != null && cfCompound.hasTag("hook_id")) {
String hookID = cfCompound.getString("hook_id");
super.insertArg("{hook}", rodItemID);
this.hasHook = true;
EffectCarrier carrier = plugin.getEffectManager().getEffectCarrier("hook", hookID);
if (carrier != null) {
this.effects.add(carrier);
@@ -174,8 +176,8 @@ public class FishingPreparation extends Condition {
*/
public void triggerActions(ActionTrigger actionTrigger) {
GlobalSettings.triggerRodActions(actionTrigger, this);
GlobalSettings.triggerBaitActions(actionTrigger, this);
GlobalSettings.triggerHookActions(actionTrigger, this);
if (hasBait) GlobalSettings.triggerBaitActions(actionTrigger, this);
if (hasHook) GlobalSettings.triggerHookActions(actionTrigger, this);
for (EffectCarrier effectCarrier : effects) {
Action[] actions = effectCarrier.getActions(actionTrigger);
if (actions != null)