1147 - Initial auto mappings pass

This commit is contained in:
modmuss50 2019-05-26 12:37:59 +01:00
parent 48198dbcb3
commit 4e03ac893c
291 changed files with 3335 additions and 3504 deletions

View file

@ -25,14 +25,13 @@
package techreborn.api;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemUseContext;
import net.minecraft.item.ItemUsageContext;
import java.util.List;
public interface IC2Helper {
public void initDuplicates();
public boolean extractSap(ItemUseContext context, List<ItemStack> stacks);
public boolean extractSap(ItemUsageContext context, List<ItemStack> stacks);
}

View file

@ -24,10 +24,10 @@
package techreborn.api;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.inventory.CraftingInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.ResourceLocation;
import net.minecraft.recipe.Recipe;
import net.minecraft.util.Identifier;
import net.minecraft.world.World;
@ -35,19 +35,19 @@ public class RollingMachineRecipe {
public static final RollingMachineRecipe instance = new RollingMachineRecipe();
public void addShapedOreRecipe(ResourceLocation resourceLocation, ItemStack outputItemStack, Object... objectInputs) {
public void addShapedOreRecipe(Identifier resourceLocation, ItemStack outputItemStack, Object... objectInputs) {
throw new UnsupportedOperationException("Needs moving to json");
}
public void addShapelessOreRecipe(ResourceLocation resourceLocation, ItemStack outputItemStack, Object... objectInputs) {
public void addShapelessOreRecipe(Identifier resourceLocation, ItemStack outputItemStack, Object... objectInputs) {
throw new UnsupportedOperationException("Needs moving to json");
}
public ItemStack findMatchingRecipeOutput(InventoryCrafting inv, World world) {
public ItemStack findMatchingRecipeOutput(CraftingInventory inv, World world) {
throw new UnsupportedOperationException("Needs moving to json");
}
public IRecipe findMatchingRecipe(InventoryCrafting inv, World world) {
public Recipe findMatchingRecipe(CraftingInventory inv, World world) {
throw new UnsupportedOperationException("Needs moving to json");
}

View file

@ -25,7 +25,7 @@
package techreborn.api.fluidreplicator;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fluids.Fluid;
import reborncore.common.util.FluidUtils;
import techreborn.init.TRContent;
import techreborn.tiles.machine.multiblock.TileFluidReplicator;

View file

@ -24,10 +24,10 @@
package techreborn.api.fluidreplicator;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.util.Inventory;
import reborncore.common.util.Tank;
@ -52,7 +52,7 @@ public class FluidReplicatorRecipeCrafter extends RecipeCrafter {
* @param inputSlots This is the list of the slots that the crafting logic should look for the input UU-Matter.
* @param outputSlots This is the list of slots that the crafting logic should look for output fluid
*/
public FluidReplicatorRecipeCrafter(TileEntity parentTile, Inventory<?> inventory, int[] inputSlots, int[] outputSlots) {
public FluidReplicatorRecipeCrafter(BlockEntity parentTile, Inventory<?> inventory, int[] inputSlots, int[] outputSlots) {
super(ModRecipes.FLUID_REPLICATOR, parentTile, 1, 1, inventory, inputSlots, outputSlots);
}
@ -63,11 +63,11 @@ public class FluidReplicatorRecipeCrafter extends RecipeCrafter {
if (recipe == null) {
return false;
}
ItemStack inputStack = inventory.getStackInSlot(inputSlots[0]);
if (!inputStack.isItemEqual(TRContent.Parts.UU_MATTER.getStack())) {
ItemStack inputStack = inventory.getInvStack(inputSlots[0]);
if (!inputStack.isEqualIgnoreTags(TRContent.Parts.UU_MATTER.getStack())) {
return false;
}
if (inputStack.getCount() < recipe.getInput()) {
if (inputStack.getAmount() < recipe.getInput()) {
return false;
}
@ -92,7 +92,7 @@ public class FluidReplicatorRecipeCrafter extends RecipeCrafter {
// RecipeCrafter
@Override
public void updateEntity() {
if (tile.getWorld().isRemote) {
if (tile.getWorld().isClient) {
return;
}
ticksSinceLastChange++;

View file

@ -24,7 +24,7 @@
package techreborn.api.fluidreplicator;
import net.minecraftforge.fluids.Fluid;
import org.apache.commons.lang3.Validate;
import reborncore.common.util.FluidUtils;

View file

@ -24,7 +24,7 @@
package techreborn.api.generator;
import net.minecraftforge.fluids.Fluid;
import reborncore.common.util.FluidUtils;
public class FluidGeneratorRecipe {

View file

@ -25,7 +25,7 @@
package techreborn.api.generator;
import com.google.common.collect.Sets;
import net.minecraftforge.fluids.Fluid;
import reborncore.common.util.FluidUtils;
import java.util.HashSet;

View file

@ -24,7 +24,7 @@
package techreborn.api.generator;
import net.minecraftforge.fluids.Fluid;
import java.util.EnumMap;
import java.util.Optional;

View file

@ -24,13 +24,13 @@
package techreborn.api.recipe;
import net.minecraft.tileentity.TileEntity;
import reborncore.common.crafting.Recipe;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.util.Inventory;
import techreborn.init.ModRecipes;
import java.util.List;
import net.minecraft.block.entity.BlockEntity;
/**
* @author drcrazy
@ -44,14 +44,14 @@ public class ScrapboxRecipeCrafter extends RecipeCrafter {
* @param inputSlots Slot IDs for input
* @param outputSlots Slot IDs for output
*/
public ScrapboxRecipeCrafter(TileEntity parentTile, Inventory<?> inventory, int[] inputSlots, int[] outputSlots) {
public ScrapboxRecipeCrafter(BlockEntity parentTile, Inventory<?> inventory, int[] inputSlots, int[] outputSlots) {
super(ModRecipes.SCRAPBOX, parentTile, 1, 1, inventory, inputSlots, outputSlots);
}
@Override
public void updateCurrentRecipe(){
List<Recipe> scrapboxRecipeList = ModRecipes.SCRAPBOX.getRecipes(tile.getWorld());
int random = tile.getWorld().rand.nextInt(scrapboxRecipeList.size());
int random = tile.getWorld().random.nextInt(scrapboxRecipeList.size());
// Sets the current recipe then syncs
setCurrentRecipe(scrapboxRecipeList.get(random));
this.currentNeededTicks = Math.max((int) (currentRecipe.getTime() * (1.0 - getSpeedMultiplier())), 1);

View file

@ -25,9 +25,9 @@
package techreborn.api.recipe.recipes;
import com.google.gson.JsonObject;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.JsonUtils;
import net.minecraft.util.ResourceLocation;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.util.Identifier;
import net.minecraft.util.JsonHelper;
import reborncore.common.crafting.Recipe;
import reborncore.common.crafting.RecipeType;
import techreborn.tiles.machine.multiblock.TileIndustrialBlastFurnace;
@ -36,14 +36,14 @@ public class BlastFurnaceRecipe extends Recipe {
int heat;
public BlastFurnaceRecipe(RecipeType<?> type, ResourceLocation name) {
public BlastFurnaceRecipe(RecipeType<?> type, Identifier name) {
super(type, name);
}
@Override
public void deserialize(JsonObject jsonObject) {
super.deserialize(jsonObject);
heat = JsonUtils.getInt(jsonObject, "heat");
heat = JsonHelper.getInt(jsonObject, "heat");
}
@Override
@ -53,7 +53,7 @@ public class BlastFurnaceRecipe extends Recipe {
}
@Override
public boolean canCraft(final TileEntity tile) {
public boolean canCraft(final BlockEntity tile) {
if (tile instanceof TileIndustrialBlastFurnace) {
final TileIndustrialBlastFurnace blastFurnace = (TileIndustrialBlastFurnace) tile;
return blastFurnace.getHeat() >= heat;
@ -62,7 +62,7 @@ public class BlastFurnaceRecipe extends Recipe {
}
@Override
public boolean onCraft(final TileEntity tile) {
public boolean onCraft(final BlockEntity tile) {
return true;
}
}

View file

@ -24,9 +24,9 @@
package techreborn.api.recipe.recipes;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.FluidStack;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.util.Identifier;
import reborncore.common.crafting.Recipe;
import reborncore.common.crafting.RecipeType;
import techreborn.tiles.machine.multiblock.TileIndustrialGrinder;
@ -36,12 +36,12 @@ public class IndustrialGrinderRecipe extends Recipe {
//TODO 1.14 fluids
FluidStack fluidStack = null;
public IndustrialGrinderRecipe(RecipeType<?> type, ResourceLocation name) {
public IndustrialGrinderRecipe(RecipeType<?> type, Identifier name) {
super(type, name);
}
@Override
public boolean canCraft(final TileEntity tileEntity) {
public boolean canCraft(final BlockEntity tileEntity) {
TileIndustrialGrinder tile = (TileIndustrialGrinder) tileEntity;
if (!tile.getMultiBlock()) {
return false;
@ -63,7 +63,7 @@ public class IndustrialGrinderRecipe extends Recipe {
}
@Override
public boolean onCraft(final TileEntity tileEntity) {
public boolean onCraft(final BlockEntity tileEntity) {
TileIndustrialGrinder tile = (TileIndustrialGrinder) tileEntity;
final FluidStack recipeFluid = fluidStack;
final FluidStack tankFluid = tile.tank.getFluid();

View file

@ -24,9 +24,9 @@
package techreborn.api.recipe.recipes;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.FluidStack;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.util.Identifier;
import reborncore.common.crafting.Recipe;
import reborncore.common.crafting.RecipeType;
import techreborn.tiles.machine.multiblock.TileIndustrialSawmill;
@ -36,12 +36,12 @@ public class IndustrialSawmillRecipe extends Recipe {
//TODO 1.14 fluids
FluidStack fluidStack = null;
public IndustrialSawmillRecipe(RecipeType<?> type, ResourceLocation name) {
public IndustrialSawmillRecipe(RecipeType<?> type, Identifier name) {
super(type, name);
}
@Override
public boolean canCraft(TileEntity tileEntity) {
public boolean canCraft(BlockEntity tileEntity) {
TileIndustrialSawmill tile = (TileIndustrialSawmill) tileEntity;
if (!tile.getMutliBlock()) {
return false;
@ -63,7 +63,7 @@ public class IndustrialSawmillRecipe extends Recipe {
}
@Override
public boolean onCraft(TileEntity tileEntity) {
public boolean onCraft(BlockEntity tileEntity) {
TileIndustrialSawmill tile = (TileIndustrialSawmill) tileEntity;
final FluidStack recipeFluid = fluidStack;
final FluidStack tankFluid = tile.tank.getFluid();