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 @SubscribeEvent
public void LoadPackets(RegisterPacketEvent event){ public void LoadPackets(RegisterPacketEvent event) {
event.registerPacket(PacketSyncSideConfig.class, Side.SERVER); event.registerPacket(PacketSyncSideConfig.class, Side.SERVER);
event.registerPacket(PacketAesu.class, Side.SERVER); event.registerPacket(PacketAesu.class, Side.SERVER);
event.registerPacket(PacketIdsu.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.NonNullList;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World; 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 reborncore.common.util.CraftingHelper;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
public class RollingMachineRecipe { public class RollingMachineRecipe {
@ -50,21 +45,21 @@ public class RollingMachineRecipe {
private final HashMap<ResourceLocation, IRecipe> recipes = new HashMap<>(); private final HashMap<ResourceLocation, IRecipe> recipes = new HashMap<>();
public void addShapedOreRecipe(ResourceLocation resourceLocation, ItemStack outputItemStack, Object... objectInputs) { public void addShapedOreRecipe(ResourceLocation resourceLocation, ItemStack outputItemStack, Object... objectInputs) {
// Validate.notNull(outputItemStack); // Validate.notNull(outputItemStack);
// Validate.notNull(outputItemStack.getItem()); // Validate.notNull(outputItemStack.getItem());
// if (objectInputs.length == 0) { // if (objectInputs.length == 0) {
// Validate.notNull(null); //Quick way to crash // Validate.notNull(null); //Quick way to crash
// } // }
// recipes.put(resourceLocation, new ShapedOreRecipe(resourceLocation, outputItemStack, objectInputs)); // recipes.put(resourceLocation, new ShapedOreRecipe(resourceLocation, outputItemStack, objectInputs));
} }
public void addShapelessOreRecipe(ResourceLocation resourceLocation, ItemStack outputItemStack, Object... objectInputs) { public void addShapelessOreRecipe(ResourceLocation resourceLocation, ItemStack outputItemStack, Object... objectInputs) {
// Validate.notNull(outputItemStack); // Validate.notNull(outputItemStack);
// Validate.notNull(outputItemStack.getItem()); // Validate.notNull(outputItemStack.getItem());
// if (objectInputs.length == 0) { // if (objectInputs.length == 0) {
// Validate.notNull(null); //Quick way to crash // Validate.notNull(null); //Quick way to crash
// } // }
// recipes.put(resourceLocation, new ShapelessOreRecipe(resourceLocation, outputItemStack, objectInputs)); // recipes.put(resourceLocation, new ShapelessOreRecipe(resourceLocation, outputItemStack, objectInputs));
} }
public void addRecipe(ResourceLocation resourceLocation, ItemStack output, Object... components) { 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)); 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(); NonNullList<Ingredient> ingredients = NonNullList.create();
for (int j = 0; j < components.length; j++) { for (int j = 0; j < components.length; j++) {
ingredients.add(CraftingHelper.toIngredient(components[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) { 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) { 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) { public static void addShapelessRollingMachinceRecipe(ResourceLocation resourceLocation, ItemStack output, Object... components) {
RollingMachineRecipe.instance.addShapelessRecipe(resourceLocation,output, components); RollingMachineRecipe.instance.addShapelessRecipe(resourceLocation, output, components);
} }
/** /**

View file

@ -28,12 +28,14 @@ import javax.annotation.Nonnull;
public enum EFluidGenerator { public enum EFluidGenerator {
THERMAL("TechReborn.ThermalGenerator"), GAS("TechReborn.GasGenerator"), DIESEL( THERMAL("TechReborn.ThermalGenerator"), GAS("TechReborn.GasGenerator"), DIESEL(
"TechReborn.DieselGenerator"), SEMIFLUID("TechReborn.SemifluidGenerator"); "TechReborn.DieselGenerator"), SEMIFLUID("TechReborn.SemifluidGenerator");
@Nonnull @Nonnull
private final String recipeID; private final String recipeID;
private EFluidGenerator(@Nonnull String recipeID) { private EFluidGenerator(
@Nonnull
String recipeID) {
this.recipeID = recipeID; this.recipeID = recipeID;
} }

View file

@ -30,9 +30,8 @@ public class FluidGeneratorRecipe {
private final EFluidGenerator generatorType; private final EFluidGenerator generatorType;
private final Fluid fluid; private final Fluid fluid;
private final int energyPerMb; private final int energyPerMb;
public FluidGeneratorRecipe(Fluid fluid, int energyPerMb, EFluidGenerator generatorType) public FluidGeneratorRecipe(Fluid fluid, int energyPerMb, EFluidGenerator generatorType) {
{
this.fluid = fluid; this.fluid = fluid;
this.energyPerMb = energyPerMb; this.energyPerMb = energyPerMb;
this.generatorType = generatorType; this.generatorType = generatorType;
@ -41,6 +40,7 @@ public class FluidGeneratorRecipe {
public Fluid getFluid() { public Fluid getFluid() {
return fluid; return fluid;
} }
public int getEnergyPerMb() { public int getEnergyPerMb() {
return energyPerMb; return energyPerMb;
} }
@ -52,7 +52,7 @@ public class FluidGeneratorRecipe {
@Override @Override
public String toString() { public String toString() {
return "FluidGeneratorRecipe [generatorType=" + generatorType + ", fluid=" + fluid + ", energyPerMb=" return "FluidGeneratorRecipe [generatorType=" + generatorType + ", fluid=" + fluid + ", energyPerMb="
+ energyPerMb + "]"; + energyPerMb + "]";
} }
@Override @Override

View file

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

View file

@ -24,10 +24,10 @@
package techreborn.api.generator; package techreborn.api.generator;
import java.util.EnumMap;
import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.Fluid;
import java.util.EnumMap;
public class GeneratorRecipeHelper { public class GeneratorRecipeHelper {
/** /**
@ -36,19 +36,17 @@ public class GeneratorRecipeHelper {
* FluidGeneratorRecipe. * FluidGeneratorRecipe.
*/ */
public static EnumMap<EFluidGenerator, FluidGeneratorRecipeList> fluidRecipes = new EnumMap<>( public static EnumMap<EFluidGenerator, FluidGeneratorRecipeList> fluidRecipes = new EnumMap<>(
EFluidGenerator.class); EFluidGenerator.class);
/** /**
* Register a Fluid energy recipe. * Register a Fluid energy recipe.
* *
* @param generatorType * @param generatorType A value of the EFluidGenerator type in which the fluid is
* A value of the EFluidGenerator type in which the fluid is * allowed to be consumed.
* allowed to be consumed.
* @param fluidType * @param fluidType
* @param energyPerMb * @param energyPerMb Represent the energy / MILLI_BUCKET the fluid will produce.
* Represent the energy / MILLI_BUCKET the fluid will produce. * Some generators use this value to alter their fluid decay
* Some generators use this value to alter their fluid decay * speed to match their maximum energy output.
* speed to match their maximum energy output.
*/ */
public static void registerFluidRecipe(EFluidGenerator generatorType, Fluid fluidType, int energyPerMb) { public static void registerFluidRecipe(EFluidGenerator generatorType, Fluid fluidType, int energyPerMb) {
fluidRecipes.putIfAbsent(generatorType, new FluidGeneratorRecipeList()); fluidRecipes.putIfAbsent(generatorType, new FluidGeneratorRecipeList());
@ -56,12 +54,10 @@ public class GeneratorRecipeHelper {
} }
/** /**
* * @param generatorType A value of the EFluidGenerator type in which the fluid is
* @param generatorType * allowed to be consumed.
* 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 * @return An object holding a set of availables recipes for this type of
* FluidGenerator. * FluidGenerator.
*/ */
public static FluidGeneratorRecipeList getFluidRecipesForGenerator(EFluidGenerator generatorType) { public static FluidGeneratorRecipeList getFluidRecipesForGenerator(EFluidGenerator generatorType) {
return fluidRecipes.get(generatorType); return fluidRecipes.get(generatorType);

View file

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

View file

@ -27,10 +27,8 @@ package techreborn.blocks;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture; import reborncore.common.blocks.IAdvancedRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -47,7 +45,7 @@ public class BlockComputerCube extends BlockMachineBase implements IAdvancedRota
@Override @Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
final float hitY, final float hitZ) { final float hitY, final float hitZ) {
if (!player.isSneaking()) if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.MANUAL.ordinal(), world, x, y, z); player.openGui(Core.INSTANCE, EGui.MANUAL.ordinal(), world, x, y, z);
return true; return true;
@ -73,4 +71,4 @@ public class BlockComputerCube extends BlockMachineBase implements IAdvancedRota
return this.prefix + "computer_cube"; return this.prefix + "computer_cube";
} }
} }

View file

@ -34,10 +34,8 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fluids.BlockFluidBase; import net.minecraftforge.fluids.BlockFluidBase;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture; import reborncore.common.blocks.IAdvancedRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -83,8 +81,8 @@ public class BlockDigitalChest extends BlockMachineBase implements IAdvancedRota
if (itemStack != ItemStack.EMPTY && itemStack.getCount() > 0) { if (itemStack != ItemStack.EMPTY && itemStack.getCount() > 0) {
if (itemStack.getItem() instanceof ItemBlock) { if (itemStack.getItem() instanceof ItemBlock) {
if (((ItemBlock) itemStack.getItem()).block instanceof BlockFluidBase if (((ItemBlock) itemStack.getItem()).block instanceof BlockFluidBase
|| ((ItemBlock) itemStack.getItem()).block instanceof BlockStaticLiquid || ((ItemBlock) itemStack.getItem()).block instanceof BlockStaticLiquid
|| ((ItemBlock) itemStack.getItem()).block instanceof BlockDynamicLiquid) { || ((ItemBlock) itemStack.getItem()).block instanceof BlockDynamicLiquid) {
continue; continue;
} }
} }
@ -100,7 +98,7 @@ public class BlockDigitalChest extends BlockMachineBase implements IAdvancedRota
final float dZ = rand.nextFloat() * 0.8F + 0.1F; final float dZ = rand.nextFloat() * 0.8F + 0.1F;
final EntityItem entityItem = new EntityItem(world, pos.getX() + dX, pos.getY() + dY, pos.getZ() + dZ, final EntityItem entityItem = new EntityItem(world, pos.getX() + dX, pos.getY() + dY, pos.getZ() + dZ,
itemStack.copy()); itemStack.copy());
if (itemStack.hasTagCompound()) { if (itemStack.hasTagCompound()) {
entityItem.getEntityItem().setTagCompound(itemStack.getTagCompound().copy()); entityItem.getEntityItem().setTagCompound(itemStack.getTagCompound().copy());
@ -122,7 +120,7 @@ public class BlockDigitalChest extends BlockMachineBase implements IAdvancedRota
@Override @Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
final float hitY, final float hitZ) { final float hitY, final float hitZ) {
if (!player.isSneaking()) if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.DIGITAL_CHEST.ordinal(), world, x, y, z); player.openGui(Core.INSTANCE, EGui.DIGITAL_CHEST.ordinal(), world, x, y, z);
return true; return true;

View file

@ -25,7 +25,6 @@
package techreborn.blocks; package techreborn.blocks;
import net.minecraft.block.BlockContainer; import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockStateContainer; 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.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture; import reborncore.common.blocks.IAdvancedRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -52,9 +50,9 @@ public class BlockFusionControlComputer extends BlockMachineBase implements IAdv
@Override @Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
final float hitY, final float hitZ) { final float hitY, final float hitZ) {
final TileEntityFusionController tileEntityFusionController = (TileEntityFusionController) world final TileEntityFusionController tileEntityFusionController = (TileEntityFusionController) world
.getTileEntity(new BlockPos(x, y, z)); .getTileEntity(new BlockPos(x, y, z));
tileEntityFusionController.checkCoils(); tileEntityFusionController.checkCoils();
if (!player.isSneaking()) if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.FUSION_CONTROLLER.ordinal(), world, x, y, z); player.openGui(Core.INSTANCE, EGui.FUSION_CONTROLLER.ordinal(), world, x, y, z);
@ -66,7 +64,7 @@ public class BlockFusionControlComputer extends BlockMachineBase implements IAdv
super.onEntityWalk(worldIn, pos, entityIn); super.onEntityWalk(worldIn, pos, entityIn);
if (worldIn.getTileEntity(pos) instanceof TileEntityFusionController) { if (worldIn.getTileEntity(pos) instanceof TileEntityFusionController) {
if (((TileEntityFusionController) worldIn.getTileEntity(pos)).crafingTickTime != 0 if (((TileEntityFusionController) worldIn.getTileEntity(pos)).crafingTickTime != 0
&& ((TileEntityFusionController) worldIn.getTileEntity(pos)).checkCoils()) { && ((TileEntityFusionController) worldIn.getTileEntity(pos)).checkCoils()) {
entityIn.attackEntityFrom(new FusionDamageSource(), 200F); entityIn.attackEntityFrom(new FusionDamageSource(), 200F);
} }
} }

View file

@ -30,7 +30,6 @@ import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraftforge.fml.relauncher.Side; 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.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos; 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.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fluids.BlockFluidBase; import net.minecraftforge.fluids.BlockFluidBase;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture; import reborncore.common.blocks.IAdvancedRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -87,8 +85,8 @@ public class BlockQuantumChest extends BlockMachineBase implements IAdvancedRota
if (itemStack != ItemStack.EMPTY && itemStack.getCount() > 0) { if (itemStack != ItemStack.EMPTY && itemStack.getCount() > 0) {
if (itemStack.getItem() instanceof ItemBlock) { if (itemStack.getItem() instanceof ItemBlock) {
if (((ItemBlock) itemStack.getItem()).block instanceof BlockFluidBase if (((ItemBlock) itemStack.getItem()).block instanceof BlockFluidBase
|| ((ItemBlock) itemStack.getItem()).block instanceof BlockStaticLiquid || ((ItemBlock) itemStack.getItem()).block instanceof BlockStaticLiquid
|| ((ItemBlock) itemStack.getItem()).block instanceof BlockDynamicLiquid) { || ((ItemBlock) itemStack.getItem()).block instanceof BlockDynamicLiquid) {
continue; continue;
} }
} }
@ -104,7 +102,7 @@ public class BlockQuantumChest extends BlockMachineBase implements IAdvancedRota
final float dZ = rand.nextFloat() * 0.8F + 0.1F; final float dZ = rand.nextFloat() * 0.8F + 0.1F;
final EntityItem entityItem = new EntityItem(world, pos.getX() + dX, pos.getY() + dY, pos.getZ() + dZ, final EntityItem entityItem = new EntityItem(world, pos.getX() + dX, pos.getY() + dY, pos.getZ() + dZ,
itemStack.copy()); itemStack.copy());
if (itemStack.hasTagCompound()) { if (itemStack.hasTagCompound()) {
entityItem.getEntityItem().setTagCompound(itemStack.getTagCompound().copy()); entityItem.getEntityItem().setTagCompound(itemStack.getTagCompound().copy());
@ -126,7 +124,7 @@ public class BlockQuantumChest extends BlockMachineBase implements IAdvancedRota
@Override @Override
public boolean onBlockActivated(final World worldIn, final BlockPos pos, final IBlockState state, final EntityPlayer playerIn, public boolean onBlockActivated(final World worldIn, final BlockPos pos, final IBlockState state, final EntityPlayer playerIn,
final EnumHand hand, final EnumFacing side, final float hitX, final float hitY, final float hitZ) { final EnumHand hand, final EnumFacing side, final float hitX, final float hitY, final float hitZ) {
if (!playerIn.isSneaking()) if (!playerIn.isSneaking())
playerIn.openGui(Core.INSTANCE, EGui.QUANTUM_CHEST.ordinal(), worldIn, pos.getX(), pos.getY(), pos.getZ()); playerIn.openGui(Core.INSTANCE, EGui.QUANTUM_CHEST.ordinal(), worldIn, pos.getX(), pos.getY(), pos.getZ());
return true; return true;

View file

@ -28,10 +28,8 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture; import reborncore.common.blocks.IAdvancedRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -55,7 +53,7 @@ public class BlockQuantumTank extends BlockMachineBase implements IAdvancedRotat
@Override @Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
final float hitY, final float hitZ) { final float hitY, final float hitZ) {
if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) { if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
return true; return true;
} }

View file

@ -28,7 +28,6 @@ import net.minecraft.block.BlockSapling;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos; 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.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture; import reborncore.common.blocks.IRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -54,7 +52,7 @@ public class BlockBlastFurnace extends BlockMachineBase implements IRotationText
@Override @Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
final float hitY, final float hitZ) { final float hitY, final float hitZ) {
if (!player.isSneaking()) if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.BLAST_FURNACE.ordinal(), world, x, y, z); player.openGui(Core.INSTANCE, EGui.BLAST_FURNACE.ordinal(), world, x, y, z);
return true; return true;

View file

@ -27,10 +27,8 @@ package techreborn.blocks.advanced_machine;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture; import reborncore.common.blocks.IRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -53,7 +51,7 @@ public class BlockCentrifuge extends BlockMachineBase implements IRotationTextur
@Override @Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
final float hitY, final float hitZ) { final float hitY, final float hitZ) {
if (!player.isSneaking()) { if (!player.isSneaking()) {
player.openGui(Core.INSTANCE, EGui.CENTRIFUGE.ordinal(), world, x, y, z); player.openGui(Core.INSTANCE, EGui.CENTRIFUGE.ordinal(), world, x, y, z);
} }

View file

@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture; import reborncore.common.blocks.IRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -54,7 +52,7 @@ public class BlockImplosionCompressor extends BlockMachineBase implements IRotat
@Override @Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
final float hitY, final float hitZ) { final float hitY, final float hitZ) {
if (!player.isSneaking()) if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.IMPLOSION_COMPRESSOR.ordinal(), world, x, y, z); player.openGui(Core.INSTANCE, EGui.IMPLOSION_COMPRESSOR.ordinal(), world, x, y, z);
return true; return true;

View file

@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture; import reborncore.common.blocks.IRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -54,7 +52,7 @@ public class BlockIndustrialElectrolyzer extends BlockMachineBase implements IRo
@Override @Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
final float hitY, final float hitZ) { final float hitY, final float hitZ) {
if (!player.isSneaking()) if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.INDUSTRIAL_ELECTROLYZER.ordinal(), world, x, y, z); player.openGui(Core.INSTANCE, EGui.INDUSTRIAL_ELECTROLYZER.ordinal(), world, x, y, z);
return true; return true;

View file

@ -29,10 +29,8 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture; import reborncore.common.blocks.IRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -55,7 +53,7 @@ public class BlockIndustrialGrinder extends BlockMachineBase implements IRotatio
@Override @Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
final float hitY, final float hitZ) { final float hitY, final float hitZ) {
if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) { if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
return true; return true;
} }

View file

@ -29,10 +29,8 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture; import reborncore.common.blocks.IRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -55,7 +53,7 @@ public class BlockIndustrialSawmill extends BlockMachineBase implements IRotatio
@Override @Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
final float hitY, final float hitZ) { final float hitY, final float hitZ) {
if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) { if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
return true; return true;
} }

View file

@ -68,7 +68,6 @@ public class BlockCable extends BlockContainer {
public static final PropertyBool DOWN = PropertyBool.create("down"); public static final PropertyBool DOWN = PropertyBool.create("down");
public static final IProperty<EnumCableType> TYPE = PropertyEnum.create("type", EnumCableType.class); public static final IProperty<EnumCableType> TYPE = PropertyEnum.create("type", EnumCableType.class);
public BlockCable() { public BlockCable() {
super(Material.ROCK); super(Material.ROCK);
setCreativeTab(TechRebornCreativeTab.instance); setCreativeTab(TechRebornCreativeTab.instance);
@ -122,7 +121,7 @@ public class BlockCable extends BlockContainer {
@Override @Override
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) { 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())); list.add(new ItemStack(this, 1, cableType.ordinal()));
} }
} }
@ -158,7 +157,7 @@ public class BlockCable extends BlockContainer {
IBlockState actualState = state; IBlockState actualState = state;
for (EnumFacing facing : EnumFacing.values()) { for (EnumFacing facing : EnumFacing.values()) {
TileEntity tileEntity = getTileEntitySafely(worldIn, pos.offset(facing)); TileEntity tileEntity = getTileEntitySafely(worldIn, pos.offset(facing));
if(tileEntity != null){ if (tileEntity != null) {
actualState = actualState.withProperty(getProperty(facing), tileEntity.hasCapability(CapabilityEnergy.ENERGY, facing.getOpposite())); 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(); return friendlyName.toLowerCase();
} }
public ItemStack getStack(){ public ItemStack getStack() {
return new ItemStack(ModBlocks.CABLE,1, this.ordinal()); 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.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture; import reborncore.common.blocks.IAdvancedRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -55,7 +53,7 @@ public class BlockDieselGenerator extends BlockMachineBase implements IAdvancedR
@Override @Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
final float hitY, final float hitZ) { final float hitY, final float hitZ) {
if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) { if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
return true; return true;
} }

View file

@ -26,7 +26,6 @@ package techreborn.blocks.generator;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.util.ITooltipFlag; import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.text.TextFormatting; 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.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture; import reborncore.common.blocks.IAdvancedRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -55,7 +53,7 @@ public class BlockGasTurbine extends BlockMachineBase implements IAdvancedRotati
@Override @Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
final float hitY, final float hitZ) { final float hitY, final float hitZ) {
if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) { if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
return true; return true;
} }

View file

@ -27,10 +27,8 @@ package techreborn.blocks.generator;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture; import reborncore.common.blocks.IRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -53,7 +51,7 @@ public class BlockGenerator extends BlockMachineBase implements IRotationTexture
@Override @Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
final float hitY, final float hitZ) { final float hitY, final float hitZ) {
if (!player.isSneaking()) { if (!player.isSneaking()) {
player.openGui(Core.INSTANCE, EGui.GENERATOR.ordinal(), world, x, y, z); player.openGui(Core.INSTANCE, EGui.GENERATOR.ordinal(), world, x, y, z);
} }

View file

@ -26,7 +26,6 @@ package techreborn.blocks.generator;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.util.ITooltipFlag; import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.text.TextFormatting; 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.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture; import reborncore.common.blocks.IAdvancedRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -55,7 +53,7 @@ public class BlockSemiFluidGenerator extends BlockMachineBase implements IAdvanc
@Override @Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
final float hitY, final float hitZ) { final float hitY, final float hitZ) {
if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) { if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
return true; return true;
} }

View file

@ -28,10 +28,8 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture; import reborncore.common.blocks.IAdvancedRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -54,7 +52,7 @@ public class BlockThermalGenerator extends BlockMachineBase implements IAdvanced
@Override @Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
final float hitY, final float hitZ) { final float hitY, final float hitZ) {
if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) { if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
return true; return true;
} }

View file

@ -32,10 +32,8 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture; import reborncore.common.blocks.IRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -61,7 +59,7 @@ public class BlockAlloyFurnace extends BlockMachineBase implements IRotationText
@Override @Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
final float hitY, final float hitZ) { final float hitY, final float hitZ) {
if (!player.isSneaking()) if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.ALLOY_FURNACE.ordinal(), world, x, y, z); player.openGui(Core.INSTANCE, EGui.ALLOY_FURNACE.ordinal(), world, x, y, z);
return true; return true;

