mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 07:17:58 +01:00
Fix build and some crashes
This commit is contained in:
parent
43d1142f1f
commit
91eae78d65
6 changed files with 37 additions and 15 deletions
|
@ -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}"
|
||||
|
|
BIN
lib/trinkets-dummy-3.6.0.jar
Normal file
BIN
lib/trinkets-dummy-3.6.0.jar
Normal file
Binary file not shown.
21
lib/trinkets-dummy-3.6.0.pom
Normal file
21
lib/trinkets-dummy-3.6.0.pom
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>dev.emi</groupId>
|
||||
<artifactId>trinkets-dummy</artifactId>
|
||||
<version>3.6.0</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>dev.onyxstudios.cardinal-components-api</groupId>
|
||||
<artifactId>cardinal-components-base</artifactId>
|
||||
<version>5.1.0</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>dev.onyxstudios.cardinal-components-api</groupId>
|
||||
<artifactId>cardinal-components-entity</artifactId>
|
||||
<version>5.1.0</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -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<RegistryKey<ItemGroup>, Set<Item>> 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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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<FallLocation> 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"));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"MixinBoatEntity",
|
||||
"MixinBrain",
|
||||
"MixinDamageSource",
|
||||
"MixinDamageTracker",
|
||||
"MixinFallLocation",
|
||||
"MixinEntity",
|
||||
"MixinFallingBlock",
|
||||
"MixinFallingBlockEntity",
|
||||
|
|
Loading…
Reference in a new issue