Now using the template TotemItem class.

This commit is contained in:
2022-01-18 17:54:34 +00:00
parent 6b4c1d2c6b
commit b78433acfb

View File

@ -1,7 +1,6 @@
package dev.micle.totemofreviving.item.crafting;
import dev.micle.totemofreviving.config.Config;
import dev.micle.totemofreviving.item.StrawTotemItem;
import dev.micle.totemofreviving.item.TotemItem;
import dev.micle.totemofreviving.setup.ModRecipes;
import net.minecraft.inventory.CraftingInventory;
import net.minecraft.item.ItemStack;
@ -21,16 +20,14 @@ public class TotemRecipe extends ExtendedShapedRecipe {
@Override
public boolean matches(CraftingInventory inventory, World world) {
if (!Config.Server.getStrawTotemConfig().getIsEnabled()) {
if (getResultItem().getItem() instanceof StrawTotemItem) {
return false;
}
if (!TotemItem.isEnabled(getResultItem())) {
return false;
}
return getBaseRecipe().matches(inventory, world);
}
@Override
public ItemStack assemble(CraftingInventory inventory) {
return getResultItem();
return getBaseRecipe().getResultItem();
}
}