View file

@ -35,10 +35,8 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture; import reborncore.common.blocks.IRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -65,7 +63,7 @@ public class BlockIronFurnace extends BlockMachineBase implements IRotationTextu
@Override @Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
final float hitY, final float hitZ) { final float hitY, final float hitZ) {
if (!player.isSneaking()) if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.IRON_FURNACE.ordinal(), world, x, y, z); player.openGui(Core.INSTANCE, EGui.IRON_FURNACE.ordinal(), world, x, y, z);
return true; return true;
@ -92,22 +90,22 @@ public class BlockIronFurnace extends BlockMachineBase implements IRotationTextu
switch (enumfacing) { switch (enumfacing) {
case WEST: case WEST:
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D,
new int[0]); new int[0]);
worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]); worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]);
break; break;
case EAST: case EAST:
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D,
new int[0]); new int[0]);
worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]); worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]);
break; break;
case NORTH: case NORTH:
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D, worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D,
new int[0]); new int[0]);
worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D, new int[0]); worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D, new int[0]);
break; break;
case SOUTH: case SOUTH:
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D, worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D,
new int[0]); new int[0]);
worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D, new int[0]); worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D, new int[0]);
} }
} }

View file

@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture; import reborncore.common.blocks.IRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -54,7 +52,7 @@ public class BlockAssemblingMachine extends BlockMachineBase implements IRotatio
@Override @Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
final float hitY, final float hitZ) { final float hitY, final float hitZ) {
if (!player.isSneaking()) if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.ASSEMBLING_MACHINE.ordinal(), world, x, y, z); player.openGui(Core.INSTANCE, EGui.ASSEMBLING_MACHINE.ordinal(), world, x, y, z);
return true; return true;

View file

@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture; import reborncore.common.blocks.IRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -54,7 +52,7 @@ public class BlockChargeBench extends BlockMachineBase implements IRotationTextu
@Override @Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
final float hitY, final float hitZ) { final float hitY, final float hitZ) {
if (!player.isSneaking()) if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.CHARGEBENCH.ordinal(), world, x, y, z); player.openGui(Core.INSTANCE, EGui.CHARGEBENCH.ordinal(), world, x, y, z);
return true; return true;

View file

@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture; import reborncore.common.blocks.IRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -54,7 +52,7 @@ public class BlockChemicalReactor extends BlockMachineBase implements IRotationT
@Override @Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
final float hitY, final float hitZ) { final float hitY, final float hitZ) {
if (!player.isSneaking()) if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.CHEMICAL_REACTOR.ordinal(), world, x, y, z); player.openGui(Core.INSTANCE, EGui.CHEMICAL_REACTOR.ordinal(), world, x, y, z);
return true; return true;

View file

@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture; import reborncore.common.blocks.IAdvancedRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -54,7 +52,7 @@ public class BlockChunkLoader extends BlockMachineBase implements IAdvancedRotat
@Override @Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
final float hitY, final float hitZ) { final float hitY, final float hitZ) {
if (!player.isSneaking()) if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.CHUNK_LOADER.ordinal(), world, x, y, z); player.openGui(Core.INSTANCE, EGui.CHUNK_LOADER.ordinal(), world, x, y, z);
return true; return true;

View file

@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture; import reborncore.common.blocks.IAdvancedRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -54,7 +52,7 @@ public class BlockMatterFabricator extends BlockMachineBase implements IAdvanced
@Override @Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
final float hitY, final float hitZ) { final float hitY, final float hitZ) {
if (!player.isSneaking()) if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.MATTER_FABRICATOR.ordinal(), world, x, y, z); player.openGui(Core.INSTANCE, EGui.MATTER_FABRICATOR.ordinal(), world, x, y, z);
return true; return true;

View file

@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture; import reborncore.common.blocks.IAdvancedRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -54,7 +52,7 @@ public class BlockRollingMachine extends BlockMachineBase implements IAdvancedRo
@Override @Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
final float hitY, final float hitZ) { final float hitY, final float hitZ) {
if (!player.isSneaking()) if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.ROLLING_MACHINE.ordinal(), world, x, y, z); player.openGui(Core.INSTANCE, EGui.ROLLING_MACHINE.ordinal(), world, x, y, z);
return true; return true;

View file

