2025-11-24 22:52:51 +03:00

41 lines
1.3 KiB
Java

/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* com.mojang.datafixers.DSL
* com.mojang.datafixers.Typed
* com.mojang.datafixers.schemas.Schema
* com.mojang.serialization.Dynamic
*/
package net.minecraft.util.datafix.fixes;
import com.mojang.datafixers.DSL;
import com.mojang.datafixers.Typed;
import com.mojang.datafixers.schemas.Schema;
import com.mojang.serialization.Dynamic;
import java.util.List;
import net.minecraft.util.datafix.fixes.NamedEntityFix;
import net.minecraft.util.datafix.fixes.References;
public class EntityShulkerRotationFix
extends NamedEntityFix {
public EntityShulkerRotationFix(Schema outputSchema) {
super(outputSchema, false, "EntityShulkerRotationFix", References.ENTITY, "minecraft:shulker");
}
public Dynamic<?> fixTag(Dynamic<?> input) {
List rotation = input.get("Rotation").asList(d -> d.asDouble(180.0));
if (!rotation.isEmpty()) {
rotation.set(0, (Double)rotation.get(0) - 180.0);
return input.set("Rotation", input.createList(rotation.stream().map(arg_0 -> input.createDouble(arg_0))));
}
return input;
}
@Override
protected Typed<?> fix(Typed<?> entity) {
return entity.update(DSL.remainderFinder(), this::fixTag);
}
}