Continue migration
This commit is contained in:
parent
47ed597358
commit
33dbfbe633
263 changed files with 1450 additions and 1486 deletions
|
@ -6,7 +6,7 @@ import net.minecraft.world.item.Item;
|
|||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.potion.PotionUtil;
|
||||
import net.minecraft.potion.Potions;
|
||||
import net.minecraft.world.item.alchemy.Potions;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.item.GuideBookItem;
|
||||
import ru.betterend.recipe.builders.GridRecipe;
|
||||
|
|
|
@ -7,7 +7,7 @@ import net.fabricmc.api.EnvType;
|
|||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.inventory.Inventory;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemConvertible;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
|
@ -157,16 +157,16 @@ public class AlloyingRecipe implements Recipe<Inventory>, BetterEndRecipe {
|
|||
return this;
|
||||
}
|
||||
|
||||
public Builder setPrimaryInput(ItemConvertible... inputs) {
|
||||
for (ItemConvertible item : inputs) {
|
||||
public Builder setPrimaryInput(ItemLike... inputs) {
|
||||
for (ItemLike item : inputs) {
|
||||
this.alright &= RecipeHelper.exists(item);
|
||||
}
|
||||
this.primaryInput = Ingredient.of(inputs);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setSecondaryInput(ItemConvertible... inputs) {
|
||||
for (ItemConvertible item : inputs) {
|
||||
public Builder setSecondaryInput(ItemLike... inputs) {
|
||||
for (ItemLike item : inputs) {
|
||||
this.alright &= RecipeHelper.exists(item);
|
||||
}
|
||||
this.secondaryInput = Ingredient.of(inputs);
|
||||
|
@ -183,7 +183,7 @@ public class AlloyingRecipe implements Recipe<Inventory>, BetterEndRecipe {
|
|||
return this;
|
||||
}
|
||||
|
||||
public Builder setInput(ItemConvertible primaryInput, ItemConvertible secondaryInput) {
|
||||
public Builder setInput(ItemLike primaryInput, ItemLike secondaryInput) {
|
||||
this.setPrimaryInput(primaryInput);
|
||||
this.setSecondaryInput(secondaryInput);
|
||||
return this;
|
||||
|
@ -195,7 +195,7 @@ public class AlloyingRecipe implements Recipe<Inventory>, BetterEndRecipe {
|
|||
return this;
|
||||
}
|
||||
|
||||
public Builder setOutput(ItemConvertible output, int amount) {
|
||||
public Builder setOutput(ItemLike output, int amount) {
|
||||
this.alright &= RecipeHelper.exists(output);
|
||||
this.output = new ItemStack(output, amount);
|
||||
return this;
|
||||
|
|
|
@ -6,12 +6,12 @@ import com.google.gson.JsonObject;
|
|||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.world.entity.player.PlayerEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.inventory.Inventory;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemConvertible;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.ToolItem;
|
||||
import net.minecraft.world.item.TieredItem;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
import net.minecraft.world.item.crafting.Recipe;
|
||||
|
@ -76,7 +76,7 @@ public class AnvilRecipe implements Recipe<Inventory>, BetterEndRecipe {
|
|||
return this.output.copy();
|
||||
}
|
||||
|
||||
public ItemStack craft(Inventory craftingInventory, PlayerEntity player) {
|
||||
public ItemStack craft(Inventory craftingInventory, Player player) {
|
||||
if (!player.isCreative()) {
|
||||
if (!checkHammerDurability(craftingInventory, player))
|
||||
return ItemStack.EMPTY;
|
||||
|
@ -86,7 +86,7 @@ public class AnvilRecipe implements Recipe<Inventory>, BetterEndRecipe {
|
|||
return this.craft(craftingInventory);
|
||||
}
|
||||
|
||||
public boolean checkHammerDurability(Inventory craftingInventory, PlayerEntity player) {
|
||||
public boolean checkHammerDurability(Inventory craftingInventory, Player player) {
|
||||
if (player.isCreative())
|
||||
return true;
|
||||
ItemStack hammer = craftingInventory.getStack(1);
|
||||
|
@ -101,7 +101,7 @@ public class AnvilRecipe implements Recipe<Inventory>, BetterEndRecipe {
|
|||
}
|
||||
ItemStack material = craftingInventory.getStack(0);
|
||||
int materialCount = material.getCount();
|
||||
int level = ((ToolItem) hammer.getItem()).getTier().getLevel();
|
||||
int level = ((TieredItem) hammer.getItem()).getTier().getLevel();
|
||||
return this.input.test(craftingInventory.getStack(0)) && materialCount >= this.inputCount
|
||||
&& level >= this.toolLevel;
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ public class AnvilRecipe implements Recipe<Inventory>, BetterEndRecipe {
|
|||
public DefaultedList<Ingredient> getPreviewInputs() {
|
||||
DefaultedList<Ingredient> defaultedList = DefaultedList.of();
|
||||
defaultedList.add(Ingredient.ofStacks(EndTags.HAMMERS.values().stream()
|
||||
.filter(hammer -> ((ToolItem) hammer).getTier().getLevel() >= toolLevel).map(ItemStack::new)));
|
||||
.filter(hammer -> ((TieredItem) hammer).getTier().getLevel() >= toolLevel).map(ItemStack::new)));
|
||||
defaultedList.add(input);
|
||||
|
||||
return defaultedList;
|
||||
|
@ -202,7 +202,7 @@ public class AnvilRecipe implements Recipe<Inventory>, BetterEndRecipe {
|
|||
private Builder() {
|
||||
}
|
||||
|
||||
public Builder setInput(ItemConvertible... inputItems) {
|
||||
public Builder setInput(ItemLike... inputItems) {
|
||||
this.alright &= RecipeHelper.exists(inputItems);
|
||||
this.setInput(Ingredient.of(inputItems));
|
||||
return this;
|
||||
|
@ -223,11 +223,11 @@ public class AnvilRecipe implements Recipe<Inventory>, BetterEndRecipe {
|
|||
return this;
|
||||
}
|
||||
|
||||
public Builder setOutput(ItemConvertible output) {
|
||||
public Builder setOutput(ItemLike output) {
|
||||
return this.setOutput(output, 1);
|
||||
}
|
||||
|
||||
public Builder setOutput(ItemConvertible output, int amount) {
|
||||
public Builder setOutput(ItemLike output, int amount) {
|
||||
this.alright &= RecipeHelper.exists(output);
|
||||
this.output = new ItemStack(output, amount);
|
||||
return this;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package ru.betterend.recipe.builders;
|
||||
|
||||
import net.minecraft.world.item.ItemConvertible;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.crafting.BlastingRecipe;
|
||||
import net.minecraft.world.item.crafting.CampfireCookingRecipe;
|
||||
|
@ -17,8 +17,8 @@ import ru.betterend.util.RecipeHelper;
|
|||
public class FurnaceRecipe {
|
||||
private static final FurnaceRecipe INSTANCE = new FurnaceRecipe();
|
||||
|
||||
private ItemConvertible input;
|
||||
private ItemConvertible output;
|
||||
private ItemLike input;
|
||||
private ItemLike output;
|
||||
private boolean exist;
|
||||
private String group;
|
||||
private String name;
|
||||
|
@ -29,7 +29,7 @@ public class FurnaceRecipe {
|
|||
private FurnaceRecipe() {
|
||||
}
|
||||
|
||||
public static FurnaceRecipe make(String name, ItemConvertible input, ItemConvertible output) {
|
||||
public static FurnaceRecipe make(String name, ItemLike input, ItemLike output) {
|
||||
INSTANCE.name = name;
|
||||
INSTANCE.group = "";
|
||||
INSTANCE.input = input;
|
||||
|
|
|
@ -6,7 +6,7 @@ import java.util.Map;
|
|||
import com.google.common.collect.Maps;
|
||||
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemConvertible;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.crafting.CraftingRecipe;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
|
@ -25,7 +25,7 @@ public class GridRecipe {
|
|||
private static final GridRecipe INSTANCE = new GridRecipe();
|
||||
|
||||
private String name;
|
||||
private ItemConvertible output;
|
||||
private ItemLike output;
|
||||
|
||||
private String group;
|
||||
private RecipeType<?> type;
|
||||
|
@ -38,7 +38,7 @@ public class GridRecipe {
|
|||
private GridRecipe() {
|
||||
}
|
||||
|
||||
public static GridRecipe make(String name, ItemConvertible output) {
|
||||
public static GridRecipe make(String name, ItemLike output) {
|
||||
INSTANCE.name = name;
|
||||
INSTANCE.output = output;
|
||||
|
||||
|
@ -78,8 +78,8 @@ public class GridRecipe {
|
|||
return addMaterial(key, Ingredient.ofStacks(Arrays.stream(value)));
|
||||
}
|
||||
|
||||
public GridRecipe addMaterial(char key, ItemConvertible... values) {
|
||||
for (ItemConvertible item : values) {
|
||||
public GridRecipe addMaterial(char key, ItemLike... values) {
|
||||
for (ItemLike item : values) {
|
||||
exist &= RecipeHelper.exists(item);
|
||||
}
|
||||
return addMaterial(key, Ingredient.of(values));
|
||||
|
|
|
@ -6,7 +6,7 @@ import com.google.gson.JsonObject;
|
|||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.world.item.ItemConvertible;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
|
@ -146,12 +146,12 @@ public class InfusionRecipe implements Recipe<InfusionRitual>, BetterEndRecipe {
|
|||
return this;
|
||||
}
|
||||
|
||||
public Builder setInput(ItemConvertible input) {
|
||||
public Builder setInput(ItemLike input) {
|
||||
this.input = Ingredient.of(input);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setOutput(ItemConvertible output) {
|
||||
public Builder setOutput(ItemLike output) {
|
||||
this.output = new ItemStack(output);
|
||||
this.output.setCount(1);
|
||||
return this;
|
||||
|
@ -168,7 +168,7 @@ public class InfusionRecipe implements Recipe<InfusionRitual>, BetterEndRecipe {
|
|||
return this;
|
||||
}
|
||||
|
||||
public Builder addCatalyst(int slot, ItemConvertible... items) {
|
||||
public Builder addCatalyst(int slot, ItemLike... items) {
|
||||
if (slot > 7)
|
||||
return this;
|
||||
this.catalysts[slot] = Ingredient.of(items);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package ru.betterend.recipe.builders;
|
||||
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemConvertible;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
import net.minecraft.world.item.crafting.RecipeType;
|
||||
|
@ -41,17 +41,17 @@ public class SmithingTableRecipe {
|
|||
private SmithingTableRecipe() {
|
||||
}
|
||||
|
||||
public SmithingTableRecipe setResult(ItemConvertible item) {
|
||||
public SmithingTableRecipe setResult(ItemLike item) {
|
||||
return this.setResult(item, 1);
|
||||
}
|
||||
|
||||
public SmithingTableRecipe setResult(ItemConvertible item, int count) {
|
||||
public SmithingTableRecipe setResult(ItemLike item, int count) {
|
||||
this.alright &= RecipeHelper.exists(item);
|
||||
this.result = new ItemStack(item, count);
|
||||
return this;
|
||||
}
|
||||
|
||||
public SmithingTableRecipe setBase(ItemConvertible... items) {
|
||||
public SmithingTableRecipe setBase(ItemLike... items) {
|
||||
this.alright &= RecipeHelper.exists(items);
|
||||
this.base = Ingredient.of(items);
|
||||
return this;
|
||||
|
@ -62,7 +62,7 @@ public class SmithingTableRecipe {
|
|||
return this;
|
||||
}
|
||||
|
||||
public SmithingTableRecipe setAddition(ItemConvertible... items) {
|
||||
public SmithingTableRecipe setAddition(ItemLike... items) {
|
||||
this.alright &= RecipeHelper.exists(items);
|
||||
this.addition = Ingredient.of(items);
|
||||
return this;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue