Now using the template TotemItem class.
This commit is contained in:
@ -1,7 +1,6 @@
|
|||||||
package dev.micle.totemofreviving.item.crafting;
|
package dev.micle.totemofreviving.item.crafting;
|
||||||
|
|
||||||
import dev.micle.totemofreviving.config.Config;
|
import dev.micle.totemofreviving.item.TotemItem;
|
||||||
import dev.micle.totemofreviving.item.StrawTotemItem;
|
|
||||||
import dev.micle.totemofreviving.setup.ModRecipes;
|
import dev.micle.totemofreviving.setup.ModRecipes;
|
||||||
import net.minecraft.inventory.CraftingInventory;
|
import net.minecraft.inventory.CraftingInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@ -21,16 +20,14 @@ public class TotemRecipe extends ExtendedShapedRecipe {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean matches(CraftingInventory inventory, World world) {
|
public boolean matches(CraftingInventory inventory, World world) {
|
||||||
if (!Config.Server.getStrawTotemConfig().getIsEnabled()) {
|
if (!TotemItem.isEnabled(getResultItem())) {
|
||||||
if (getResultItem().getItem() instanceof StrawTotemItem) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return getBaseRecipe().matches(inventory, world);
|
return getBaseRecipe().matches(inventory, world);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack assemble(CraftingInventory inventory) {
|
public ItemStack assemble(CraftingInventory inventory) {
|
||||||
return getResultItem();
|
return getBaseRecipe().getResultItem();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user