mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-30 16:28:00 +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"
|
include "com.sollace:Romanizer:Romanizer:1.0.2"
|
||||||
|
|
||||||
modCompileOnly "com.terraformersmc:modmenu:${project.modmenu_version}"
|
modCompileOnly "com.terraformersmc:modmenu:${project.modmenu_version}"
|
||||||
modCompileOnly "dev.emi:trinkets:${project.trinkets_version}"
|
if (project.use_trinkets == '1') {
|
||||||
modCompileOnly "dev.onyxstudios.cardinal-components-api:cardinal-components-base:5.3.0"
|
modCompileOnly "dev.emi:trinkets:${project.trinkets_version}"
|
||||||
modCompileOnly "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:5.3.0"
|
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}"
|
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}"
|
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
|
nodium_version=1.1.0+1.20
|
||||||
|
|
||||||
# Testing
|
# Testing
|
||||||
|
use_trinkets=1
|
||||||
use_pehkui=0
|
use_pehkui=0
|
||||||
use_sodium=1
|
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) {
|
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) {
|
EquippedStack(LivingEntity entity, EquipmentSlot slot) {
|
||||||
this(entity.getEquippedStack(slot), () -> {}, l -> l.sendEquipmentBreakStatus(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) {
|
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()
|
.findFirst()
|
||||||
.orElse(TrinketsDelegate.EquippedStack.EMPTY);
|
.orElse(TrinketsDelegate.EquippedStack.EMPTY);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue