diff options
Diffstat (limited to 'src/main/java/moe/nea/firmament/mixins/DFUEntityIdFixPatch.java')
| -rw-r--r-- | src/main/java/moe/nea/firmament/mixins/DFUEntityIdFixPatch.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/moe/nea/firmament/mixins/DFUEntityIdFixPatch.java b/src/main/java/moe/nea/firmament/mixins/DFUEntityIdFixPatch.java index 717d404..8503411 100644 --- a/src/main/java/moe/nea/firmament/mixins/DFUEntityIdFixPatch.java +++ b/src/main/java/moe/nea/firmament/mixins/DFUEntityIdFixPatch.java @@ -6,8 +6,8 @@ import com.mojang.datafixers.DataFix; import com.mojang.datafixers.TypeRewriteRule; import com.mojang.datafixers.schemas.Schema; import com.mojang.datafixers.util.Pair; -import net.minecraft.datafixer.TypeReferences; -import net.minecraft.datafixer.fix.EntityIdFix; +import net.minecraft.util.datafix.fixes.References; +import net.minecraft.util.datafix.fixes.EntityIdFix; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -22,7 +22,7 @@ import java.util.Map; public abstract class DFUEntityIdFixPatch extends DataFix { @Shadow @Final - private static Map<String, String> RENAMED_ENTITIES; + private static Map<String, String> ID_MAP; public DFUEntityIdFixPatch(Schema outputSchema, boolean changesType) { super(outputSchema, changesType); @@ -30,6 +30,6 @@ public abstract class DFUEntityIdFixPatch extends DataFix { @Inject(method = "makeRule", at = @At("RETURN"), cancellable = true) public void onMakeRule(CallbackInfoReturnable<TypeRewriteRule> cir) { - cir.setReturnValue(TypeRewriteRule.seq(fixTypeEverywhere("EntityIdFix", getInputSchema().findChoiceType(TypeReferences.ENTITY), getOutputSchema().findChoiceType(TypeReferences.ENTITY), dynamicOps -> pair -> ((Pair) pair).mapFirst(string -> RENAMED_ENTITIES.getOrDefault(string, (String) string))), convertUnchecked("Fix Type", getInputSchema().getType(TypeReferences.ITEM_STACK), getOutputSchema().getType(TypeReferences.ITEM_STACK)))); + cir.setReturnValue(TypeRewriteRule.seq(fixTypeEverywhere("EntityIdFix", getInputSchema().findChoiceType(References.ENTITY), getOutputSchema().findChoiceType(References.ENTITY), dynamicOps -> pair -> ((Pair) pair).mapFirst(string -> ID_MAP.getOrDefault(string, (String) string))), convertUnchecked("Fix Type", getInputSchema().getType(References.ITEM_STACK), getOutputSchema().getType(References.ITEM_STACK)))); } } |
