The Twilight Forest

The Twilight Forest

140M Downloads

[1.20.6-DEV] Recrafting copying over all components when it shouldn't.

Tamaized opened this issue ยท 0 comments

commented

Old 1.20.1 code:
https://github.com/TeamTwilight/twilightforest/blob/1.20.1/src/main/java/twilightforest/inventory/UncraftingMenu.java#L224-L263

Current code:

if (!result.isEmpty() && isValidMatchForInput(input, result)) {
// copy all data with nbt, enchantments, etc
result.applyComponents(input.getComponents());
this.tinkerResult.setItem(0, result);
this.uncraftingMatrix.uncraftingCost = 0;
this.uncraftingMatrix.recraftingCost = this.calculateRecraftingCost();
}

As you can see the old code filtered out incompatible enchantments and removed the damage tag.

The new code however doesn't filter out anything, meaning it copies over durability, incompatible enchantments, and other components it shouldn't like edible. Besides those 3 mentioned we should do a bit of research and see which vanilla components should be black listed from the transfer. Modded components should be fine as that's how the old behavior worked before with copying over the entire nbt tag.