|
9 | 9 | import com.tcm.MineTale.registry.ModBlockEntities; |
10 | 10 |
|
11 | 11 | import net.minecraft.core.BlockPos; |
| 12 | +import net.minecraft.tags.ItemTags; |
12 | 13 | import net.minecraft.world.Container; |
13 | 14 | import net.minecraft.world.SimpleContainer; |
14 | 15 | import net.minecraft.world.entity.player.Inventory; |
@@ -214,7 +215,7 @@ private void smeltItem(ItemStack input) { |
214 | 215 | ItemStack output = inventory.getItem(outputSlot); |
215 | 216 |
|
216 | 217 | if (output.isEmpty()) { |
217 | | - inventory.setItem(2, result.copy()); |
| 218 | + inventory.setItem(outputSlot, result.copy()) |
218 | 219 | } else if (ItemStack.isSameItem(output, result)) { |
219 | 220 | output.grow(result.getCount()); |
220 | 221 | } |
@@ -262,19 +263,19 @@ private int findOutputSlot(ItemStack result) { |
262 | 263 | } |
263 | 264 |
|
264 | 265 | /** |
265 | | - * Determines whether the provided item stack is a supported ore. |
266 | | - * |
267 | | - * @param stack the item stack to test |
268 | | - * @return `true` if the stack is a supported ore (currently `Items.RAW_COPPER`), `false` otherwise |
269 | | - */ |
| 266 | + * Determines whether the provided item stack is a supported ore. |
| 267 | + * |
| 268 | + * @param stack the item stack to test |
| 269 | + * @return `true` if the stack is a supported ore (currently `Items.RAW_COPPER`), `false` otherwise |
| 270 | + */ |
270 | 271 | private boolean isOre(ItemStack stack) { return stack.is(Items.RAW_COPPER); /* Add more ores */ } |
271 | 272 | /** |
272 | | - * Determines whether the given item stack represents a wood log item. |
273 | | - * |
274 | | - * @param stack the item stack to inspect |
275 | | - * @return `true` if the stack's item is a wood log, `false` otherwise |
276 | | - */ |
277 | | -private boolean isWood(ItemStack stack) { return stack.getItem().toString().contains("log"); } |
| 273 | + * Determines whether the given item stack represents a wood log item. |
| 274 | + * |
| 275 | + * @param stack the item stack to inspect |
| 276 | + * @return `true` if the stack's item is a wood log, `false` otherwise |
| 277 | + */ |
| 278 | + private boolean isWood(ItemStack stack) { return stack.is(ItemTags.LOGS_THAT_BURN); } |
278 | 279 |
|
279 | 280 | /** |
280 | 281 | * Persist entity-specific state into the provided ValueOutput. |
|
0 commit comments