minecraft_25w45a_unobfuscated/net/minecraft/util/datafix/fixes/WeaponSmithChestLootTableFix.java
2025-11-24 22:52:51 +03:00

32 lines
1.1 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
*/
package net.minecraft.util.datafix.fixes;
import com.mojang.datafixers.DSL;
import com.mojang.datafixers.Typed;
import com.mojang.datafixers.schemas.Schema;
import net.minecraft.util.datafix.fixes.NamedEntityFix;
import net.minecraft.util.datafix.fixes.References;
public class WeaponSmithChestLootTableFix
extends NamedEntityFix {
public WeaponSmithChestLootTableFix(Schema outputSchema, boolean changesType) {
super(outputSchema, changesType, "WeaponSmithChestLootTableFix", References.BLOCK_ENTITY, "minecraft:chest");
}
@Override
protected Typed<?> fix(Typed<?> entity) {
return entity.update(DSL.remainderFinder(), tag -> {
String lootTable = tag.get("LootTable").asString("");
return lootTable.equals("minecraft:chests/village_blacksmith") ? tag.set("LootTable", tag.createString("minecraft:chests/village/village_weaponsmith")) : tag;
});
}
}