@ -31,10 +31,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture; import reborncore.common.blocks.IRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -59,7 +57,7 @@ public class BlockScrapboxinator extends BlockMachineBase implements IRotationTe
@Override @Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
final float hitY, final float hitZ) { final float hitY, final float hitZ) {
if (!player.isSneaking()) { if (!player.isSneaking()) {
player.openGui(Core.INSTANCE, EGui.SCRAPBOXINATOR.ordinal(), world, x, y, z); player.openGui(Core.INSTANCE, EGui.SCRAPBOXINATOR.ordinal(), world, x, y, z);
} }

View file

@ -32,10 +32,8 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand; import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture; import reborncore.common.blocks.IAdvancedRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -57,7 +55,15 @@ public class BlockVacuumFreezer extends BlockMachineBase implements IAdvancedRot
} }
@Override @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()) { if (!player.isSneaking()) {
player.openGui(Core.INSTANCE, EGui.VACUUM_FREEZER.ordinal(), world, pos.getX(), pos.getY(), pos.getZ()); player.openGui(Core.INSTANCE, EGui.VACUUM_FREEZER.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
return true; return true;

View file

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

View file

@ -30,7 +30,6 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.tiles.storage.TileBatBox; 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.util.math.BlockPos;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.tiles.idsu.TileIDSU; import techreborn.tiles.idsu.TileIDSU;
@ -51,7 +50,7 @@ public class BlockIDSU extends BlockEnergyStorage {
@Override @Override
public IBlockState getStateForPlacement(final World world, final BlockPos pos, final EnumFacing facing, final float hitX, final float hitY, public IBlockState getStateForPlacement(final World world, final BlockPos pos, final EnumFacing facing, final float hitX, final float hitY,
final float hitZ, final int meta, final EntityLivingBase placer) { final float hitZ, final int meta, final EntityLivingBase placer) {
final TileEntity tile = world.getTileEntity(pos); final TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileIDSU) { if (tile instanceof TileIDSU) {
((TileIDSU) tile).ownerUdid = placer.getUniqueID().toString(); ((TileIDSU) tile).ownerUdid = placer.getUniqueID().toString();

View file

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

View file

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

View file

@ -30,7 +30,6 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.init.ModBlocks; import techreborn.init.ModBlocks;
import techreborn.tiles.storage.TileMFE; 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.util.math.BlockPos;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.init.ModBlocks; import techreborn.init.ModBlocks;
import techreborn.tiles.storage.TileMFSU; 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.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture; import reborncore.common.blocks.IRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -54,7 +52,7 @@ public class BlockAlloySmelter extends BlockMachineBase implements IRotationText
@Override @Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
final float hitY, final float hitZ) { final float hitY, final float hitZ) {
if (!player.isSneaking()) if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.ALLOY_SMELTER.ordinal(), world, x, y, z); player.openGui(Core.INSTANCE, EGui.ALLOY_SMELTER.ordinal(), world, x, y, z);
return true; return true;

View file

@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture; import reborncore.common.blocks.IRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -54,7 +52,7 @@ public class BlockCompressor extends BlockMachineBase implements IRotationTextur
@Override @Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
final float hitY, final float hitZ) { final float hitY, final float hitZ) {
if (!player.isSneaking()) { if (!player.isSneaking()) {
player.openGui(Core.INSTANCE, EGui.COMPRESSOR.ordinal(), world, x, y, z); player.openGui(Core.INSTANCE, EGui.COMPRESSOR.ordinal(), world, x, y, z);
} }

View file

@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture; import reborncore.common.blocks.IRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -54,7 +52,7 @@ public class BlockElectricFurnace extends BlockMachineBase implements IRotationT
@Override @Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
final float hitY, final float hitZ) { final float hitY, final float hitZ) {
if (!player.isSneaking()) { if (!player.isSneaking()) {
player.openGui(Core.INSTANCE, EGui.ELECTRIC_FURNACE.ordinal(), world, x, y, z); player.openGui(Core.INSTANCE, EGui.ELECTRIC_FURNACE.ordinal(), world, x, y, z);
} }

View file

@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture; import reborncore.common.blocks.IRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -54,7 +52,7 @@ public class BlockExtractor extends BlockMachineBase implements IRotationTexture
@Override @Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
final float hitY, final float hitZ) { final float hitY, final float hitZ) {
if (!player.isSneaking()) { if (!player.isSneaking()) {
player.openGui(Core.INSTANCE, EGui.EXTRACTOR.ordinal(), world, x, y, z); player.openGui(Core.INSTANCE, EGui.EXTRACTOR.ordinal(), world, x, y, z);
} }

View file

@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IAdvancedRotationTexture; import reborncore.common.blocks.IAdvancedRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -54,7 +52,7 @@ public class BlockGrinder extends BlockMachineBase implements IAdvancedRotationT
@Override @Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
final float hitY, final float hitZ) { final float hitY, final float hitZ) {
if (!player.isSneaking()) { if (!player.isSneaking()) {
player.openGui(Core.INSTANCE, EGui.GRINDER.ordinal(), world, x, y, z); player.openGui(Core.INSTANCE, EGui.GRINDER.ordinal(), world, x, y, z);
} }

View file

@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import reborncore.common.blocks.IRotationTexture; import reborncore.common.blocks.IRotationTexture;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
@ -54,7 +52,7 @@ public class BlockRecycler extends BlockMachineBase implements IRotationTexture
@Override @Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX, public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
final float hitY, final float hitZ) { final float hitY, final float hitZ) {
if (!player.isSneaking()) { if (!player.isSneaking()) {
player.openGui(Core.INSTANCE, EGui.RECYCLER.ordinal(), world, x, y, z); player.openGui(Core.INSTANCE, EGui.RECYCLER.ordinal(), world, x, y, z);
} }

View file

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

View file

@ -29,7 +29,6 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.IGuiHandler; import net.minecraftforge.fml.common.network.IGuiHandler;
import techreborn.client.container.*; import techreborn.client.container.*;
import techreborn.client.gui.*; import techreborn.client.gui.*;
import techreborn.manual.GuiManual; import techreborn.manual.GuiManual;
@ -48,7 +47,7 @@ public class GuiHandler implements IGuiHandler {
@Override @Override
public Object getServerGuiElement(final int ID, final EntityPlayer player, final World world, final int x, public Object getServerGuiElement(final int ID, final EntityPlayer player, final World world, final int x,
final int y, final int z) { final int y, final int z) {
final EGui gui = EGui.values()[ID]; final EGui gui = EGui.values()[ID];
final TileEntity tile = world.getTileEntity(new BlockPos(x, y, z)); final TileEntity tile = world.getTileEntity(new BlockPos(x, y, z));
@ -73,7 +72,7 @@ public class GuiHandler implements IGuiHandler {
@Override @Override
public Object getClientGuiElement(final int ID, final EntityPlayer player, final World world, final int x, public Object getClientGuiElement(final int ID, final EntityPlayer player, final World world, final int x,
final int y, final int z) { final int y, final int z) {
final EGui gui = EGui.values()[ID]; final EGui gui = EGui.values()[ID];
final TileEntity tile = world.getTileEntity(new BlockPos(x, y, z)); final TileEntity tile = world.getTileEntity(new BlockPos(x, y, z));

View file

@ -179,7 +179,7 @@ public class RegisterItemJsons {
} }
for (EnumCableType cableType : EnumCableType.values()) { 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 net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.slots.BaseSlot; import reborncore.client.gui.slots.BaseSlot;
import reborncore.common.container.RebornContainer; import reborncore.common.container.RebornContainer;
import techreborn.config.ConfigTechReborn;
import techreborn.tiles.lesu.TileLesu; import techreborn.tiles.lesu.TileLesu;
public class ContainerLESU extends RebornContainer { public class ContainerLESU extends RebornContainer {

View file

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

View file

@ -24,16 +24,14 @@
package techreborn.client.container.builder; 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.entity.player.EntityPlayer;
import net.minecraft.inventory.*; import net.minecraft.inventory.*;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; 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 reborncore.common.util.ItemUtils;
import techreborn.client.container.IRightClickHandler; import techreborn.client.container.IRightClickHandler;
@ -58,8 +56,8 @@ public class BuiltContainer extends Container {
private Integer[] integerParts; private Integer[] integerParts;
public BuiltContainer(final String name, final Predicate<EntityPlayer> canInteract, public BuiltContainer(final String name, final Predicate<EntityPlayer> canInteract,
final List<Range<Integer>> playerSlotRange, final List<Range<Integer>> playerSlotRange,
final List<Range<Integer>> tileSlotRange) { final List<Range<Integer>> tileSlotRange) {
this.name = name; this.name = name;
this.canInteract = canInteract; this.canInteract = canInteract;
@ -107,10 +105,10 @@ public class BuiltContainer extends Container {
@Override @Override
public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, EntityPlayer player) { 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); Slot slot = this.inventorySlots.get(slotId);
if(slot instanceof IRightClickHandler){ if (slot instanceof IRightClickHandler) {
if(((IRightClickHandler) slot).handleRightClick(slot.getSlotIndex(), player, this)){ if (((IRightClickHandler) slot).handleRightClick(slot.getSlotIndex(), player, this)) {
return ItemStack.EMPTY; return ItemStack.EMPTY;
} }
} }
@ -180,20 +178,16 @@ public class BuiltContainer extends Container {
@Override @Override
public void updateProgressBar(final int id, final int value) { 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).getMiddle().accept((short) value);
this.shortValues.get(id).setRight((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) if ((id - this.shortValues.size()) % 2 == 0)
this.integerParts[(id - this.shortValues.size()) / 2] = value; this.integerParts[(id - this.shortValues.size()) / 2] = value;
else else {
{
this.integerValues.get((id - this.shortValues.size()) / 2).getMiddle().accept( this.integerValues.get((id - this.shortValues.size()) / 2).getMiddle().accept(
(this.integerParts[(id - this.shortValues.size()) / 2] & 0xFFFF) << 16 | value & 0xFFFF); (this.integerParts[(id - this.shortValues.size()) / 2] & 0xFFFF) << 16 | value & 0xFFFF);
} }
} }
} }
@ -247,7 +241,7 @@ public class BuiltContainer extends Container {
final Slot slot = this.inventorySlots.get(slotIndex); final Slot slot = this.inventorySlots.get(slotIndex);
final ItemStack stackInSlot = slot.getStack(); final ItemStack stackInSlot = slot.getStack();
if (stackInSlot != ItemStack.EMPTY && ItemUtils.isItemEqual(stackInSlot, stackToShift, true, true) if (stackInSlot != ItemStack.EMPTY && ItemUtils.isItemEqual(stackInSlot, stackToShift, true, true)
&& slot.isItemValid(stackToShift)) { && slot.isItemValid(stackToShift)) {
final int resultingStackSize = stackInSlot.getCount() + stackToShift.getCount(); final int resultingStackSize = stackInSlot.getCount() + stackToShift.getCount();
final int max = Math.min(stackToShift.getMaxStackSize(), slot.getSlotStackLimit()); final int max = Math.min(stackToShift.getMaxStackSize(), slot.getSlotStackLimit());
if (resultingStackSize <= max) { if (resultingStackSize <= max) {
@ -299,4 +293,4 @@ public class BuiltContainer extends Container {
public String getName() { public String getName() {
return this.name; return this.name;
} }
} }

View file

@ -24,14 +24,13 @@
package techreborn.client.container.builder; 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.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCrafting; import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.inventory.Slot; 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.ArrayList;
import java.util.List; import java.util.List;
@ -91,8 +90,8 @@ public class ContainerBuilder {
public BuiltContainer create() { public BuiltContainer create() {
final BuiltContainer built = new BuiltContainer(this.name, this.canInteract, final BuiltContainer built = new BuiltContainer(this.name, this.canInteract,
this.playerInventoryRanges, this.playerInventoryRanges,
this.tileInventoryRanges); this.tileInventoryRanges);
if (!this.shortValues.isEmpty()) if (!this.shortValues.isEmpty())
built.addShortSync(this.shortValues); built.addShortSync(this.shortValues);
if (!this.integerValues.isEmpty()) if (!this.integerValues.isEmpty())

View file

@ -24,9 +24,6 @@
package techreborn.client.container.builder; 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.IInventory;
import net.minecraft.inventory.InventoryCrafting; import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.inventory.SlotFurnaceFuel; import net.minecraft.inventory.SlotFurnaceFuel;
@ -34,7 +31,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraftforge.energy.CapabilityEnergy; import net.minecraftforge.energy.CapabilityEnergy;
import net.minecraftforge.fluids.capability.CapabilityFluidHandler; 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.power.IEnergyInterfaceItem;
import reborncore.api.recipe.IRecipeCrafterProvider; import reborncore.api.recipe.IRecipeCrafterProvider;
import reborncore.api.tile.IUpgrade; 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.SlotFake;
import reborncore.client.gui.slots.SlotOutput; import reborncore.client.gui.slots.SlotOutput;
import reborncore.common.powerSystem.TilePowerAcceptor; import reborncore.common.powerSystem.TilePowerAcceptor;
import techreborn.Core; import techreborn.Core;
import techreborn.client.container.builder.slot.FilteredSlot; import techreborn.client.container.builder.slot.FilteredSlot;
import techreborn.client.container.builder.slot.UpgradeSlot; import techreborn.client.container.builder.slot.UpgradeSlot;
@ -63,7 +60,7 @@ public class ContainerTileInventoryBuilder {
this.tile = tile; this.tile = tile;
this.parent = parent; this.parent = parent;
this.rangeStart = parent.slots.size(); this.rangeStart = parent.slots.size();
if(tile instanceof IUpgradeable){ if (tile instanceof IUpgradeable) {
upgradeSlots((IUpgradeable) tile); upgradeSlots((IUpgradeable) tile);
} }
} }
@ -84,7 +81,7 @@ public class ContainerTileInventoryBuilder {
} }
public ContainerTileInventoryBuilder filterSlot(final int index, final int x, final int y, public ContainerTileInventoryBuilder filterSlot(final int index, final int x, final int y,
final Predicate<ItemStack> filter) { final Predicate<ItemStack> filter) {
this.parent.slots.add(new FilteredSlot(this.tile, index, x, y).setFilter(filter)); this.parent.slots.add(new FilteredSlot(this.tile, index, x, y).setFilter(filter));
return this; return this;
} }
@ -92,20 +89,19 @@ public class ContainerTileInventoryBuilder {
@SuppressWarnings("null") @SuppressWarnings("null")
public ContainerTileInventoryBuilder energySlot(final int index, final int x, final int y) { public ContainerTileInventoryBuilder energySlot(final int index, final int x, final int y) {
this.parent.slots.add(new FilteredSlot(this.tile, index, x, y) this.parent.slots.add(new FilteredSlot(this.tile, index, x, y)
.setFilter(stack -> stack.hasCapability(CapabilityEnergy.ENERGY, EnumFacing.UP) .setFilter(stack -> stack.hasCapability(CapabilityEnergy.ENERGY, EnumFacing.UP)
|| stack.getItem() instanceof IEnergyInterfaceItem)); || stack.getItem() instanceof IEnergyInterfaceItem));
return this; return this;
} }
@SuppressWarnings("null") @SuppressWarnings("null")
public ContainerTileInventoryBuilder fluidSlot(final int index, final int x, final int y) { public ContainerTileInventoryBuilder fluidSlot(final int index, final int x, final int y) {
this.parent.slots.add(new FilteredSlot(this.tile, index, x, y).setFilter( this.parent.slots.add(new FilteredSlot(this.tile, index, x, y).setFilter(
stack -> stack.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_ITEM_CAPABILITY, EnumFacing.UP))); stack -> stack.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_ITEM_CAPABILITY, EnumFacing.UP)));
return this; 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)); this.parent.slots.add(new SlotFurnaceFuel(this.tile, index, x, y));
return this; return this;
} }
@ -113,12 +109,12 @@ public class ContainerTileInventoryBuilder {
@Deprecated @Deprecated
public ContainerTileInventoryBuilder upgradeSlot(final int index, final int x, final int y) { public ContainerTileInventoryBuilder upgradeSlot(final int index, final int x, final int y) {
this.parent.slots.add(new FilteredSlot(this.tile, index, x, y) this.parent.slots.add(new FilteredSlot(this.tile, index, x, y)
.setFilter(stack -> stack.getItem() instanceof IUpgrade)); .setFilter(stack -> stack.getItem() instanceof IUpgrade));
return this; return this;
} }
private ContainerTileInventoryBuilder upgradeSlots(IUpgradeable upgradeable){ private ContainerTileInventoryBuilder upgradeSlots(IUpgradeable upgradeable) {
if(upgradeable.canBeUpgraded()){ if (upgradeable.canBeUpgraded()) {
for (int i = 0; i < upgradeable.getUpgradeSlotCount(); i++) { for (int i = 0; i < upgradeable.getUpgradeSlotCount(); i++) {
this.parent.slots.add(new UpgradeSlot(upgradeable.getUpgradeInvetory(), i, -19, i * 18 + 12)); 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 * will be truncated by force.
* The supplier must supply a variable holding inside a Short, it * @param setter The setter to call when the variable has been updated.
* will be truncated by force.
* @param setter
* The setter to call when the variable has been updated.
*/ */
public ContainerTileInventoryBuilder syncShortValue(final IntSupplier supplier, final IntConsumer setter) { public ContainerTileInventoryBuilder syncShortValue(final IntSupplier supplier, final IntConsumer setter) {
this.parent.shortValues.add(Pair.of(supplier, 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 * will be split inside multiples shorts.
* The supplier it can supply a variable holding in an Integer it * @param setter The setter to call when the variable has been updated.
* will be split inside multiples shorts.
* @param setter
* The setter to call when the variable has been updated.
*/ */
public ContainerTileInventoryBuilder syncIntegerValue(final IntSupplier supplier, final IntConsumer setter) { public ContainerTileInventoryBuilder syncIntegerValue(final IntSupplier supplier, final IntConsumer setter) {
this.parent.integerValues.add(Pair.of(supplier, setter)); this.parent.integerValues.add(Pair.of(supplier, setter));
@ -155,7 +145,7 @@ public class ContainerTileInventoryBuilder {
public ContainerTileInventoryBuilder syncEnergyValue() { public ContainerTileInventoryBuilder syncEnergyValue() {
if (this.tile instanceof TilePowerAcceptor) if (this.tile instanceof TilePowerAcceptor)
return this.syncIntegerValue(() -> (int) ((TilePowerAcceptor) this.tile).getEnergy(), return this.syncIntegerValue(() -> (int) ((TilePowerAcceptor) this.tile).getEnergy(),
((TilePowerAcceptor) this.tile)::setEnergy) ((TilePowerAcceptor) this.tile)::setEnergy)
.syncIntegerValue(() -> (int) ((TilePowerAcceptor) this.tile).extraPowerStoage, .syncIntegerValue(() -> (int) ((TilePowerAcceptor) this.tile).extraPowerStoage,
((TilePowerAcceptor) this.tile)::setExtraPowerStoage); ((TilePowerAcceptor) this.tile)::setExtraPowerStoage);
Core.logHelper.error(this.tile + " is not an instance of TilePowerAcceptor! Energy cannot be synced."); Core.logHelper.error(this.tile + " is not an instance of TilePowerAcceptor! Energy cannot be synced.");
@ -165,14 +155,14 @@ public class ContainerTileInventoryBuilder {
public ContainerTileInventoryBuilder syncCrafterValue() { public ContainerTileInventoryBuilder syncCrafterValue() {
if (this.tile instanceof IRecipeCrafterProvider) if (this.tile instanceof IRecipeCrafterProvider)
return this return this
.syncIntegerValue(() -> ((IRecipeCrafterProvider) this.tile).getRecipeCrafter().currentTickTime, .syncIntegerValue(() -> ((IRecipeCrafterProvider) this.tile).getRecipeCrafter().currentTickTime,
(currentTickTime) -> ((IRecipeCrafterProvider) this.tile) (currentTickTime) -> ((IRecipeCrafterProvider) this.tile)
.getRecipeCrafter().currentTickTime = currentTickTime) .getRecipeCrafter().currentTickTime = currentTickTime)
.syncIntegerValue(() -> ((IRecipeCrafterProvider) this.tile).getRecipeCrafter().currentNeededTicks, .syncIntegerValue(() -> ((IRecipeCrafterProvider) this.tile).getRecipeCrafter().currentNeededTicks,
(currentNeededTicks) -> ((IRecipeCrafterProvider) this.tile) (currentNeededTicks) -> ((IRecipeCrafterProvider) this.tile)
.getRecipeCrafter().currentNeededTicks = currentNeededTicks); .getRecipeCrafter().currentNeededTicks = currentNeededTicks);
Core.logHelper Core.logHelper
.error(this.tile + " is not an instance of IRecipeCrafterProvider! Craft progress cannot be synced."); .error(this.tile + " is not an instance of IRecipeCrafterProvider! Craft progress cannot be synced.");
return this; return this;
} }

View file

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

View file

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

View file

@ -29,13 +29,12 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n; import net.minecraft.util.text.translation.I18n;
import techreborn.tiles.TileAlloyFurnace; import techreborn.tiles.TileAlloyFurnace;
public class GuiAlloyFurnace extends GuiContainer { public class GuiAlloyFurnace extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation("techreborn", private static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/alloy_furnace.png"); "textures/gui/alloy_furnace.png");
TileAlloyFurnace alloyfurnace; TileAlloyFurnace alloyfurnace;
@ -73,8 +72,8 @@ public class GuiAlloyFurnace extends GuiContainer {
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) { protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.translateToLocal("tile.techreborn.alloyfurnace.name"); final String name = I18n.translateToLocal("tile.techreborn.alloyfurnace.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752); 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752); this.ySize - 96 + 2, 4210752);
} }
} }

View file

@ -29,13 +29,12 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n; import net.minecraft.util.text.translation.I18n;
import techreborn.tiles.TileAlloySmelter; import techreborn.tiles.TileAlloySmelter;
public class GuiAlloySmelter extends GuiContainer { public class GuiAlloySmelter extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn", public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/electric_alloy_furnace.png"); "textures/gui/electric_alloy_furnace.png");
TileAlloySmelter alloysmelter; TileAlloySmelter alloysmelter;
@ -78,8 +77,8 @@ public class GuiAlloySmelter extends GuiContainer {
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) { protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.translateToLocal("tile.techreborn.alloysmelter.name"); final String name = I18n.translateToLocal("tile.techreborn.alloysmelter.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752); 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752); this.ySize - 96 + 2, 4210752);
} }
} }

View file

@ -29,13 +29,12 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n; import net.minecraft.util.text.translation.I18n;
import techreborn.tiles.TileAssemblingMachine; import techreborn.tiles.TileAssemblingMachine;
public class GuiAssemblingMachine extends GuiContainer { public class GuiAssemblingMachine extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn", public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/assembling_machine.png"); "textures/gui/assembling_machine.png");
TileAssemblingMachine assemblingmachine; TileAssemblingMachine assemblingmachine;
@ -78,8 +77,8 @@ public class GuiAssemblingMachine extends GuiContainer {
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) { protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.translateToLocal("tile.techreborn.assemblinmachine.name"); final String name = I18n.translateToLocal("tile.techreborn.assemblinmachine.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752); 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752); this.ySize - 96 + 2, 4210752);
} }
} }

View file

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

View file

@ -30,13 +30,12 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n; import net.minecraft.util.text.translation.I18n;
import techreborn.tiles.TileChunkLoader; import techreborn.tiles.TileChunkLoader;
public class GuiChunkLoader extends GuiContainer { public class GuiChunkLoader extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation("techreborn", private static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/industrial_chunkloader.png"); "textures/gui/industrial_chunkloader.png");
TileChunkLoader chunkloader; TileChunkLoader chunkloader;
private GuiButton plusOneButton; private GuiButton plusOneButton;
private GuiButton plusTenButton; private GuiButton plusTenButton;
@ -80,9 +79,9 @@ public class GuiChunkLoader extends GuiContainer {
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) { protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.translateToLocal("tile.techreborn.chunkloader.name"); final String name = I18n.translateToLocal("tile.techreborn.chunkloader.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752); 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752); this.ySize - 96 + 2, 4210752);
} }
} }

View file

@ -29,15 +29,13 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n; import net.minecraft.util.text.translation.I18n;
import reborncore.common.powerSystem.PowerSystem; import reborncore.common.powerSystem.PowerSystem;
import techreborn.tiles.generator.TileDieselGenerator; import techreborn.tiles.generator.TileDieselGenerator;
public class GuiDieselGenerator extends GuiContainer { public class GuiDieselGenerator extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation("techreborn", private static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/diesel_generator.png"); "textures/gui/diesel_generator.png");
TileDieselGenerator dieselGenerator; TileDieselGenerator dieselGenerator;
@ -61,14 +59,14 @@ public class GuiDieselGenerator extends GuiContainer {
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) { protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.translateToLocal("tile.techreborn.dieselgenerator.name"); final String name = I18n.translateToLocal("tile.techreborn.dieselgenerator.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752); 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752); this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255); this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
this.fontRendererObj.drawString(this.dieselGenerator.tank.getFluidAmount() + "", 10, 30, 16448255); this.fontRendererObj.drawString(this.dieselGenerator.tank.getFluidAmount() + "", 10, 30, 16448255);
this.fontRendererObj.drawString("Power Amount", 10, 40, 16448255); this.fontRendererObj.drawString("Power Amount", 10, 40, 16448255);
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(this.dieselGenerator.getEnergy()) + "", 10, 50, this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(this.dieselGenerator.getEnergy()) + "", 10, 50,
16448255); 16448255);
} }
} }

View file

@ -26,7 +26,6 @@ package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import techreborn.tiles.TileDigitalChest; import techreborn.tiles.TileDigitalChest;
public class GuiDigitalChest extends GuiBase { public class GuiDigitalChest extends GuiBase {
@ -54,12 +53,12 @@ public class GuiDigitalChest extends GuiBase {
if (this.digitalChest.storedItem != ItemStack.EMPTY && this.digitalChest.getStackInSlot(1) != null) { if (this.digitalChest.storedItem != ItemStack.EMPTY && this.digitalChest.getStackInSlot(1) != null) {
this.builder.drawBigBlueBar(this, 31, 43, this.builder.drawBigBlueBar(this, 31, 43,
this.digitalChest.storedItem.getCount() + this.digitalChest.getStackInSlot(1).getCount(), this.digitalChest.storedItem.getCount() + this.digitalChest.getStackInSlot(1).getCount(),
this.digitalChest.maxCapacity, mouseX - this.guiLeft, mouseY - this.guiTop, "Stored", layer); this.digitalChest.maxCapacity, mouseX - this.guiLeft, mouseY - this.guiTop, "Stored", layer);
} }
if (this.digitalChest.storedItem == ItemStack.EMPTY && this.digitalChest.getStackInSlot(1) != null) { if (this.digitalChest.storedItem == ItemStack.EMPTY && this.digitalChest.getStackInSlot(1) != null) {
this.builder.drawBigBlueBar(this, 31, 43, this.digitalChest.getStackInSlot(1).getCount(), this.builder.drawBigBlueBar(this, 31, 43, this.digitalChest.getStackInSlot(1).getCount(),
this.digitalChest.maxCapacity, mouseX - this.guiLeft, mouseY - this.guiTop, "Stored", layer); this.digitalChest.maxCapacity, mouseX - this.guiLeft, mouseY - this.guiTop, "Stored", layer);
} }
} }
} }

View file

@ -32,12 +32,10 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.translation.I18n; import net.minecraft.util.text.translation.I18n;
import reborncore.client.multiblock.MultiblockRenderEvent; import reborncore.client.multiblock.MultiblockRenderEvent;
import reborncore.client.multiblock.MultiblockSet; import reborncore.client.multiblock.MultiblockSet;
import reborncore.common.misc.Location; import reborncore.common.misc.Location;
import reborncore.common.powerSystem.PowerSystem; import reborncore.common.powerSystem.PowerSystem;
import techreborn.client.ClientMultiBlocks; import techreborn.client.ClientMultiBlocks;
import techreborn.proxies.ClientProxy; import techreborn.proxies.ClientProxy;
import techreborn.tiles.fusionReactor.TileEntityFusionController; import techreborn.tiles.fusionReactor.TileEntityFusionController;
@ -47,7 +45,7 @@ import java.io.IOException;
public class GuiFusionReactor extends GuiContainer { public class GuiFusionReactor extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn", public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/fusion_reactor.png"); "textures/gui/fusion_reactor.png");
TileEntityFusionController fusionController; TileEntityFusionController fusionController;
@ -61,16 +59,16 @@ public class GuiFusionReactor extends GuiContainer {
final String name = I18n.translateToLocal("tile.techreborn.fusioncontrolcomputer.name"); final String name = I18n.translateToLocal("tile.techreborn.fusioncontrolcomputer.name");
this.fontRendererObj.drawString(name, 87, 6, 4210752); this.fontRendererObj.drawString(name, 87, 6, 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752); this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(this.fusionController.getEnergy()), 11, 8, this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(this.fusionController.getEnergy()), 11, 8,
16448255); 16448255);
this.fontRendererObj.drawString("Coils: " + (this.fusionController.getCoilStatus() == 1 ? "Yes" : "No"), 11, 16, this.fontRendererObj.drawString("Coils: " + (this.fusionController.getCoilStatus() == 1 ? "Yes" : "No"), 11, 16,
16448255); 16448255);
if (this.fusionController.getNeededPower() > 1 && this.fusionController.getCrafingTickTime() < 1) if (this.fusionController.getNeededPower() > 1 && this.fusionController.getCrafingTickTime() < 1)
this.fontRendererObj.drawString("Start: " this.fontRendererObj.drawString("Start: "
+ this.percentage(this.fusionController.getNeededPower(), (int) this.fusionController.getEnergy()) + this.percentage(this.fusionController.getNeededPower(), (int) this.fusionController.getEnergy())
+ "%", 11, 24, 16448255); + "%", 11, 24, 16448255);
} }
@ -82,10 +80,10 @@ public class GuiFusionReactor extends GuiContainer {
this.buttonList.add(button); this.buttonList.add(button);
super.initGui(); super.initGui();
final BlockPos coordinates = new BlockPos( final BlockPos coordinates = new BlockPos(
this.fusionController.getPos().getX() this.fusionController.getPos().getX()
- EnumFacing.getFront(this.fusionController.getFacingInt()).getFrontOffsetX() * 2, - EnumFacing.getFront(this.fusionController.getFacingInt()).getFrontOffsetX() * 2,
this.fusionController.getPos().getY() - 1, this.fusionController.getPos().getZ() this.fusionController.getPos().getY() - 1, this.fusionController.getPos().getZ()
- EnumFacing.getFront(this.fusionController.getFacingInt()).getFrontOffsetZ() * 2); - EnumFacing.getFront(this.fusionController.getFacingInt()).getFrontOffsetZ() * 2);
if (coordinates.equals(MultiblockRenderEvent.anchor)) { if (coordinates.equals(MultiblockRenderEvent.anchor)) {
ClientProxy.multiblockRenderEvent.setMultiblock(null); ClientProxy.multiblockRenderEvent.setMultiblock(null);
button.displayString = "B"; button.displayString = "B";
@ -96,7 +94,7 @@ public class GuiFusionReactor extends GuiContainer {
@Override @Override
protected void drawGuiContainerBackgroundLayer(final float p_146976_1_, final int p_146976_2_, protected void drawGuiContainerBackgroundLayer(final float p_146976_1_, final int p_146976_2_,
final int p_146976_3_) { final int p_146976_3_) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(GuiFusionReactor.texture); this.mc.getTextureManager().bindTexture(GuiFusionReactor.texture);
final int k = (this.width - this.xSize) / 2; final int k = (this.width - this.xSize) / 2;
@ -126,10 +124,10 @@ public class GuiFusionReactor extends GuiContainer {
final MultiblockSet set = new MultiblockSet(ClientMultiBlocks.reactor); final MultiblockSet set = new MultiblockSet(ClientMultiBlocks.reactor);
ClientProxy.multiblockRenderEvent.setMultiblock(set); ClientProxy.multiblockRenderEvent.setMultiblock(set);
ClientProxy.multiblockRenderEvent.parent = new Location(this.fusionController.getPos().getX(), ClientProxy.multiblockRenderEvent.parent = new Location(this.fusionController.getPos().getX(),
this.fusionController.getPos().getY(), this.fusionController.getPos().getZ(), this.fusionController.getPos().getY(), this.fusionController.getPos().getZ(),
this.fusionController.getWorld()); this.fusionController.getWorld());
MultiblockRenderEvent.anchor = new BlockPos(this.fusionController.getPos().getX(), MultiblockRenderEvent.anchor = new BlockPos(this.fusionController.getPos().getX(),
this.fusionController.getPos().getY() - 1, this.fusionController.getPos().getZ()); this.fusionController.getPos().getY() - 1, this.fusionController.getPos().getZ());
button.displayString = "A"; button.displayString = "A";
} else { } else {

View file

@ -29,14 +29,13 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n; import net.minecraft.util.text.translation.I18n;
import techreborn.tiles.generator.TileGasTurbine; import techreborn.tiles.generator.TileGasTurbine;
public class GuiGasTurbine extends GuiContainer { public class GuiGasTurbine extends GuiContainer {
// TODO: use semifluid generator texture // TODO: use semifluid generator texture
private static final ResourceLocation texture = new ResourceLocation("techreborn", private static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/thermal_generator.png"); "textures/gui/thermal_generator.png");
TileGasTurbine gasTurbine; TileGasTurbine gasTurbine;
@ -60,9 +59,9 @@ public class GuiGasTurbine extends GuiContainer {
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) { protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = "Gas Turbine"; final String name = "Gas Turbine";
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752); 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752); this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255); this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
this.fontRendererObj.drawString(this.gasTurbine.tank.getFluidAmount() + "", 10, 30, 16448255); this.fontRendererObj.drawString(this.gasTurbine.tank.getFluidAmount() + "", 10, 30, 16448255);
} }

View file

@ -29,13 +29,12 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n; import net.minecraft.util.text.translation.I18n;
import techreborn.tiles.multiblock.TileImplosionCompressor; import techreborn.tiles.multiblock.TileImplosionCompressor;
public class GuiImplosionCompressor extends GuiContainer { public class GuiImplosionCompressor extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn", public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/implosion_compressor.png"); "textures/gui/implosion_compressor.png");
TileImplosionCompressor compressor; TileImplosionCompressor compressor;

View file

@ -29,17 +29,15 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n; import net.minecraft.util.text.translation.I18n;
import techreborn.tiles.TileIndustrialElectrolyzer; import techreborn.tiles.TileIndustrialElectrolyzer;
public class GuiIndustrialElectrolyzer extends GuiContainer { public class GuiIndustrialElectrolyzer extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn", public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/industrial_electrolyzer.png"); "textures/gui/industrial_electrolyzer.png");
TileIndustrialElectrolyzer eletrolyzer; TileIndustrialElectrolyzer eletrolyzer;
public GuiIndustrialElectrolyzer(final EntityPlayer player, final TileIndustrialElectrolyzer tileeletrolyzer) { public GuiIndustrialElectrolyzer(final EntityPlayer player, final TileIndustrialElectrolyzer tileeletrolyzer) {
super(tileeletrolyzer.createContainer(player)); super(tileeletrolyzer.createContainer(player));
this.xSize = 176; this.xSize = 176;
@ -79,8 +77,8 @@ public class GuiIndustrialElectrolyzer extends GuiContainer {
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) { protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.translateToLocal("tile.techreborn.industrialelectrolyzer.name"); final String name = I18n.translateToLocal("tile.techreborn.industrialelectrolyzer.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752); 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752); this.ySize - 96 + 2, 4210752);
} }
} }

View file

@ -32,13 +32,12 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n; import net.minecraft.util.text.translation.I18n;
import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidStack;
import techreborn.tiles.multiblock.TileIndustrialSawmill; import techreborn.tiles.multiblock.TileIndustrialSawmill;
public class GuiIndustrialSawmill extends GuiContainer { public class GuiIndustrialSawmill extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn", public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/industrial_sawmill.png"); "textures/gui/industrial_sawmill.png");
TileIndustrialSawmill sawmill; TileIndustrialSawmill sawmill;
@ -82,7 +81,7 @@ public class GuiIndustrialSawmill extends GuiContainer {
if (!this.sawmill.getMutliBlock()) { if (!this.sawmill.getMutliBlock()) {
//GuiUtil.drawTooltipBox(k + 30, l + 50 + 12, 114, 10); //GuiUtil.drawTooltipBox(k + 30, l + 50 + 12, 114, 10);
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38,
l + 52 + 12, -1); l + 52 + 12, -1);
} }
} }
} }

View file

@ -29,13 +29,12 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n; import net.minecraft.util.text.translation.I18n;
import techreborn.tiles.TileIronFurnace; import techreborn.tiles.TileIronFurnace;
public class GuiIronFurnace extends GuiContainer { public class GuiIronFurnace extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("minecraft", public static final ResourceLocation texture = new ResourceLocation("minecraft",
"textures/gui/container/furnace.png"); "textures/gui/container/furnace.png");
TileIronFurnace furnace; TileIronFurnace furnace;
@ -71,9 +70,9 @@ public class GuiIronFurnace extends GuiContainer {
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) { protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.translateToLocal("tile.techreborn.ironfurnace.name"); final String name = I18n.translateToLocal("tile.techreborn.ironfurnace.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752); 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752); this.ySize - 96 + 2, 4210752);
} }
} }

View file

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

View file

@ -29,13 +29,12 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n; import net.minecraft.util.text.translation.I18n;
import techreborn.tiles.TileQuantumTank; import techreborn.tiles.TileQuantumTank;
public class GuiQuantumTank extends GuiContainer { public class GuiQuantumTank extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation("techreborn", private static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/thermal_generator.png"); "textures/gui/thermal_generator.png");
TileQuantumTank quantumTank; TileQuantumTank quantumTank;
@ -59,9 +58,9 @@ public class GuiQuantumTank extends GuiContainer {
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) { protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.translateToLocal("tile.techreborn.quantumTank.name"); final String name = I18n.translateToLocal("tile.techreborn.quantumTank.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752); 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752); this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255); this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
this.fontRendererObj.drawString(this.quantumTank.tank.getFluidAmount() + "", 10, 30, 16448255); this.fontRendererObj.drawString(this.quantumTank.tank.getFluidAmount() + "", 10, 30, 16448255);
} }

View file

@ -30,13 +30,12 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n; import net.minecraft.util.text.translation.I18n;
import techreborn.tiles.TileRollingMachine; import techreborn.tiles.TileRollingMachine;
public class GuiRollingMachine extends GuiContainer { public class GuiRollingMachine extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn", public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/rolling_machine.png"); "textures/gui/rolling_machine.png");
TileRollingMachine rollingMachine; TileRollingMachine rollingMachine;
public GuiRollingMachine(final EntityPlayer player, final TileRollingMachine tileRollingmachine) { public GuiRollingMachine(final EntityPlayer player, final TileRollingMachine tileRollingmachine) {
@ -67,9 +66,9 @@ public class GuiRollingMachine extends GuiContainer {
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) { protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.translateToLocal("tile.techreborn.rollingmachine.name"); final String name = I18n.translateToLocal("tile.techreborn.rollingmachine.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752); 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752); this.ySize - 96 + 2, 4210752);
} }
@Override @Override

View file

@ -29,13 +29,12 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n; import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import techreborn.tiles.TileScrapboxinator; import techreborn.tiles.TileScrapboxinator;
public class GuiScrapboxinator extends GuiContainer { public class GuiScrapboxinator extends GuiContainer {
public static final ResourceLocation texture = new ResourceLocation("techreborn", public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/scrapboxinator.png"); "textures/gui/scrapboxinator.png");
TileScrapboxinator scrapboxinator; TileScrapboxinator scrapboxinator;
@ -72,8 +71,8 @@ public class GuiScrapboxinator extends GuiContainer {
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) { protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = net.minecraft.util.text.translation.I18n.translateToLocal("tile.techreborn.scrapboxinator.name"); final String name = net.minecraft.util.text.translation.I18n.translateToLocal("tile.techreborn.scrapboxinator.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752); 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2,
4210752); 4210752);
} }
} }

View file

@ -29,16 +29,14 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n; import net.minecraft.util.text.translation.I18n;
import reborncore.client.RenderUtil; import reborncore.client.RenderUtil;
import techreborn.tiles.generator.TileSemifluidGenerator; import techreborn.tiles.generator.TileSemifluidGenerator;
public class GuiSemifluidGenerator extends GuiContainer { public class GuiSemifluidGenerator extends GuiContainer {
// TODO: use semifluid generator texture // TODO: use semifluid generator texture
private static final ResourceLocation texture = new ResourceLocation("techreborn", private static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/semifluid_generator.png"); "textures/gui/semifluid_generator.png");
TileSemifluidGenerator semifluidGenerator; TileSemifluidGenerator semifluidGenerator;
@ -63,10 +61,10 @@ public class GuiSemifluidGenerator extends GuiContainer {
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) { protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = "Semifluid Generator"; final String name = "Semifluid Generator";
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752); 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752); this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255); this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
this.fontRendererObj.drawString(this.semifluidGenerator.tank.getFluidAmount() + "", 10, 30, 16448255); this.fontRendererObj.drawString(this.semifluidGenerator.tank.getFluidAmount() + "", 10, 30, 16448255);
} }
} }

View file

@ -29,15 +29,13 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n; import net.minecraft.util.text.translation.I18n;
import reborncore.client.RenderUtil; import reborncore.client.RenderUtil;
import techreborn.tiles.generator.TileThermalGenerator; import techreborn.tiles.generator.TileThermalGenerator;
public class GuiThermalGenerator extends GuiContainer { public class GuiThermalGenerator extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation("techreborn", private static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/thermal_generator.png"); "textures/gui/thermal_generator.png");
TileThermalGenerator thermalGenerator; TileThermalGenerator thermalGenerator;
@ -62,9 +60,9 @@ public class GuiThermalGenerator extends GuiContainer {
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) { protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.translateToLocal("tile.techreborn.thermalGenerator.name"); final String name = I18n.translateToLocal("tile.techreborn.thermalGenerator.name");
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
4210752); 4210752);
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752); this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255); this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
this.fontRendererObj.drawString(this.thermalGenerator.tank.getFluidAmount() + "", 10, 30, 16448255); this.fontRendererObj.drawString(this.thermalGenerator.tank.getFluidAmount() + "", 10, 30, 16448255);
this.fontRendererObj.drawString(this.thermalGenerator.getEnergy() + "", 10, 40, 16448255); this.fontRendererObj.drawString(this.thermalGenerator.getEnergy() + "", 10, 40, 16448255);

View file

@ -333,7 +333,7 @@ public class TRBuilder extends GuiBuilder {
public void drawUpgrades(GuiScreen gui, IUpgradeable upgradeable, int posX, int posY) { public void drawUpgrades(GuiScreen gui, IUpgradeable upgradeable, int posX, int posY) {
Minecraft.getMinecraft().getTextureManager().bindTexture(GUI_SHEET); 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) { 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.block.state.IBlockState;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -62,7 +61,7 @@ public class GuiSideConfig extends GuiBase {
super.initGui(); super.initGui();
this.buttonList.clear(); this.buttonList.clear();
int i = 0; 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, "")); 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); super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND; final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
} }
@Override @Override
@ -82,11 +80,11 @@ public class GuiSideConfig extends GuiBase {
int offset = 10; int offset = 10;
RenderHelper.enableStandardItemLighting(); RenderHelper.enableStandardItemLighting();
RenderHelper.enableGUIStandardItemLighting(); RenderHelper.enableGUIStandardItemLighting();
for(EnumFacing facing : EnumFacing.VALUES){ for (EnumFacing facing : EnumFacing.VALUES) {
BlockPos pos = tileEntity.getPos().offset(facing); BlockPos pos = tileEntity.getPos().offset(facing);
IBlockState state = tileEntity.getWorld().getBlockState(pos); 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); 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); drawCentredString(stack.getDisplayName() + " - " + facing.getName(), offset += 22, 4210752, layer);
itemRender.renderItemIntoGUI(stack, 10, offset - 2); itemRender.renderItemIntoGUI(stack, 10, offset - 2);
} else { } else {

View file

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

View file

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

View file

@ -54,7 +54,7 @@ public class CTIndustrialGrinder extends CTGeneric {
fluidStack = CraftTweakerCompat.toFluidStack(fluid); fluidStack = CraftTweakerCompat.toFluidStack(fluid);
} }
IndustrialGrinderRecipe r = new IndustrialGrinderRecipe(oInput1, fluidStack, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), CraftTweakerCompat.toStack(output3), CraftTweakerCompat.toStack(output4), ticktime, euTick); IndustrialGrinderRecipe r = new IndustrialGrinderRecipe(oInput1, fluidStack, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), CraftTweakerCompat.toStack(output3), CraftTweakerCompat.toStack(output4), ticktime, euTick);
addRecipe(r); addRecipe(r);
} }

View file

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

View file

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

View file

@ -24,15 +24,13 @@
package techreborn.compat.jei; package techreborn.compat.jei;
import mezz.jei.api.recipe.transfer.IRecipeTransferInfo;
import net.minecraft.inventory.Slot; import net.minecraft.inventory.Slot;
import techreborn.client.container.builder.BuiltContainer; import techreborn.client.container.builder.BuiltContainer;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import mezz.jei.api.recipe.transfer.IRecipeTransferInfo;
public class BuiltContainerTransferInfo implements IRecipeTransferInfo<BuiltContainer> { public class BuiltContainerTransferInfo implements IRecipeTransferInfo<BuiltContainer> {
private final String containerName, recipeCategory; private final String containerName, recipeCategory;
@ -40,8 +38,8 @@ public class BuiltContainerTransferInfo implements IRecipeTransferInfo<BuiltCont
private final int recipeSlotStart, recipeSlotCount, inventorySlotStart, inventorySlotCount; private final int recipeSlotStart, recipeSlotCount, inventorySlotStart, inventorySlotCount;
public BuiltContainerTransferInfo(final String containerName, final String recipeCategory, public BuiltContainerTransferInfo(final String containerName, final String recipeCategory,
final int recipeSlotStart, final int recipeSlotCount, final int inventorySlotStart, final int recipeSlotStart, final int recipeSlotCount, final int inventorySlotStart,
final int inventorySlotCount) { final int inventorySlotCount) {
this.containerName = containerName; this.containerName = containerName;
this.recipeCategory = recipeCategory; this.recipeCategory = recipeCategory;

View file

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

View file

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

View file

@ -86,7 +86,7 @@ public class FluidGeneratorRecipeCategory extends BlankRecipeCategory<FluidGener
@Override @Override
public void setRecipe(IRecipeLayout recipeLayout, FluidGeneratorRecipeWrapper recipeWrapper, public void setRecipe(IRecipeLayout recipeLayout, FluidGeneratorRecipeWrapper recipeWrapper,
IIngredients ingredients) { IIngredients ingredients) {
IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks(); IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks();
guiFluidStacks.init(INPUT_TANKS[0], true, 4, 8, 12, 47, 10000, true, tankOverlay); guiFluidStacks.init(INPUT_TANKS[0], true, 4, 8, 12, 47, 10000, true, tankOverlay);

View file

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

View file

@ -24,13 +24,6 @@
package techreborn.compat.jei.generators.fluid; 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.IGuiHelper;
import mezz.jei.api.IJeiHelpers; import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.gui.IDrawable; import mezz.jei.api.gui.IDrawable;
@ -41,6 +34,12 @@ import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidStack;
import techreborn.api.generator.FluidGeneratorRecipe; 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 { public class FluidGeneratorRecipeWrapper extends BlankRecipeWrapper {
private static final DecimalFormat formatter; private static final DecimalFormat formatter;
@ -58,13 +57,17 @@ public class FluidGeneratorRecipeWrapper extends BlankRecipeWrapper {
private final FluidGeneratorRecipe baseRecipe; private final FluidGeneratorRecipe baseRecipe;
private final IDrawable energyProduced; private final IDrawable energyProduced;
public FluidGeneratorRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull FluidGeneratorRecipe recipe) { public FluidGeneratorRecipeWrapper(
@Nonnull
IJeiHelpers jeiHelpers,
@Nonnull
FluidGeneratorRecipe recipe) {
this.baseRecipe = recipe; this.baseRecipe = recipe;
IGuiHelper guiHelper = jeiHelpers.getGuiHelper(); IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
energyProduced = guiHelper.createDrawable(FluidGeneratorRecipeCategory.texture, 176, 3, energyProduced = guiHelper.createDrawable(FluidGeneratorRecipeCategory.texture, 176, 3,
(int) (25 * ((recipe.getEnergyPerMb() * 1000.0) / FLUID_GENERATOR_STORAGE)), 14); (int) (25 * ((recipe.getEnergyPerMb() * 1000.0) / FLUID_GENERATOR_STORAGE)), 14);
} }
@Override @Override
@ -74,7 +77,7 @@ public class FluidGeneratorRecipeWrapper extends BlankRecipeWrapper {
energyProduced.draw(minecraft, 73, 26); energyProduced.draw(minecraft, 73, 26);
minecraft.fontRendererObj.drawString(formatter.format(baseRecipe.getEnergyPerMb() * 1000) + " FE", 70, 13, minecraft.fontRendererObj.drawString(formatter.format(baseRecipe.getEnergyPerMb() * 1000) + " FE", 70, 13,
0x444444); 0x444444);
} }
@Override @Override

View file

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

View file

@ -44,15 +44,14 @@ public class IndustrialSawmillRecipeCategory extends BlankRecipeCategory<Industr
private final String title; private final String title;
public static final ResourceLocation texture = new ResourceLocation("techreborn", public static final ResourceLocation texture = new ResourceLocation("techreborn",
"textures/gui/industrial_sawmill.png"); "textures/gui/industrial_sawmill.png");
private final IDrawable background; private final IDrawable background;
private final IDrawable tankOverlay; private final IDrawable tankOverlay;
private static final int[] INPUT_SLOTS = { 0, 1 }; private static final int[] INPUT_SLOTS = { 0, 1 };
private static final int[] OUTPUT_SLOTS = { 2, 3, 4 }; private static final int[] OUTPUT_SLOTS = { 2, 3, 4 };
private static final int[] INPUT_TANKS = { 0 }; private static final int[] INPUT_TANKS = { 0 };
public IndustrialSawmillRecipeCategory(IGuiHelper guiHelper) {
public IndustrialSawmillRecipeCategory(IGuiHelper guiHelper){
title = Translator.translateToLocal("tile.techreborn.industrialsawmill.name"); title = Translator.translateToLocal("tile.techreborn.industrialsawmill.name");
background = guiHelper.createDrawable(texture, 7, 15, 141, 55); background = guiHelper.createDrawable(texture, 7, 15, 141, 55);
tankOverlay = guiHelper.createDrawable(texture, 176, 86, 12, 47); tankOverlay = guiHelper.createDrawable(texture, 176, 86, 12, 47);
@ -62,25 +61,25 @@ public class IndustrialSawmillRecipeCategory extends BlankRecipeCategory<Industr
public String getModName() { public String getModName() {
return ModInfo.MOD_NAME; return ModInfo.MOD_NAME;
} }
@Nonnull @Nonnull
@Override @Override
public String getUid() { public String getUid() {
return RecipeCategoryUids.INDUSTRIAL_SAWMILL; return RecipeCategoryUids.INDUSTRIAL_SAWMILL;
} }
@Nonnull @Nonnull
@Override @Override
public String getTitle() { public String getTitle() {
return title; return title;
} }
@Nonnull @Nonnull
@Override @Override
public IDrawable getBackground() { public IDrawable getBackground() {
return background; return background;
} }
@Override @Override
public void setRecipe(IRecipeLayout recipeLayout, IndustrialSawmillRecipeWrapper recipeWrapper, IIngredients ingredients) { public void setRecipe(IRecipeLayout recipeLayout, IndustrialSawmillRecipeWrapper recipeWrapper, IIngredients ingredients) {
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks(); IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
@ -90,11 +89,11 @@ public class IndustrialSawmillRecipeCategory extends BlankRecipeCategory<Industr
guiItemStacks.init(OUTPUT_SLOTS[0], false, 76, 19); guiItemStacks.init(OUTPUT_SLOTS[0], false, 76, 19);
guiItemStacks.init(OUTPUT_SLOTS[1], false, 94, 19); guiItemStacks.init(OUTPUT_SLOTS[1], false, 94, 19);
guiItemStacks.init(OUTPUT_SLOTS[2], false, 112, 19); guiItemStacks.init(OUTPUT_SLOTS[2], false, 112, 19);
IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks(); IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks();
guiFluidStacks.init(INPUT_TANKS[0], true, 4, 4, 12, 47, TileIndustrialSawmill.TANK_CAPACITY, true, tankOverlay); guiFluidStacks.init(INPUT_TANKS[0], true, 4, 4, 12, 47, TileIndustrialSawmill.TANK_CAPACITY, true, tankOverlay);
RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, INPUT_TANKS, null); RecipeUtil.setRecipeItems(recipeLayout, ingredients, INPUT_SLOTS, OUTPUT_SLOTS, INPUT_TANKS, null);
} }
} }

View file

@ -24,23 +24,24 @@
package techreborn.compat.jei.industrialSawmill; package techreborn.compat.jei.industrialSawmill;
import javax.annotation.Nonnull;
import mezz.jei.api.IJeiHelpers; import mezz.jei.api.IJeiHelpers;
import mezz.jei.api.recipe.IRecipeHandler; import mezz.jei.api.recipe.IRecipeHandler;
import mezz.jei.api.recipe.IRecipeWrapper; import mezz.jei.api.recipe.IRecipeWrapper;
import techreborn.Core;
import techreborn.api.recipe.machines.IndustrialSawmillRecipe; import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
import techreborn.compat.jei.RecipeCategoryUids; import techreborn.compat.jei.RecipeCategoryUids;
import javax.annotation.Nonnull;
public class IndustrialSawmillRecipeHandler implements IRecipeHandler<IndustrialSawmillRecipe> { public class IndustrialSawmillRecipeHandler implements IRecipeHandler<IndustrialSawmillRecipe> {
@Nonnull @Nonnull
private final IJeiHelpers jeiHelpers; private final IJeiHelpers jeiHelpers;
public IndustrialSawmillRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) { public IndustrialSawmillRecipeHandler(
@Nonnull
IJeiHelpers jeiHelpers) {
this.jeiHelpers = jeiHelpers; this.jeiHelpers = jeiHelpers;
} }
@Nonnull @Nonnull
@Override @Override
public Class<IndustrialSawmillRecipe> getRecipeClass() { public Class<IndustrialSawmillRecipe> getRecipeClass() {
@ -51,7 +52,7 @@ public class IndustrialSawmillRecipeHandler implements IRecipeHandler<Industrial
@Override @Override
public String getRecipeCategoryUid( public String getRecipeCategoryUid(
@Nonnull @Nonnull
IndustrialSawmillRecipe recipe) { IndustrialSawmillRecipe recipe) {
return RecipeCategoryUids.INDUSTRIAL_SAWMILL; return RecipeCategoryUids.INDUSTRIAL_SAWMILL;
} }
@ -59,14 +60,14 @@ public class IndustrialSawmillRecipeHandler implements IRecipeHandler<Industrial
@Override @Override
public IRecipeWrapper getRecipeWrapper( public IRecipeWrapper getRecipeWrapper(
@Nonnull @Nonnull
IndustrialSawmillRecipe recipe) { IndustrialSawmillRecipe recipe) {
return new IndustrialSawmillRecipeWrapper(jeiHelpers, recipe); return new IndustrialSawmillRecipeWrapper(jeiHelpers, recipe);
} }
@Override @Override
public boolean isRecipeValid( public boolean isRecipeValid(
@Nonnull @Nonnull
IndustrialSawmillRecipe recipe) { IndustrialSawmillRecipe recipe) {
return true; return true;
} }
} }

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