mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 07:17:58 +01:00
Fixed amulet rendering when trinkets is not installed. Closes #455
This commit is contained in:
parent
9523070c96
commit
3cc7030e7b
5 changed files with 10 additions and 5 deletions
10
build.gradle
10
build.gradle
|
@ -77,9 +77,13 @@ dependencies {
|
|||
include "com.sollace:Romanizer:Romanizer:1.0.2"
|
||||
|
||||
modCompileOnly "com.terraformersmc:modmenu:${project.modmenu_version}"
|
||||
modCompileOnly "dev.emi:trinkets:${project.trinkets_version}"
|
||||
modCompileOnly "dev.onyxstudios.cardinal-components-api:cardinal-components-base:5.3.0"
|
||||
modCompileOnly "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:5.3.0"
|
||||
if (project.use_trinkets == '1') {
|
||||
modCompileOnly "dev.emi:trinkets:${project.trinkets_version}"
|
||||
modCompileOnly "dev.onyxstudios.cardinal-components-api:cardinal-components-base:5.3.0"
|
||||
modCompileOnly "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:5.3.0"
|
||||
} 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