diff --git a/build.gradle b/build.gradle index 7f05c7f7..90e34d66 100644 --- a/build.gradle +++ b/build.gradle @@ -67,7 +67,9 @@ 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.emi:trinkets-dummy:${project.trinkets_version}" + modCompileOnly "dev.onyxstudios.cardinal-components-api:cardinal-components-base:5.1.0" + modCompileOnly "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:5.1.0" 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/lib/trinkets-dummy-3.6.0.jar b/lib/trinkets-dummy-3.6.0.jar new file mode 100644 index 00000000..e21a57d7 Binary files /dev/null and b/lib/trinkets-dummy-3.6.0.jar differ diff --git a/lib/trinkets-dummy-3.6.0.pom b/lib/trinkets-dummy-3.6.0.pom new file mode 100644 index 00000000..19fea6e4 --- /dev/null +++ b/lib/trinkets-dummy-3.6.0.pom @@ -0,0 +1,21 @@ + + + 4.0.0 + dev.emi + trinkets-dummy + 3.6.0 + + + dev.onyxstudios.cardinal-components-api + cardinal-components-base + 5.1.0 + runtime + + + dev.onyxstudios.cardinal-components-api + cardinal-components-entity + 5.1.0 + runtime + + + diff --git a/src/main/java/com/minelittlepony/unicopia/item/group/ItemGroupRegistry.java b/src/main/java/com/minelittlepony/unicopia/item/group/ItemGroupRegistry.java index c82ff3bc..071f258f 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/group/ItemGroupRegistry.java +++ b/src/main/java/com/minelittlepony/unicopia/item/group/ItemGroupRegistry.java @@ -15,6 +15,8 @@ import net.minecraft.registry.Registry; import net.minecraft.registry.RegistryKey; import net.minecraft.registry.RegistryKeys; import net.minecraft.registry.tag.TagKey; +import net.minecraft.text.Text; +import net.minecraft.util.Util; public interface ItemGroupRegistry { Map, Set> REGISTRY = new HashMap<>(); @@ -37,7 +39,7 @@ public interface ItemGroupRegistry { items.get().forEach(item -> { entries.addAll(ItemGroupRegistry.getVariations(item)); }); - }).icon(icon).build()); + }).icon(icon).displayName(Text.translatable(Util.createTranslationKey("itemGroup", key.getValue()))).build()); return key; } diff --git a/src/main/java/com/minelittlepony/unicopia/mixin/MixinDamageSource.java b/src/main/java/com/minelittlepony/unicopia/mixin/MixinDamageSource.java index 204fd764..082f246a 100644 --- a/src/main/java/com/minelittlepony/unicopia/mixin/MixinDamageSource.java +++ b/src/main/java/com/minelittlepony/unicopia/mixin/MixinDamageSource.java @@ -1,10 +1,8 @@ package com.minelittlepony.unicopia.mixin; -import org.jetbrains.annotations.Nullable; import org.spongepowered.asm.mixin.*; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import com.minelittlepony.unicopia.entity.Living; @@ -40,18 +38,17 @@ abstract class MixinDamageSource { } } -@Mixin(DamageTracker.class) -abstract class MixinDamageTracker { - @Shadow - private @Final LivingEntity entity; - @Nullable - private String fallDeathSuffix; - - @Inject(method = "setFallDeathSuffix", at = @At("RETURN")) - private void onSetFallDeathSuffix(CallbackInfo info) { +@Mixin(FallLocation.class) +abstract class MixinFallLocation { + @Inject(method = "fromEntity", at = @At("RETURN")) + private static void onFromEntity(LivingEntity entity, CallbackInfoReturnable info) { + FallLocation location = info.getReturnValue(); + if (location == null) { + return; + } Pony.of(entity).ifPresent(pony -> { if (pony.getSpecies().canFly()) { - fallDeathSuffix = (fallDeathSuffix == null ? "" : fallDeathSuffix + ".") + "pegasus"; + info.setReturnValue(new FallLocation(location.id() + ".pegasus")); } }); } diff --git a/src/main/resources/unicopia.mixin.json b/src/main/resources/unicopia.mixin.json index 5a9c0794..7e19da9e 100644 --- a/src/main/resources/unicopia.mixin.json +++ b/src/main/resources/unicopia.mixin.json @@ -13,7 +13,7 @@ "MixinBoatEntity", "MixinBrain", "MixinDamageSource", - "MixinDamageTracker", + "MixinFallLocation", "MixinEntity", "MixinFallingBlock", "MixinFallingBlockEntity",