Auto format code
This commit is contained in:
parent
fc4d8686b8
commit
b25742dde0
175 changed files with 527 additions and 737 deletions
|
@ -219,7 +219,7 @@ public class Core {
|
|||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void LoadPackets(RegisterPacketEvent event){
|
||||
public void LoadPackets(RegisterPacketEvent event) {
|
||||
event.registerPacket(PacketSyncSideConfig.class, Side.SERVER);
|
||||
event.registerPacket(PacketAesu.class, Side.SERVER);
|
||||
event.registerPacket(PacketIdsu.class, Side.SERVER);
|
||||
|
|
|
@ -35,14 +35,9 @@ import net.minecraft.item.crafting.ShapelessRecipes;
|
|||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import reborncore.common.util.CraftingHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class RollingMachineRecipe {
|
||||
|
||||
|
@ -50,21 +45,21 @@ public class RollingMachineRecipe {
|
|||
private final HashMap<ResourceLocation, IRecipe> recipes = new HashMap<>();
|
||||
|
||||
public void addShapedOreRecipe(ResourceLocation resourceLocation, ItemStack outputItemStack, Object... objectInputs) {
|
||||
// Validate.notNull(outputItemStack);
|
||||
// Validate.notNull(outputItemStack.getItem());
|
||||
// if (objectInputs.length == 0) {
|
||||
// Validate.notNull(null); //Quick way to crash
|
||||
// }
|
||||
// recipes.put(resourceLocation, new ShapedOreRecipe(resourceLocation, outputItemStack, objectInputs));
|
||||
// Validate.notNull(outputItemStack);
|
||||
// Validate.notNull(outputItemStack.getItem());
|
||||
// if (objectInputs.length == 0) {
|
||||
// Validate.notNull(null); //Quick way to crash
|
||||
// }
|
||||
// recipes.put(resourceLocation, new ShapedOreRecipe(resourceLocation, outputItemStack, objectInputs));
|
||||
}
|
||||
|
||||
public void addShapelessOreRecipe(ResourceLocation resourceLocation, ItemStack outputItemStack, Object... objectInputs) {
|
||||
// Validate.notNull(outputItemStack);
|
||||
// Validate.notNull(outputItemStack.getItem());
|
||||
// if (objectInputs.length == 0) {
|
||||
// Validate.notNull(null); //Quick way to crash
|
||||
// }
|
||||
// recipes.put(resourceLocation, new ShapelessOreRecipe(resourceLocation, outputItemStack, objectInputs));
|
||||
// Validate.notNull(outputItemStack);
|
||||
// Validate.notNull(outputItemStack.getItem());
|
||||
// if (objectInputs.length == 0) {
|
||||
// Validate.notNull(null); //Quick way to crash
|
||||
// }
|
||||
// recipes.put(resourceLocation, new ShapelessOreRecipe(resourceLocation, outputItemStack, objectInputs));
|
||||
}
|
||||
|
||||
public void addRecipe(ResourceLocation resourceLocation, ItemStack output, Object... components) {
|
||||
|
@ -115,7 +110,7 @@ public class RollingMachineRecipe {
|
|||
recipes.put(resourceLocation, new ShapedRecipes("", j, k, recipeArray, output));
|
||||
}
|
||||
|
||||
public void addShapelessRecipe(ResourceLocation resourceLocation,ItemStack output, Object... components) {
|
||||
public void addShapelessRecipe(ResourceLocation resourceLocation, ItemStack output, Object... components) {
|
||||
NonNullList<Ingredient> ingredients = NonNullList.create();
|
||||
for (int j = 0; j < components.length; j++) {
|
||||
ingredients.add(CraftingHelper.toIngredient(components[j]));
|
||||
|
|
|
@ -44,15 +44,15 @@ public final class TechRebornAPI {
|
|||
}
|
||||
|
||||
public static void addShapelessOreRollingMachinceRecipe(ResourceLocation resourceLocation, ItemStack output, Object... components) {
|
||||
RollingMachineRecipe.instance.addShapelessOreRecipe(resourceLocation,output, components);
|
||||
RollingMachineRecipe.instance.addShapelessOreRecipe(resourceLocation, output, components);
|
||||
}
|
||||
|
||||
public static void addRollingMachinceRecipe(ResourceLocation resourceLocation, ItemStack output, Object... components) {
|
||||
RollingMachineRecipe.instance.addRecipe(resourceLocation,output, components);
|
||||
RollingMachineRecipe.instance.addRecipe(resourceLocation, output, components);
|
||||
}
|
||||
|
||||
public static void addShapelessRollingMachinceRecipe(ResourceLocation resourceLocation, ItemStack output, Object... components) {
|
||||
RollingMachineRecipe.instance.addShapelessRecipe(resourceLocation,output, components);
|
||||
RollingMachineRecipe.instance.addShapelessRecipe(resourceLocation, output, components);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -28,12 +28,14 @@ import javax.annotation.Nonnull;
|
|||
|
||||
public enum EFluidGenerator {
|
||||
THERMAL("TechReborn.ThermalGenerator"), GAS("TechReborn.GasGenerator"), DIESEL(
|
||||
"TechReborn.DieselGenerator"), SEMIFLUID("TechReborn.SemifluidGenerator");
|
||||
"TechReborn.DieselGenerator"), SEMIFLUID("TechReborn.SemifluidGenerator");
|
||||
|
||||
@Nonnull
|
||||
private final String recipeID;
|
||||
|
||||
private EFluidGenerator(@Nonnull String recipeID) {
|
||||
private EFluidGenerator(
|
||||
@Nonnull
|
||||
String recipeID) {
|
||||
this.recipeID = recipeID;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,9 +30,8 @@ public class FluidGeneratorRecipe {
|
|||
private final EFluidGenerator generatorType;
|
||||
private final Fluid fluid;
|
||||
private final int energyPerMb;
|
||||
|
||||
public FluidGeneratorRecipe(Fluid fluid, int energyPerMb, EFluidGenerator generatorType)
|
||||
{
|
||||
|
||||
public FluidGeneratorRecipe(Fluid fluid, int energyPerMb, EFluidGenerator generatorType) {
|
||||
this.fluid = fluid;
|
||||
this.energyPerMb = energyPerMb;
|
||||
this.generatorType = generatorType;
|
||||
|
@ -41,6 +40,7 @@ public class FluidGeneratorRecipe {
|
|||
public Fluid getFluid() {
|
||||
return fluid;
|
||||
}
|
||||
|
||||
public int getEnergyPerMb() {
|
||||
return energyPerMb;
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ public class FluidGeneratorRecipe {
|
|||
@Override
|
||||
public String toString() {
|
||||
return "FluidGeneratorRecipe [generatorType=" + generatorType + ", fluid=" + fluid + ", energyPerMb="
|
||||
+ energyPerMb + "]";
|
||||
+ energyPerMb + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -25,33 +25,29 @@
|
|||
package techreborn.api.generator;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Optional;
|
||||
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
|
||||
public class FluidGeneratorRecipeList {
|
||||
private HashSet<FluidGeneratorRecipe> recipes;
|
||||
|
||||
public FluidGeneratorRecipeList(FluidGeneratorRecipe... recipes)
|
||||
{
|
||||
|
||||
public FluidGeneratorRecipeList(FluidGeneratorRecipe... recipes) {
|
||||
this.recipes = Sets.newHashSet(recipes);
|
||||
}
|
||||
|
||||
|
||||
public boolean addRecipe(FluidGeneratorRecipe fluidGeneratorRecipe) {
|
||||
if(!this.getRecipeForFluid(fluidGeneratorRecipe.getFluid()).isPresent())
|
||||
if (!this.getRecipeForFluid(fluidGeneratorRecipe.getFluid()).isPresent())
|
||||
return this.getRecipes().add(fluidGeneratorRecipe);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean removeRecipe(FluidGeneratorRecipe fluidGeneratorRecipe)
|
||||
{
|
||||
|
||||
public boolean removeRecipe(FluidGeneratorRecipe fluidGeneratorRecipe) {
|
||||
return this.getRecipes().remove(fluidGeneratorRecipe);
|
||||
}
|
||||
|
||||
public Optional<FluidGeneratorRecipe> getRecipeForFluid(Fluid fluid)
|
||||
{
|
||||
|
||||
public Optional<FluidGeneratorRecipe> getRecipeForFluid(Fluid fluid) {
|
||||
return this.recipes.stream().filter(recipe -> recipe.getFluid().equals(fluid)).findAny();
|
||||
}
|
||||
|
||||
|
|
|
@ -24,10 +24,10 @@
|
|||
|
||||
package techreborn.api.generator;
|
||||
|
||||
import java.util.EnumMap;
|
||||
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
|
||||
import java.util.EnumMap;
|
||||
|
||||
public class GeneratorRecipeHelper {
|
||||
|
||||
/**
|
||||
|
@ -36,19 +36,17 @@ public class GeneratorRecipeHelper {
|
|||
* FluidGeneratorRecipe.
|
||||
*/
|
||||
public static EnumMap<EFluidGenerator, FluidGeneratorRecipeList> fluidRecipes = new EnumMap<>(
|
||||
EFluidGenerator.class);
|
||||
EFluidGenerator.class);
|
||||
|
||||
/**
|
||||
* Register a Fluid energy recipe.
|
||||
*
|
||||
* @param generatorType
|
||||
* A value of the EFluidGenerator type in which the fluid is
|
||||
* allowed to be consumed.
|
||||
*
|
||||
* @param generatorType A value of the EFluidGenerator type in which the fluid is
|
||||
* allowed to be consumed.
|
||||
* @param fluidType
|
||||
* @param energyPerMb
|
||||
* Represent the energy / MILLI_BUCKET the fluid will produce.
|
||||
* Some generators use this value to alter their fluid decay
|
||||
* speed to match their maximum energy output.
|
||||
* @param energyPerMb Represent the energy / MILLI_BUCKET the fluid will produce.
|
||||
* Some generators use this value to alter their fluid decay
|
||||
* speed to match their maximum energy output.
|
||||
*/
|
||||
public static void registerFluidRecipe(EFluidGenerator generatorType, Fluid fluidType, int energyPerMb) {
|
||||
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
|
||||
* allowed to be consumed.
|
||||
* @param generatorType A value of the EFluidGenerator type in which the fluid is
|
||||
* allowed to be consumed.
|
||||
* @return An object holding a set of availables recipes for this type of
|
||||
* FluidGenerator.
|
||||
* FluidGenerator.
|
||||
*/
|
||||
public static FluidGeneratorRecipeList getFluidRecipesForGenerator(EFluidGenerator generatorType) {
|
||||
return fluidRecipes.get(generatorType);
|
||||
|
|
|
@ -130,12 +130,12 @@ public abstract class BaseRecipe implements IBaseRecipeType, Cloneable {
|
|||
if (inuput == null) {
|
||||
throw new InvalidParameterException("input is invalid!");
|
||||
}
|
||||
if(inuput instanceof ItemStack){
|
||||
if(((ItemStack) inuput).isEmpty()){
|
||||
if (inuput instanceof ItemStack) {
|
||||
if (((ItemStack) inuput).isEmpty()) {
|
||||
throw new InvalidParameterException("input is invalid!");
|
||||
}
|
||||
}
|
||||
if(RecipeTranslator.getStackFromObject(inuput) == null){
|
||||
if (RecipeTranslator.getStackFromObject(inuput) == null) {
|
||||
throw new InvalidParameterException("Could not determin recipe input for " + inuput);
|
||||
}
|
||||
inputs.add(inuput);
|
||||
|
|
|
@ -27,10 +27,8 @@ package techreborn.blocks;
|
|||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -47,7 +45,7 @@ public class BlockComputerCube extends BlockMachineBase implements IAdvancedRota
|
|||
|
||||
@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,
|
||||
final float hitY, final float hitZ) {
|
||||
final float hitY, final float hitZ) {
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, EGui.MANUAL.ordinal(), world, x, y, z);
|
||||
return true;
|
||||
|
@ -73,4 +71,4 @@ public class BlockComputerCube extends BlockMachineBase implements IAdvancedRota
|
|||
return this.prefix + "computer_cube";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,10 +34,8 @@ import net.minecraft.tileentity.TileEntity;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.BlockFluidBase;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -83,8 +81,8 @@ public class BlockDigitalChest extends BlockMachineBase implements IAdvancedRota
|
|||
if (itemStack != ItemStack.EMPTY && itemStack.getCount() > 0) {
|
||||
if (itemStack.getItem() instanceof ItemBlock) {
|
||||
if (((ItemBlock) itemStack.getItem()).block instanceof BlockFluidBase
|
||||
|| ((ItemBlock) itemStack.getItem()).block instanceof BlockStaticLiquid
|
||||
|| ((ItemBlock) itemStack.getItem()).block instanceof BlockDynamicLiquid) {
|
||||
|| ((ItemBlock) itemStack.getItem()).block instanceof BlockStaticLiquid
|
||||
|| ((ItemBlock) itemStack.getItem()).block instanceof BlockDynamicLiquid) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -100,7 +98,7 @@ public class BlockDigitalChest extends BlockMachineBase implements IAdvancedRota
|
|||
final float dZ = rand.nextFloat() * 0.8F + 0.1F;
|
||||
|
||||
final EntityItem entityItem = new EntityItem(world, pos.getX() + dX, pos.getY() + dY, pos.getZ() + dZ,
|
||||
itemStack.copy());
|
||||
itemStack.copy());
|
||||
|
||||
if (itemStack.hasTagCompound()) {
|
||||
entityItem.getEntityItem().setTagCompound(itemStack.getTagCompound().copy());
|
||||
|
@ -122,7 +120,7 @@ public class BlockDigitalChest extends BlockMachineBase implements IAdvancedRota
|
|||
|
||||
@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,
|
||||
final float hitY, final float hitZ) {
|
||||
final float hitY, final float hitZ) {
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, EGui.DIGITAL_CHEST.ordinal(), world, x, y, z);
|
||||
return true;
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
package techreborn.blocks;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
|
|
|
@ -30,10 +30,8 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -52,9 +50,9 @@ public class BlockFusionControlComputer extends BlockMachineBase implements IAdv
|
|||
|
||||
@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,
|
||||
final float hitY, final float hitZ) {
|
||||
final float hitY, final float hitZ) {
|
||||
final TileEntityFusionController tileEntityFusionController = (TileEntityFusionController) world
|
||||
.getTileEntity(new BlockPos(x, y, z));
|
||||
.getTileEntity(new BlockPos(x, y, z));
|
||||
tileEntityFusionController.checkCoils();
|
||||
if (!player.isSneaking())
|
||||
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);
|
||||
if (worldIn.getTileEntity(pos) instanceof TileEntityFusionController) {
|
||||
if (((TileEntityFusionController) worldIn.getTileEntity(pos)).crafingTickTime != 0
|
||||
&& ((TileEntityFusionController) worldIn.getTileEntity(pos)).checkCoils()) {
|
||||
&& ((TileEntityFusionController) worldIn.getTileEntity(pos)).checkCoils()) {
|
||||
entityIn.attackEntityFrom(new FusionDamageSource(), 200F);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,6 @@ import net.minecraft.block.properties.PropertyInteger;
|
|||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
|
|
@ -31,7 +31,6 @@ import net.minecraft.block.state.BlockStateContainer;
|
|||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
|
|
@ -37,10 +37,8 @@ import net.minecraft.util.EnumHand;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.BlockFluidBase;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -87,8 +85,8 @@ public class BlockQuantumChest extends BlockMachineBase implements IAdvancedRota
|
|||
if (itemStack != ItemStack.EMPTY && itemStack.getCount() > 0) {
|
||||
if (itemStack.getItem() instanceof ItemBlock) {
|
||||
if (((ItemBlock) itemStack.getItem()).block instanceof BlockFluidBase
|
||||
|| ((ItemBlock) itemStack.getItem()).block instanceof BlockStaticLiquid
|
||||
|| ((ItemBlock) itemStack.getItem()).block instanceof BlockDynamicLiquid) {
|
||||
|| ((ItemBlock) itemStack.getItem()).block instanceof BlockStaticLiquid
|
||||
|| ((ItemBlock) itemStack.getItem()).block instanceof BlockDynamicLiquid) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -104,7 +102,7 @@ public class BlockQuantumChest extends BlockMachineBase implements IAdvancedRota
|
|||
final float dZ = rand.nextFloat() * 0.8F + 0.1F;
|
||||
|
||||
final EntityItem entityItem = new EntityItem(world, pos.getX() + dX, pos.getY() + dY, pos.getZ() + dZ,
|
||||
itemStack.copy());
|
||||
itemStack.copy());
|
||||
|
||||
if (itemStack.hasTagCompound()) {
|
||||
entityItem.getEntityItem().setTagCompound(itemStack.getTagCompound().copy());
|
||||
|
@ -126,7 +124,7 @@ public class BlockQuantumChest extends BlockMachineBase implements IAdvancedRota
|
|||
|
||||
@Override
|
||||
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())
|
||||
playerIn.openGui(Core.INSTANCE, EGui.QUANTUM_CHEST.ordinal(), worldIn, pos.getX(), pos.getY(), pos.getZ());
|
||||
return true;
|
||||
|
|
|
@ -28,10 +28,8 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -55,7 +53,7 @@ public class BlockQuantumTank extends BlockMachineBase implements IAdvancedRotat
|
|||
|
||||
@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,
|
||||
final float hitY, final float hitZ) {
|
||||
final float hitY, final float hitZ) {
|
||||
if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -28,7 +28,6 @@ import net.minecraft.block.BlockSapling;
|
|||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
|
|
@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -54,7 +52,7 @@ public class BlockBlastFurnace extends BlockMachineBase implements IRotationText
|
|||
|
||||
@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,
|
||||
final float hitY, final float hitZ) {
|
||||
final float hitY, final float hitZ) {
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, EGui.BLAST_FURNACE.ordinal(), world, x, y, z);
|
||||
return true;
|
||||
|
|
|
@ -27,10 +27,8 @@ package techreborn.blocks.advanced_machine;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -53,7 +51,7 @@ public class BlockCentrifuge extends BlockMachineBase implements IRotationTextur
|
|||
|
||||
@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,
|
||||
final float hitY, final float hitZ) {
|
||||
final float hitY, final float hitZ) {
|
||||
if (!player.isSneaking()) {
|
||||
player.openGui(Core.INSTANCE, EGui.CENTRIFUGE.ordinal(), world, x, y, z);
|
||||
}
|
||||
|
|
|
@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -54,7 +52,7 @@ public class BlockImplosionCompressor extends BlockMachineBase implements IRotat
|
|||
|
||||
@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,
|
||||
final float hitY, final float hitZ) {
|
||||
final float hitY, final float hitZ) {
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, EGui.IMPLOSION_COMPRESSOR.ordinal(), world, x, y, z);
|
||||
return true;
|
||||
|
|
|
@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -54,7 +52,7 @@ public class BlockIndustrialElectrolyzer extends BlockMachineBase implements IRo
|
|||
|
||||
@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,
|
||||
final float hitY, final float hitZ) {
|
||||
final float hitY, final float hitZ) {
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, EGui.INDUSTRIAL_ELECTROLYZER.ordinal(), world, x, y, z);
|
||||
return true;
|
||||
|
|
|
@ -29,10 +29,8 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -55,7 +53,7 @@ public class BlockIndustrialGrinder extends BlockMachineBase implements IRotatio
|
|||
|
||||
@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,
|
||||
final float hitY, final float hitZ) {
|
||||
final float hitY, final float hitZ) {
|
||||
if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -29,10 +29,8 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -55,7 +53,7 @@ public class BlockIndustrialSawmill extends BlockMachineBase implements IRotatio
|
|||
|
||||
@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,
|
||||
final float hitY, final float hitZ) {
|
||||
final float hitY, final float hitZ) {
|
||||
if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -68,7 +68,6 @@ public class BlockCable extends BlockContainer {
|
|||
public static final PropertyBool DOWN = PropertyBool.create("down");
|
||||
public static final IProperty<EnumCableType> TYPE = PropertyEnum.create("type", EnumCableType.class);
|
||||
|
||||
|
||||
public BlockCable() {
|
||||
super(Material.ROCK);
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
|
@ -122,7 +121,7 @@ public class BlockCable extends BlockContainer {
|
|||
|
||||
@Override
|
||||
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
for(EnumCableType cableType : EnumCableType.values()){
|
||||
for (EnumCableType cableType : EnumCableType.values()) {
|
||||
list.add(new ItemStack(this, 1, cableType.ordinal()));
|
||||
}
|
||||
}
|
||||
|
@ -158,7 +157,7 @@ public class BlockCable extends BlockContainer {
|
|||
IBlockState actualState = state;
|
||||
for (EnumFacing facing : EnumFacing.values()) {
|
||||
TileEntity tileEntity = getTileEntitySafely(worldIn, pos.offset(facing));
|
||||
if(tileEntity != null){
|
||||
if (tileEntity != null) {
|
||||
actualState = actualState.withProperty(getProperty(facing), tileEntity.hasCapability(CapabilityEnergy.ENERGY, facing.getOpposite()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ public enum EnumCableType implements IStringSerializable {
|
|||
return friendlyName.toLowerCase();
|
||||
}
|
||||
|
||||
public ItemStack getStack(){
|
||||
return new ItemStack(ModBlocks.CABLE,1, this.ordinal());
|
||||
public ItemStack getStack() {
|
||||
return new ItemStack(ModBlocks.CABLE, 1, this.ordinal());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,10 +29,8 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -55,7 +53,7 @@ public class BlockDieselGenerator extends BlockMachineBase implements IAdvancedR
|
|||
|
||||
@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,
|
||||
final float hitY, final float hitZ) {
|
||||
final float hitY, final float hitZ) {
|
||||
if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ package techreborn.blocks.generator;
|
|||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
|
|
|
@ -29,10 +29,8 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -55,7 +53,7 @@ public class BlockGasTurbine extends BlockMachineBase implements IAdvancedRotati
|
|||
|
||||
@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,
|
||||
final float hitY, final float hitZ) {
|
||||
final float hitY, final float hitZ) {
|
||||
if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -27,10 +27,8 @@ package techreborn.blocks.generator;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -53,7 +51,7 @@ public class BlockGenerator extends BlockMachineBase implements IRotationTexture
|
|||
|
||||
@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,
|
||||
final float hitY, final float hitZ) {
|
||||
final float hitY, final float hitZ) {
|
||||
if (!player.isSneaking()) {
|
||||
player.openGui(Core.INSTANCE, EGui.GENERATOR.ordinal(), world, x, y, z);
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ package techreborn.blocks.generator;
|
|||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
|
|
|
@ -29,10 +29,8 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -55,7 +53,7 @@ public class BlockSemiFluidGenerator extends BlockMachineBase implements IAdvanc
|
|||
|
||||
@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,
|
||||
final float hitY, final float hitZ) {
|
||||
final float hitY, final float hitZ) {
|
||||
if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -28,10 +28,8 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -54,7 +52,7 @@ public class BlockThermalGenerator extends BlockMachineBase implements IAdvanced
|
|||
|
||||
@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,
|
||||
final float hitY, final float hitZ) {
|
||||
final float hitY, final float hitZ) {
|
||||
if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -32,10 +32,8 @@ import net.minecraft.tileentity.TileEntity;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -61,7 +59,7 @@ public class BlockAlloyFurnace extends BlockMachineBase implements IRotationText
|
|||
|
||||
@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,
|
||||
final float hitY, final float hitZ) {
|
||||
final float hitY, final float hitZ) {
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, EGui.ALLOY_FURNACE.ordinal(), world, x, y, z);
|
||||
return true;
|
||||
|
|
|
@ -35,10 +35,8 @@ import net.minecraft.world.IBlockAccess;
|
|||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -65,7 +63,7 @@ public class BlockIronFurnace extends BlockMachineBase implements IRotationTextu
|
|||
|
||||
@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,
|
||||
final float hitY, final float hitZ) {
|
||||
final float hitY, final float hitZ) {
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, EGui.IRON_FURNACE.ordinal(), world, x, y, z);
|
||||
return true;
|
||||
|
@ -92,22 +90,22 @@ public class BlockIronFurnace extends BlockMachineBase implements IRotationTextu
|
|||
switch (enumfacing) {
|
||||
case WEST:
|
||||
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]);
|
||||
break;
|
||||
case EAST:
|
||||
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]);
|
||||
break;
|
||||
case NORTH:
|
||||
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]);
|
||||
break;
|
||||
case SOUTH:
|
||||
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]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -54,7 +52,7 @@ public class BlockAssemblingMachine extends BlockMachineBase implements IRotatio
|
|||
|
||||
@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,
|
||||
final float hitY, final float hitZ) {
|
||||
final float hitY, final float hitZ) {
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, EGui.ASSEMBLING_MACHINE.ordinal(), world, x, y, z);
|
||||
return true;
|
||||
|
|
|
@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -54,7 +52,7 @@ public class BlockChargeBench extends BlockMachineBase implements IRotationTextu
|
|||
|
||||
@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,
|
||||
final float hitY, final float hitZ) {
|
||||
final float hitY, final float hitZ) {
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, EGui.CHARGEBENCH.ordinal(), world, x, y, z);
|
||||
return true;
|
||||
|
|
|
@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -54,7 +52,7 @@ public class BlockChemicalReactor extends BlockMachineBase implements IRotationT
|
|||
|
||||
@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,
|
||||
final float hitY, final float hitZ) {
|
||||
final float hitY, final float hitZ) {
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, EGui.CHEMICAL_REACTOR.ordinal(), world, x, y, z);
|
||||
return true;
|
||||
|
|
|
@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -54,7 +52,7 @@ public class BlockChunkLoader extends BlockMachineBase implements IAdvancedRotat
|
|||
|
||||
@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,
|
||||
final float hitY, final float hitZ) {
|
||||
final float hitY, final float hitZ) {
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, EGui.CHUNK_LOADER.ordinal(), world, x, y, z);
|
||||
return true;
|
||||
|
|
|
@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -54,7 +52,7 @@ public class BlockMatterFabricator extends BlockMachineBase implements IAdvanced
|
|||
|
||||
@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,
|
||||
final float hitY, final float hitZ) {
|
||||
final float hitY, final float hitZ) {
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, EGui.MATTER_FABRICATOR.ordinal(), world, x, y, z);
|
||||
return true;
|
||||
|
|
|
@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -54,7 +52,7 @@ public class BlockRollingMachine extends BlockMachineBase implements IAdvancedRo
|
|||
|
||||
@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,
|
||||
final float hitY, final float hitZ) {
|
||||
final float hitY, final float hitZ) {
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, EGui.ROLLING_MACHINE.ordinal(), world, x, y, z);
|
||||
return true;
|
||||
|
|
|
@ -31,10 +31,8 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -59,7 +57,7 @@ public class BlockScrapboxinator extends BlockMachineBase implements IRotationTe
|
|||
|
||||
@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,
|
||||
final float hitY, final float hitZ) {
|
||||
final float hitY, final float hitZ) {
|
||||
if (!player.isSneaking()) {
|
||||
player.openGui(Core.INSTANCE, EGui.SCRAPBOXINATOR.ordinal(), world, x, y, z);
|
||||
}
|
||||
|
|
|
@ -32,10 +32,8 @@ import net.minecraft.util.EnumFacing;
|
|||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -57,7 +55,15 @@ public class BlockVacuumFreezer extends BlockMachineBase implements IAdvancedRot
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, final EntityPlayer player, final EnumHand hand, final EnumFacing side, final float hitX, final float hitY, final float hitZ) {
|
||||
public boolean onBlockActivated(final World world,
|
||||
final BlockPos pos,
|
||||
final IBlockState state,
|
||||
final EntityPlayer player,
|
||||
final EnumHand hand,
|
||||
final EnumFacing side,
|
||||
final float hitX,
|
||||
final float hitY,
|
||||
final float hitZ) {
|
||||
if (!player.isSneaking()) {
|
||||
player.openGui(Core.INSTANCE, EGui.VACUUM_FREEZER.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
|
||||
return true;
|
||||
|
|
|
@ -30,7 +30,6 @@ import net.minecraft.tileentity.TileEntity;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.tiles.TileAesu;
|
||||
|
|
|
@ -30,7 +30,6 @@ import net.minecraft.tileentity.TileEntity;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.tiles.storage.TileBatBox;
|
||||
|
||||
|
|
|
@ -32,7 +32,6 @@ import net.minecraft.util.EnumFacing;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.tiles.idsu.TileIDSU;
|
||||
|
||||
|
@ -51,7 +50,7 @@ public class BlockIDSU extends BlockEnergyStorage {
|
|||
|
||||
@Override
|
||||
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);
|
||||
if (tile instanceof TileIDSU) {
|
||||
((TileIDSU) tile).ownerUdid = placer.getUniqueID().toString();
|
||||
|
|
|
@ -30,7 +30,6 @@ import net.minecraft.tileentity.TileEntity;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.tiles.lesu.TileLesu;
|
||||
|
||||
|
|
|
@ -40,7 +40,8 @@ import techreborn.tiles.lesu.TileLesuStorage;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockLESUStorage extends BaseTileBlock {;
|
||||
public class BlockLESUStorage extends BaseTileBlock {
|
||||
;
|
||||
|
||||
public BlockLESUStorage(Material material) {
|
||||
super(material);
|
||||
|
|
|
@ -30,7 +30,6 @@ import net.minecraft.tileentity.TileEntity;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.tiles.storage.TileMFE;
|
||||
|
|
|
@ -30,7 +30,6 @@ import net.minecraft.tileentity.TileEntity;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.tiles.storage.TileMFSU;
|
||||
|
|
|
@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -54,7 +52,7 @@ public class BlockAlloySmelter extends BlockMachineBase implements IRotationText
|
|||
|
||||
@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,
|
||||
final float hitY, final float hitZ) {
|
||||
final float hitY, final float hitZ) {
|
||||
if (!player.isSneaking())
|
||||
player.openGui(Core.INSTANCE, EGui.ALLOY_SMELTER.ordinal(), world, x, y, z);
|
||||
return true;
|
||||
|
|
|
@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -54,7 +52,7 @@ public class BlockCompressor extends BlockMachineBase implements IRotationTextur
|
|||
|
||||
@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,
|
||||
final float hitY, final float hitZ) {
|
||||
final float hitY, final float hitZ) {
|
||||
if (!player.isSneaking()) {
|
||||
player.openGui(Core.INSTANCE, EGui.COMPRESSOR.ordinal(), world, x, y, z);
|
||||
}
|
||||
|
|
|
@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -54,7 +52,7 @@ public class BlockElectricFurnace extends BlockMachineBase implements IRotationT
|
|||
|
||||
@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,
|
||||
final float hitY, final float hitZ) {
|
||||
final float hitY, final float hitZ) {
|
||||
if (!player.isSneaking()) {
|
||||
player.openGui(Core.INSTANCE, EGui.ELECTRIC_FURNACE.ordinal(), world, x, y, z);
|
||||
}
|
||||
|
|
|
@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -54,7 +52,7 @@ public class BlockExtractor extends BlockMachineBase implements IRotationTexture
|
|||
|
||||
@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,
|
||||
final float hitY, final float hitZ) {
|
||||
final float hitY, final float hitZ) {
|
||||
if (!player.isSneaking()) {
|
||||
player.openGui(Core.INSTANCE, EGui.EXTRACTOR.ordinal(), world, x, y, z);
|
||||
}
|
||||
|
|
|
@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -54,7 +52,7 @@ public class BlockGrinder extends BlockMachineBase implements IAdvancedRotationT
|
|||
|
||||
@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,
|
||||
final float hitY, final float hitZ) {
|
||||
final float hitY, final float hitZ) {
|
||||
if (!player.isSneaking()) {
|
||||
player.openGui(Core.INSTANCE, EGui.GRINDER.ordinal(), world, x, y, z);
|
||||
}
|
||||
|
|
|
@ -28,10 +28,8 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IRotationTexture;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.EGui;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
|
@ -54,7 +52,7 @@ public class BlockRecycler extends BlockMachineBase implements IRotationTexture
|
|||
|
||||
@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,
|
||||
final float hitY, final float hitZ) {
|
||||
final float hitY, final float hitZ) {
|
||||
if (!player.isSneaking()) {
|
||||
player.openGui(Core.INSTANCE, EGui.RECYCLER.ordinal(), world, x, y, z);
|
||||
}
|
||||
|
|
|
@ -68,8 +68,7 @@ public enum EGui {
|
|||
|
||||
private final boolean containerBuilder;
|
||||
|
||||
private EGui(final boolean containerBuilder)
|
||||
{
|
||||
private EGui(final boolean containerBuilder) {
|
||||
this.containerBuilder = containerBuilder;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@ import net.minecraft.tileentity.TileEntity;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.network.IGuiHandler;
|
||||
|
||||
import techreborn.client.container.*;
|
||||
import techreborn.client.gui.*;
|
||||
import techreborn.manual.GuiManual;
|
||||
|
@ -48,7 +47,7 @@ public class GuiHandler implements IGuiHandler {
|
|||
|
||||
@Override
|
||||
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 TileEntity tile = world.getTileEntity(new BlockPos(x, y, z));
|
||||
|
@ -73,7 +72,7 @@ public class GuiHandler implements IGuiHandler {
|
|||
|
||||
@Override
|
||||
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 TileEntity tile = world.getTileEntity(new BlockPos(x, y, z));
|
||||
|
||||
|
|
|
@ -179,7 +179,7 @@ public class RegisterItemJsons {
|
|||
}
|
||||
|
||||
for (EnumCableType cableType : EnumCableType.values()) {
|
||||
registerBlockstate(ModBlocks.CABLE, cableType.ordinal(), "inv_" +cableType.getName().toLowerCase());
|
||||
registerBlockstate(ModBlocks.CABLE, cableType.ordinal(), "inv_" + cableType.getName().toLowerCase());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,6 @@ import net.minecraftforge.fml.relauncher.Side;
|
|||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.client.gui.slots.BaseSlot;
|
||||
import reborncore.common.container.RebornContainer;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.tiles.lesu.TileLesu;
|
||||
|
||||
public class ContainerLESU extends RebornContainer {
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import techreborn.client.container.builder.BuiltContainer;
|
||||
|
||||
public interface IContainerProvider {
|
||||
|
|
|
@ -24,16 +24,14 @@
|
|||
|
||||
package techreborn.client.container.builder;
|
||||
|
||||
import org.apache.commons.lang3.Range;
|
||||
import org.apache.commons.lang3.tuple.MutableTriple;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.*;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.apache.commons.lang3.Range;
|
||||
import org.apache.commons.lang3.tuple.MutableTriple;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.client.container.IRightClickHandler;
|
||||
|
||||
|
@ -58,8 +56,8 @@ public class BuiltContainer extends Container {
|
|||
private Integer[] integerParts;
|
||||
|
||||
public BuiltContainer(final String name, final Predicate<EntityPlayer> canInteract,
|
||||
final List<Range<Integer>> playerSlotRange,
|
||||
final List<Range<Integer>> tileSlotRange) {
|
||||
final List<Range<Integer>> playerSlotRange,
|
||||
final List<Range<Integer>> tileSlotRange) {
|
||||
this.name = name;
|
||||
|
||||
this.canInteract = canInteract;
|
||||
|
@ -107,10 +105,10 @@ public class BuiltContainer extends Container {
|
|||
|
||||
@Override
|
||||
public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, EntityPlayer player) {
|
||||
if(dragType == 1 && slotId > 0 && slotId < 1000){
|
||||
if (dragType == 1 && slotId > 0 && slotId < 1000) {
|
||||
Slot slot = this.inventorySlots.get(slotId);
|
||||
if(slot instanceof IRightClickHandler){
|
||||
if(((IRightClickHandler) slot).handleRightClick(slot.getSlotIndex(), player, this)){
|
||||
if (slot instanceof IRightClickHandler) {
|
||||
if (((IRightClickHandler) slot).handleRightClick(slot.getSlotIndex(), player, this)) {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
}
|
||||
|
@ -180,20 +178,16 @@ public class BuiltContainer extends Container {
|
|||
@Override
|
||||
public void updateProgressBar(final int id, final int value) {
|
||||
|
||||
if(id < this.shortValues.size())
|
||||
{
|
||||
if (id < this.shortValues.size()) {
|
||||
this.shortValues.get(id).getMiddle().accept((short) value);
|
||||
this.shortValues.get(id).setRight((short) value);
|
||||
}
|
||||
else if (id - this.shortValues.size() < this.integerValues.size() * 2)
|
||||
{
|
||||
} else if (id - this.shortValues.size() < this.integerValues.size() * 2) {
|
||||
|
||||
if ((id - this.shortValues.size()) % 2 == 0)
|
||||
this.integerParts[(id - this.shortValues.size()) / 2] = value;
|
||||
else
|
||||
{
|
||||
else {
|
||||
this.integerValues.get((id - this.shortValues.size()) / 2).getMiddle().accept(
|
||||
(this.integerParts[(id - this.shortValues.size()) / 2] & 0xFFFF) << 16 | value & 0xFFFF);
|
||||
(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 ItemStack stackInSlot = slot.getStack();
|
||||
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 max = Math.min(stackToShift.getMaxStackSize(), slot.getSlotStackLimit());
|
||||
if (resultingStackSize <= max) {
|
||||
|
@ -299,4 +293,4 @@ public class BuiltContainer extends Container {
|
|||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,14 +24,13 @@
|
|||
|
||||
package techreborn.client.container.builder;
|
||||
|
||||
import org.apache.commons.lang3.Range;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import org.apache.commons.lang3.Range;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -91,8 +90,8 @@ public class ContainerBuilder {
|
|||
|
||||
public BuiltContainer create() {
|
||||
final BuiltContainer built = new BuiltContainer(this.name, this.canInteract,
|
||||
this.playerInventoryRanges,
|
||||
this.tileInventoryRanges);
|
||||
this.playerInventoryRanges,
|
||||
this.tileInventoryRanges);
|
||||
if (!this.shortValues.isEmpty())
|
||||
built.addShortSync(this.shortValues);
|
||||
if (!this.integerValues.isEmpty())
|
||||
|
|
|
@ -24,9 +24,6 @@
|
|||
|
||||
package techreborn.client.container.builder;
|
||||
|
||||
import org.apache.commons.lang3.Range;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.inventory.SlotFurnaceFuel;
|
||||
|
@ -34,7 +31,8 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.energy.CapabilityEnergy;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
|
||||
import org.apache.commons.lang3.Range;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import reborncore.api.power.IEnergyInterfaceItem;
|
||||
import reborncore.api.recipe.IRecipeCrafterProvider;
|
||||
import reborncore.api.tile.IUpgrade;
|
||||
|
@ -43,7 +41,6 @@ import reborncore.client.gui.slots.BaseSlot;
|
|||
import reborncore.client.gui.slots.SlotFake;
|
||||
import reborncore.client.gui.slots.SlotOutput;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
|
||||
import techreborn.Core;
|
||||
import techreborn.client.container.builder.slot.FilteredSlot;
|
||||
import techreborn.client.container.builder.slot.UpgradeSlot;
|
||||
|
@ -63,7 +60,7 @@ public class ContainerTileInventoryBuilder {
|
|||
this.tile = tile;
|
||||
this.parent = parent;
|
||||
this.rangeStart = parent.slots.size();
|
||||
if(tile instanceof IUpgradeable){
|
||||
if (tile instanceof IUpgradeable) {
|
||||
upgradeSlots((IUpgradeable) tile);
|
||||
}
|
||||
}
|
||||
|
@ -84,7 +81,7 @@ public class ContainerTileInventoryBuilder {
|
|||
}
|
||||
|
||||
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));
|
||||
return this;
|
||||
}
|
||||
|
@ -92,20 +89,19 @@ public class ContainerTileInventoryBuilder {
|
|||
@SuppressWarnings("null")
|
||||
public ContainerTileInventoryBuilder energySlot(final int index, final int x, final int y) {
|
||||
this.parent.slots.add(new FilteredSlot(this.tile, index, x, y)
|
||||
.setFilter(stack -> stack.hasCapability(CapabilityEnergy.ENERGY, EnumFacing.UP)
|
||||
|| stack.getItem() instanceof IEnergyInterfaceItem));
|
||||
.setFilter(stack -> stack.hasCapability(CapabilityEnergy.ENERGY, EnumFacing.UP)
|
||||
|| stack.getItem() instanceof IEnergyInterfaceItem));
|
||||
return this;
|
||||
}
|
||||
|
||||
@SuppressWarnings("null")
|
||||
public ContainerTileInventoryBuilder fluidSlot(final int index, final int x, final int y) {
|
||||
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;
|
||||
}
|
||||
|
||||
public ContainerTileInventoryBuilder fuelSlot(final int index, final int x, final int y)
|
||||
{
|
||||
public ContainerTileInventoryBuilder fuelSlot(final int index, final int x, final int y) {
|
||||
this.parent.slots.add(new SlotFurnaceFuel(this.tile, index, x, y));
|
||||
return this;
|
||||
}
|
||||
|
@ -113,12 +109,12 @@ public class ContainerTileInventoryBuilder {
|
|||
@Deprecated
|
||||
public ContainerTileInventoryBuilder upgradeSlot(final int index, final int x, final int 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;
|
||||
}
|
||||
|
||||
private ContainerTileInventoryBuilder upgradeSlots(IUpgradeable upgradeable){
|
||||
if(upgradeable.canBeUpgraded()){
|
||||
private ContainerTileInventoryBuilder upgradeSlots(IUpgradeable upgradeable) {
|
||||
if (upgradeable.canBeUpgraded()) {
|
||||
for (int i = 0; i < upgradeable.getUpgradeSlotCount(); i++) {
|
||||
this.parent.slots.add(new UpgradeSlot(upgradeable.getUpgradeInvetory(), i, -19, i * 18 + 12));
|
||||
}
|
||||
|
@ -127,12 +123,9 @@ public class ContainerTileInventoryBuilder {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param supplier
|
||||
* The supplier must supply a variable holding inside a Short, it
|
||||
* will be truncated by force.
|
||||
* @param setter
|
||||
* The setter to call when the variable has been updated.
|
||||
* @param supplier The supplier must supply a variable holding inside a Short, it
|
||||
* will be truncated by force.
|
||||
* @param setter The setter to call when the variable has been updated.
|
||||
*/
|
||||
public ContainerTileInventoryBuilder syncShortValue(final IntSupplier supplier, final IntConsumer setter) {
|
||||
this.parent.shortValues.add(Pair.of(supplier, setter));
|
||||
|
@ -140,12 +133,9 @@ public class ContainerTileInventoryBuilder {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param supplier
|
||||
* The supplier it can supply a variable holding in an Integer it
|
||||
* will be split inside multiples shorts.
|
||||
* @param setter
|
||||
* The setter to call when the variable has been updated.
|
||||
* @param supplier The supplier it can supply a variable holding in an Integer it
|
||||
* will be split inside multiples shorts.
|
||||
* @param setter The setter to call when the variable has been updated.
|
||||
*/
|
||||
public ContainerTileInventoryBuilder syncIntegerValue(final IntSupplier supplier, final IntConsumer setter) {
|
||||
this.parent.integerValues.add(Pair.of(supplier, setter));
|
||||
|
@ -155,7 +145,7 @@ public class ContainerTileInventoryBuilder {
|
|||
public ContainerTileInventoryBuilder syncEnergyValue() {
|
||||
if (this.tile instanceof TilePowerAcceptor)
|
||||
return this.syncIntegerValue(() -> (int) ((TilePowerAcceptor) this.tile).getEnergy(),
|
||||
((TilePowerAcceptor) this.tile)::setEnergy)
|
||||
((TilePowerAcceptor) this.tile)::setEnergy)
|
||||
.syncIntegerValue(() -> (int) ((TilePowerAcceptor) this.tile).extraPowerStoage,
|
||||
((TilePowerAcceptor) this.tile)::setExtraPowerStoage);
|
||||
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() {
|
||||
if (this.tile instanceof IRecipeCrafterProvider)
|
||||
return this
|
||||
.syncIntegerValue(() -> ((IRecipeCrafterProvider) this.tile).getRecipeCrafter().currentTickTime,
|
||||
(currentTickTime) -> ((IRecipeCrafterProvider) this.tile)
|
||||
.getRecipeCrafter().currentTickTime = currentTickTime)
|
||||
.syncIntegerValue(() -> ((IRecipeCrafterProvider) this.tile).getRecipeCrafter().currentNeededTicks,
|
||||
(currentNeededTicks) -> ((IRecipeCrafterProvider) this.tile)
|
||||
.getRecipeCrafter().currentNeededTicks = currentNeededTicks);
|
||||
.syncIntegerValue(() -> ((IRecipeCrafterProvider) this.tile).getRecipeCrafter().currentTickTime,
|
||||
(currentTickTime) -> ((IRecipeCrafterProvider) this.tile)
|
||||
.getRecipeCrafter().currentTickTime = currentTickTime)
|
||||
.syncIntegerValue(() -> ((IRecipeCrafterProvider) this.tile).getRecipeCrafter().currentNeededTicks,
|
||||
(currentNeededTicks) -> ((IRecipeCrafterProvider) this.tile)
|
||||
.getRecipeCrafter().currentNeededTicks = currentNeededTicks);
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,14 +24,13 @@
|
|||
|
||||
package techreborn.client.container.builder.slot;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class SpriteSlot extends FilteredSlot {
|
||||
|
||||
private final String sprite;
|
||||
|
|
|
@ -31,7 +31,6 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import reborncore.api.tile.IUpgrade;
|
||||
import reborncore.api.tile.IUpgradeable;
|
||||
import reborncore.common.tile.TileBase;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.client.container.IRightClickHandler;
|
||||
import techreborn.client.container.builder.BuiltContainer;
|
||||
|
@ -46,7 +45,6 @@ public class UpgradeSlot extends Slot implements IRightClickHandler {
|
|||
super(inventory, index, xPosition, yPosition);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(final ItemStack stack) {
|
||||
return stack.getItem() instanceof IUpgrade;
|
||||
|
@ -59,15 +57,15 @@ public class UpgradeSlot extends Slot implements IRightClickHandler {
|
|||
|
||||
@Override
|
||||
public boolean handleRightClick(int slotID, EntityPlayer player, BuiltContainer container) {
|
||||
if(inventory instanceof Inventory){
|
||||
if (inventory instanceof Inventory) {
|
||||
Inventory inv = (Inventory) inventory;
|
||||
TileEntity tileEntity = inv.getTileBase();
|
||||
if(tileEntity instanceof IUpgradeable){
|
||||
if (tileEntity instanceof IUpgradeable) {
|
||||
IUpgradeable upgradeable = (IUpgradeable) tileEntity;
|
||||
if(upgradeable.canBeUpgraded()){
|
||||
if (upgradeable.canBeUpgraded()) {
|
||||
ItemStack stack = upgradeable.getUpgradeInvetory().getStackInSlot(slotID);
|
||||
if(!stack.isEmpty() && stack.getItem() instanceof IUpgrade){
|
||||
if(player.world.isRemote){
|
||||
if (!stack.isEmpty() && stack.getItem() instanceof IUpgrade) {
|
||||
if (player.world.isRemote) {
|
||||
((IUpgrade) stack.getItem()).handleRightClick(tileEntity, stack, container, slotID);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,13 +29,12 @@ import net.minecraft.client.renderer.GlStateManager;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
|
||||
import techreborn.tiles.TileAlloyFurnace;
|
||||
|
||||
public class GuiAlloyFurnace extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/alloy_furnace.png");
|
||||
"textures/gui/alloy_furnace.png");
|
||||
|
||||
TileAlloyFurnace alloyfurnace;
|
||||
|
||||
|
@ -73,8 +72,8 @@ public class GuiAlloyFurnace extends GuiContainer {
|
|||
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
|
||||
final String name = I18n.translateToLocal("tile.techreborn.alloyfurnace.name");
|
||||
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.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,13 +29,12 @@ import net.minecraft.client.renderer.GlStateManager;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
|
||||
import techreborn.tiles.TileAlloySmelter;
|
||||
|
||||
public class GuiAlloySmelter extends GuiContainer {
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/electric_alloy_furnace.png");
|
||||
"textures/gui/electric_alloy_furnace.png");
|
||||
|
||||
TileAlloySmelter alloysmelter;
|
||||
|
||||
|
@ -78,8 +77,8 @@ public class GuiAlloySmelter extends GuiContainer {
|
|||
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
|
||||
final String name = I18n.translateToLocal("tile.techreborn.alloysmelter.name");
|
||||
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.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,13 +29,12 @@ import net.minecraft.client.renderer.GlStateManager;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
|
||||
import techreborn.tiles.TileAssemblingMachine;
|
||||
|
||||
public class GuiAssemblingMachine extends GuiContainer {
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/assembling_machine.png");
|
||||
"textures/gui/assembling_machine.png");
|
||||
|
||||
TileAssemblingMachine assemblingmachine;
|
||||
|
||||
|
@ -78,8 +77,8 @@ public class GuiAssemblingMachine extends GuiContainer {
|
|||
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
|
||||
final String name = I18n.translateToLocal("tile.techreborn.assemblinmachine.name");
|
||||
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.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -112,22 +112,22 @@ public class GuiBase extends GuiContainer {
|
|||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int mouseX, int mouseY) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
builder.drawDefaultBackground(this, guiLeft, guiTop, xSize, ySize);
|
||||
if(drawPlayerSlots()){
|
||||
if (drawPlayerSlots()) {
|
||||
builder.drawPlayerSlots(this, guiLeft + xSize / 2, guiTop + 93, true);
|
||||
}
|
||||
if(tryAddUpgrades() && tile instanceof IUpgradeable){
|
||||
if (tryAddUpgrades() && tile instanceof IUpgradeable) {
|
||||
IUpgradeable upgradeable = (IUpgradeable) tile;
|
||||
if(upgradeable.canBeUpgraded()){
|
||||
if (upgradeable.canBeUpgraded()) {
|
||||
builder.drawUpgrades(this, upgradeable, guiLeft, guiTop);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean drawPlayerSlots(){
|
||||
public boolean drawPlayerSlots() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean tryAddUpgrades(){
|
||||
public boolean tryAddUpgrades() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,13 +30,12 @@ import net.minecraft.client.renderer.GlStateManager;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
|
||||
import techreborn.tiles.TileChunkLoader;
|
||||
|
||||
public class GuiChunkLoader extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/industrial_chunkloader.png");
|
||||
"textures/gui/industrial_chunkloader.png");
|
||||
TileChunkLoader chunkloader;
|
||||
private GuiButton plusOneButton;
|
||||
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_) {
|
||||
final String name = I18n.translateToLocal("tile.techreborn.chunkloader.name");
|
||||
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.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -29,15 +29,13 @@ import net.minecraft.client.renderer.GlStateManager;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
|
||||
import techreborn.tiles.generator.TileDieselGenerator;
|
||||
|
||||
public class GuiDieselGenerator extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/diesel_generator.png");
|
||||
"textures/gui/diesel_generator.png");
|
||||
|
||||
TileDieselGenerator dieselGenerator;
|
||||
|
||||
|
@ -61,14 +59,14 @@ public class GuiDieselGenerator extends GuiContainer {
|
|||
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
|
||||
final String name = I18n.translateToLocal("tile.techreborn.dieselgenerator.name");
|
||||
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.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
|
||||
this.fontRendererObj.drawString(this.dieselGenerator.tank.getFluidAmount() + "", 10, 30, 16448255);
|
||||
|
||||
this.fontRendererObj.drawString("Power Amount", 10, 40, 16448255);
|
||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(this.dieselGenerator.getEnergy()) + "", 10, 50,
|
||||
16448255);
|
||||
16448255);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ package techreborn.client.gui;
|
|||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import techreborn.tiles.TileDigitalChest;
|
||||
|
||||
public class GuiDigitalChest extends GuiBase {
|
||||
|
@ -54,12 +53,12 @@ public class GuiDigitalChest extends GuiBase {
|
|||
|
||||
if (this.digitalChest.storedItem != ItemStack.EMPTY && this.digitalChest.getStackInSlot(1) != null) {
|
||||
this.builder.drawBigBlueBar(this, 31, 43,
|
||||
this.digitalChest.storedItem.getCount() + this.digitalChest.getStackInSlot(1).getCount(),
|
||||
this.digitalChest.maxCapacity, mouseX - this.guiLeft, mouseY - this.guiTop, "Stored", layer);
|
||||
this.digitalChest.storedItem.getCount() + this.digitalChest.getStackInSlot(1).getCount(),
|
||||
this.digitalChest.maxCapacity, mouseX - this.guiLeft, mouseY - this.guiTop, "Stored", layer);
|
||||
}
|
||||
if (this.digitalChest.storedItem == ItemStack.EMPTY && this.digitalChest.getStackInSlot(1) != null) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,12 +32,10 @@ import net.minecraft.util.EnumFacing;
|
|||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
|
||||
import reborncore.client.multiblock.MultiblockRenderEvent;
|
||||
import reborncore.client.multiblock.MultiblockSet;
|
||||
import reborncore.common.misc.Location;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
|
||||
import techreborn.client.ClientMultiBlocks;
|
||||
import techreborn.proxies.ClientProxy;
|
||||
import techreborn.tiles.fusionReactor.TileEntityFusionController;
|
||||
|
@ -47,7 +45,7 @@ import java.io.IOException;
|
|||
public class GuiFusionReactor extends GuiContainer {
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/fusion_reactor.png");
|
||||
"textures/gui/fusion_reactor.png");
|
||||
|
||||
TileEntityFusionController fusionController;
|
||||
|
||||
|
@ -61,16 +59,16 @@ public class GuiFusionReactor extends GuiContainer {
|
|||
final String name = I18n.translateToLocal("tile.techreborn.fusioncontrolcomputer.name");
|
||||
this.fontRendererObj.drawString(name, 87, 6, 4210752);
|
||||
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,
|
||||
16448255);
|
||||
16448255);
|
||||
this.fontRendererObj.drawString("Coils: " + (this.fusionController.getCoilStatus() == 1 ? "Yes" : "No"), 11, 16,
|
||||
16448255);
|
||||
16448255);
|
||||
if (this.fusionController.getNeededPower() > 1 && this.fusionController.getCrafingTickTime() < 1)
|
||||
this.fontRendererObj.drawString("Start: "
|
||||
+ this.percentage(this.fusionController.getNeededPower(), (int) this.fusionController.getEnergy())
|
||||
+ "%", 11, 24, 16448255);
|
||||
+ this.percentage(this.fusionController.getNeededPower(), (int) this.fusionController.getEnergy())
|
||||
+ "%", 11, 24, 16448255);
|
||||
|
||||
}
|
||||
|
||||
|
@ -82,10 +80,10 @@ public class GuiFusionReactor extends GuiContainer {
|
|||
this.buttonList.add(button);
|
||||
super.initGui();
|
||||
final BlockPos coordinates = new BlockPos(
|
||||
this.fusionController.getPos().getX()
|
||||
this.fusionController.getPos().getX()
|
||||
- EnumFacing.getFront(this.fusionController.getFacingInt()).getFrontOffsetX() * 2,
|
||||
this.fusionController.getPos().getY() - 1, this.fusionController.getPos().getZ()
|
||||
- EnumFacing.getFront(this.fusionController.getFacingInt()).getFrontOffsetZ() * 2);
|
||||
this.fusionController.getPos().getY() - 1, this.fusionController.getPos().getZ()
|
||||
- EnumFacing.getFront(this.fusionController.getFacingInt()).getFrontOffsetZ() * 2);
|
||||
if (coordinates.equals(MultiblockRenderEvent.anchor)) {
|
||||
ClientProxy.multiblockRenderEvent.setMultiblock(null);
|
||||
button.displayString = "B";
|
||||
|
@ -96,7 +94,7 @@ public class GuiFusionReactor extends GuiContainer {
|
|||
|
||||
@Override
|
||||
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);
|
||||
this.mc.getTextureManager().bindTexture(GuiFusionReactor.texture);
|
||||
final int k = (this.width - this.xSize) / 2;
|
||||
|
@ -126,10 +124,10 @@ public class GuiFusionReactor extends GuiContainer {
|
|||
final MultiblockSet set = new MultiblockSet(ClientMultiBlocks.reactor);
|
||||
ClientProxy.multiblockRenderEvent.setMultiblock(set);
|
||||
ClientProxy.multiblockRenderEvent.parent = new Location(this.fusionController.getPos().getX(),
|
||||
this.fusionController.getPos().getY(), this.fusionController.getPos().getZ(),
|
||||
this.fusionController.getWorld());
|
||||
this.fusionController.getPos().getY(), this.fusionController.getPos().getZ(),
|
||||
this.fusionController.getWorld());
|
||||
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";
|
||||
} else {
|
||||
|
|
|
@ -29,14 +29,13 @@ import net.minecraft.client.renderer.GlStateManager;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
|
||||
import techreborn.tiles.generator.TileGasTurbine;
|
||||
|
||||
public class GuiGasTurbine extends GuiContainer {
|
||||
|
||||
// TODO: use semifluid generator texture
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/thermal_generator.png");
|
||||
"textures/gui/thermal_generator.png");
|
||||
|
||||
TileGasTurbine gasTurbine;
|
||||
|
||||
|
@ -60,9 +59,9 @@ public class GuiGasTurbine extends GuiContainer {
|
|||
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
|
||||
final String name = "Gas Turbine";
|
||||
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.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
|
||||
this.fontRendererObj.drawString(this.gasTurbine.tank.getFluidAmount() + "", 10, 30, 16448255);
|
||||
}
|
||||
|
|
|
@ -29,13 +29,12 @@ import net.minecraft.client.renderer.GlStateManager;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
|
||||
import techreborn.tiles.multiblock.TileImplosionCompressor;
|
||||
|
||||
public class GuiImplosionCompressor extends GuiContainer {
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/implosion_compressor.png");
|
||||
"textures/gui/implosion_compressor.png");
|
||||
|
||||
TileImplosionCompressor compressor;
|
||||
|
||||
|
|
|
@ -29,17 +29,15 @@ import net.minecraft.client.renderer.GlStateManager;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
|
||||
import techreborn.tiles.TileIndustrialElectrolyzer;
|
||||
|
||||
public class GuiIndustrialElectrolyzer extends GuiContainer {
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/industrial_electrolyzer.png");
|
||||
"textures/gui/industrial_electrolyzer.png");
|
||||
|
||||
TileIndustrialElectrolyzer eletrolyzer;
|
||||
|
||||
|
||||
public GuiIndustrialElectrolyzer(final EntityPlayer player, final TileIndustrialElectrolyzer tileeletrolyzer) {
|
||||
super(tileeletrolyzer.createContainer(player));
|
||||
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_) {
|
||||
final String name = I18n.translateToLocal("tile.techreborn.industrialelectrolyzer.name");
|
||||
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.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,13 +32,12 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import techreborn.tiles.multiblock.TileIndustrialSawmill;
|
||||
|
||||
public class GuiIndustrialSawmill extends GuiContainer {
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/industrial_sawmill.png");
|
||||
"textures/gui/industrial_sawmill.png");
|
||||
|
||||
TileIndustrialSawmill sawmill;
|
||||
|
||||
|
@ -82,7 +81,7 @@ public class GuiIndustrialSawmill extends GuiContainer {
|
|||
if (!this.sawmill.getMutliBlock()) {
|
||||
//GuiUtil.drawTooltipBox(k + 30, l + 50 + 12, 114, 10);
|
||||
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38,
|
||||
l + 52 + 12, -1);
|
||||
l + 52 + 12, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,13 +29,12 @@ import net.minecraft.client.renderer.GlStateManager;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
|
||||
import techreborn.tiles.TileIronFurnace;
|
||||
|
||||
public class GuiIronFurnace extends GuiContainer {
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("minecraft",
|
||||
"textures/gui/container/furnace.png");
|
||||
"textures/gui/container/furnace.png");
|
||||
|
||||
TileIronFurnace furnace;
|
||||
|
||||
|
@ -71,9 +70,9 @@ public class GuiIronFurnace extends GuiContainer {
|
|||
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
|
||||
final String name = I18n.translateToLocal("tile.techreborn.ironfurnace.name");
|
||||
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.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ package techreborn.client.gui;
|
|||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import techreborn.tiles.TileQuantumChest;
|
||||
|
||||
public class GuiQuantumChest extends GuiBase {
|
||||
|
|
|
@ -29,13 +29,12 @@ import net.minecraft.client.renderer.GlStateManager;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
|
||||
import techreborn.tiles.TileQuantumTank;
|
||||
|
||||
public class GuiQuantumTank extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/thermal_generator.png");
|
||||
"textures/gui/thermal_generator.png");
|
||||
|
||||
TileQuantumTank quantumTank;
|
||||
|
||||
|
@ -59,9 +58,9 @@ public class GuiQuantumTank extends GuiContainer {
|
|||
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
|
||||
final String name = I18n.translateToLocal("tile.techreborn.quantumTank.name");
|
||||
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.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
|
||||
this.fontRendererObj.drawString(this.quantumTank.tank.getFluidAmount() + "", 10, 30, 16448255);
|
||||
}
|
||||
|
|
|
@ -30,13 +30,12 @@ import net.minecraft.client.renderer.GlStateManager;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
|
||||
import techreborn.tiles.TileRollingMachine;
|
||||
|
||||
public class GuiRollingMachine extends GuiContainer {
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/rolling_machine.png");
|
||||
"textures/gui/rolling_machine.png");
|
||||
TileRollingMachine rollingMachine;
|
||||
|
||||
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_) {
|
||||
final String name = I18n.translateToLocal("tile.techreborn.rollingmachine.name");
|
||||
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.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -29,13 +29,12 @@ import net.minecraft.client.renderer.GlStateManager;
|
|||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import techreborn.tiles.TileScrapboxinator;
|
||||
|
||||
public class GuiScrapboxinator extends GuiContainer {
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/scrapboxinator.png");
|
||||
"textures/gui/scrapboxinator.png");
|
||||
|
||||
TileScrapboxinator scrapboxinator;
|
||||
|
||||
|
@ -72,8 +71,8 @@ public class GuiScrapboxinator extends GuiContainer {
|
|||
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");
|
||||
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,
|
||||
4210752);
|
||||
4210752);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,16 +29,14 @@ import net.minecraft.client.renderer.GlStateManager;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
|
||||
import reborncore.client.RenderUtil;
|
||||
|
||||
import techreborn.tiles.generator.TileSemifluidGenerator;
|
||||
|
||||
public class GuiSemifluidGenerator extends GuiContainer {
|
||||
|
||||
// TODO: use semifluid generator texture
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/semifluid_generator.png");
|
||||
"textures/gui/semifluid_generator.png");
|
||||
|
||||
TileSemifluidGenerator semifluidGenerator;
|
||||
|
||||
|
@ -63,10 +61,10 @@ public class GuiSemifluidGenerator extends GuiContainer {
|
|||
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
|
||||
final String name = "Semifluid Generator";
|
||||
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.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
|
||||
this.fontRendererObj.drawString(this.semifluidGenerator.tank.getFluidAmount() + "", 10, 30, 16448255);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,15 +29,13 @@ import net.minecraft.client.renderer.GlStateManager;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
|
||||
import reborncore.client.RenderUtil;
|
||||
|
||||
import techreborn.tiles.generator.TileThermalGenerator;
|
||||
|
||||
public class GuiThermalGenerator extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||
"textures/gui/thermal_generator.png");
|
||||
"textures/gui/thermal_generator.png");
|
||||
|
||||
TileThermalGenerator thermalGenerator;
|
||||
|
||||
|
@ -62,9 +60,9 @@ public class GuiThermalGenerator extends GuiContainer {
|
|||
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
|
||||
final String name = I18n.translateToLocal("tile.techreborn.thermalGenerator.name");
|
||||
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.ySize - 96 + 2, 4210752);
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
|
||||
this.fontRendererObj.drawString(this.thermalGenerator.tank.getFluidAmount() + "", 10, 30, 16448255);
|
||||
this.fontRendererObj.drawString(this.thermalGenerator.getEnergy() + "", 10, 40, 16448255);
|
||||
|
|
|
@ -333,7 +333,7 @@ public class TRBuilder extends GuiBuilder {
|
|||
|
||||
public void drawUpgrades(GuiScreen gui, IUpgradeable upgradeable, int posX, int posY) {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(GUI_SHEET);
|
||||
gui.drawTexturedModalRect(posX -27, posY + 4, 126, 151, 30, 87);
|
||||
gui.drawTexturedModalRect(posX - 27, posY + 4, 126, 151, 30, 87);
|
||||
}
|
||||
|
||||
public void drawScrapSlot(GuiScreen gui, int posX, int posY) {
|
||||
|
|
|
@ -27,7 +27,6 @@ package techreborn.client.gui.upgrades;
|
|||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -62,7 +61,7 @@ public class GuiSideConfig extends GuiBase {
|
|||
super.initGui();
|
||||
this.buttonList.clear();
|
||||
int i = 0;
|
||||
for(EnumFacing facing : EnumFacing.VALUES){
|
||||
for (EnumFacing facing : EnumFacing.VALUES) {
|
||||
buttonList.add(new GuiButton(facing.getIndex(), guiLeft + 150, guiTop + i++ * 23 + 22, 20, 20, "✓"));
|
||||
}
|
||||
}
|
||||
|
@ -72,7 +71,6 @@ public class GuiSideConfig extends GuiBase {
|
|||
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -82,11 +80,11 @@ public class GuiSideConfig extends GuiBase {
|
|||
int offset = 10;
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
for(EnumFacing facing : EnumFacing.VALUES){
|
||||
for (EnumFacing facing : EnumFacing.VALUES) {
|
||||
BlockPos pos = tileEntity.getPos().offset(facing);
|
||||
IBlockState state = tileEntity.getWorld().getBlockState(pos);
|
||||
ItemStack stack = state.getBlock().getPickBlock(state, new RayTraceResult(new Vec3d(0, 0, 0), facing, pos), tileEntity.getWorld(), pos, Minecraft.getMinecraft().player);
|
||||
if(stack != null && !stack.isEmpty() && stack.getItem() != null){
|
||||
if (stack != null && !stack.isEmpty() && stack.getItem() != null) {
|
||||
drawCentredString(stack.getDisplayName() + " - " + facing.getName(), offset += 22, 4210752, layer);
|
||||
itemRender.renderItemIntoGUI(stack, 10, offset - 2);
|
||||
} else {
|
||||
|
|
|
@ -114,7 +114,7 @@ public class TechRebornDevCommand extends CommandBase {
|
|||
sender.sendMessage(new TextComponentString(e.getLocalizedMessage()));
|
||||
}
|
||||
} else if ("ores".equals(args[0])) {
|
||||
for(String ore: OreDictionary.getOreNames()){
|
||||
for (String ore : OreDictionary.getOreNames()) {
|
||||
System.out.println(ore);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -158,7 +158,7 @@ public class CTGeneric {
|
|||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(name)) {
|
||||
for (Object stack : recipeType.getInputs()) {
|
||||
if(stack instanceof ItemStack){
|
||||
if (stack instanceof ItemStack) {
|
||||
if (output.matches(MineTweakerMC.getIItemStack((ItemStack) stack))) {
|
||||
removedRecipes.add((BaseRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
|
|
|
@ -54,7 +54,7 @@ public class CTIndustrialGrinder extends CTGeneric {
|
|||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@ import reborncore.common.util.ItemUtils;
|
|||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.RollingMachineRecipe;
|
||||
import techreborn.api.TechRebornAPI;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -44,17 +43,16 @@ import java.util.Map;
|
|||
@ZenClass("mods.techreborn.rollingMachine")
|
||||
public class CTRollingMachine {
|
||||
|
||||
|
||||
//TODO 1.12 Crafttweaker
|
||||
// @ZenMethod
|
||||
// public static void addShaped(IItemStack output, IIngredient[][] ingredients) {
|
||||
// TechRebornAPI.addRollingOreMachinceRecipe(toStack(output), toShapedObjects(ingredients));
|
||||
// }
|
||||
// @ZenMethod
|
||||
// public static void addShaped(IItemStack output, IIngredient[][] ingredients) {
|
||||
// TechRebornAPI.addRollingOreMachinceRecipe(toStack(output), toShapedObjects(ingredients));
|
||||
// }
|
||||
|
||||
// @ZenMethod
|
||||
// public static void addShapeless(IItemStack output, IIngredient[] ingredients) {
|
||||
// TechRebornAPI.addShapelessOreRollingMachinceRecipe(toStack(output), toObjects(ingredients));
|
||||
// }
|
||||
// @ZenMethod
|
||||
// public static void addShapeless(IItemStack output, IIngredient[] ingredients) {
|
||||
// TechRebornAPI.addShapelessOreRollingMachinceRecipe(toStack(output), toObjects(ingredients));
|
||||
// }
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
|
@ -64,7 +62,7 @@ public class CTRollingMachine {
|
|||
toRemove.add(recipe.getKey());
|
||||
}
|
||||
}
|
||||
for(ResourceLocation resourceLocation : toRemove){
|
||||
for (ResourceLocation resourceLocation : toRemove) {
|
||||
RollingMachineRecipe.instance.getRecipeList().remove(resourceLocation);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ public abstract class BaseRecipeWrapper<T extends BaseRecipe> extends BlankRecip
|
|||
inputs = new ArrayList<>();
|
||||
outputs = new ArrayList<>();
|
||||
for (Object input : baseRecipe.getInputs()) {
|
||||
if(input instanceof ItemStack){
|
||||
if (input instanceof ItemStack) {
|
||||
ItemStack stack = (ItemStack) input;
|
||||
if (baseRecipe.useOreDic()) {
|
||||
List<ItemStack> oreDictInputs = expandOreDict(stack);
|
||||
|
@ -55,7 +55,7 @@ public abstract class BaseRecipeWrapper<T extends BaseRecipe> extends BlankRecip
|
|||
} else {
|
||||
inputs.add(Collections.singletonList(stack));
|
||||
}
|
||||
} else if (input instanceof String){
|
||||
} else if (input instanceof String) {
|
||||
inputs.add(OreDictionary.getOres((String) input));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,15 +24,13 @@
|
|||
|
||||
package techreborn.compat.jei;
|
||||
|
||||
import mezz.jei.api.recipe.transfer.IRecipeTransferInfo;
|
||||
import net.minecraft.inventory.Slot;
|
||||
|
||||
import techreborn.client.container.builder.BuiltContainer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import mezz.jei.api.recipe.transfer.IRecipeTransferInfo;
|
||||
|
||||
public class BuiltContainerTransferInfo implements IRecipeTransferInfo<BuiltContainer> {
|
||||
|
||||
private final String containerName, recipeCategory;
|
||||
|
@ -40,8 +38,8 @@ public class BuiltContainerTransferInfo implements IRecipeTransferInfo<BuiltCont
|
|||
private final int recipeSlotStart, recipeSlotCount, inventorySlotStart, inventorySlotCount;
|
||||
|
||||
public BuiltContainerTransferInfo(final String containerName, final String recipeCategory,
|
||||
final int recipeSlotStart, final int recipeSlotCount, final int inventorySlotStart,
|
||||
final int inventorySlotCount) {
|
||||
final int recipeSlotStart, final int recipeSlotCount, final int inventorySlotStart,
|
||||
final int inventorySlotCount) {
|
||||
this.containerName = containerName;
|
||||
this.recipeCategory = recipeCategory;
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@ public class TechRebornJeiPlugin extends BlankModPlugin {
|
|||
new CompressorRecipeCategory(guiHelper), new ScrapboxRecipeCategory(guiHelper),
|
||||
new IndustrialSawmillRecipeCategory(guiHelper));
|
||||
|
||||
if(!IC2Duplicates.deduplicate()){
|
||||
if (!IC2Duplicates.deduplicate()) {
|
||||
registry.addRecipeCategories(new ExtractorRecipeCategory(guiHelper));
|
||||
registry.addRecipeHandlers(new ExtractorRecipeHandler(jeiHelpers));
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ public class ChemicalReactorRecipeWrapper extends BaseRecipeWrapper<ChemicalReac
|
|||
progressright.draw(minecraft, 25, 12);
|
||||
progressleft.draw(minecraft, 75, 12);
|
||||
|
||||
int y = 30 ;
|
||||
int y = 30;
|
||||
int lineHeight = minecraft.fontRendererObj.FONT_HEIGHT;
|
||||
|
||||
minecraft.fontRendererObj.drawString(baseRecipe.tickTime / 20 + " seconds", (recipeWidth / 2 - minecraft.fontRendererObj.getStringWidth(baseRecipe.tickTime / 20 + " seconds") / 2), y, 0x444444);
|
||||
|
|
|
@ -86,7 +86,7 @@ public class FluidGeneratorRecipeCategory extends BlankRecipeCategory<FluidGener
|
|||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, FluidGeneratorRecipeWrapper recipeWrapper,
|
||||
IIngredients ingredients) {
|
||||
IIngredients ingredients) {
|
||||
|
||||
IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks();
|
||||
guiFluidStacks.init(INPUT_TANKS[0], true, 4, 8, 12, 47, 10000, true, tankOverlay);
|
||||
|
|
|
@ -24,18 +24,20 @@
|
|||
|
||||
package techreborn.compat.jei.generators.fluid;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.api.generator.FluidGeneratorRecipe;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class FluidGeneratorRecipeHandler implements IRecipeHandler<FluidGeneratorRecipe> {
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public FluidGeneratorRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) {
|
||||
public FluidGeneratorRecipeHandler(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,13 +24,6 @@
|
|||
|
||||
package techreborn.compat.jei.generators.fluid;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.DecimalFormatSymbols;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.Locale;
|
||||
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
|
@ -41,6 +34,12 @@ import net.minecraftforge.fluids.Fluid;
|
|||
import net.minecraftforge.fluids.FluidStack;
|
||||
import techreborn.api.generator.FluidGeneratorRecipe;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.DecimalFormatSymbols;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.Locale;
|
||||
|
||||
public class FluidGeneratorRecipeWrapper extends BlankRecipeWrapper {
|
||||
|
||||
private static final DecimalFormat formatter;
|
||||
|
@ -58,13 +57,17 @@ public class FluidGeneratorRecipeWrapper extends BlankRecipeWrapper {
|
|||
private final FluidGeneratorRecipe baseRecipe;
|
||||
private final IDrawable energyProduced;
|
||||
|
||||
public FluidGeneratorRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull FluidGeneratorRecipe recipe) {
|
||||
public FluidGeneratorRecipeWrapper(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers,
|
||||
@Nonnull
|
||||
FluidGeneratorRecipe recipe) {
|
||||
|
||||
this.baseRecipe = recipe;
|
||||
|
||||
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();
|
||||
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
|
||||
|
@ -74,7 +77,7 @@ public class FluidGeneratorRecipeWrapper extends BlankRecipeWrapper {
|
|||
energyProduced.draw(minecraft, 73, 26);
|
||||
|
||||
minecraft.fontRendererObj.drawString(formatter.format(baseRecipe.getEnergyPerMb() * 1000) + " FE", 70, 13,
|
||||
0x444444);
|
||||
0x444444);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -50,6 +50,7 @@ public class GrinderRecipeCategory extends BlankRecipeCategory<GrinderRecipeWrap
|
|||
background = guiHelper.createDrawable(texture, 0, 62, 74, 32);
|
||||
title = I18n.translateToLocal("tile.techreborn.grinder.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
|
|
|
@ -44,15 +44,14 @@ public class IndustrialSawmillRecipeCategory extends BlankRecipeCategory<Industr
|
|||
|
||||
private final String title;
|
||||
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 tankOverlay;
|
||||
private static final int[] INPUT_SLOTS = { 0, 1 };
|
||||
private static final int[] OUTPUT_SLOTS = { 2, 3, 4 };
|
||||
private static final int[] INPUT_TANKS = { 0 };
|
||||
|
||||
|
||||
public IndustrialSawmillRecipeCategory(IGuiHelper guiHelper){
|
||||
|
||||
public IndustrialSawmillRecipeCategory(IGuiHelper guiHelper) {
|
||||
title = Translator.translateToLocal("tile.techreborn.industrialsawmill.name");
|
||||
background = guiHelper.createDrawable(texture, 7, 15, 141, 55);
|
||||
tankOverlay = guiHelper.createDrawable(texture, 176, 86, 12, 47);
|
||||
|
@ -62,25 +61,25 @@ public class IndustrialSawmillRecipeCategory extends BlankRecipeCategory<Industr
|
|||
public String getModName() {
|
||||
return ModInfo.MOD_NAME;
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid() {
|
||||
return RecipeCategoryUids.INDUSTRIAL_SAWMILL;
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return background;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IndustrialSawmillRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
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[1], false, 94, 19);
|
||||
guiItemStacks.init(OUTPUT_SLOTS[2], false, 112, 19);
|
||||
|
||||
|
||||
IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks();
|
||||
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);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,23 +24,24 @@
|
|||
|
||||
package techreborn.compat.jei.industrialSawmill;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import techreborn.Core;
|
||||
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
|
||||
import techreborn.compat.jei.RecipeCategoryUids;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class IndustrialSawmillRecipeHandler implements IRecipeHandler<IndustrialSawmillRecipe> {
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public IndustrialSawmillRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) {
|
||||
public IndustrialSawmillRecipeHandler(
|
||||
@Nonnull
|
||||
IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<IndustrialSawmillRecipe> getRecipeClass() {
|
||||
|
@ -51,7 +52,7 @@ public class IndustrialSawmillRecipeHandler implements IRecipeHandler<Industrial
|
|||
@Override
|
||||
public String getRecipeCategoryUid(
|
||||
@Nonnull
|
||||
IndustrialSawmillRecipe recipe) {
|
||||
IndustrialSawmillRecipe recipe) {
|
||||
return RecipeCategoryUids.INDUSTRIAL_SAWMILL;
|
||||
}
|
||||
|
||||
|
@ -59,14 +60,14 @@ public class IndustrialSawmillRecipeHandler implements IRecipeHandler<Industrial
|
|||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(
|
||||
@Nonnull
|
||||
IndustrialSawmillRecipe recipe) {
|
||||
IndustrialSawmillRecipe recipe) {
|
||||
return new IndustrialSawmillRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(
|
||||
@Nonnull
|
||||
IndustrialSawmillRecipe recipe) {
|
||||
IndustrialSawmillRecipe recipe) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue