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
2024-01-03 06:04:44 +08:00
parent 23fc9c33bd
commit da74c91f61
22 changed files with 365 additions and 139 deletions

View File

@@ -121,5 +121,9 @@ public interface ActionManager {
* @param actions The list of actions to trigger.
* @param condition The condition associated with the actions.
*/
void triggerActions(List<Action> actions, Condition condition);
static void triggerActions(Condition condition, Action... actions) {
if (actions != null)
for (Action action : actions)
action.trigger(condition);
}
}

View File

@@ -18,9 +18,12 @@
package net.momirealms.customfishing.api.manager;
import net.momirealms.customfishing.api.data.user.OfflineUser;
import net.momirealms.customfishing.api.mechanic.action.Action;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import java.util.List;
import java.util.UUID;
public interface BagManager {
@@ -44,4 +47,14 @@ public interface BagManager {
* @param userData The OfflineUser data of the player whose bag is being edited.
*/
void editOfflinePlayerBag(Player admin, OfflineUser userData);
Action[] getCollectLootActions();
Action[] getBagFullActions();
boolean doesBagStoreLoots();
String getBagTitle();
List<Material> getBagWhiteListItems();
}

View File

@@ -18,6 +18,7 @@
package net.momirealms.customfishing.api.manager;
import net.momirealms.customfishing.api.common.Key;
import net.momirealms.customfishing.api.mechanic.condition.Condition;
import net.momirealms.customfishing.api.mechanic.item.BuildableItem;
import net.momirealms.customfishing.api.mechanic.item.ItemBuilder;
import net.momirealms.customfishing.api.mechanic.item.ItemLibrary;
@@ -157,19 +158,10 @@ public interface ItemManager {
* @param player The player for whom the item is intended.
* @param hookLocation The location where the item will initially drop.
* @param playerLocation The target location towards which the item's velocity is applied.
* @param id The loot object representing the item to be dropped.
* @param args A map of placeholders for item customization.
* @param itemStack The loot to drop
* @param condition A map of placeholders for item customization.
*/
void dropItem(Player player, Location hookLocation, Location playerLocation, String id, Map<String, String> args);
/**
* Drops an item entity at the specified location and applies velocity towards another location.
*
* @param hookLocation The location where the item will initially drop.
* @param playerLocation The target location towards which the item's velocity is applied.
* @param itemStack The item stack to be dropped as an entity.
*/
void dropItem(Location hookLocation, Location playerLocation, ItemStack itemStack);
void dropItem(Player player, Location hookLocation, Location playerLocation, ItemStack itemStack, Condition condition);
/**
* Checks if the provided ItemStack is a custom fishing item