diff options
author | Linnea Gräf <nea@nea.moe> | 2024-12-23 23:53:27 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-12-23 23:53:27 +0100 |
commit | 39d35afb702cf017569ef9594774561848db7494 (patch) | |
tree | b8ce02020bebced97115373507d37ffc713e49e2 /src/main/java | |
parent | 656958937fe29da90d7229b979996a68b5ea5b67 (diff) | |
download | Firmament-39d35afb702cf017569ef9594774561848db7494.tar.gz Firmament-39d35afb702cf017569ef9594774561848db7494.tar.bz2 Firmament-39d35afb702cf017569ef9594774561848db7494.zip |
fix: Some items not being saved in /firm stoarge
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/TolerateFirmamentTolerateRegistryOwners.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main/java/moe/nea/firmament/mixins/TolerateFirmamentTolerateRegistryOwners.java b/src/main/java/moe/nea/firmament/mixins/TolerateFirmamentTolerateRegistryOwners.java new file mode 100644 index 0000000..ac6f614 --- /dev/null +++ b/src/main/java/moe/nea/firmament/mixins/TolerateFirmamentTolerateRegistryOwners.java @@ -0,0 +1,18 @@ +package moe.nea.firmament.mixins; + +import moe.nea.firmament.util.mc.TolerantRegistriesOps; +import net.minecraft.registry.entry.RegistryEntryOwner; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin(RegistryEntryOwner.class) +public interface TolerateFirmamentTolerateRegistryOwners<T> { + @Inject(method = "ownerEquals", at = @At("HEAD"), cancellable = true) + private void equalTolerantRegistryOwners(RegistryEntryOwner<T> other, CallbackInfoReturnable<Boolean> cir) { + if (other instanceof TolerantRegistriesOps.TolerantOwner<?>) { + cir.setReturnValue(true); + } + } +} |