mirror of
https://github.com/Xiao-MoMi/Custom-Fishing.git
synced 2025-12-19 15:09:24 +00:00
2.3.4.2
This commit is contained in:
@@ -627,4 +627,8 @@ public class CustomFishingHook {
|
||||
plugin.getEventManager().trigger(context, id, MechanicType.LOOT, ActionTrigger.SUCCESS);
|
||||
player.setStatistic(Statistic.FISH_CAUGHT, player.getStatistic(Statistic.FISH_CAUGHT) + 1);
|
||||
}
|
||||
|
||||
public FishingGears gears() {
|
||||
return gears;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,6 +73,18 @@ public class FishingGears {
|
||||
private boolean canFish = true;
|
||||
private HandSlot rodSlot;
|
||||
|
||||
public void setCanFish(boolean canFish) {
|
||||
this.canFish = canFish;
|
||||
}
|
||||
|
||||
public void setRodSlot(HandSlot rodSlot) {
|
||||
this.rodSlot = rodSlot;
|
||||
}
|
||||
|
||||
public Map<GearType, List<Pair<String, ItemStack>>> gears() {
|
||||
return gears;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the fishing gears consumers.
|
||||
*
|
||||
|
||||
@@ -150,7 +150,7 @@ public class LootImpl implements Loot {
|
||||
private String[] groups = new String[0];
|
||||
private LootBaseEffect lootBaseEffect = null;
|
||||
private MathValue<Player> toInventory = MathValue.plain(0);
|
||||
private Map<String, TextValue<Player>> customData = new LinkedHashMap<>();
|
||||
private final Map<String, TextValue<Player>> customData = new LinkedHashMap<>();
|
||||
|
||||
@Override
|
||||
public Builder type(LootType type) {
|
||||
|
||||
@@ -50,8 +50,15 @@ public interface TextValue<T> {
|
||||
* @return the rendered text as a String
|
||||
*/
|
||||
default String render(Context<T> context, boolean parseRawPlaceholders) {
|
||||
if (!parseRawPlaceholders || !(context.holder() instanceof OfflinePlayer player)) return render(context);
|
||||
return PlaceholderAPIUtils.parse(player, render(context));
|
||||
if (!(context.holder() instanceof OfflinePlayer player)) {
|
||||
if (!parseRawPlaceholders) {
|
||||
return render(context);
|
||||
} else {
|
||||
return PlaceholderAPIUtils.parse(null, render(context));
|
||||
}
|
||||
} else {
|
||||
return PlaceholderAPIUtils.parse(player, render(context));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -51,7 +51,7 @@ dependencies {
|
||||
compileOnly(files("libs/ExecutableItems-7.24.9.29.jar"))
|
||||
compileOnly(files("libs/SCore-5.24.9.29.jar"))
|
||||
compileOnly(files("libs/SCore-5.24.9.29.jar"))
|
||||
compileOnly(files("libs/CraftEngine-beta.jar"))
|
||||
compileOnly(files("libs/CraftEngine-0.0.8.jar"))
|
||||
compileOnly(files("libs/libreforge-4.73.0.jar"))
|
||||
compileOnly("com.github.LoneDev6:API-ItemsAdder:3.6.1")
|
||||
compileOnly("net.Indyuce:MMOItems-API:6.10-SNAPSHOT")
|
||||
|
||||
BIN
compatibility/libs/CraftEngine-0.0.8.jar
Normal file
BIN
compatibility/libs/CraftEngine-0.0.8.jar
Normal file
Binary file not shown.
Binary file not shown.
@@ -17,7 +17,7 @@
|
||||
|
||||
package net.momirealms.customfishing.bukkit.integration.item;
|
||||
|
||||
import net.momirealms.craftengine.api.Key;
|
||||
import net.momirealms.craftengine.api.util.Key;
|
||||
import net.momirealms.craftengine.bukkit.plugin.BukkitCraftEngine;
|
||||
import net.momirealms.customfishing.api.integration.ItemProvider;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -38,7 +38,7 @@ public class CraftEngineProvider implements ItemProvider {
|
||||
@NotNull
|
||||
@Override
|
||||
public ItemStack buildItem(@NotNull Player player, @NotNull String id) {
|
||||
ItemStack itemStack = BukkitCraftEngine.instance().itemManager().buildItem(Key.of(id), BukkitCraftEngine.instance().adapt(player));
|
||||
ItemStack itemStack = BukkitCraftEngine.instance().itemManager().buildItemStack(Key.of(id), BukkitCraftEngine.instance().adapt(player));
|
||||
return requireNonNull(itemStack, "Item not found in CraftEngine: " + id);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@ package net.momirealms.customfishing.bukkit.integration;
|
||||
|
||||
import net.momirealms.customfishing.api.BukkitCustomFishingPlugin;
|
||||
import net.momirealms.customfishing.api.integration.*;
|
||||
import net.momirealms.customfishing.api.mechanic.fishing.CustomFishingHook;
|
||||
import net.momirealms.customfishing.api.mechanic.fishing.FishingGears;
|
||||
import net.momirealms.customfishing.bukkit.block.BukkitBlockManager;
|
||||
import net.momirealms.customfishing.bukkit.entity.BukkitEntityManager;
|
||||
import net.momirealms.customfishing.bukkit.integration.block.ItemsAdderBlockProvider;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Project settings
|
||||
# Rule: [major update].[feature update].[bug fix]
|
||||
project_version=2.3.4
|
||||
project_version=2.3.4.2
|
||||
config_version=38
|
||||
project_group=net.momirealms
|
||||
|
||||
|
||||
Reference in New Issue
Block a user