mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 13:37:58 +01:00
Fixed amulet rendering when trinkets is not installed. Closes #455
This commit is contained in:
parent
956dbd26b9
commit
8c560e3ff3
5 changed files with 9 additions and 3 deletions
|
@ -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}"
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
BIN
lib/trinkets-dummy-3.8.0.jar
Normal file
BIN
lib/trinkets-dummy-3.8.0.jar
Normal file
Binary file not shown.
|
@ -127,7 +127,7 @@ public interface TrinketsDelegate {
|
|||
}
|
||||
|
||||
record EquippedStack(ItemStack stack, Runnable sendUpdate, Consumer<LivingEntity> 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));
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue