diff --git a/build.gradle b/build.gradle index 8752d140..de730eec 100644 --- a/build.gradle +++ b/build.gradle @@ -78,7 +78,12 @@ dependencies { include "com.sollace:Romanizer:Romanizer:1.0.2" modCompileOnly "com.terraformersmc:modmenu:${project.modmenu_version}" - modCompileOnly "dev.emi:trinkets:${project.trinkets_version}" + + if (project.use_trinkets == '1') { + modCompileOnly "dev.emi:trinkets:${project.trinkets_version}" + } else { + modCompileOnly "dev.emi:trinkets-dummy:${project.trinkets_version}" + } modImplementation "com.terraformersmc.terraform-api:terraform-wood-api-v1:${project.terraformer_api_version}" include "com.terraformersmc.terraform-api:terraform-wood-api-v1:${project.terraformer_api_version}" diff --git a/gradle.properties b/gradle.properties index 7018784c..25ccc1c3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -30,6 +30,7 @@ org.gradle.daemon=false nodium_version=1.1.0+1.20 # Testing + use_trinkets=1 use_pehkui=0 use_sodium=1 diff --git a/lib/trinkets-dummy-3.8.0.jar b/lib/trinkets-dummy-3.8.0.jar new file mode 100644 index 00000000..1e65318d Binary files /dev/null and b/lib/trinkets-dummy-3.8.0.jar differ diff --git a/src/main/java/com/minelittlepony/unicopia/compat/trinkets/TrinketsDelegate.java b/src/main/java/com/minelittlepony/unicopia/compat/trinkets/TrinketsDelegate.java index f19d592a..c73f5d46 100644 --- a/src/main/java/com/minelittlepony/unicopia/compat/trinkets/TrinketsDelegate.java +++ b/src/main/java/com/minelittlepony/unicopia/compat/trinkets/TrinketsDelegate.java @@ -127,7 +127,7 @@ public interface TrinketsDelegate { } record EquippedStack(ItemStack stack, Runnable sendUpdate, Consumer breakStatusSender) { - public static EquippedStack EMPTY = new EquippedStack(ItemStack.EMPTY, () -> {}, l -> {}); + public static final EquippedStack EMPTY = new EquippedStack(ItemStack.EMPTY, () -> {}, l -> {}); EquippedStack(LivingEntity entity, EquipmentSlot slot) { this(entity.getEquippedStack(slot), () -> {}, l -> l.sendEquipmentBreakStatus(slot)); diff --git a/src/main/java/com/minelittlepony/unicopia/item/AmuletItem.java b/src/main/java/com/minelittlepony/unicopia/item/AmuletItem.java index 8e0673f7..a434863f 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/AmuletItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/AmuletItem.java @@ -101,7 +101,7 @@ public class AmuletItem extends WearableItem implements ChargeableItem { } public static TrinketsDelegate.EquippedStack get(LivingEntity entity) { - return TrinketsDelegate.getInstance(entity).getEquipped(entity, TrinketsDelegate.NECKLACE) + return TrinketsDelegate.getInstance(entity).getEquipped(entity, TrinketsDelegate.NECKLACE, stack -> stack.getItem() instanceof AmuletItem) .findFirst() .orElse(TrinketsDelegate.EquippedStack.EMPTY); }