/* * Decompiled with CFR 0.152. * * Could not load the following classes: * com.mojang.datafixers.schemas.Schema * com.mojang.serialization.Dynamic */ package net.minecraft.util.datafix.fixes; import com.mojang.datafixers.schemas.Schema; import com.mojang.serialization.Dynamic; import java.util.Map; import java.util.Optional; import net.minecraft.util.datafix.fixes.NamedEntityWriteReadFix; import net.minecraft.util.datafix.fixes.References; public class PrimedTntBlockStateFixer extends NamedEntityWriteReadFix { public PrimedTntBlockStateFixer(Schema outputSchema) { super(outputSchema, true, "PrimedTnt BlockState fixer", References.ENTITY, "minecraft:tnt"); } private static Dynamic renameFuse(Dynamic input) { Optional fuseValue = input.get("Fuse").get().result(); if (fuseValue.isPresent()) { return input.set("fuse", (Dynamic)fuseValue.get()); } return input; } private static Dynamic insertBlockState(Dynamic input) { return input.set("block_state", input.createMap(Map.of(input.createString("Name"), input.createString("minecraft:tnt")))); } @Override protected Dynamic fix(Dynamic input) { return PrimedTntBlockStateFixer.renameFuse(PrimedTntBlockStateFixer.insertBlockState(input)); } }