Auto format code

This commit is contained in:
modmuss50 2017-06-12 14:23:32 +01:00
parent fc4d8686b8
commit b25742dde0
No known key found for this signature in database
GPG key ID: 203A5ED4D3E48BEA
175 changed files with 527 additions and 737 deletions

View file

@ -219,7 +219,7 @@ public class Core {
}
@SubscribeEvent
public void LoadPackets(RegisterPacketEvent event){
public void LoadPackets(RegisterPacketEvent event) {
event.registerPacket(PacketSyncSideConfig.class, Side.SERVER);
event.registerPacket(PacketAesu.class, Side.SERVER);
event.registerPacket(PacketIdsu.class, Side.SERVER);

View file

@ -35,14 +35,9 @@ import net.minecraft.item.crafting.ShapelessRecipes;
import net.minecraft.util.NonNullList;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import org.apache.commons.lang3.Validate;
import reborncore.common.util.CraftingHelper;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public class RollingMachineRecipe {
@ -50,21 +45,21 @@ public class RollingMachineRecipe {
private final HashMap<ResourceLocation, IRecipe> recipes = new HashMap<>();
public void addShapedOreRecipe(ResourceLocation resourceLocation, ItemStack outputItemStack, Object... objectInputs) {
// Validate.notNull(outputItemStack);
// Validate.notNull(outputItemStack.getItem());
// if (objectInputs.length == 0) {
// Validate.notNull(null); //Quick way to crash
// }
// recipes.put(resourceLocation, new ShapedOreRecipe(resourceLocation, outputItemStack, objectInputs));
// Validate.notNull(outputItemStack);
// Validate.notNull(outputItemStack.getItem());
// if (objectInputs.length == 0) {
// Validate.notNull(null); //Quick way to crash
// }
// recipes.put(resourceLocation, new ShapedOreRecipe(resourceLocation, outputItemStack, objectInputs));
}
public void addShapelessOreRecipe(ResourceLocation resourceLocation, ItemStack outputItemStack, Object... objectInputs) {
// Validate.notNull(outputItemStack);
// Validate.notNull(outputItemStack.getItem());
// if (objectInputs.length == 0) {
// Validate.notNull(null); //Quick way to crash
// }
// recipes.put(resourceLocation, new ShapelessOreRecipe(resourceLocation, outputItemStack, objectInputs));
// Validate.notNull(outputItemStack);
// Validate.notNull(outputItemStack.getItem());
// if (objectInputs.length == 0) {
// Validate.notNull(null); //Quick way to crash
// }
// recipes.put(resourceLocation, new ShapelessOreRecipe(resourceLocation, outputItemStack, objectInputs));
}
public void addRecipe(ResourceLocation resourceLocation, ItemStack output, Object... components) {
@ -115,7 +110,7 @@ public class RollingMachineRecipe {
recipes.put(resourceLocation, new ShapedRecipes("", j, k, recipeArray, output));
}
public void addShapelessRecipe(ResourceLocation resourceLocation,ItemStack output, Object... components) {
public void addShapelessRecipe(ResourceLocation resourceLocation, ItemStack output, Object... components) {
NonNullList<Ingredient> ingredients = NonNullList.create();
for (int j = 0; j < components.length; j++) {
ingredients.add(CraftingHelper.toIngredient(components[j]));

View file

@ -44,15 +44,15 @@ public final class TechRebornAPI {
}
public static void addShapelessOreRollingMachinceRecipe(ResourceLocation resourceLocation, ItemStack output, Object... components) {
RollingMachineRecipe.instance.addShapelessOreRecipe(resourceLocation,output, components);
RollingMachineRecipe.instance.addShapelessOreRecipe(resourceLocation, output, components);
}
public static void addRollingMachinceRecipe(ResourceLocation resourceLocation, ItemStack output, Object... components) {
RollingMachineRecipe.instance.addRecipe(resourceLocation,output, components);
RollingMachineRecipe.instance.addRecipe(resourceLocation, output, components);
}
public static void addShapelessRollingMachinceRecipe(ResourceLocation resourceLocation, ItemStack output, Object... components) {
RollingMachineRecipe.instance.addShapelessRecipe(resourceLocation,output, components);
RollingMachineRecipe.instance.addShapelessRecipe(resourceLocation, output, components);
}
/**

View file

@ -33,7 +33,9 @@ public enum EFluidGenerator {
@Nonnull
private final String recipeID;
private EFluidGenerator(@Nonnull String recipeID) {
private EFluidGenerator(
@Nonnull
String recipeID) {
this.recipeID = recipeID;
}

View file

@ -31,8 +31,7 @@ public class FluidGeneratorRecipe {
private final Fluid fluid;
private final int energyPerMb;
public FluidGeneratorRecipe(Fluid fluid, int energyPerMb, EFluidGenerator generatorType)
{
public FluidGeneratorRecipe(Fluid fluid, int energyPerMb, EFluidGenerator generatorType) {
this.fluid = fluid;
this.energyPerMb = energyPerMb;
this.generatorType = generatorType;
@ -41,6 +40,7 @@ public class FluidGeneratorRecipe {
public Fluid getFluid() {
return fluid;
}
public int getEnergyPerMb() {
return energyPerMb;
}

View file

@ -25,33 +25,29 @@
package techreborn.api.generator;
import com.google.common.collect.Sets;
import net.minecraftforge.fluids.Fluid;
import java.util.HashSet;
import java.util.Optional;
import net.minecraftforge.fluids.Fluid;
public class FluidGeneratorRecipeList {
private HashSet<FluidGeneratorRecipe> recipes;
public FluidGeneratorRecipeList(FluidGeneratorRecipe... recipes)
{
public FluidGeneratorRecipeList(FluidGeneratorRecipe... recipes) {
this.recipes = Sets.newHashSet(recipes);
}
public boolean addRecipe(FluidGeneratorRecipe fluidGeneratorRecipe) {
if(!this.getRecipeForFluid(fluidGeneratorRecipe.getFluid()).isPresent())
if (!this.getRecipeForFluid(fluidGeneratorRecipe.getFluid()).isPresent())
return this.getRecipes().add(fluidGeneratorRecipe);
return false;
}
public boolean removeRecipe(FluidGeneratorRecipe fluidGeneratorRecipe)
{
public boolean removeRecipe(FluidGeneratorRecipe fluidGeneratorRecipe) {
return this.getRecipes().remove(fluidGeneratorRecipe);
}
public Optional<FluidGeneratorRecipe> getRecipeForFluid(Fluid fluid)
{
public Optional<FluidGeneratorRecipe> getRecipeForFluid(Fluid fluid) {
return this.recipes.stream().filter(recipe -> recipe.getFluid().equals(fluid)).findAny();
}

View file

@ -24,10 +24,10 @@
package techreborn.api.generator;
import java.util.EnumMap;
import net.minecraftforge.fluids.Fluid;
import java.util.EnumMap;
public class GeneratorRecipeHelper {
/**
@ -41,12 +41,10 @@ public class GeneratorRecipeHelper {
/**
* Register a Fluid energy recipe.
*
* @param generatorType
* A value of the EFluidGenerator type in which the fluid is
* @param generatorType A value of the EFluidGenerator type in which the fluid is
* allowed to be consumed.
* @param fluidType
* @param energyPerMb
* Represent the energy / MILLI_BUCKET the fluid will produce.
* @param energyPerMb Represent the energy / MILLI_BUCKET the fluid will produce.
* Some generators use this value to alter their fluid decay
* speed to match their maximum energy output.
*/
@ -56,9 +54,7 @@ public class GeneratorRecipeHelper {
}
/**
*
* @param generatorType
* A value of the EFluidGenerator type in which the fluid is
* @param generatorType A value of the EFluidGenerator type in which the fluid is
* allowed to be consumed.
* @return An object holding a set of availables recipes for this type of
* FluidGenerator.

View file

@ -130,12 +130,12 @@ public abstract class BaseRecipe implements IBaseRecipeType, Cloneable {
if (inuput == null) {
throw new InvalidParameterException("input is invalid!");
}
if(inuput instanceof ItemStack){
if(((ItemStack) inuput).isEmpty()){
if (inuput instanceof ItemStack) {
if (((ItemStack) inuput).isEmpty()) {
throw new InvalidParameterException("input is invalid!");
}
}
if(RecipeTranslator.getStackFromObject(inuput) == null){
if (RecipeTranslator.getStackFromObject(inuput) == null) {
throw new InvalidParameterException("Could not determin recipe input for " + inuput);
}
inputs.add(inuput);

View file

@ -27,10 +27,8 @@ package techreborn.blocks;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;

View file

@ -34,10 +34,8 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fluids.BlockFluidBase;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;

View file

@ -25,7 +25,6 @@
package techreborn.blocks;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockStateContainer;

View file

@ -30,10 +30,8 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;

View file

@ -30,7 +30,6 @@ import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraftforge.fml.relauncher.Side;

View file

@ -31,7 +31,6 @@ import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;

View file

@ -37,10 +37,8 @@ import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fluids.BlockFluidBase;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;

View file

@ -28,10 +28,8 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;

View file

@ -28,7 +28,6 @@ import net.minecraft.block.BlockSapling;
import net.minecraft.block.SoundType;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;

View file

@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;

View file

@ -27,10 +27,8 @@ package techreborn.blocks.advanced_machine;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;

View file

@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;

View file

@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;

View file

@ -29,10 +29,8 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;

View file

@ -29,10 +29,8 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;

View file

@ -68,7 +68,6 @@ public class BlockCable extends BlockContainer {
public static final PropertyBool DOWN = PropertyBool.create("down");
public static final IProperty<EnumCableType> TYPE = PropertyEnum.create("type", EnumCableType.class);
public BlockCable() {
super(Material.ROCK);
setCreativeTab(TechRebornCreativeTab.instance);
@ -122,7 +121,7 @@ public class BlockCable extends BlockContainer {
@Override
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) {
for(EnumCableType cableType : EnumCableType.values()){
for (EnumCableType cableType : EnumCableType.values()) {
list.add(new ItemStack(this, 1, cableType.ordinal()));
}
}
@ -158,7 +157,7 @@ public class BlockCable extends BlockContainer {
IBlockState actualState = state;
for (EnumFacing facing : EnumFacing.values()) {
TileEntity tileEntity = getTileEntitySafely(worldIn, pos.offset(facing));
if(tileEntity != null){
if (tileEntity != null) {
actualState = actualState.withProperty(getProperty(facing), tileEntity.hasCapability(CapabilityEnergy.ENERGY, facing.getOpposite()));
}
}

View file

@ -61,7 +61,7 @@ public enum EnumCableType implements IStringSerializable {
return friendlyName.toLowerCase();
}
public ItemStack getStack(){
return new ItemStack(ModBlocks.CABLE,1, this.ordinal());
public ItemStack getStack() {
return new ItemStack(ModBlocks.CABLE, 1, this.ordinal());
}
}

View file

@ -29,10 +29,8 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;

View file

@ -26,7 +26,6 @@ package techreborn.blocks.generator;
import net.minecraft.block.material.Material;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.text.TextFormatting;

View file

@ -29,10 +29,8 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;

View file

@ -27,10 +27,8 @@ package techreborn.blocks.generator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;

View file

@ -26,7 +26,6 @@ package techreborn.blocks.generator;
import net.minecraft.block.material.Material;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.text.TextFormatting;

View file

@ -29,10 +29,8 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;

View file

@ -28,10 +28,8 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;

View file

@ -32,10 +32,8 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;

View file

@ -35,10 +35,8 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;

View file

@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;

View file

@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;

View file

@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;

View file

@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;

View file

@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;

View file

@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;

View file

@ -31,10 +31,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;

View file

@ -32,10 +32,8 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;
@ -57,7 +55,15 @@ public class BlockVacuumFreezer extends BlockMachineBase implements IAdvancedRot
}
@Override
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, final EntityPlayer player, final EnumHand hand, final EnumFacing side, final float hitX, final float hitY, final float hitZ) {
public boolean onBlockActivated(final World world,
final BlockPos pos,
final IBlockState state,
final EntityPlayer player,
final EnumHand hand,
final EnumFacing side,
final float hitX,
final float hitY,
final float hitZ) {
if (!player.isSneaking()) {
player.openGui(Core.INSTANCE, EGui.VACUUM_FREEZER.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
return true;

View file

@ -30,7 +30,6 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import techreborn.client.EGui;
import techreborn.init.ModBlocks;
import techreborn.tiles.TileAesu;

View file

@ -30,7 +30,6 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import techreborn.client.EGui;
import techreborn.tiles.storage.TileBatBox;

View file

@ -32,7 +32,6 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import techreborn.client.EGui;
import techreborn.tiles.idsu.TileIDSU;

View file

@ -30,7 +30,6 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import techreborn.client.EGui;
import techreborn.tiles.lesu.TileLesu;

View file

@ -40,7 +40,8 @@ import techreborn.tiles.lesu.TileLesuStorage;
import java.util.ArrayList;
import java.util.List;
public class BlockLESUStorage extends BaseTileBlock {;
public class BlockLESUStorage extends BaseTileBlock {
;
public BlockLESUStorage(Material material) {
super(material);

View file

@ -30,7 +30,6 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import techreborn.client.EGui;
import techreborn.init.ModBlocks;
import techreborn.tiles.storage.TileMFE;

View file

@ -30,7 +30,6 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import techreborn.client.EGui;
import techreborn.init.ModBlocks;
import techreborn.tiles.storage.TileMFSU;

View file

@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;

View file

@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;

View file

@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;

View file

@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;

View file

@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;

View file

@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;

View file

@ -68,8 +68,7 @@ public enum EGui {
private final boolean containerBuilder;
private EGui(final boolean containerBuilder)
{
private EGui(final boolean containerBuilder) {
this.containerBuilder = containerBuilder;
}

View file

@ -29,7 +29,6 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.IGuiHandler;
import techreborn.client.container.*;
import techreborn.client.gui.*;
import techreborn.manual.GuiManual;

View file

@ -179,7 +179,7 @@ public class RegisterItemJsons {
}
for (EnumCableType cableType : EnumCableType.values()) {
registerBlockstate(ModBlocks.CABLE, cableType.ordinal(), "inv_" +cableType.getName().toLowerCase());
registerBlockstate(ModBlocks.CABLE, cableType.ordinal(), "inv_" + cableType.getName().toLowerCase());
}
}

View file

@ -30,7 +30,6 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.slots.BaseSlot;
import reborncore.common.container.RebornContainer;
import techreborn.config.ConfigTechReborn;
import techreborn.tiles.lesu.TileLesu;
public class ContainerLESU extends RebornContainer {

View file

@ -25,7 +25,6 @@
package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import techreborn.client.container.builder.BuiltContainer;
public interface IContainerProvider {

View file

@ -24,16 +24,14 @@
package techreborn.client.container.builder;
import org.apache.commons.lang3.Range;
import org.apache.commons.lang3.tuple.MutableTriple;
import org.apache.commons.lang3.tuple.Pair;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.*;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.apache.commons.lang3.Range;
import org.apache.commons.lang3.tuple.MutableTriple;
import org.apache.commons.lang3.tuple.Pair;
import reborncore.common.util.ItemUtils;
import techreborn.client.container.IRightClickHandler;
@ -107,10 +105,10 @@ public class BuiltContainer extends Container {
@Override
public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, EntityPlayer player) {
if(dragType == 1 && slotId > 0 && slotId < 1000){
if (dragType == 1 && slotId > 0 && slotId < 1000) {
Slot slot = this.inventorySlots.get(slotId);
if(slot instanceof IRightClickHandler){
if(((IRightClickHandler) slot).handleRightClick(slot.getSlotIndex(), player, this)){
if (slot instanceof IRightClickHandler) {
if (((IRightClickHandler) slot).handleRightClick(slot.getSlotIndex(), player, this)) {
return ItemStack.EMPTY;
}
}
@ -180,18 +178,14 @@ public class BuiltContainer extends Container {
@Override
public void updateProgressBar(final int id, final int value) {
if(id < this.shortValues.size())
{
if (id < this.shortValues.size()) {
this.shortValues.get(id).getMiddle().accept((short) value);
this.shortValues.get(id).setRight((short) value);
}
else if (id - this.shortValues.size() < this.integerValues.size() * 2)
{
} else if (id - this.shortValues.size() < this.integerValues.size() * 2) {
if ((id - this.shortValues.size()) % 2 == 0)
this.integerParts[(id - this.shortValues.size()) / 2] = value;
else
{
else {
this.integerValues.get((id - this.shortValues.size()) / 2).getMiddle().accept(
(this.integerParts[(id - this.shortValues.size()) / 2] & 0xFFFF) << 16 | value & 0xFFFF);
}

View file

@ -24,14 +24,13 @@
package techreborn.client.container.builder;
import org.apache.commons.lang3.Range;
import org.apache.commons.lang3.tuple.Pair;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.inventory.Slot;
import org.apache.commons.lang3.Range;
import org.apache.commons.lang3.tuple.Pair;
import java.util.ArrayList;
import java.util.List;

View file

@ -24,9 +24,6 @@
package techreborn.client.container.builder;
import org.apache.commons.lang3.Range;
import org.apache.commons.lang3.tuple.Pair;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.inventory.SlotFurnaceFuel;
@ -34,7 +31,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.energy.CapabilityEnergy;
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
import org.apache.commons.lang3.Range;
import org.apache.commons.lang3.tuple.Pair;
import reborncore.api.power.IEnergyInterfaceItem;
import reborncore.api.recipe.IRecipeCrafterProvider;
import reborncore.api.tile.IUpgrade;
@ -43,7 +41,6 @@ import reborncore.client.gui.slots.BaseSlot;
import reborncore.client.gui.slots.SlotFake;
import reborncore.client.gui.slots.SlotOutput;
import reborncore.common.powerSystem.TilePowerAcceptor;
import techreborn.Core;
import techreborn.client.container.builder.slot.FilteredSlot;
import techreborn.client.container.builder.slot.UpgradeSlot;
@ -63,7 +60,7 @@ public class ContainerTileInventoryBuilder {
this.tile = tile;
this.parent = parent;
this.rangeStart = parent.slots.size();
if(tile instanceof IUpgradeable){
if (tile instanceof IUpgradeable) {
upgradeSlots((IUpgradeable) tile);
}
}
@ -104,8 +101,7 @@ public class ContainerTileInventoryBuilder {
return this;
}
public ContainerTileInventoryBuilder fuelSlot(final int index, final int x, final int y)
{
public ContainerTileInventoryBuilder fuelSlot(final int index, final int x, final int y) {
this.parent.slots.add(new SlotFurnaceFuel(this.tile, index, x, y));
return this;
}
@ -117,8 +113,8 @@ public class ContainerTileInventoryBuilder {
return this;
}
private ContainerTileInventoryBuilder upgradeSlots(IUpgradeable upgradeable){
if(upgradeable.canBeUpgraded()){
private ContainerTileInventoryBuilder upgradeSlots(IUpgradeable upgradeable) {
if (upgradeable.canBeUpgraded()) {
for (int i = 0; i < upgradeable.getUpgradeSlotCount(); i++) {
this.parent.slots.add(new UpgradeSlot(upgradeable.getUpgradeInvetory(), i, -19, i * 18 + 12));
}
@ -127,12 +123,9 @@ public class ContainerTileInventoryBuilder {
}
/**
*
* @param supplier
* The supplier must supply a variable holding inside a Short, it
* @param supplier The supplier must supply a variable holding inside a Short, it
* will be truncated by force.
* @param setter
* The setter to call when the variable has been updated.
* @param setter The setter to call when the variable has been updated.
*/
public ContainerTileInventoryBuilder syncShortValue(final IntSupplier supplier, final IntConsumer setter) {
this.parent.shortValues.add(Pair.of(supplier, setter));
@ -140,12 +133,9 @@ public class ContainerTileInventoryBuilder {
}
/**
*
* @param supplier
* The supplier it can supply a variable holding in an Integer it
* @param supplier The supplier it can supply a variable holding in an Integer it
* will be split inside multiples shorts.
* @param setter
* The setter to call when the variable has been updated.
* @param setter The setter to call when the variable has been updated.
*/
public ContainerTileInventoryBuilder syncIntegerValue(final IntSupplier supplier, final IntConsumer setter) {
this.parent.integerValues.add(Pair.of(supplier, setter));

View file

@ -24,14 +24,13 @@
package techreborn.client.container.builder.slot;
import javax.annotation.Nullable;
import net.minecraft.inventory.IInventory;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import techreborn.lib.ModInfo;
import javax.annotation.Nullable;
public class SpriteSlot extends FilteredSlot {
private final String sprite;

View file

@ -31,7 +31,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import reborncore.api.tile.IUpgrade;
import reborncore.api.tile.IUpgradeable;
import reborncore.common.tile.TileBase;
import reborncore.common.util.Inventory;
import techreborn.client.container.IRightClickHandler;
import techreborn.client.container.builder.BuiltContainer;
@ -46,7 +45,6 @@ public class UpgradeSlot extends Slot implements IRightClickHandler {
super(inventory, index, xPosition, yPosition);
}
@Override
public boolean isItemValid(final ItemStack stack) {
return stack.getItem() instanceof IUpgrade;
@ -59,15 +57,15 @@ public class UpgradeSlot extends Slot implements IRightClickHandler {
@Override
public boolean handleRightClick(int slotID, EntityPlayer player, BuiltContainer container) {
if(inventory instanceof Inventory){
if (inventory instanceof Inventory) {
Inventory inv = (Inventory) inventory;
TileEntity tileEntity = inv.getTileBase();
if(tileEntity instanceof IUpgradeable){
if (tileEntity instanceof IUpgradeable) {
IUpgradeable upgradeable = (IUpgradeable) tileEntity;
if(upgradeable.canBeUpgraded()){
if (upgradeable.canBeUpgraded()) {
ItemStack stack = upgradeable.getUpgradeInvetory().getStackInSlot(slotID);
if(!stack.isEmpty() && stack.getItem() instanceof IUpgrade){
if(player.world.isRemote){
if (!stack.isEmpty() && stack.getItem() instanceof IUpgrade) {
if (player.world.isRemote) {
((IUpgrade) stack.getItem()).handleRightClick(tileEntity, stack, container, slotID);
}
}

View file

@ -29,7 +29,6 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.tiles.TileAlloyFurnace;
public class GuiAlloyFurnace extends GuiContainer {

View file

@ -29,7 +29,6 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.tiles.TileAlloySmelter;
public class GuiAlloySmelter extends GuiContainer {

View file

@ -29,7 +29,6 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.tiles.TileAssemblingMachine;
public class GuiAssemblingMachine extends GuiContainer {

View file

@ -112,22 +112,22 @@ public class GuiBase extends GuiContainer {
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int mouseX, int mouseY) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
builder.drawDefaultBackground(this, guiLeft, guiTop, xSize, ySize);
if(drawPlayerSlots()){
if (drawPlayerSlots()) {
builder.drawPlayerSlots(this, guiLeft + xSize / 2, guiTop + 93, true);
}
if(tryAddUpgrades() && tile instanceof IUpgradeable){
if (tryAddUpgrades() && tile instanceof IUpgradeable) {
IUpgradeable upgradeable = (IUpgradeable) tile;
if(upgradeable.canBeUpgraded()){
if (upgradeable.canBeUpgraded()) {
builder.drawUpgrades(this, upgradeable, guiLeft, guiTop);
}
}
}
public boolean drawPlayerSlots(){
public boolean drawPlayerSlots() {
return true;
}
public boolean tryAddUpgrades(){
public boolean tryAddUpgrades() {
return true;
}

View file

@ -30,7 +30,6 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.tiles.TileChunkLoader;
public class GuiChunkLoader extends GuiContainer {

View file

@ -29,9 +29,7 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.tiles.generator.TileDieselGenerator;
public class GuiDieselGenerator extends GuiContainer {

View file

@ -26,7 +26,6 @@ package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import techreborn.tiles.TileDigitalChest;
public class GuiDigitalChest extends GuiBase {

View file

@ -32,12 +32,10 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.translation.I18n;
import reborncore.client.multiblock.MultiblockRenderEvent;
import reborncore.client.multiblock.MultiblockSet;
import reborncore.common.misc.Location;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.client.ClientMultiBlocks;
import techreborn.proxies.ClientProxy;
import techreborn.tiles.fusionReactor.TileEntityFusionController;

View file

@ -29,7 +29,6 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.tiles.generator.TileGasTurbine;
public class GuiGasTurbine extends GuiContainer {

View file

@ -29,7 +29,6 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.tiles.multiblock.TileImplosionCompressor;
public class GuiImplosionCompressor extends GuiContainer {

View file

@ -29,7 +29,6 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.tiles.TileIndustrialElectrolyzer;
public class GuiIndustrialElectrolyzer extends GuiContainer {
@ -39,7 +38,6 @@ public class GuiIndustrialElectrolyzer extends GuiContainer {
TileIndustrialElectrolyzer eletrolyzer;
public GuiIndustrialElectrolyzer(final EntityPlayer player, final TileIndustrialElectrolyzer tileeletrolyzer) {
super(tileeletrolyzer.createContainer(player));
this.xSize = 176;

View file

@ -32,7 +32,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import net.minecraftforge.fluids.FluidStack;
import techreborn.tiles.multiblock.TileIndustrialSawmill;
public class GuiIndustrialSawmill extends GuiContainer {

View file

@ -29,7 +29,6 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.tiles.TileIronFurnace;
public class GuiIronFurnace extends GuiContainer {

View file

@ -26,7 +26,6 @@ package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import techreborn.tiles.TileQuantumChest;
public class GuiQuantumChest extends GuiBase {

View file

@ -29,7 +29,6 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.tiles.TileQuantumTank;
public class GuiQuantumTank extends GuiContainer {

View file

@ -30,7 +30,6 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import techreborn.tiles.TileRollingMachine;
public class GuiRollingMachine extends GuiContainer {

View file

@ -29,7 +29,6 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import techreborn.tiles.TileScrapboxinator;
public class GuiScrapboxinator extends GuiContainer {

View file

@ -29,9 +29,7 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import reborncore.client.RenderUtil;
import techreborn.tiles.generator.TileSemifluidGenerator;
public class GuiSemifluidGenerator extends GuiContainer {

View file

@ -29,9 +29,7 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n;
import reborncore.client.RenderUtil;
import techreborn.tiles.generator.TileThermalGenerator;
public class GuiThermalGenerator extends GuiContainer {

View file

@ -333,7 +333,7 @@ public class TRBuilder extends GuiBuilder {
public void drawUpgrades(GuiScreen gui, IUpgradeable upgradeable, int posX, int posY) {
Minecraft.getMinecraft().getTextureManager().bindTexture(GUI_SHEET);
gui.drawTexturedModalRect(posX -27, posY + 4, 126, 151, 30, 87);
gui.drawTexturedModalRect(posX - 27, posY + 4, 126, 151, 30, 87);
}
public void drawScrapSlot(GuiScreen gui, int posX, int posY) {

View file

@ -27,7 +27,6 @@ package techreborn.client.gui.upgrades;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@ -62,7 +61,7 @@ public class GuiSideConfig extends GuiBase {
super.initGui();
this.buttonList.clear();
int i = 0;
for(EnumFacing facing : EnumFacing.VALUES){
for (EnumFacing facing : EnumFacing.VALUES) {
buttonList.add(new GuiButton(facing.getIndex(), guiLeft + 150, guiTop + i++ * 23 + 22, 20, 20, ""));
}
}
@ -72,7 +71,6 @@ public class GuiSideConfig extends GuiBase {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
}
@Override
@ -82,11 +80,11 @@ public class GuiSideConfig extends GuiBase {
int offset = 10;
RenderHelper.enableStandardItemLighting();
RenderHelper.enableGUIStandardItemLighting();
for(EnumFacing facing : EnumFacing.VALUES){
for (EnumFacing facing : EnumFacing.VALUES) {
BlockPos pos = tileEntity.getPos().offset(facing);
IBlockState state = tileEntity.getWorld().getBlockState(pos);
ItemStack stack = state.getBlock().getPickBlock(state, new RayTraceResult(new Vec3d(0, 0, 0), facing, pos), tileEntity.getWorld(), pos, Minecraft.getMinecraft().player);
if(stack != null && !stack.isEmpty() && stack.getItem() != null){
if (stack != null && !stack.isEmpty() && stack.getItem() != null) {
drawCentredString(stack.getDisplayName() + " - " + facing.getName(), offset += 22, 4210752, layer);
itemRender.renderItemIntoGUI(stack, 10, offset - 2);
} else {

View file

@ -114,7 +114,7 @@ public class TechRebornDevCommand extends CommandBase {
sender.sendMessage(new TextComponentString(e.getLocalizedMessage()));
}
} else if ("ores".equals(args[0])) {
for(String ore: OreDictionary.getOreNames()){
for (String ore : OreDictionary.getOreNames()) {
System.out.println(ore);
}
}

View file

@ -158,7 +158,7 @@ public class CTGeneric {
public void apply() {
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(name)) {
for (Object stack : recipeType.getInputs()) {
if(stack instanceof ItemStack){
if (stack instanceof ItemStack) {
if (output.matches(MineTweakerMC.getIItemStack((ItemStack) stack))) {
removedRecipes.add((BaseRecipe) recipeType);
RecipeHandler.recipeList.remove(recipeType);

View file

@ -35,7 +35,6 @@ import reborncore.common.util.ItemUtils;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.RollingMachineRecipe;
import techreborn.api.TechRebornAPI;
import java.util.ArrayList;
import java.util.List;
@ -44,17 +43,16 @@ import java.util.Map;
@ZenClass("mods.techreborn.rollingMachine")
public class CTRollingMachine {
//TODO 1.12 Crafttweaker
// @ZenMethod
// public static void addShaped(IItemStack output, IIngredient[][] ingredients) {
// TechRebornAPI.addRollingOreMachinceRecipe(toStack(output), toShapedObjects(ingredients));
// }
// @ZenMethod
// public static void addShaped(IItemStack output, IIngredient[][] ingredients) {
// TechRebornAPI.addRollingOreMachinceRecipe(toStack(output), toShapedObjects(ingredients));
// }
// @ZenMethod
// public static void addShapeless(IItemStack output, IIngredient[] ingredients) {
// TechRebornAPI.addShapelessOreRollingMachinceRecipe(toStack(output), toObjects(ingredients));
// }
// @ZenMethod
// public static void addShapeless(IItemStack output, IIngredient[] ingredients) {
// TechRebornAPI.addShapelessOreRollingMachinceRecipe(toStack(output), toObjects(ingredients));
// }
@ZenMethod
public static void removeRecipe(IItemStack output) {
@ -64,7 +62,7 @@ public class CTRollingMachine {
toRemove.add(recipe.getKey());
}
}
for(ResourceLocation resourceLocation : toRemove){
for (ResourceLocation resourceLocation : toRemove) {
RollingMachineRecipe.instance.getRecipeList().remove(resourceLocation);
}
}

View file

@ -47,7 +47,7 @@ public abstract class BaseRecipeWrapper<T extends BaseRecipe> extends BlankRecip
inputs = new ArrayList<>();
outputs = new ArrayList<>();
for (Object input : baseRecipe.getInputs()) {
if(input instanceof ItemStack){
if (input instanceof ItemStack) {
ItemStack stack = (ItemStack) input;
if (baseRecipe.useOreDic()) {
List<ItemStack> oreDictInputs = expandOreDict(stack);
@ -55,7 +55,7 @@ public abstract class BaseRecipeWrapper<T extends BaseRecipe> extends BlankRecip
} else {
inputs.add(Collections.singletonList(stack));
}
} else if (input instanceof String){
} else if (input instanceof String) {
inputs.add(OreDictionary.getOres((String) input));
}
}

View file

@ -24,15 +24,13 @@
package techreborn.compat.jei;
import mezz.jei.api.recipe.transfer.IRecipeTransferInfo;
import net.minecraft.inventory.Slot;
import techreborn.client.container.builder.BuiltContainer;
import java.util.ArrayList;
import java.util.List;
import mezz.jei.api.recipe.transfer.IRecipeTransferInfo;
public class BuiltContainerTransferInfo implements IRecipeTransferInfo<BuiltContainer> {
private final String containerName, recipeCategory;

View file

@ -189,7 +189,7 @@ public class TechRebornJeiPlugin extends BlankModPlugin {
new CompressorRecipeCategory(guiHelper), new ScrapboxRecipeCategory(guiHelper),
new IndustrialSawmillRecipeCategory(guiHelper));
if(!IC2Duplicates.deduplicate()){
if (!IC2Duplicates.deduplicate()) {
registry.addRecipeCategories(new ExtractorRecipeCategory(guiHelper));
registry.addRecipeHandlers(new ExtractorRecipeHandler(jeiHelpers));
}

View file

@ -62,7 +62,7 @@ public class ChemicalReactorRecipeWrapper extends BaseRecipeWrapper<ChemicalReac
progressright.draw(minecraft, 25, 12);
progressleft.draw(minecraft, 75, 12);
int y = 30 ;
int y = 30;
int lineHeight = minecraft.fontRendererObj.FONT_HEIGHT;
minecraft.fontRendererObj.drawString(baseRecipe.tickTime / 20 + " seconds", (recipeWidth / 2 - minecraft.fontRendererObj.getStringWidth(baseRecipe.tickTime / 20 + " seconds") / 2), y, 0x444444);

View file

@ -24,18 +24,20 @@
package techreborn.compat.jei.generators.fluid;
import javax.annotation.Nonnull;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.recipe.IRecipeHandler;
import mezz.jei.api.recipe.IRecipeWrapper;
import techreborn.api.generator.FluidGeneratorRecipe;
import javax.annotation.Nonnull;
public class FluidGeneratorRecipeHandler implements IRecipeHandler<FluidGeneratorRecipe> {
@Nonnull
private final IJeiHelpers jeiHelpers;
public FluidGeneratorRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) {
public FluidGeneratorRecipeHandler(
@Nonnull
IJeiHelpers jeiHelpers) {
this.jeiHelpers = jeiHelpers;
}

View file

@ -24,13 +24,6 @@
package techreborn.compat.jei.generators.fluid;
import javax.annotation.Nonnull;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.NumberFormat;
import java.util.Locale;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.gui.IDrawable;
@ -41,6 +34,12 @@ import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
import techreborn.api.generator.FluidGeneratorRecipe;
import javax.annotation.Nonnull;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.NumberFormat;
import java.util.Locale;
public class FluidGeneratorRecipeWrapper extends BlankRecipeWrapper {
private static final DecimalFormat formatter;
@ -58,7 +57,11 @@ public class FluidGeneratorRecipeWrapper extends BlankRecipeWrapper {
private final FluidGeneratorRecipe baseRecipe;
private final IDrawable energyProduced;
public FluidGeneratorRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull FluidGeneratorRecipe recipe) {
public FluidGeneratorRecipeWrapper(
@Nonnull
IJeiHelpers jeiHelpers,
@Nonnull
FluidGeneratorRecipe recipe) {
this.baseRecipe = recipe;

View file

@ -50,6 +50,7 @@ public class GrinderRecipeCategory extends BlankRecipeCategory<GrinderRecipeWrap
background = guiHelper.createDrawable(texture, 0, 62, 74, 32);
title = I18n.translateToLocal("tile.techreborn.grinder.name");
}
@Override
public String getModName() {
return ModInfo.MOD_NAME;

View file

@ -51,8 +51,7 @@ public class IndustrialSawmillRecipeCategory extends BlankRecipeCategory<Industr
private static final int[] OUTPUT_SLOTS = { 2, 3, 4 };
private static final int[] INPUT_TANKS = { 0 };
public IndustrialSawmillRecipeCategory(IGuiHelper guiHelper){
public IndustrialSawmillRecipeCategory(IGuiHelper guiHelper) {
title = Translator.translateToLocal("tile.techreborn.industrialsawmill.name");
background = guiHelper.createDrawable(texture, 7, 15, 141, 55);
tankOverlay = guiHelper.createDrawable(texture, 176, 86, 12, 47);

View file

@ -24,20 +24,21 @@
package techreborn.compat.jei.industrialSawmill;
import javax.annotation.Nonnull;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.recipe.IRecipeHandler;
import mezz.jei.api.recipe.IRecipeWrapper;
import techreborn.Core;
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
import techreborn.compat.jei.RecipeCategoryUids;
import javax.annotation.Nonnull;
public class IndustrialSawmillRecipeHandler implements IRecipeHandler<IndustrialSawmillRecipe> {
@Nonnull
private final IJeiHelpers jeiHelpers;
public IndustrialSawmillRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) {
public IndustrialSawmillRecipeHandler(
@Nonnull
IJeiHelpers jeiHelpers) {
this.jeiHelpers = jeiHelpers;
}

View file

@ -24,11 +24,6 @@
package techreborn.compat.jei.industrialSawmill;
import java.util.Collections;
import java.util.List;
import javax.annotation.Nonnull;
import mezz.jei.api.IGuiHelper;
import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.gui.IDrawableAnimated;
@ -40,16 +35,18 @@ import net.minecraftforge.fluids.FluidStack;
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
import techreborn.compat.jei.BaseRecipeWrapper;
import javax.annotation.Nonnull;
import java.util.Collections;
import java.util.List;
/**
* @author drcrazy
*
*/
public class IndustrialSawmillRecipeWrapper extends BaseRecipeWrapper <IndustrialSawmillRecipe>{
public class IndustrialSawmillRecipeWrapper extends BaseRecipeWrapper<IndustrialSawmillRecipe> {
public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/industrial_sawmill.png");
private final IDrawableAnimated progress;
public IndustrialSawmillRecipeWrapper(
@Nonnull
IJeiHelpers jeiHelpers,
@ -96,7 +93,4 @@ public class IndustrialSawmillRecipeWrapper extends BaseRecipeWrapper <Industria
}
}
}

View file

@ -130,7 +130,6 @@ public class IC2Dict {
OreDictionary.registerOre("plateIridium", ItemName.crafting.getItemStack(CraftingItemType.iridium));
} catch (NoClassDefFoundError notFound) {
Core.logHelper.warn(
"Can't enable integration: IC2 installed but cannot be hooked\n" +
@ -146,14 +145,12 @@ public class IC2Dict {
}
}
public static ItemStack getIC2Cable(CableType type, int insulation){
if(insulation > type.maxInsulation){
public static ItemStack getIC2Cable(CableType type, int insulation) {
if (insulation > type.maxInsulation) {
return null;
}
ItemCable itemCable = ItemName.cable.getInstance();
return itemCable.getCable(type, insulation);
}
}

Some files were not shown because too many files have changed in this diff Show more