Fix recipe has empty result (#837)
This commit is contained in:
parent
f4277eecc2
commit
203a22e3d4
@ -1,6 +1,7 @@
|
||||
package io.izzel.arclight.common.mixin.core.world.item.crafting;
|
||||
|
||||
import io.izzel.arclight.common.bridge.core.item.crafting.IRecipeBridge;
|
||||
import io.izzel.arclight.common.mod.util.ArclightSpecialRecipe;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.crafting.AbstractCookingRecipe;
|
||||
@ -23,6 +24,9 @@ public abstract class BlastingRecipeMixin extends AbstractCookingRecipe implemen
|
||||
|
||||
@Override
|
||||
public Recipe bridge$toBukkitRecipe() {
|
||||
if (this.result.isEmpty()) {
|
||||
return new ArclightSpecialRecipe(this);
|
||||
}
|
||||
CraftItemStack result = CraftItemStack.asCraftMirror(this.result);
|
||||
CraftBlastingRecipe recipe = new CraftBlastingRecipe(CraftNamespacedKey.fromMinecraft(this.getId()), result, CraftRecipe.toBukkit(this.ingredient), this.experience, this.cookingTime);
|
||||
recipe.setGroup(this.group);
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package io.izzel.arclight.common.mixin.core.world.item.crafting;
|
||||
|
||||
import io.izzel.arclight.common.bridge.core.item.crafting.IRecipeBridge;
|
||||
import io.izzel.arclight.common.mod.util.ArclightSpecialRecipe;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.crafting.AbstractCookingRecipe;
|
||||
@ -23,6 +24,9 @@ public abstract class CampfireCookingRecipeMixin extends AbstractCookingRecipe i
|
||||
|
||||
@Override
|
||||
public Recipe bridge$toBukkitRecipe() {
|
||||
if (this.result.isEmpty()) {
|
||||
return new ArclightSpecialRecipe(this);
|
||||
}
|
||||
CraftItemStack result = CraftItemStack.asCraftMirror(this.result);
|
||||
CraftCampfireRecipe recipe = new CraftCampfireRecipe(CraftNamespacedKey.fromMinecraft(this.getId()), result, CraftRecipe.toBukkit(this.ingredient), this.experience, this.cookingTime);
|
||||
recipe.setGroup(this.group);
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package io.izzel.arclight.common.mixin.core.world.item.crafting;
|
||||
|
||||
import io.izzel.arclight.common.bridge.core.item.crafting.IRecipeBridge;
|
||||
import io.izzel.arclight.common.mod.util.ArclightSpecialRecipe;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.crafting.AbstractCookingRecipe;
|
||||
@ -23,6 +24,9 @@ public abstract class FurnaceRecipeMixin extends AbstractCookingRecipe implement
|
||||
|
||||
@Override
|
||||
public Recipe bridge$toBukkitRecipe() {
|
||||
if (this.result.isEmpty()) {
|
||||
return new ArclightSpecialRecipe(this);
|
||||
}
|
||||
CraftItemStack result = CraftItemStack.asCraftMirror(this.result);
|
||||
|
||||
CraftFurnaceRecipe recipe = new CraftFurnaceRecipe(CraftNamespacedKey.fromMinecraft(this.id), result, CraftRecipe.toBukkit(this.ingredient), this.experience, this.cookingTime);
|
||||
|
||||
@ -28,7 +28,7 @@ public abstract class ShapedRecipeMixin implements IRecipeBridge {
|
||||
|
||||
@Override
|
||||
public Recipe bridge$toBukkitRecipe() {
|
||||
if (this.getWidth() < 0 || this.getWidth() > 3 || this.getHeight() < 0 || this.getHeight() > 3) {
|
||||
if (this.getWidth() < 1 || this.getWidth() > 3 || this.getHeight() < 1 || this.getHeight() > 3 || this.result.isEmpty()) {
|
||||
return new ArclightSpecialRecipe((net.minecraft.world.item.crafting.Recipe<?>) this);
|
||||
}
|
||||
CraftItemStack result = CraftItemStack.asCraftMirror(this.result);
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package io.izzel.arclight.common.mixin.core.world.item.crafting;
|
||||
|
||||
import io.izzel.arclight.common.bridge.core.item.crafting.IRecipeBridge;
|
||||
import io.izzel.arclight.common.mod.util.ArclightSpecialRecipe;
|
||||
import net.minecraft.core.NonNullList;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
@ -20,10 +21,13 @@ public class ShapelessRecipeMixin implements IRecipeBridge {
|
||||
@Shadow @Final ItemStack result;
|
||||
@Shadow @Final String group;
|
||||
@Shadow @Final NonNullList<Ingredient> ingredients;
|
||||
// @formatter:off
|
||||
// @formatter:on
|
||||
|
||||
@Override
|
||||
public Recipe bridge$toBukkitRecipe() {
|
||||
if (this.result.isEmpty()) {
|
||||
return new ArclightSpecialRecipe((ShapelessRecipe) (Object) this);
|
||||
}
|
||||
CraftItemStack result = CraftItemStack.asCraftMirror(this.result);
|
||||
CraftShapelessRecipe recipe = new CraftShapelessRecipe(result, (ShapelessRecipe) (Object) this);
|
||||
recipe.setGroup(this.group);
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package io.izzel.arclight.common.mixin.core.world.item.crafting;
|
||||
|
||||
import io.izzel.arclight.common.bridge.core.item.crafting.IRecipeBridge;
|
||||
import io.izzel.arclight.common.mod.util.ArclightSpecialRecipe;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
@ -26,6 +27,9 @@ public class SmithingRecipeMixin implements IRecipeBridge {
|
||||
|
||||
@Override
|
||||
public Recipe bridge$toBukkitRecipe() {
|
||||
if (this.result.isEmpty()) {
|
||||
return new ArclightSpecialRecipe((UpgradeRecipe) (Object) this);
|
||||
}
|
||||
CraftItemStack result = CraftItemStack.asCraftMirror(this.result);
|
||||
return new CraftSmithingRecipe(CraftNamespacedKey.fromMinecraft(this.id), result, CraftRecipe.toBukkit(this.base), CraftRecipe.toBukkit(this.addition));
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package io.izzel.arclight.common.mixin.core.world.item.crafting;
|
||||
|
||||
import io.izzel.arclight.common.bridge.core.item.crafting.IRecipeBridge;
|
||||
import io.izzel.arclight.common.mod.util.ArclightSpecialRecipe;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.crafting.AbstractCookingRecipe;
|
||||
@ -23,6 +24,9 @@ public abstract class SmokingRecipeMixin extends AbstractCookingRecipe implement
|
||||
|
||||
@Override
|
||||
public Recipe bridge$toBukkitRecipe() {
|
||||
if (this.result.isEmpty()) {
|
||||
return new ArclightSpecialRecipe(this);
|
||||
}
|
||||
CraftItemStack result = CraftItemStack.asCraftMirror(this.result);
|
||||
CraftSmokingRecipe recipe = new CraftSmokingRecipe(CraftNamespacedKey.fromMinecraft(this.getId()), result, CraftRecipe.toBukkit(this.ingredient), this.experience, this.cookingTime);
|
||||
recipe.setGroup(this.group);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user