Merge remote-tracking branch 'remotes/origin/1.14' into 1.15

# Conflicts:
#	build.gradle
#	src/main/java/techreborn/blocks/misc/BlockRubberLog.java
This commit is contained in:
modmuss50 2019-11-14 19:03:36 +00:00
commit d5e89c5e20
139 changed files with 1534 additions and 501 deletions

View file

@ -26,10 +26,13 @@ package techreborn.api.recipe.recipes;
import com.google.gson.JsonObject;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DefaultedList;
import net.minecraft.util.Identifier;
import net.minecraft.util.JsonHelper;
import reborncore.common.crafting.RebornRecipe;
import reborncore.common.crafting.RebornRecipeType;
import reborncore.common.crafting.ingredient.RebornIngredient;
import techreborn.blockentity.machine.multiblock.IndustrialBlastFurnaceBlockEntity;
public class BlastFurnaceRecipe extends RebornRecipe {
@ -39,6 +42,11 @@ public class BlastFurnaceRecipe extends RebornRecipe {
public BlastFurnaceRecipe(RebornRecipeType<?> type, Identifier name) {
super(type, name);
}
public BlastFurnaceRecipe(RebornRecipeType<?> type, Identifier name, DefaultedList<RebornIngredient> ingredients, DefaultedList<ItemStack> outputs, int power, int time, int heat) {
super(type, name, ingredients, outputs, power, time);
this.heat = heat;
}
public int getHeat() {
return heat;

View file

@ -27,10 +27,14 @@ package techreborn.api.recipe.recipes;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.fluid.Fluid;
import net.minecraft.fluid.Fluids;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DefaultedList;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
import reborncore.common.crafting.RebornFluidRecipe;
import reborncore.common.crafting.RebornRecipeType;
import reborncore.common.crafting.ingredient.RebornIngredient;
import reborncore.common.fluid.container.FluidInstance;
import reborncore.common.util.Tank;
import techreborn.blockentity.machine.multiblock.FluidReplicatorBlockEntity;
import techreborn.utils.FluidUtils;
@ -41,6 +45,14 @@ public class FluidReplicatorRecipe extends RebornFluidRecipe {
super(type, name);
}
public FluidReplicatorRecipe(RebornRecipeType<?> type, Identifier name, DefaultedList<RebornIngredient> ingredients, DefaultedList<ItemStack> outputs, int power, int time) {
super(type, name, ingredients, outputs, power, time);
}
public FluidReplicatorRecipe(RebornRecipeType<?> type, Identifier name, DefaultedList<RebornIngredient> ingredients, DefaultedList<ItemStack> outputs, int power, int time, FluidInstance fluid) {
super(type, name, ingredients, outputs, power, time, fluid);
}
@Override
public Tank getTank(BlockEntity be) {
FluidReplicatorBlockEntity blockEntity = (FluidReplicatorBlockEntity) be;

View file

@ -27,10 +27,13 @@ package techreborn.api.recipe.recipes;
import com.google.gson.JsonObject;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DefaultedList;
import net.minecraft.util.Identifier;
import net.minecraft.util.JsonHelper;
import reborncore.common.crafting.RebornRecipe;
import reborncore.common.crafting.RebornRecipeType;
import reborncore.common.crafting.ingredient.RebornIngredient;
import techreborn.blockentity.fusionReactor.FusionControlComputerBlockEntity;
/**
@ -45,6 +48,12 @@ public class FusionReactorRecipe extends RebornRecipe {
public FusionReactorRecipe(RebornRecipeType<?> type, Identifier name) {
super(type, name);
}
public FusionReactorRecipe(RebornRecipeType<?> type, Identifier name, DefaultedList<RebornIngredient> ingredients, DefaultedList<ItemStack> outputs, int power, int time, int startE, int minSize) {
super(type, name, ingredients, outputs, power, time);
this.startE = startE;
this.minSize = minSize;
}
public int getStartEnergy () {
return startE;

View file

@ -25,9 +25,13 @@
package techreborn.api.recipe.recipes;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DefaultedList;
import net.minecraft.util.Identifier;
import reborncore.common.crafting.RebornFluidRecipe;
import reborncore.common.crafting.RebornRecipeType;
import reborncore.common.crafting.ingredient.RebornIngredient;
import reborncore.common.fluid.container.FluidInstance;
import reborncore.common.util.Tank;
import techreborn.blockentity.machine.multiblock.IndustrialGrinderBlockEntity;
@ -37,6 +41,14 @@ public class IndustrialGrinderRecipe extends RebornFluidRecipe {
super(type, name);
}
public IndustrialGrinderRecipe(RebornRecipeType<?> type, Identifier name, DefaultedList<RebornIngredient> ingredients, DefaultedList<ItemStack> outputs, int power, int time) {
super(type, name, ingredients, outputs, power, time);
}
public IndustrialGrinderRecipe(RebornRecipeType<?> type, Identifier name, DefaultedList<RebornIngredient> ingredients, DefaultedList<ItemStack> outputs, int power, int time, FluidInstance fluid) {
super(type, name, ingredients, outputs, power, time, fluid);
}
@Override
public Tank getTank(BlockEntity be) {
IndustrialGrinderBlockEntity blockEntity = (IndustrialGrinderBlockEntity) be;

View file

@ -25,9 +25,13 @@
package techreborn.api.recipe.recipes;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DefaultedList;
import net.minecraft.util.Identifier;
import reborncore.common.crafting.RebornFluidRecipe;
import reborncore.common.crafting.RebornRecipeType;
import reborncore.common.crafting.ingredient.RebornIngredient;
import reborncore.common.fluid.container.FluidInstance;
import reborncore.common.util.Tank;
import techreborn.blockentity.machine.multiblock.IndustrialSawmillBlockEntity;
@ -37,6 +41,14 @@ public class IndustrialSawmillRecipe extends RebornFluidRecipe {
super(type, name);
}
public IndustrialSawmillRecipe(RebornRecipeType<?> type, Identifier name, DefaultedList<RebornIngredient> ingredients, DefaultedList<ItemStack> outputs, int power, int time) {
super(type, name, ingredients, outputs, power, time);
}
public IndustrialSawmillRecipe(RebornRecipeType<?> type, Identifier name, DefaultedList<RebornIngredient> ingredients, DefaultedList<ItemStack> outputs, int power, int time, FluidInstance fluid) {
super(type, name, ingredients, outputs, power, time, fluid);
}
@Override
public Tank getTank(BlockEntity be) {
IndustrialSawmillBlockEntity blockEntity = (IndustrialSawmillBlockEntity) be;

View file

@ -24,21 +24,17 @@
package techreborn.api.recipe.recipes;
import com.google.common.collect.Iterables;
import com.google.gson.JsonObject;
import net.minecraft.inventory.CraftingInventory;
import net.minecraft.inventory.Inventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.recipe.Ingredient;
import net.minecraft.recipe.RecipeSerializer;
import net.minecraft.recipe.ShapedRecipe;
import net.minecraft.tag.ItemTags;
import net.minecraft.tag.Tag;
import net.minecraft.util.DefaultedList;
import net.minecraft.util.Identifier;
import net.minecraft.util.JsonHelper;
import net.minecraft.util.registry.Registry;
import net.minecraft.util.PacketByteBuf;
import net.minecraft.world.World;
import reborncore.common.crafting.RebornRecipe;
import reborncore.common.crafting.RebornRecipeType;
@ -50,43 +46,39 @@ import java.util.List;
public class RollingMachineRecipe extends RebornRecipe {
private ShapedRecipe shapedRecipe;
private JsonObject shaped;
public RollingMachineRecipe(RebornRecipeType<?> type, Identifier name) {
super(type, name);
}
public RollingMachineRecipe(RebornRecipeType<?> type, Identifier name, ShapedRecipe recipe) {
super(type, name);
this.shapedRecipe = recipe;
}
@Override
public void deserialize(JsonObject jsonObject) {
JsonObject json = JsonHelper.getObject(jsonObject, "shaped");
shapedRecipe = RecipeSerializer.SHAPED.read(getId(), json);
shaped = withoutTags(json);
if(jsonObject.has("shaped")) {
JsonObject json = JsonHelper.getObject(jsonObject, "shaped");
shapedRecipe = RecipeSerializer.SHAPED.read(getId(), json);
} else {
//This will be handled by the PacketByteBuf deserialize
}
}
@Override
public void serialize(JsonObject jsonObject) {
jsonObject.add("shaped", shaped);
public void serialize(PacketByteBuf byteBuf) {
String s = shapedRecipe.getId().toString();
byteBuf.writeInt(s.length());
byteBuf.writeString(s);
RecipeSerializer.SHAPED.write(byteBuf, shapedRecipe);
}
//This needs to be done to remove the item tags, and replace them with just items for when syncing to the server
private JsonObject withoutTags(JsonObject jsonObject) {
JsonObject key = jsonObject.get("key").getAsJsonObject();
key.entrySet().forEach(entry -> {
if(entry.getValue().isJsonObject()){
JsonObject value = entry.getValue().getAsJsonObject();
if(value.has("tag")){
Identifier tag = new Identifier(value.get("tag").getAsString());
Tag<Item> itemTag = ItemTags.getContainer().get(tag);
Item item = Iterables.get(itemTag.values(), 0);
//Remove the tag, and replace it with a basic s
value.remove("tag");
value.addProperty("item", Registry.ITEM.getId(item).toString());
}
}
});
return jsonObject;
@Override
public void deserialize(PacketByteBuf byteBuf) {
Identifier identifier = new Identifier(byteBuf.readString(byteBuf.readInt()));
shapedRecipe = RecipeSerializer.SHAPED.read(identifier, byteBuf);
}
@Override