Merge remote-tracking branch 'remotes/origin/feature/containers-builder' into 1.11.2
# Conflicts: # src/main/java/techreborn/client/container/ContainerAlloyFurnace.java # src/main/java/techreborn/tiles/TileAlloyFurnace.java
This commit is contained in:
commit
8b24fdf765
195 changed files with 4701 additions and 5523 deletions
|
@ -3,48 +3,50 @@ package techreborn.blocks;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
|
|
||||||
public class BlockComputerCube extends BlockMachineBase implements IAdvancedRotationTexture {
|
public class BlockComputerCube extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||||
|
|
||||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||||
|
|
||||||
public BlockComputerCube(Material material) {
|
public BlockComputerCube(final Material material) {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.computercube");
|
this.setUnlocalizedName("techreborn.computercube");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||||
float hitY, float hitZ) {
|
final float hitY, final float hitZ) {
|
||||||
if (!player.isSneaking())
|
if (!player.isSneaking())
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.manuelID, world, x, y, z);
|
player.openGui(Core.INSTANCE, EGui.MANUAL.ordinal(), world, x, y, z);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFront(boolean isActive) {
|
public String getFront(final boolean isActive) {
|
||||||
return prefix + "computer_cube";
|
return this.prefix + "computer_cube";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide(boolean isActive) {
|
public String getSide(final boolean isActive) {
|
||||||
return prefix + "computer_cube";
|
return this.prefix + "computer_cube";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop(boolean isActive) {
|
public String getTop(final boolean isActive) {
|
||||||
return prefix + "computer_cube";
|
return this.prefix + "computer_cube";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom(boolean isActive) {
|
public String getBottom(final boolean isActive) {
|
||||||
return prefix + "computer_cube";
|
return this.prefix + "computer_cube";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -6,7 +6,6 @@ import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemBlock;
|
import net.minecraft.item.ItemBlock;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
@ -14,8 +13,9 @@ import net.minecraftforge.fluids.BlockFluidBase;
|
||||||
|
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileDigitalChest;
|
import techreborn.tiles.TileDigitalChest;
|
||||||
import techreborn.tiles.TileTechStorageBase;
|
import techreborn.tiles.TileTechStorageBase;
|
||||||
|
@ -30,13 +30,13 @@ public class BlockDigitalChest extends BlockMachineBase implements IAdvancedRota
|
||||||
|
|
||||||
public BlockDigitalChest() {
|
public BlockDigitalChest() {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.digitalChest");
|
this.setUnlocalizedName("techreborn.digitalChest");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void dropInventory(World world, BlockPos pos) {
|
protected void dropInventory(final World world, final BlockPos pos) {
|
||||||
TileEntity tileEntity = world.getTileEntity(pos);
|
final TileEntity tileEntity = world.getTileEntity(pos);
|
||||||
|
|
||||||
if (tileEntity == null) {
|
if (tileEntity == null) {
|
||||||
return;
|
return;
|
||||||
|
@ -45,13 +45,13 @@ public class BlockDigitalChest extends BlockMachineBase implements IAdvancedRota
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
TileTechStorageBase inventory = (TileTechStorageBase) tileEntity;
|
final TileTechStorageBase inventory = (TileTechStorageBase) tileEntity;
|
||||||
|
|
||||||
List<ItemStack> items = new ArrayList<ItemStack>();
|
final List<ItemStack> items = new ArrayList<>();
|
||||||
|
|
||||||
List<ItemStack> droppables = inventory.getContentDrops();
|
final List<ItemStack> droppables = inventory.getContentDrops();
|
||||||
for (int i = 0; i < droppables.size(); i++) {
|
for (int i = 0; i < droppables.size(); i++) {
|
||||||
ItemStack itemStack = droppables.get(i);
|
final ItemStack itemStack = droppables.get(i);
|
||||||
|
|
||||||
if (itemStack == ItemStack.EMPTY) {
|
if (itemStack == ItemStack.EMPTY) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -68,21 +68,21 @@ public class BlockDigitalChest extends BlockMachineBase implements IAdvancedRota
|
||||||
items.add(itemStack.copy());
|
items.add(itemStack.copy());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ItemStack itemStack : items) {
|
for (final ItemStack itemStack : items) {
|
||||||
Random rand = new Random();
|
final Random rand = new Random();
|
||||||
|
|
||||||
float dX = rand.nextFloat() * 0.8F + 0.1F;
|
final float dX = rand.nextFloat() * 0.8F + 0.1F;
|
||||||
float dY = rand.nextFloat() * 0.8F + 0.1F;
|
final float dY = rand.nextFloat() * 0.8F + 0.1F;
|
||||||
float dZ = rand.nextFloat() * 0.8F + 0.1F;
|
final float dZ = rand.nextFloat() * 0.8F + 0.1F;
|
||||||
|
|
||||||
EntityItem entityItem = new EntityItem(world, pos.getX() + dX, pos.getY() + dY, pos.getZ() + dZ,
|
final EntityItem entityItem = new EntityItem(world, pos.getX() + dX, pos.getY() + dY, pos.getZ() + dZ,
|
||||||
itemStack.copy());
|
itemStack.copy());
|
||||||
|
|
||||||
if (itemStack.hasTagCompound()) {
|
if (itemStack.hasTagCompound()) {
|
||||||
entityItem.getEntityItem().setTagCompound((NBTTagCompound) itemStack.getTagCompound().copy());
|
entityItem.getEntityItem().setTagCompound(itemStack.getTagCompound().copy());
|
||||||
}
|
}
|
||||||
|
|
||||||
float factor = 0.05F;
|
final float factor = 0.05F;
|
||||||
entityItem.motionX = rand.nextGaussian() * factor;
|
entityItem.motionX = rand.nextGaussian() * factor;
|
||||||
entityItem.motionY = rand.nextGaussian() * factor + 0.2F;
|
entityItem.motionY = rand.nextGaussian() * factor + 0.2F;
|
||||||
entityItem.motionZ = rand.nextGaussian() * factor;
|
entityItem.motionZ = rand.nextGaussian() * factor;
|
||||||
|
@ -92,35 +92,35 @@ public class BlockDigitalChest extends BlockMachineBase implements IAdvancedRota
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World p_149915_1_, final int p_149915_2_) {
|
||||||
return new TileDigitalChest();
|
return new TileDigitalChest();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||||
float hitY, float hitZ) {
|
final float hitY, final float hitZ) {
|
||||||
if (!player.isSneaking())
|
if (!player.isSneaking())
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.digitalChestID, world, x, y, z);
|
player.openGui(Core.INSTANCE, EGui.DIGITAL_CHEST.ordinal(), world, x, y, z);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFront(boolean isActive) {
|
public String getFront(final boolean isActive) {
|
||||||
return prefix + "quantum_chest";
|
return this.prefix + "quantum_chest";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide(boolean isActive) {
|
public String getSide(final boolean isActive) {
|
||||||
return prefix + "qchest_side";
|
return this.prefix + "qchest_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop(boolean isActive) {
|
public String getTop(final boolean isActive) {
|
||||||
return prefix + "quantum_top";
|
return this.prefix + "quantum_top";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom(boolean isActive) {
|
public String getBottom(final boolean isActive) {
|
||||||
return prefix + "machine_bottom";
|
return this.prefix + "machine_bottom";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,10 +6,12 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.fusionReactor.TileEntityFusionController;
|
import techreborn.tiles.fusionReactor.TileEntityFusionController;
|
||||||
import techreborn.utils.damageSources.FusionDamageSource;
|
import techreborn.utils.damageSources.FusionDamageSource;
|
||||||
|
@ -18,56 +20,56 @@ public class BlockFusionControlComputer extends BlockMachineBase implements IAdv
|
||||||
|
|
||||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||||
|
|
||||||
public BlockFusionControlComputer(Material material) {
|
public BlockFusionControlComputer(final Material material) {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.fusioncontrolcomputer");
|
this.setUnlocalizedName("techreborn.fusioncontrolcomputer");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||||
float hitY, float hitZ) {
|
final float hitY, final float hitZ) {
|
||||||
TileEntityFusionController tileEntityFusionController = (TileEntityFusionController) world
|
final TileEntityFusionController tileEntityFusionController = (TileEntityFusionController) world
|
||||||
.getTileEntity(new BlockPos(x, y, z));
|
.getTileEntity(new BlockPos(x, y, z));
|
||||||
tileEntityFusionController.checkCoils();
|
tileEntityFusionController.checkCoils();
|
||||||
if (!player.isSneaking())
|
if (!player.isSneaking())
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.fusionID, world, x, y, z);
|
player.openGui(Core.INSTANCE, EGui.FUSION_CONTROLLER.ordinal(), world, x, y, z);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEntityWalk(World worldIn, BlockPos pos, Entity entityIn) {
|
public void onEntityWalk(final World worldIn, final BlockPos pos, final Entity entityIn) {
|
||||||
super.onEntityWalk(worldIn, pos, entityIn);
|
super.onEntityWalk(worldIn, pos, entityIn);
|
||||||
if (worldIn.getTileEntity(pos) instanceof TileEntityFusionController) {
|
if (worldIn.getTileEntity(pos) instanceof TileEntityFusionController) {
|
||||||
if (((TileEntityFusionController) worldIn.getTileEntity(pos)).crafingTickTime != 0
|
if (((TileEntityFusionController) worldIn.getTileEntity(pos)).crafingTickTime != 0
|
||||||
&& ((TileEntityFusionController) worldIn.getTileEntity(pos)).checkCoils()) {
|
&& ((TileEntityFusionController) worldIn.getTileEntity(pos)).checkCoils()) {
|
||||||
entityIn.attackEntityFrom(new FusionDamageSource(), 200F);
|
entityIn.attackEntityFrom(new FusionDamageSource(), 200F);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int meta) {
|
public TileEntity createNewTileEntity(final World world, final int meta) {
|
||||||
return new TileEntityFusionController();
|
return new TileEntityFusionController();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFront(boolean isActive) {
|
public String getFront(final boolean isActive) {
|
||||||
return prefix + "fusion_control_computer_front";
|
return this.prefix + "fusion_control_computer_front";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide(boolean isActive) {
|
public String getSide(final boolean isActive) {
|
||||||
return prefix + "machine_side";
|
return this.prefix + "machine_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop(boolean isActive) {
|
public String getTop(final boolean isActive) {
|
||||||
return prefix + "machine_side";
|
return this.prefix + "machine_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom(boolean isActive) {
|
public String getBottom(final boolean isActive) {
|
||||||
return prefix + "machine_side";
|
return this.prefix + "machine_side";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,10 +5,8 @@ import net.minecraft.block.BlockStaticLiquid;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.IInventory;
|
|
||||||
import net.minecraft.item.ItemBlock;
|
import net.minecraft.item.ItemBlock;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.EnumHand;
|
import net.minecraft.util.EnumHand;
|
||||||
|
@ -20,7 +18,7 @@ import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileQuantumChest;
|
import techreborn.tiles.TileQuantumChest;
|
||||||
import techreborn.tiles.TileTechStorageBase;
|
import techreborn.tiles.TileTechStorageBase;
|
||||||
|
@ -35,14 +33,14 @@ public class BlockQuantumChest extends BlockMachineBase implements IAdvancedRota
|
||||||
|
|
||||||
public BlockQuantumChest() {
|
public BlockQuantumChest() {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.quantumChest");
|
this.setUnlocalizedName("techreborn.quantumChest");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
setHardness(2.0F);
|
this.setHardness(2.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void dropInventory(World world, BlockPos pos) {
|
protected void dropInventory(final World world, final BlockPos pos) {
|
||||||
TileEntity tileEntity = world.getTileEntity(pos);
|
final TileEntity tileEntity = world.getTileEntity(pos);
|
||||||
|
|
||||||
if (tileEntity == null) {
|
if (tileEntity == null) {
|
||||||
return;
|
return;
|
||||||
|
@ -51,13 +49,13 @@ public class BlockQuantumChest extends BlockMachineBase implements IAdvancedRota
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
TileTechStorageBase inventory = (TileTechStorageBase) tileEntity;
|
final TileTechStorageBase inventory = (TileTechStorageBase) tileEntity;
|
||||||
|
|
||||||
List<ItemStack> items = new ArrayList<ItemStack>();
|
final List<ItemStack> items = new ArrayList<>();
|
||||||
|
|
||||||
List<ItemStack> droppables = inventory.getContentDrops();
|
final List<ItemStack> droppables = inventory.getContentDrops();
|
||||||
for (int i = 0; i < droppables.size(); i++) {
|
for (int i = 0; i < droppables.size(); i++) {
|
||||||
ItemStack itemStack = droppables.get(i);
|
final ItemStack itemStack = droppables.get(i);
|
||||||
|
|
||||||
if (itemStack == ItemStack.EMPTY) {
|
if (itemStack == ItemStack.EMPTY) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -74,21 +72,21 @@ public class BlockQuantumChest extends BlockMachineBase implements IAdvancedRota
|
||||||
items.add(itemStack.copy());
|
items.add(itemStack.copy());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ItemStack itemStack : items) {
|
for (final ItemStack itemStack : items) {
|
||||||
Random rand = new Random();
|
final Random rand = new Random();
|
||||||
|
|
||||||
float dX = rand.nextFloat() * 0.8F + 0.1F;
|
final float dX = rand.nextFloat() * 0.8F + 0.1F;
|
||||||
float dY = rand.nextFloat() * 0.8F + 0.1F;
|
final float dY = rand.nextFloat() * 0.8F + 0.1F;
|
||||||
float dZ = rand.nextFloat() * 0.8F + 0.1F;
|
final float dZ = rand.nextFloat() * 0.8F + 0.1F;
|
||||||
|
|
||||||
EntityItem entityItem = new EntityItem(world, pos.getX() + dX, pos.getY() + dY, pos.getZ() + dZ,
|
final EntityItem entityItem = new EntityItem(world, pos.getX() + dX, pos.getY() + dY, pos.getZ() + dZ,
|
||||||
itemStack.copy());
|
itemStack.copy());
|
||||||
|
|
||||||
if (itemStack.hasTagCompound()) {
|
if (itemStack.hasTagCompound()) {
|
||||||
entityItem.getEntityItem().setTagCompound((NBTTagCompound) itemStack.getTagCompound().copy());
|
entityItem.getEntityItem().setTagCompound(itemStack.getTagCompound().copy());
|
||||||
}
|
}
|
||||||
|
|
||||||
float factor = 0.05F;
|
final float factor = 0.05F;
|
||||||
entityItem.motionX = rand.nextGaussian() * factor;
|
entityItem.motionX = rand.nextGaussian() * factor;
|
||||||
entityItem.motionY = rand.nextGaussian() * factor + 0.2F;
|
entityItem.motionY = rand.nextGaussian() * factor + 0.2F;
|
||||||
entityItem.motionZ = rand.nextGaussian() * factor;
|
entityItem.motionZ = rand.nextGaussian() * factor;
|
||||||
|
@ -98,35 +96,35 @@ public class BlockQuantumChest extends BlockMachineBase implements IAdvancedRota
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World p_149915_1_, final int p_149915_2_) {
|
||||||
return new TileQuantumChest();
|
return new TileQuantumChest();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn,
|
public boolean onBlockActivated(final World worldIn, final BlockPos pos, final IBlockState state, final EntityPlayer playerIn,
|
||||||
EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
|
final EnumHand hand, final EnumFacing side, final float hitX, final float hitY, final float hitZ) {
|
||||||
if (!playerIn.isSneaking())
|
if (!playerIn.isSneaking())
|
||||||
playerIn.openGui(Core.INSTANCE, GuiHandler.quantumChestID, worldIn, pos.getX(), pos.getY(), pos.getZ());
|
playerIn.openGui(Core.INSTANCE, EGui.QUANTUM_CHEST.ordinal(), worldIn, pos.getX(), pos.getY(), pos.getZ());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFront(boolean isActive) {
|
public String getFront(final boolean isActive) {
|
||||||
return prefix + "quantum_chest";
|
return this.prefix + "quantum_chest";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide(boolean isActive) {
|
public String getSide(final boolean isActive) {
|
||||||
return prefix + "qchest_side";
|
return this.prefix + "qchest_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop(boolean isActive) {
|
public String getTop(final boolean isActive) {
|
||||||
return prefix + "quantum_top";
|
return this.prefix + "quantum_top";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom(boolean isActive) {
|
public String getBottom(final boolean isActive) {
|
||||||
return prefix + "machine_bottom";
|
return this.prefix + "machine_bottom";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,12 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileQuantumTank;
|
import techreborn.tiles.TileQuantumTank;
|
||||||
|
|
||||||
|
@ -17,45 +19,45 @@ public class BlockQuantumTank extends BlockMachineBase implements IAdvancedRotat
|
||||||
|
|
||||||
public BlockQuantumTank() {
|
public BlockQuantumTank() {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.quantumTank");
|
this.setUnlocalizedName("techreborn.quantumTank");
|
||||||
setHardness(2.0F);
|
this.setHardness(2.0F);
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World p_149915_1_, final int p_149915_2_) {
|
||||||
return new TileQuantumTank();
|
return new TileQuantumTank();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||||
float hitY, float hitZ) {
|
final float hitY, final float hitZ) {
|
||||||
if (fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
|
if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!player.isSneaking()) {
|
if (!player.isSneaking()) {
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.quantumTankID, world, x, y, z);
|
player.openGui(Core.INSTANCE, EGui.QUANTUM_TANK.ordinal(), world, x, y, z);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFront(boolean isActive) {
|
public String getFront(final boolean isActive) {
|
||||||
return "techreborn:blocks/machine/generators/thermal_generator_side_off";
|
return "techreborn:blocks/machine/generators/thermal_generator_side_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide(boolean isActive) {
|
public String getSide(final boolean isActive) {
|
||||||
return "techreborn:blocks/machine/generators/thermal_generator_side_off";
|
return "techreborn:blocks/machine/generators/thermal_generator_side_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop(boolean isActive) {
|
public String getTop(final boolean isActive) {
|
||||||
return prefix + "quantum_top";
|
return this.prefix + "quantum_top";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom(boolean isActive) {
|
public String getBottom(final boolean isActive) {
|
||||||
return "techreborn:blocks/machine/generators/thermal_generator_bottom";
|
return "techreborn:blocks/machine/generators/thermal_generator_bottom";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,12 @@ import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.multiblock.TileBlastFurnace;
|
import techreborn.tiles.multiblock.TileBlastFurnace;
|
||||||
|
|
||||||
|
@ -15,22 +17,22 @@ public class BlockBlastFurnace extends BlockMachineBase implements IRotationText
|
||||||
|
|
||||||
private final String prefix = "techreborn:blocks/machine/advanced_machines/";
|
private final String prefix = "techreborn:blocks/machine/advanced_machines/";
|
||||||
|
|
||||||
public BlockBlastFurnace(Material material) {
|
public BlockBlastFurnace(final Material material) {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.blastfurnace");
|
this.setUnlocalizedName("techreborn.blastfurnace");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
|
||||||
return new TileBlastFurnace();
|
return new TileBlastFurnace();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||||
float hitY, float hitZ) {
|
final float hitY, final float hitZ) {
|
||||||
if (!player.isSneaking())
|
if (!player.isSneaking())
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.blastFurnaceID, world, x, y, z);
|
player.openGui(Core.INSTANCE, EGui.BLAST_FURNACE.ordinal(), world, x, y, z);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,26 +43,26 @@ public class BlockBlastFurnace extends BlockMachineBase implements IRotationText
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOff() {
|
public String getFrontOff() {
|
||||||
return prefix + "industrial_blast_furnace_front_off";
|
return this.prefix + "industrial_blast_furnace_front_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOn() {
|
public String getFrontOn() {
|
||||||
return prefix + "industrial_blast_furnace_front_on";
|
return this.prefix + "industrial_blast_furnace_front_on";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide() {
|
public String getSide() {
|
||||||
return prefix + "advanced_machine_side";
|
return this.prefix + "advanced_machine_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop() {
|
public String getTop() {
|
||||||
return prefix + "advanced_machine_top";
|
return this.prefix + "advanced_machine_top";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom() {
|
public String getBottom() {
|
||||||
return prefix + "advanced_machine_bottom";
|
return this.prefix + "advanced_machine_bottom";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,10 +3,12 @@ package techreborn.blocks.advanced_machine;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileCentrifuge;
|
import techreborn.tiles.TileCentrifuge;
|
||||||
|
|
||||||
|
@ -16,46 +18,46 @@ public class BlockCentrifuge extends BlockMachineBase implements IRotationTextur
|
||||||
|
|
||||||
public BlockCentrifuge() {
|
public BlockCentrifuge() {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.centrifuge");
|
this.setUnlocalizedName("techreborn.centrifuge");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World p_149915_1_, final int p_149915_2_) {
|
||||||
return new TileCentrifuge();
|
return new TileCentrifuge();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||||
float hitY, float hitZ) {
|
final float hitY, final float hitZ) {
|
||||||
if (!player.isSneaking()) {
|
if (!player.isSneaking()) {
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.centrifugeID, world, x, y, z);
|
player.openGui(Core.INSTANCE, EGui.CENTRIFUGE.ordinal(), world, x, y, z);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOff() {
|
public String getFrontOff() {
|
||||||
return prefix + "industrial_centrifuge_side_off";
|
return this.prefix + "industrial_centrifuge_side_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOn() {
|
public String getFrontOn() {
|
||||||
return prefix + "industrial_centrifuge_side_on";
|
return this.prefix + "industrial_centrifuge_side_on";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide() {
|
public String getSide() {
|
||||||
return getFrontOff();
|
return this.getFrontOff();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop() {
|
public String getTop() {
|
||||||
return prefix + "industrial_centrifuge_top_off";
|
return this.prefix + "industrial_centrifuge_top_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom() {
|
public String getBottom() {
|
||||||
return prefix + "industrial_centrifuge_bottom";
|
return this.prefix + "industrial_centrifuge_bottom";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,12 @@ import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.multiblock.TileImplosionCompressor;
|
import techreborn.tiles.multiblock.TileImplosionCompressor;
|
||||||
|
|
||||||
|
@ -15,47 +17,47 @@ public class BlockImplosionCompressor extends BlockMachineBase implements IRotat
|
||||||
|
|
||||||
private final String prefix = "techreborn:blocks/machine/advanced_machines/";
|
private final String prefix = "techreborn:blocks/machine/advanced_machines/";
|
||||||
|
|
||||||
public BlockImplosionCompressor(Material material) {
|
public BlockImplosionCompressor(final Material material) {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.implosioncompressor");
|
this.setUnlocalizedName("techreborn.implosioncompressor");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World p_149915_1_, final int p_149915_2_) {
|
||||||
return new TileImplosionCompressor();
|
return new TileImplosionCompressor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||||
float hitY, float hitZ) {
|
final float hitY, final float hitZ) {
|
||||||
if (!player.isSneaking())
|
if (!player.isSneaking())
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.implosionCompresserID, world, x, y, z);
|
player.openGui(Core.INSTANCE, EGui.IMPLOSION_COMPRESSOR.ordinal(), world, x, y, z);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOff() {
|
public String getFrontOff() {
|
||||||
return prefix + "implosion_compressor_front_off";
|
return this.prefix + "implosion_compressor_front_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOn() {
|
public String getFrontOn() {
|
||||||
return prefix + "implosion_compressor_front_on";
|
return this.prefix + "implosion_compressor_front_on";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide() {
|
public String getSide() {
|
||||||
return prefix + "advanced_machine_side";
|
return this.prefix + "advanced_machine_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop() {
|
public String getTop() {
|
||||||
return prefix + "industrial_centrifuge_top_off";
|
return this.prefix + "industrial_centrifuge_top_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom() {
|
public String getBottom() {
|
||||||
return prefix + "implosion_compressor_bottom";
|
return this.prefix + "implosion_compressor_bottom";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,12 @@ import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileIndustrialElectrolyzer;
|
import techreborn.tiles.TileIndustrialElectrolyzer;
|
||||||
|
|
||||||
|
@ -15,47 +17,47 @@ public class BlockIndustrialElectrolyzer extends BlockMachineBase implements IRo
|
||||||
|
|
||||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||||
|
|
||||||
public BlockIndustrialElectrolyzer(Material material) {
|
public BlockIndustrialElectrolyzer(final Material material) {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.industrialelectrolyzer");
|
this.setUnlocalizedName("techreborn.industrialelectrolyzer");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
|
||||||
return new TileIndustrialElectrolyzer();
|
return new TileIndustrialElectrolyzer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||||
float hitY, float hitZ) {
|
final float hitY, final float hitZ) {
|
||||||
if (!player.isSneaking())
|
if (!player.isSneaking())
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.industrialElectrolyzerID, world, x, y, z);
|
player.openGui(Core.INSTANCE, EGui.INDUSTRIAL_ELECTROLYZER.ordinal(), world, x, y, z);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOff() {
|
public String getFrontOff() {
|
||||||
return prefix + "industrial_electrolyzer_front_off";
|
return this.prefix + "industrial_electrolyzer_front_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOn() {
|
public String getFrontOn() {
|
||||||
return prefix + "industrial_electrolyzer_front_on";
|
return this.prefix + "industrial_electrolyzer_front_on";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide() {
|
public String getSide() {
|
||||||
return prefix + "industrial_electrolyzer_front_off";
|
return this.prefix + "industrial_electrolyzer_front_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop() {
|
public String getTop() {
|
||||||
return prefix + "machine_top";
|
return this.prefix + "machine_top";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom() {
|
public String getBottom() {
|
||||||
return prefix + "machine_bottom";
|
return this.prefix + "machine_bottom";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,10 +5,12 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.multiblock.TileIndustrialGrinder;
|
import techreborn.tiles.multiblock.TileIndustrialGrinder;
|
||||||
|
|
||||||
|
@ -16,50 +18,50 @@ public class BlockIndustrialGrinder extends BlockMachineBase implements IRotatio
|
||||||
|
|
||||||
private final String prefix = "techreborn:blocks/machine/advanced_machines/";
|
private final String prefix = "techreborn:blocks/machine/advanced_machines/";
|
||||||
|
|
||||||
public BlockIndustrialGrinder(Material material) {
|
public BlockIndustrialGrinder(final Material material) {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.industrialgrinder");
|
this.setUnlocalizedName("techreborn.industrialgrinder");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World p_149915_1_, final int p_149915_2_) {
|
||||||
return new TileIndustrialGrinder();
|
return new TileIndustrialGrinder();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||||
float hitY, float hitZ) {
|
final float hitY, final float hitZ) {
|
||||||
if (fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
|
if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!player.isSneaking())
|
if (!player.isSneaking())
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.industrialGrinderID, world, x, y, z);
|
player.openGui(Core.INSTANCE, EGui.INDUSTRIAL_GRINDER.ordinal(), world, x, y, z);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOff() {
|
public String getFrontOff() {
|
||||||
return prefix + "industrial_grinder_front_off";
|
return this.prefix + "industrial_grinder_front_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOn() {
|
public String getFrontOn() {
|
||||||
return prefix + "industrial_grinder_front_on";
|
return this.prefix + "industrial_grinder_front_on";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide() {
|
public String getSide() {
|
||||||
return prefix + "machine_side";
|
return this.prefix + "machine_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop() {
|
public String getTop() {
|
||||||
return prefix + "industrial_grinder_top_off";
|
return this.prefix + "industrial_grinder_top_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom() {
|
public String getBottom() {
|
||||||
return prefix + "industrial_centrifuge_bottom";
|
return this.prefix + "industrial_centrifuge_bottom";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,10 +5,12 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.multiblock.TileIndustrialSawmill;
|
import techreborn.tiles.multiblock.TileIndustrialSawmill;
|
||||||
|
|
||||||
|
@ -16,50 +18,50 @@ public class BlockIndustrialSawmill extends BlockMachineBase implements IRotatio
|
||||||
|
|
||||||
private final String prefix = "techreborn:blocks/machine/advanced_machines/";
|
private final String prefix = "techreborn:blocks/machine/advanced_machines/";
|
||||||
|
|
||||||
public BlockIndustrialSawmill(Material material) {
|
public BlockIndustrialSawmill(final Material material) {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.industrialsawmill");
|
this.setUnlocalizedName("techreborn.industrialsawmill");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
|
||||||
return new TileIndustrialSawmill();
|
return new TileIndustrialSawmill();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||||
float hitY, float hitZ) {
|
final float hitY, final float hitZ) {
|
||||||
if (fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
|
if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!player.isSneaking())
|
if (!player.isSneaking())
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.sawMillID, world, x, y, z);
|
player.openGui(Core.INSTANCE, EGui.SAWMILL.ordinal(), world, x, y, z);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOff() {
|
public String getFrontOff() {
|
||||||
return prefix + "industrial_sawmill_front_off";
|
return this.prefix + "industrial_sawmill_front_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOn() {
|
public String getFrontOn() {
|
||||||
return prefix + "industrial_sawmill_front_on";
|
return this.prefix + "industrial_sawmill_front_on";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide() {
|
public String getSide() {
|
||||||
return prefix + "advanced_machine_side";
|
return this.prefix + "advanced_machine_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop() {
|
public String getTop() {
|
||||||
return prefix + "advanced_machine_side";
|
return this.prefix + "advanced_machine_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom() {
|
public String getBottom() {
|
||||||
return prefix + "advanced_machine_side";
|
return this.prefix + "advanced_machine_side";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,10 +5,12 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.generator.TileDieselGenerator;
|
import techreborn.tiles.generator.TileDieselGenerator;
|
||||||
|
|
||||||
|
@ -16,46 +18,46 @@ public class BlockDieselGenerator extends BlockMachineBase implements IAdvancedR
|
||||||
|
|
||||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||||
|
|
||||||
public BlockDieselGenerator(Material material) {
|
public BlockDieselGenerator(final Material material) {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.dieselgenerator");
|
this.setUnlocalizedName("techreborn.dieselgenerator");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
|
||||||
return new TileDieselGenerator();
|
return new TileDieselGenerator();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||||
float hitY, float hitZ) {
|
final float hitY, final float hitZ) {
|
||||||
if (fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
|
if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!player.isSneaking())
|
if (!player.isSneaking())
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.dieselGeneratorID, world, x, y, z);
|
player.openGui(Core.INSTANCE, EGui.DIESEL_GENERATOR.ordinal(), world, x, y, z);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFront(boolean isActive) {
|
public String getFront(final boolean isActive) {
|
||||||
return prefix + "generator_machine_side";
|
return this.prefix + "generator_machine_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide(boolean isActive) {
|
public String getSide(final boolean isActive) {
|
||||||
return prefix + "generator_machine_side";
|
return this.prefix + "generator_machine_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop(boolean isActive) {
|
public String getTop(final boolean isActive) {
|
||||||
return prefix + "diesel_generator_top_off";
|
return this.prefix + "diesel_generator_top_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom(boolean isActive) {
|
public String getBottom(final boolean isActive) {
|
||||||
return prefix + "generator_machine_bottom";
|
return this.prefix + "generator_machine_bottom";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,10 +5,12 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.generator.TileGasTurbine;
|
import techreborn.tiles.generator.TileGasTurbine;
|
||||||
|
|
||||||
|
@ -16,46 +18,46 @@ public class BlockGasTurbine extends BlockMachineBase implements IAdvancedRotati
|
||||||
|
|
||||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||||
|
|
||||||
public BlockGasTurbine(Material material) {
|
public BlockGasTurbine(final Material material) {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.gasTurbine");
|
this.setUnlocalizedName("techreborn.gasTurbine");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
|
||||||
return new TileGasTurbine();
|
return new TileGasTurbine();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||||
float hitY, float hitZ) {
|
final float hitY, final float hitZ) {
|
||||||
if (fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
|
if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!player.isSneaking())
|
if (!player.isSneaking())
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.gasTurbineID, world, x, y, z);
|
player.openGui(Core.INSTANCE, EGui.GAS_TURBINE.ordinal(), world, x, y, z);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFront(boolean isActive) {
|
public String getFront(final boolean isActive) {
|
||||||
return prefix + "generator_machine_side";
|
return this.prefix + "generator_machine_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide(boolean isActive) {
|
public String getSide(final boolean isActive) {
|
||||||
return prefix + "generator_machine_side";
|
return this.prefix + "generator_machine_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop(boolean isActive) {
|
public String getTop(final boolean isActive) {
|
||||||
return prefix + "gas_generator_top";
|
return this.prefix + "gas_generator_top";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom(boolean isActive) {
|
public String getBottom(final boolean isActive) {
|
||||||
return prefix + "gas_generator_bottom";
|
return this.prefix + "gas_generator_bottom";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,10 +3,12 @@ package techreborn.blocks.generator;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.generator.TileGenerator;
|
import techreborn.tiles.generator.TileGenerator;
|
||||||
|
|
||||||
|
@ -16,46 +18,46 @@ public class BlockGenerator extends BlockMachineBase implements IRotationTexture
|
||||||
|
|
||||||
public BlockGenerator() {
|
public BlockGenerator() {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.generator");
|
this.setUnlocalizedName("techreborn.generator");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
|
||||||
return new TileGenerator();
|
return new TileGenerator();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||||
float hitY, float hitZ) {
|
final float hitY, final float hitZ) {
|
||||||
if (!player.isSneaking()) {
|
if (!player.isSneaking()) {
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.generatorID, world, x, y, z);
|
player.openGui(Core.INSTANCE, EGui.GENERATOR.ordinal(), world, x, y, z);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOff() {
|
public String getFrontOff() {
|
||||||
return prefix + "generator_front_off";
|
return this.prefix + "generator_front_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOn() {
|
public String getFrontOn() {
|
||||||
return prefix + "generator_front_on";
|
return this.prefix + "generator_front_on";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide() {
|
public String getSide() {
|
||||||
return prefix + "generator_machine_side";
|
return this.prefix + "generator_machine_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop() {
|
public String getTop() {
|
||||||
return prefix + "generator_machine_top";
|
return this.prefix + "generator_machine_top";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom() {
|
public String getBottom() {
|
||||||
return prefix + "generator_machine_bottom";
|
return this.prefix + "generator_machine_bottom";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,10 +5,12 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.generator.TileSemifluidGenerator;
|
import techreborn.tiles.generator.TileSemifluidGenerator;
|
||||||
|
|
||||||
|
@ -16,46 +18,46 @@ public class BlockSemiFluidGenerator extends BlockMachineBase implements IAdvanc
|
||||||
|
|
||||||
private final String prefix = "techreborn:blocks/machine/generators/";
|
private final String prefix = "techreborn:blocks/machine/generators/";
|
||||||
|
|
||||||
public BlockSemiFluidGenerator(Material material) {
|
public BlockSemiFluidGenerator(final Material material) {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.semifluidgenerator");
|
this.setUnlocalizedName("techreborn.semifluidgenerator");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
|
||||||
return new TileSemifluidGenerator();
|
return new TileSemifluidGenerator();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||||
float hitY, float hitZ) {
|
final float hitY, final float hitZ) {
|
||||||
if (fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
|
if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!player.isSneaking())
|
if (!player.isSneaking())
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.semifluidGeneratorID, world, x, y, z);
|
player.openGui(Core.INSTANCE, EGui.SEMIFLUID_GENERATOR.ordinal(), world, x, y, z);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFront(boolean isActive) {
|
public String getFront(final boolean isActive) {
|
||||||
return prefix + "semifluid_generator_side";
|
return this.prefix + "semifluid_generator_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide(boolean isActive) {
|
public String getSide(final boolean isActive) {
|
||||||
return prefix + "semifluid_generator_side";
|
return this.prefix + "semifluid_generator_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop(boolean isActive) {
|
public String getTop(final boolean isActive) {
|
||||||
return prefix + "generator_machine_top";
|
return this.prefix + "generator_machine_top";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom(boolean isActive) {
|
public String getBottom(final boolean isActive) {
|
||||||
return prefix + "generator_machine_bottom";
|
return this.prefix + "generator_machine_bottom";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,12 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.generator.TileThermalGenerator;
|
import techreborn.tiles.generator.TileThermalGenerator;
|
||||||
|
|
||||||
|
@ -17,43 +19,43 @@ public class BlockThermalGenerator extends BlockMachineBase implements IAdvanced
|
||||||
|
|
||||||
public BlockThermalGenerator() {
|
public BlockThermalGenerator() {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.thermalGenerator");
|
this.setUnlocalizedName("techreborn.thermalGenerator");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
|
||||||
return new TileThermalGenerator();
|
return new TileThermalGenerator();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||||
float hitY, float hitZ) {
|
final float hitY, final float hitZ) {
|
||||||
if (fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
|
if (this.fillBlockWithFluid(world, new BlockPos(x, y, z), player)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!player.isSneaking())
|
if (!player.isSneaking())
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.thermalGeneratorID, world, x, y, z);
|
player.openGui(Core.INSTANCE, EGui.THERMAL_GENERATOR.ordinal(), world, x, y, z);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFront(boolean isActive) {
|
public String getFront(final boolean isActive) {
|
||||||
return isActive ? prefix + "thermal_generator_side_on" : prefix + "thermal_generator_side_off";
|
return isActive ? this.prefix + "thermal_generator_side_on" : this.prefix + "thermal_generator_side_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide(boolean isActive) {
|
public String getSide(final boolean isActive) {
|
||||||
return isActive ? prefix + "thermal_generator_side_on" : prefix + "thermal_generator_side_off";
|
return isActive ? this.prefix + "thermal_generator_side_on" : this.prefix + "thermal_generator_side_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop(boolean isActive) {
|
public String getTop(final boolean isActive) {
|
||||||
return isActive ? prefix + "thermal_generator_top_on" : prefix + "thermal_generator_top_off";
|
return isActive ? this.prefix + "thermal_generator_top_on" : this.prefix + "thermal_generator_top_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom(boolean isActive) {
|
public String getBottom(final boolean isActive) {
|
||||||
return prefix + "generator_machine_bottom";
|
return this.prefix + "generator_machine_bottom";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,10 +8,12 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileAlloyFurnace;
|
import techreborn.tiles.TileAlloyFurnace;
|
||||||
|
|
||||||
|
@ -22,54 +24,54 @@ public class BlockAlloyFurnace extends BlockMachineBase implements IRotationText
|
||||||
|
|
||||||
private final String prefix = "techreborn:blocks/machine/iron_machines/";
|
private final String prefix = "techreborn:blocks/machine/iron_machines/";
|
||||||
|
|
||||||
public BlockAlloyFurnace(Material material) {
|
public BlockAlloyFurnace(final Material material) {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.alloyfurnace");
|
this.setUnlocalizedName("techreborn.alloyfurnace");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
|
||||||
return new TileAlloyFurnace();
|
return new TileAlloyFurnace();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||||
float hitY, float hitZ) {
|
final float hitY, final float hitZ) {
|
||||||
if (!player.isSneaking())
|
if (!player.isSneaking())
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.alloyFurnaceID, world, x, y, z);
|
player.openGui(Core.INSTANCE, EGui.ALLOY_FURNACE.ordinal(), world, x, y, z);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
public List<ItemStack> getDrops(final IBlockAccess world, final BlockPos pos, final IBlockState state, final int fortune) {
|
||||||
List<ItemStack> items = new ArrayList<>();
|
final List<ItemStack> items = new ArrayList<>();
|
||||||
items.add(new ItemStack(this));
|
items.add(new ItemStack(this));
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOff() {
|
public String getFrontOff() {
|
||||||
return prefix + "alloy_furnace_front_off";
|
return this.prefix + "alloy_furnace_front_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOn() {
|
public String getFrontOn() {
|
||||||
return prefix + "alloy_furnace_front_on";
|
return this.prefix + "alloy_furnace_front_on";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide() {
|
public String getSide() {
|
||||||
return prefix + "iron_machine_side";
|
return this.prefix + "iron_machine_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop() {
|
public String getTop() {
|
||||||
return prefix + "iron_machine_top";
|
return this.prefix + "iron_machine_top";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom() {
|
public String getBottom() {
|
||||||
return prefix + "iron_machine_bottom";
|
return this.prefix + "iron_machine_bottom";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,10 +11,12 @@ import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileIronFurnace;
|
import techreborn.tiles.TileIronFurnace;
|
||||||
|
|
||||||
|
@ -28,60 +30,60 @@ public class BlockIronFurnace extends BlockMachineBase implements IRotationTextu
|
||||||
|
|
||||||
public BlockIronFurnace() {
|
public BlockIronFurnace() {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.ironfurnace");
|
this.setUnlocalizedName("techreborn.ironfurnace");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
|
||||||
return new TileIronFurnace();
|
return new TileIronFurnace();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||||
float hitY, float hitZ) {
|
final float hitY, final float hitZ) {
|
||||||
if (!player.isSneaking())
|
if (!player.isSneaking())
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.ironFurnace, world, x, y, z);
|
player.openGui(Core.INSTANCE, EGui.IRON_FURNACE.ordinal(), world, x, y, z);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
public List<ItemStack> getDrops(final IBlockAccess world, final BlockPos pos, final IBlockState state, final int fortune) {
|
||||||
List<ItemStack> items = new ArrayList<>();
|
final List<ItemStack> items = new ArrayList<>();
|
||||||
items.add(new ItemStack(this));
|
items.add(new ItemStack(this));
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@SuppressWarnings("incomplete-switch")
|
@SuppressWarnings("incomplete-switch")
|
||||||
public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand) {
|
public void randomDisplayTick(final World worldIn, final BlockPos pos, final IBlockState state, final Random rand) {
|
||||||
if (this.isActive(state)) {
|
if (this.isActive(state)) {
|
||||||
EnumFacing enumfacing = state.getValue(FACING);
|
final EnumFacing enumfacing = state.getValue(BlockMachineBase.FACING);
|
||||||
double d0 = (double) pos.getX() + 0.5D;
|
final double d0 = pos.getX() + 0.5D;
|
||||||
double d1 = (double) pos.getY() + rand.nextDouble() * 6.0D / 16.0D;
|
final double d1 = pos.getY() + rand.nextDouble() * 6.0D / 16.0D;
|
||||||
double d2 = (double) pos.getZ() + 0.5D;
|
final double d2 = pos.getZ() + 0.5D;
|
||||||
double d3 = 0.52D;
|
final double d3 = 0.52D;
|
||||||
double d4 = rand.nextDouble() * 0.6D - 0.3D;
|
final double d4 = rand.nextDouble() * 0.6D - 0.3D;
|
||||||
|
|
||||||
switch (enumfacing) {
|
switch (enumfacing) {
|
||||||
case WEST:
|
case WEST:
|
||||||
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D,
|
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D,
|
||||||
new int[0]);
|
new int[0]);
|
||||||
worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]);
|
worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]);
|
||||||
break;
|
break;
|
||||||
case EAST:
|
case EAST:
|
||||||
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D,
|
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D,
|
||||||
new int[0]);
|
new int[0]);
|
||||||
worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]);
|
worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]);
|
||||||
break;
|
break;
|
||||||
case NORTH:
|
case NORTH:
|
||||||
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D,
|
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D,
|
||||||
new int[0]);
|
new int[0]);
|
||||||
worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D, new int[0]);
|
worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D, new int[0]);
|
||||||
break;
|
break;
|
||||||
case SOUTH:
|
case SOUTH:
|
||||||
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D,
|
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D,
|
||||||
new int[0]);
|
new int[0]);
|
||||||
worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D, new int[0]);
|
worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D, new int[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,26 +91,26 @@ public class BlockIronFurnace extends BlockMachineBase implements IRotationTextu
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOff() {
|
public String getFrontOff() {
|
||||||
return prefix + "iron_furnace_front_off";
|
return this.prefix + "iron_furnace_front_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOn() {
|
public String getFrontOn() {
|
||||||
return prefix + "iron_furnace_front_on";
|
return this.prefix + "iron_furnace_front_on";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide() {
|
public String getSide() {
|
||||||
return prefix + "iron_machine_side";
|
return this.prefix + "iron_machine_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop() {
|
public String getTop() {
|
||||||
return prefix + "iron_machine_top";
|
return this.prefix + "iron_machine_top";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom() {
|
public String getBottom() {
|
||||||
return prefix + "iron_machine_bottom";
|
return this.prefix + "iron_machine_bottom";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,12 @@ import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileAssemblingMachine;
|
import techreborn.tiles.TileAssemblingMachine;
|
||||||
|
|
||||||
|
@ -15,47 +17,47 @@ public class BlockAssemblingMachine extends BlockMachineBase implements IRotatio
|
||||||
|
|
||||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||||
|
|
||||||
public BlockAssemblingMachine(Material material) {
|
public BlockAssemblingMachine(final Material material) {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.assemblingmachine");
|
this.setUnlocalizedName("techreborn.assemblingmachine");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
|
||||||
return new TileAssemblingMachine();
|
return new TileAssemblingMachine();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||||
float hitY, float hitZ) {
|
final float hitY, final float hitZ) {
|
||||||
if (!player.isSneaking())
|
if (!player.isSneaking())
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.assemblingmachineID, world, x, y, z);
|
player.openGui(Core.INSTANCE, EGui.ASSEMBLING_MACHINE.ordinal(), world, x, y, z);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOff() {
|
public String getFrontOff() {
|
||||||
return prefix + "assembling_machine_front_off";
|
return this.prefix + "assembling_machine_front_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOn() {
|
public String getFrontOn() {
|
||||||
return prefix + "assembling_machine_front_on";
|
return this.prefix + "assembling_machine_front_on";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide() {
|
public String getSide() {
|
||||||
return prefix + "machine_side";
|
return this.prefix + "machine_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop() {
|
public String getTop() {
|
||||||
return prefix + "machine_top";
|
return this.prefix + "machine_top";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom() {
|
public String getBottom() {
|
||||||
return prefix + "assembling_machine_top";
|
return this.prefix + "assembling_machine_top";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,12 @@ import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileChargeBench;
|
import techreborn.tiles.TileChargeBench;
|
||||||
|
|
||||||
|
@ -15,47 +17,47 @@ public class BlockChargeBench extends BlockMachineBase implements IRotationTextu
|
||||||
|
|
||||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||||
|
|
||||||
public BlockChargeBench(Material material) {
|
public BlockChargeBench(final Material material) {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.chargebench");
|
this.setUnlocalizedName("techreborn.chargebench");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
|
||||||
return new TileChargeBench();
|
return new TileChargeBench();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||||
float hitY, float hitZ) {
|
final float hitY, final float hitZ) {
|
||||||
if (!player.isSneaking())
|
if (!player.isSneaking())
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.chargeBench, world, x, y, z);
|
player.openGui(Core.INSTANCE, EGui.CHARGEBENCH.ordinal(), world, x, y, z);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOff() {
|
public String getFrontOff() {
|
||||||
return prefix + "chargeBench_side";
|
return this.prefix + "chargeBench_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOn() {
|
public String getFrontOn() {
|
||||||
return prefix + "chargeBench_side";
|
return this.prefix + "chargeBench_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide() {
|
public String getSide() {
|
||||||
return prefix + "chargeBench_side";
|
return this.prefix + "chargeBench_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop() {
|
public String getTop() {
|
||||||
return prefix + "chargeBench_side";
|
return this.prefix + "chargeBench_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom() {
|
public String getBottom() {
|
||||||
return prefix + "chargeBench_side";
|
return this.prefix + "chargeBench_side";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,12 @@ import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileChemicalReactor;
|
import techreborn.tiles.TileChemicalReactor;
|
||||||
|
|
||||||
|
@ -15,47 +17,47 @@ public class BlockChemicalReactor extends BlockMachineBase implements IRotationT
|
||||||
|
|
||||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||||
|
|
||||||
public BlockChemicalReactor(Material material) {
|
public BlockChemicalReactor(final Material material) {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.chemicalreactor");
|
this.setUnlocalizedName("techreborn.chemicalreactor");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
|
||||||
return new TileChemicalReactor();
|
return new TileChemicalReactor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||||
float hitY, float hitZ) {
|
final float hitY, final float hitZ) {
|
||||||
if (!player.isSneaking())
|
if (!player.isSneaking())
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.chemicalReactorID, world, x, y, z);
|
player.openGui(Core.INSTANCE, EGui.CHEMICAL_REACTOR.ordinal(), world, x, y, z);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOff() {
|
public String getFrontOff() {
|
||||||
return prefix + "chemical_reactor_side_off";
|
return this.prefix + "chemical_reactor_side_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOn() {
|
public String getFrontOn() {
|
||||||
return prefix + "chemical_reactor_side_on";
|
return this.prefix + "chemical_reactor_side_on";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide() {
|
public String getSide() {
|
||||||
return prefix + "machine_side";
|
return this.prefix + "machine_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop() {
|
public String getTop() {
|
||||||
return prefix + "machine_top";
|
return this.prefix + "machine_top";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom() {
|
public String getBottom() {
|
||||||
return prefix + "chemical_reactor_bottom";
|
return this.prefix + "chemical_reactor_bottom";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,12 @@ import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileChunkLoader;
|
import techreborn.tiles.TileChunkLoader;
|
||||||
|
|
||||||
|
@ -15,42 +17,42 @@ public class BlockChunkLoader extends BlockMachineBase implements IAdvancedRotat
|
||||||
|
|
||||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||||
|
|
||||||
public BlockChunkLoader(Material material) {
|
public BlockChunkLoader(final Material material) {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.chunkloader");
|
this.setUnlocalizedName("techreborn.chunkloader");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
|
||||||
return new TileChunkLoader();
|
return new TileChunkLoader();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||||
float hitY, float hitZ) {
|
final float hitY, final float hitZ) {
|
||||||
if (!player.isSneaking())
|
if (!player.isSneaking())
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.chunkloaderID, world, x, y, z);
|
player.openGui(Core.INSTANCE, EGui.CHUNK_LOADER.ordinal(), world, x, y, z);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFront(boolean isActive) {
|
public String getFront(final boolean isActive) {
|
||||||
return prefix + "industrial_chunk_loader_side";
|
return this.prefix + "industrial_chunk_loader_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide(boolean isActive) {
|
public String getSide(final boolean isActive) {
|
||||||
return prefix + "industrial_chunk_loader_side";
|
return this.prefix + "industrial_chunk_loader_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop(boolean isActive) {
|
public String getTop(final boolean isActive) {
|
||||||
return prefix + "machine_top";
|
return this.prefix + "machine_top";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom(boolean isActive) {
|
public String getBottom(final boolean isActive) {
|
||||||
return prefix + "machine_bottom";
|
return this.prefix + "machine_bottom";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,12 @@ import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileMatterFabricator;
|
import techreborn.tiles.TileMatterFabricator;
|
||||||
|
|
||||||
|
@ -15,22 +17,22 @@ public class BlockMatterFabricator extends BlockMachineBase implements IAdvanced
|
||||||
|
|
||||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||||
|
|
||||||
public BlockMatterFabricator(Material material) {
|
public BlockMatterFabricator(final Material material) {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.matterfabricator");
|
this.setUnlocalizedName("techreborn.matterfabricator");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World p_149915_1_, final int p_149915_2_) {
|
||||||
return new TileMatterFabricator();
|
return new TileMatterFabricator();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||||
float hitY, float hitZ) {
|
final float hitY, final float hitZ) {
|
||||||
if (!player.isSneaking())
|
if (!player.isSneaking())
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.matterfabID, world, x, y, z);
|
player.openGui(Core.INSTANCE, EGui.MATTER_FABRICATOR.ordinal(), world, x, y, z);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,22 +42,22 @@ public class BlockMatterFabricator extends BlockMachineBase implements IAdvanced
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFront(boolean isActive) {
|
public String getFront(final boolean isActive) {
|
||||||
return isActive ? prefix + "matter_fabricator_on" : prefix + "matter_fabricator_off";
|
return isActive ? this.prefix + "matter_fabricator_on" : this.prefix + "matter_fabricator_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide(boolean isActive) {
|
public String getSide(final boolean isActive) {
|
||||||
return isActive ? prefix + "matter_fabricator_on" : prefix + "matter_fabricator_off";
|
return isActive ? this.prefix + "matter_fabricator_on" : this.prefix + "matter_fabricator_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop(boolean isActive) {
|
public String getTop(final boolean isActive) {
|
||||||
return isActive ? prefix + "matter_fabricator_on" : prefix + "matter_fabricator_off";
|
return isActive ? this.prefix + "matter_fabricator_on" : this.prefix + "matter_fabricator_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom(boolean isActive) {
|
public String getBottom(final boolean isActive) {
|
||||||
return isActive ? prefix + "matter_fabricator_on" : prefix + "matter_fabricator_off";
|
return isActive ? this.prefix + "matter_fabricator_on" : this.prefix + "matter_fabricator_off";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,12 @@ import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileRollingMachine;
|
import techreborn.tiles.TileRollingMachine;
|
||||||
|
|
||||||
|
@ -15,42 +17,42 @@ public class BlockRollingMachine extends BlockMachineBase implements IAdvancedRo
|
||||||
|
|
||||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||||
|
|
||||||
public BlockRollingMachine(Material material) {
|
public BlockRollingMachine(final Material material) {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.rollingmachine");
|
this.setUnlocalizedName("techreborn.rollingmachine");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World p_149915_1_, final int p_149915_2_) {
|
||||||
return new TileRollingMachine();
|
return new TileRollingMachine();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||||
float hitY, float hitZ) {
|
final float hitY, final float hitZ) {
|
||||||
if (!player.isSneaking())
|
if (!player.isSneaking())
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.rollingMachineID, world, x, y, z);
|
player.openGui(Core.INSTANCE, EGui.ROLLING_MACHINE.ordinal(), world, x, y, z);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFront(boolean isActive) {
|
public String getFront(final boolean isActive) {
|
||||||
return isActive ? prefix + "rolling_machine_side_on" : prefix + "rolling_machine_side_off";
|
return isActive ? this.prefix + "rolling_machine_side_on" : this.prefix + "rolling_machine_side_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide(boolean isActive) {
|
public String getSide(final boolean isActive) {
|
||||||
return prefix + "machine_side";
|
return this.prefix + "machine_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop(boolean isActive) {
|
public String getTop(final boolean isActive) {
|
||||||
return prefix + "machine_top";
|
return this.prefix + "machine_top";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom(boolean isActive) {
|
public String getBottom(final boolean isActive) {
|
||||||
return prefix + "machine_bottom";
|
return this.prefix + "machine_bottom";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,12 @@ import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileScrapboxinator;
|
import techreborn.tiles.TileScrapboxinator;
|
||||||
|
|
||||||
|
@ -15,48 +17,48 @@ public class BlockScrapboxinator extends BlockMachineBase implements IRotationTe
|
||||||
|
|
||||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||||
|
|
||||||
public BlockScrapboxinator(Material material) {
|
public BlockScrapboxinator(final Material material) {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.scrapboxinator");
|
this.setUnlocalizedName("techreborn.scrapboxinator");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World p_149915_1_, final int p_149915_2_) {
|
||||||
return new TileScrapboxinator();
|
return new TileScrapboxinator();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||||
float hitY, float hitZ) {
|
final float hitY, final float hitZ) {
|
||||||
if (!player.isSneaking()) {
|
if (!player.isSneaking()) {
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.scrapboxinatorID, world, x, y, z);
|
player.openGui(Core.INSTANCE, EGui.SCRAPBOXINATOR.ordinal(), world, x, y, z);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOff() {
|
public String getFrontOff() {
|
||||||
return prefix + "scrapboxinator_front_off";
|
return this.prefix + "scrapboxinator_front_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOn() {
|
public String getFrontOn() {
|
||||||
return prefix + "scrapboxinator_front_on";
|
return this.prefix + "scrapboxinator_front_on";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide() {
|
public String getSide() {
|
||||||
return prefix + "machine_side";
|
return this.prefix + "machine_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop() {
|
public String getTop() {
|
||||||
return prefix + "machine_top";
|
return this.prefix + "machine_top";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom() {
|
public String getBottom() {
|
||||||
return prefix + "machine_bottom";
|
return this.prefix + "machine_bottom";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,10 +8,12 @@ import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.EnumHand;
|
import net.minecraft.util.EnumHand;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.multiblock.TileVacuumFreezer;
|
import techreborn.tiles.multiblock.TileVacuumFreezer;
|
||||||
|
|
||||||
|
@ -19,43 +21,43 @@ public class BlockVacuumFreezer extends BlockMachineBase implements IAdvancedRot
|
||||||
|
|
||||||
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
private final String prefix = "techreborn:blocks/machine/greg_machines/";
|
||||||
|
|
||||||
public BlockVacuumFreezer(Material material) {
|
public BlockVacuumFreezer(final Material material) {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.vacuumfreezer");
|
this.setUnlocalizedName("techreborn.vacuumfreezer");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int meta) {
|
public TileEntity createNewTileEntity(final World world, final int meta) {
|
||||||
return new TileVacuumFreezer();
|
return new TileVacuumFreezer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
|
public boolean onBlockActivated(final World world, final BlockPos pos, final IBlockState state, final EntityPlayer player, final EnumHand hand, final EnumFacing side, final float hitX, final float hitY, final float hitZ) {
|
||||||
if (!player.isSneaking()) {
|
if (!player.isSneaking()) {
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.vacuumFreezerID, world, pos.getX(), pos.getY(), pos.getZ());
|
player.openGui(Core.INSTANCE, EGui.VACUUM_FREEZER.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFront(boolean isActive) {
|
public String getFront(final boolean isActive) {
|
||||||
return prefix + "vacuum_freezer_front";
|
return this.prefix + "vacuum_freezer_front";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide(boolean isActive) {
|
public String getSide(final boolean isActive) {
|
||||||
return prefix + "machine_side";
|
return this.prefix + "machine_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop(boolean isActive) {
|
public String getTop(final boolean isActive) {
|
||||||
return prefix + "vacuum_freezer_top";
|
return this.prefix + "vacuum_freezer_top";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom(boolean isActive) {
|
public String getBottom(final boolean isActive) {
|
||||||
return prefix + "machine_bottom";
|
return this.prefix + "machine_bottom";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,8 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.client.GuiHandler;
|
|
||||||
|
import techreborn.client.EGui;
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
import techreborn.tiles.TileAesu;
|
import techreborn.tiles.TileAesu;
|
||||||
|
|
||||||
|
@ -15,17 +16,17 @@ import java.util.List;
|
||||||
|
|
||||||
public class BlockAESU extends BlockEnergyStorage {
|
public class BlockAESU extends BlockEnergyStorage {
|
||||||
public BlockAESU() {
|
public BlockAESU() {
|
||||||
super("AESU", GuiHandler.aesuID);
|
super("AESU", EGui.AESU.ordinal());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
|
||||||
return new TileAesu();
|
return new TileAesu();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
public List<ItemStack> getDrops(final IBlockAccess world, final BlockPos pos, final IBlockState state, final int fortune) {
|
||||||
ArrayList<ItemStack> list = new ArrayList<>();
|
final ArrayList<ItemStack> list = new ArrayList<>();
|
||||||
list.add(new ItemStack(ModBlocks.MACHINE_FRAMES, 1, 2));
|
list.add(new ItemStack(ModBlocks.MACHINE_FRAMES, 1, 2));
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,8 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.client.GuiHandler;
|
|
||||||
|
import techreborn.client.EGui;
|
||||||
import techreborn.tiles.storage.TileBatBox;
|
import techreborn.tiles.storage.TileBatBox;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -17,17 +18,17 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public class BlockBatBox extends BlockEnergyStorage {
|
public class BlockBatBox extends BlockEnergyStorage {
|
||||||
public BlockBatBox() {
|
public BlockBatBox() {
|
||||||
super("Batbox", GuiHandler.batboxID);
|
super("Batbox", EGui.BATBOX.ordinal());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
|
||||||
return new TileBatBox();
|
return new TileBatBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
public List<ItemStack> getDrops(final IBlockAccess world, final BlockPos pos, final IBlockState state, final int fortune) {
|
||||||
ArrayList<ItemStack> list = new ArrayList<>();
|
final ArrayList<ItemStack> list = new ArrayList<>();
|
||||||
list.add(new ItemStack(this));
|
list.add(new ItemStack(this));
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,8 @@ import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.client.GuiHandler;
|
|
||||||
|
import techreborn.client.EGui;
|
||||||
import techreborn.tiles.idsu.TileIDSU;
|
import techreborn.tiles.idsu.TileIDSU;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -16,18 +17,18 @@ import java.util.List;
|
||||||
|
|
||||||
public class BlockIDSU extends BlockEnergyStorage {
|
public class BlockIDSU extends BlockEnergyStorage {
|
||||||
public BlockIDSU() {
|
public BlockIDSU() {
|
||||||
super("IDSU", GuiHandler.idsuID);
|
super("IDSU", EGui.IDSU.ordinal());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
|
||||||
return new TileIDSU();
|
return new TileIDSU();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY,
|
public IBlockState getStateForPlacement(final World world, final BlockPos pos, final EnumFacing facing, final float hitX, final float hitY,
|
||||||
float hitZ, int meta, EntityLivingBase placer) {
|
final float hitZ, final int meta, final EntityLivingBase placer) {
|
||||||
TileEntity tile = world.getTileEntity(pos);
|
final TileEntity tile = world.getTileEntity(pos);
|
||||||
if (tile instanceof TileIDSU) {
|
if (tile instanceof TileIDSU) {
|
||||||
((TileIDSU) tile).ownerUdid = placer.getUniqueID().toString();
|
((TileIDSU) tile).ownerUdid = placer.getUniqueID().toString();
|
||||||
}
|
}
|
||||||
|
@ -35,8 +36,8 @@ public class BlockIDSU extends BlockEnergyStorage {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
public List<ItemStack> getDrops(final IBlockAccess world, final BlockPos pos, final IBlockState state, final int fortune) {
|
||||||
ArrayList<ItemStack> list = new ArrayList<>();
|
final ArrayList<ItemStack> list = new ArrayList<>();
|
||||||
list.add(new ItemStack(this, 1, 2));
|
list.add(new ItemStack(this, 1, 2));
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,8 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.client.GuiHandler;
|
|
||||||
|
import techreborn.client.EGui;
|
||||||
import techreborn.tiles.lesu.TileLesu;
|
import techreborn.tiles.lesu.TileLesu;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -14,17 +15,17 @@ import java.util.List;
|
||||||
|
|
||||||
public class BlockLESU extends BlockEnergyStorage {
|
public class BlockLESU extends BlockEnergyStorage {
|
||||||
public BlockLESU() {
|
public BlockLESU() {
|
||||||
super("LESU", GuiHandler.lesuID);
|
super("LESU", EGui.LESU.ordinal());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
|
||||||
return new TileLesu();
|
return new TileLesu();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
public List<ItemStack> getDrops(final IBlockAccess world, final BlockPos pos, final IBlockState state, final int fortune) {
|
||||||
ArrayList<ItemStack> list = new ArrayList<>();
|
final ArrayList<ItemStack> list = new ArrayList<>();
|
||||||
list.add(new ItemStack(this, 1, 2));
|
list.add(new ItemStack(this, 1, 2));
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,8 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.client.GuiHandler;
|
|
||||||
|
import techreborn.client.EGui;
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
import techreborn.tiles.storage.TileMFE;
|
import techreborn.tiles.storage.TileMFE;
|
||||||
|
|
||||||
|
@ -18,17 +19,17 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public class BlockMFE extends BlockEnergyStorage {
|
public class BlockMFE extends BlockEnergyStorage {
|
||||||
public BlockMFE() {
|
public BlockMFE() {
|
||||||
super("MFE", GuiHandler.mfeID);
|
super("MFE", EGui.MFE.ordinal());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
|
||||||
return new TileMFE();
|
return new TileMFE();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
public List<ItemStack> getDrops(final IBlockAccess world, final BlockPos pos, final IBlockState state, final int fortune) {
|
||||||
ArrayList<ItemStack> list = new ArrayList<>();
|
final ArrayList<ItemStack> list = new ArrayList<>();
|
||||||
list.add(new ItemStack(ModBlocks.MACHINE_FRAMES, 1, 1));
|
list.add(new ItemStack(ModBlocks.MACHINE_FRAMES, 1, 1));
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,8 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.client.GuiHandler;
|
|
||||||
|
import techreborn.client.EGui;
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
import techreborn.tiles.storage.TileMFSU;
|
import techreborn.tiles.storage.TileMFSU;
|
||||||
|
|
||||||
|
@ -18,18 +19,18 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public class BlockMFSU extends BlockEnergyStorage {
|
public class BlockMFSU extends BlockEnergyStorage {
|
||||||
public BlockMFSU() {
|
public BlockMFSU() {
|
||||||
super("MFSU", GuiHandler.mfsuID);
|
super("MFSU", EGui.MFSU.ordinal());
|
||||||
setHardness(2f);
|
this.setHardness(2f);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
|
||||||
return new TileMFSU();
|
return new TileMFSU();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
public List<ItemStack> getDrops(final IBlockAccess world, final BlockPos pos, final IBlockState state, final int fortune) {
|
||||||
ArrayList<ItemStack> list = new ArrayList<>();
|
final ArrayList<ItemStack> list = new ArrayList<>();
|
||||||
list.add(new ItemStack(ModBlocks.MACHINE_FRAMES, 1, 1));
|
list.add(new ItemStack(ModBlocks.MACHINE_FRAMES, 1, 1));
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,12 @@ import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileAlloySmelter;
|
import techreborn.tiles.TileAlloySmelter;
|
||||||
|
|
||||||
|
@ -15,47 +17,47 @@ public class BlockAlloySmelter extends BlockMachineBase implements IRotationText
|
||||||
|
|
||||||
private final String prefix = "techreborn:blocks/machine/tier1_machines/";
|
private final String prefix = "techreborn:blocks/machine/tier1_machines/";
|
||||||
|
|
||||||
public BlockAlloySmelter(Material material) {
|
public BlockAlloySmelter(final Material material) {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.alloysmelter");
|
this.setUnlocalizedName("techreborn.alloysmelter");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
|
||||||
return new TileAlloySmelter();
|
return new TileAlloySmelter();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||||
float hitY, float hitZ) {
|
final float hitY, final float hitZ) {
|
||||||
if (!player.isSneaking())
|
if (!player.isSneaking())
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.alloySmelterID, world, x, y, z);
|
player.openGui(Core.INSTANCE, EGui.ALLOY_SMELTER.ordinal(), world, x, y, z);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOff() {
|
public String getFrontOff() {
|
||||||
return prefix + "electric_alloy_furnace_front_off";
|
return this.prefix + "electric_alloy_furnace_front_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOn() {
|
public String getFrontOn() {
|
||||||
return prefix + "electric_alloy_furnace_front_on";
|
return this.prefix + "electric_alloy_furnace_front_on";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide() {
|
public String getSide() {
|
||||||
return prefix + "tier1_machine_side";
|
return this.prefix + "tier1_machine_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop() {
|
public String getTop() {
|
||||||
return prefix + "tier1_machine_top";
|
return this.prefix + "tier1_machine_top";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom() {
|
public String getBottom() {
|
||||||
return prefix + "tier1_machine_bottom";
|
return this.prefix + "tier1_machine_bottom";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,12 @@ import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.teir1.TileCompressor;
|
import techreborn.tiles.teir1.TileCompressor;
|
||||||
|
|
||||||
|
@ -15,48 +17,48 @@ public class BlockCompressor extends BlockMachineBase implements IRotationTextur
|
||||||
|
|
||||||
private final String prefix = "techreborn:blocks/machine/tier1_machines/";
|
private final String prefix = "techreborn:blocks/machine/tier1_machines/";
|
||||||
|
|
||||||
public BlockCompressor(Material material) {
|
public BlockCompressor(final Material material) {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.compressor");
|
this.setUnlocalizedName("techreborn.compressor");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World p_149915_1_, final int p_149915_2_) {
|
||||||
return new TileCompressor();
|
return new TileCompressor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||||
float hitY, float hitZ) {
|
final float hitY, final float hitZ) {
|
||||||
if (!player.isSneaking()) {
|
if (!player.isSneaking()) {
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.compressorID, world, x, y, z);
|
player.openGui(Core.INSTANCE, EGui.COMPRESSOR.ordinal(), world, x, y, z);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOff() {
|
public String getFrontOff() {
|
||||||
return prefix + "compressor_front_off";
|
return this.prefix + "compressor_front_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOn() {
|
public String getFrontOn() {
|
||||||
return prefix + "compressor_front_on";
|
return this.prefix + "compressor_front_on";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide() {
|
public String getSide() {
|
||||||
return prefix + "tier1_machine_side";
|
return this.prefix + "tier1_machine_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop() {
|
public String getTop() {
|
||||||
return prefix + "tier1_machine_top";
|
return this.prefix + "tier1_machine_top";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom() {
|
public String getBottom() {
|
||||||
return prefix + "tier1_machine_bottom";
|
return this.prefix + "tier1_machine_bottom";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,12 @@ import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.teir1.TileElectricFurnace;
|
import techreborn.tiles.teir1.TileElectricFurnace;
|
||||||
|
|
||||||
|
@ -15,48 +17,48 @@ public class BlockElectricFurnace extends BlockMachineBase implements IRotationT
|
||||||
|
|
||||||
private final String prefix = "techreborn:blocks/machine/tier1_machines/";
|
private final String prefix = "techreborn:blocks/machine/tier1_machines/";
|
||||||
|
|
||||||
public BlockElectricFurnace(Material material) {
|
public BlockElectricFurnace(final Material material) {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.electricfurnace");
|
this.setUnlocalizedName("techreborn.electricfurnace");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World p_149915_1_, final int p_149915_2_) {
|
||||||
return new TileElectricFurnace();
|
return new TileElectricFurnace();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||||
float hitY, float hitZ) {
|
final float hitY, final float hitZ) {
|
||||||
if (!player.isSneaking()) {
|
if (!player.isSneaking()) {
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.electricFurnaceID, world, x, y, z);
|
player.openGui(Core.INSTANCE, EGui.ELECTRIC_FURNACE.ordinal(), world, x, y, z);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOff() {
|
public String getFrontOff() {
|
||||||
return prefix + "electric_furnace_front_off";
|
return this.prefix + "electric_furnace_front_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOn() {
|
public String getFrontOn() {
|
||||||
return prefix + "electric_furnace_front_on";
|
return this.prefix + "electric_furnace_front_on";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide() {
|
public String getSide() {
|
||||||
return prefix + "tier1_machine_side";
|
return this.prefix + "tier1_machine_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop() {
|
public String getTop() {
|
||||||
return prefix + "tier1_machine_top";
|
return this.prefix + "tier1_machine_top";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom() {
|
public String getBottom() {
|
||||||
return prefix + "tier1_machine_bottom";
|
return this.prefix + "tier1_machine_bottom";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,12 @@ import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.teir1.TileExtractor;
|
import techreborn.tiles.teir1.TileExtractor;
|
||||||
|
|
||||||
|
@ -15,48 +17,48 @@ public class BlockExtractor extends BlockMachineBase implements IRotationTexture
|
||||||
|
|
||||||
private final String prefix = "techreborn:blocks/machine/tier1_machines/";
|
private final String prefix = "techreborn:blocks/machine/tier1_machines/";
|
||||||
|
|
||||||
public BlockExtractor(Material material) {
|
public BlockExtractor(final Material material) {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.extractor");
|
this.setUnlocalizedName("techreborn.extractor");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World p_149915_1_, final int p_149915_2_) {
|
||||||
return new TileExtractor();
|
return new TileExtractor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||||
float hitY, float hitZ) {
|
final float hitY, final float hitZ) {
|
||||||
if (!player.isSneaking()) {
|
if (!player.isSneaking()) {
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.extractorID, world, x, y, z);
|
player.openGui(Core.INSTANCE, EGui.EXTRACTOR.ordinal(), world, x, y, z);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOff() {
|
public String getFrontOff() {
|
||||||
return prefix + "extractor_front_off";
|
return this.prefix + "extractor_front_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOn() {
|
public String getFrontOn() {
|
||||||
return prefix + "extractor_front_on";
|
return this.prefix + "extractor_front_on";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide() {
|
public String getSide() {
|
||||||
return prefix + "tier1_machine_side";
|
return this.prefix + "tier1_machine_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop() {
|
public String getTop() {
|
||||||
return prefix + "tier1_machine_top";
|
return this.prefix + "tier1_machine_top";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom() {
|
public String getBottom() {
|
||||||
return prefix + "tier1_machine_bottom";
|
return this.prefix + "tier1_machine_bottom";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,12 @@ import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.teir1.TileGrinder;
|
import techreborn.tiles.teir1.TileGrinder;
|
||||||
|
|
||||||
|
@ -15,44 +17,44 @@ public class BlockGrinder extends BlockMachineBase implements IAdvancedRotationT
|
||||||
|
|
||||||
private final String prefix = "techreborn:blocks/machine/tier1_machines/";
|
private final String prefix = "techreborn:blocks/machine/tier1_machines/";
|
||||||
|
|
||||||
public BlockGrinder(Material material) {
|
public BlockGrinder(final Material material) {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.grinder");
|
this.setUnlocalizedName("techreborn.grinder");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World p_149915_1_, final int p_149915_2_) {
|
||||||
return new TileGrinder();
|
return new TileGrinder();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||||
float hitY, float hitZ) {
|
final float hitY, final float hitZ) {
|
||||||
if (!player.isSneaking()) {
|
if (!player.isSneaking()) {
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.grinderID, world, x, y, z);
|
player.openGui(Core.INSTANCE, EGui.GRINDER.ordinal(), world, x, y, z);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFront(boolean isActive) {
|
public String getFront(final boolean isActive) {
|
||||||
return isActive ? prefix + "grinder_front_on" : prefix + "grinder_front_off";
|
return isActive ? this.prefix + "grinder_front_on" : this.prefix + "grinder_front_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide(boolean isActive) {
|
public String getSide(final boolean isActive) {
|
||||||
return prefix + "tier1_machine_side";
|
return this.prefix + "tier1_machine_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop(boolean isActive) {
|
public String getTop(final boolean isActive) {
|
||||||
return isActive ? prefix + "grinder_top_on" : prefix + "grinder_top_off";
|
return isActive ? this.prefix + "grinder_top_on" : this.prefix + "grinder_top_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom(boolean isActive) {
|
public String getBottom(final boolean isActive) {
|
||||||
return prefix + "tier1_machine_bottom";
|
return this.prefix + "tier1_machine_bottom";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,12 @@ import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import reborncore.common.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
|
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.EGui;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.teir1.TileRecycler;
|
import techreborn.tiles.teir1.TileRecycler;
|
||||||
|
|
||||||
|
@ -15,48 +17,48 @@ public class BlockRecycler extends BlockMachineBase implements IRotationTexture
|
||||||
|
|
||||||
private final String prefix = "techreborn:blocks/machine/tier1_machines/";
|
private final String prefix = "techreborn:blocks/machine/tier1_machines/";
|
||||||
|
|
||||||
public BlockRecycler(Material material) {
|
public BlockRecycler(final Material material) {
|
||||||
super();
|
super();
|
||||||
setUnlocalizedName("techreborn.recycler");
|
this.setUnlocalizedName("techreborn.recycler");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
this.setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
public TileEntity createNewTileEntity(final World p_149915_1_, final int p_149915_2_) {
|
||||||
return new TileRecycler();
|
return new TileRecycler();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX,
|
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
|
||||||
float hitY, float hitZ) {
|
final float hitY, final float hitZ) {
|
||||||
if (!player.isSneaking()) {
|
if (!player.isSneaking()) {
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.recyclerID, world, x, y, z);
|
player.openGui(Core.INSTANCE, EGui.RECYCLER.ordinal(), world, x, y, z);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOff() {
|
public String getFrontOff() {
|
||||||
return prefix + "recycler_front_off";
|
return this.prefix + "recycler_front_off";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFrontOn() {
|
public String getFrontOn() {
|
||||||
return prefix + "recycler_front_on";
|
return this.prefix + "recycler_front_on";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSide() {
|
public String getSide() {
|
||||||
return prefix + "tier1_machine_side";
|
return this.prefix + "tier1_machine_side";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTop() {
|
public String getTop() {
|
||||||
return prefix + "tier1_machine_top";
|
return this.prefix + "tier1_machine_top";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBottom() {
|
public String getBottom() {
|
||||||
return prefix + "tier1_machine_bottom";
|
return this.prefix + "tier1_machine_bottom";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
55
src/main/java/techreborn/client/EGui.java
Normal file
55
src/main/java/techreborn/client/EGui.java
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
package techreborn.client;
|
||||||
|
|
||||||
|
public enum EGui {
|
||||||
|
|
||||||
|
THERMAL_GENERATOR(true),
|
||||||
|
QUANTUM_TANK(true),
|
||||||
|
QUANTUM_CHEST(true),
|
||||||
|
CENTRIFUGE(true),
|
||||||
|
ROLLING_MACHINE(true),
|
||||||
|
BLAST_FURNACE(true),
|
||||||
|
ALLOY_SMELTER(true),
|
||||||
|
INDUSTRIAL_GRINDER(true),
|
||||||
|
IMPLOSION_COMPRESSOR(true),
|
||||||
|
MATTER_FABRICATOR(true),
|
||||||
|
MANUAL(false),
|
||||||
|
CHUNK_LOADER(true),
|
||||||
|
ASSEMBLING_MACHINE(true),
|
||||||
|
DIESEL_GENERATOR(true),
|
||||||
|
INDUSTRIAL_ELECTROLYZER(true),
|
||||||
|
AESU(false),
|
||||||
|
ALLOY_FURNACE(true),
|
||||||
|
SAWMILL(true),
|
||||||
|
CHEMICAL_REACTOR(true),
|
||||||
|
SEMIFLUID_GENERATOR(true),
|
||||||
|
GAS_TURBINE(true),
|
||||||
|
DIGITAL_CHEST(true),
|
||||||
|
DESTRUCTOPACK(false),
|
||||||
|
LESU(false),
|
||||||
|
IDSU(false),
|
||||||
|
CHARGEBENCH(true),
|
||||||
|
FUSION_CONTROLLER(true),
|
||||||
|
VACUUM_FREEZER(true),
|
||||||
|
GRINDER(true),
|
||||||
|
GENERATOR(true),
|
||||||
|
EXTRACTOR(true),
|
||||||
|
COMPRESSOR(true),
|
||||||
|
ELECTRIC_FURNACE(true),
|
||||||
|
IRON_FURNACE(true),
|
||||||
|
RECYCLER(true),
|
||||||
|
SCRAPBOXINATOR(true),
|
||||||
|
BATBOX(true),
|
||||||
|
MFSU(true),
|
||||||
|
MFE(true);
|
||||||
|
|
||||||
|
private final boolean containerBuilder;
|
||||||
|
|
||||||
|
private EGui(final boolean containerBuilder)
|
||||||
|
{
|
||||||
|
this.containerBuilder = containerBuilder;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean useContainerBuilder() {
|
||||||
|
return this.containerBuilder;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,11 +1,11 @@
|
||||||
package techreborn.client;
|
package techreborn.client;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.fml.common.network.IGuiHandler;
|
import net.minecraftforge.fml.common.network.IGuiHandler;
|
||||||
import reborncore.api.tile.IContainerLayout;
|
|
||||||
import reborncore.common.container.RebornContainer;
|
|
||||||
import techreborn.client.container.*;
|
import techreborn.client.container.*;
|
||||||
import techreborn.client.gui.*;
|
import techreborn.client.gui.*;
|
||||||
import techreborn.manual.GuiManual;
|
import techreborn.manual.GuiManual;
|
||||||
|
@ -22,236 +22,119 @@ import techreborn.tiles.teir1.*;
|
||||||
|
|
||||||
public class GuiHandler implements IGuiHandler {
|
public class GuiHandler implements IGuiHandler {
|
||||||
|
|
||||||
public static final int thermalGeneratorID = 0;
|
|
||||||
public static final int quantumTankID = 1;
|
|
||||||
public static final int quantumChestID = 2;
|
|
||||||
public static final int centrifugeID = 3;
|
|
||||||
public static final int rollingMachineID = 4;
|
|
||||||
public static final int blastFurnaceID = 5;
|
|
||||||
public static final int alloySmelterID = 6;
|
|
||||||
public static final int industrialGrinderID = 7;
|
|
||||||
public static final int implosionCompresserID = 8;
|
|
||||||
public static final int matterfabID = 9;
|
|
||||||
public static final int manuelID = 10;
|
|
||||||
public static final int chunkloaderID = 11;
|
|
||||||
public static final int assemblingmachineID = 12;
|
|
||||||
public static final int dieselGeneratorID = 15;
|
|
||||||
public static final int industrialElectrolyzerID = 16;
|
|
||||||
public static final int aesuID = 17;
|
|
||||||
public static final int alloyFurnaceID = 18;
|
|
||||||
public static final int sawMillID = 19;
|
|
||||||
public static final int chemicalReactorID = 20;
|
|
||||||
public static final int semifluidGeneratorID = 21;
|
|
||||||
public static final int gasTurbineID = 22;
|
|
||||||
public static final int digitalChestID = 23;
|
|
||||||
public static final int destructoPackID = 25;
|
|
||||||
public static final int lesuID = 26;
|
|
||||||
public static final int idsuID = 27;
|
|
||||||
public static final int chargeBench = 28;
|
|
||||||
public static final int fusionID = 29;
|
|
||||||
public static final int vacuumFreezerID = 30;
|
|
||||||
public static final int grinderID = 31;
|
|
||||||
public static final int generatorID = 32;
|
|
||||||
public static final int extractorID = 33;
|
|
||||||
public static final int compressorID = 34;
|
|
||||||
public static final int electricFurnaceID = 35;
|
|
||||||
public static final int ironFurnace = 36;
|
|
||||||
public static final int recyclerID = 37;
|
|
||||||
public static final int scrapboxinatorID = 38;
|
|
||||||
public static final int batboxID = 39;
|
|
||||||
public static final int mfsuID = 40;
|
|
||||||
public static final int mfeID = 41;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
public Object getServerGuiElement(final int ID, final EntityPlayer player, final World world, final int x,
|
||||||
RebornContainer container = null;
|
final int y, final int z) {
|
||||||
if (ID == thermalGeneratorID) {
|
|
||||||
return new ContainerThermalGenerator((TileThermalGenerator) world.getTileEntity(new BlockPos(x, y, z)),
|
final EGui gui = EGui.values()[ID];
|
||||||
player);
|
final TileEntity tile = world.getTileEntity(new BlockPos(x, y, z));
|
||||||
} else if (ID == semifluidGeneratorID) {
|
|
||||||
return new ContainerSemifluidGenerator((TileSemifluidGenerator) world.getTileEntity(new BlockPos(x, y, z)),
|
if (gui.useContainerBuilder() && tile != null)
|
||||||
player);
|
return ((IContainerProvider) tile).createContainer(player);
|
||||||
} else if (ID == gasTurbineID) {
|
|
||||||
return new ContainerGasTurbine((TileGasTurbine) world.getTileEntity(new BlockPos(x, y, z)), player);
|
switch (gui) {
|
||||||
} else if (ID == quantumTankID) {
|
case AESU:
|
||||||
return new ContainerQuantumTank((TileQuantumTank) world.getTileEntity(new BlockPos(x, y, z)), player);
|
return new ContainerAESU((TileAesu) tile, player);
|
||||||
} else if (ID == digitalChestID) {
|
case DESTRUCTOPACK:
|
||||||
return new ContainerDigitalChest((TileDigitalChest) world.getTileEntity(new BlockPos(x, y, z)), player);
|
return new ContainerDestructoPack(player);
|
||||||
} else if (ID == quantumChestID) {
|
case LESU:
|
||||||
return new ContainerQuantumChest((TileQuantumChest) world.getTileEntity(new BlockPos(x, y, z)), player);
|
return new ContainerLESU((TileLesu) tile, player);
|
||||||
} else if (ID == centrifugeID) {
|
case IDSU:
|
||||||
container = new ContainerCentrifuge(player, (TileCentrifuge) world.getTileEntity(new BlockPos(x, y, z)));
|
return new ContainerIDSU((TileIDSU) tile, player);
|
||||||
} else if (ID == rollingMachineID) {
|
default:
|
||||||
return new ContainerRollingMachine((TileRollingMachine) world.getTileEntity(new BlockPos(x, y, z)), player);
|
break;
|
||||||
} else if (ID == blastFurnaceID) {
|
|
||||||
return new ContainerBlastFurnace((TileBlastFurnace) world.getTileEntity(new BlockPos(x, y, z)), player);
|
|
||||||
} else if (ID == alloySmelterID) {
|
|
||||||
container = new ContainerAlloySmelter(player, (TileAlloySmelter) world.getTileEntity(new BlockPos(x, y, z)));
|
|
||||||
} else if (ID == industrialGrinderID) {
|
|
||||||
return new ContainerIndustrialGrinder((TileIndustrialGrinder) world.getTileEntity(new BlockPos(x, y, z)),
|
|
||||||
player);
|
|
||||||
} else if (ID == implosionCompresserID) {
|
|
||||||
return new ContainerImplosionCompressor(
|
|
||||||
(TileImplosionCompressor) world.getTileEntity(new BlockPos(x, y, z)), player);
|
|
||||||
} else if (ID == matterfabID) {
|
|
||||||
return new ContainerMatterFabricator((TileMatterFabricator) world.getTileEntity(new BlockPos(x, y, z)),
|
|
||||||
player);
|
|
||||||
} else if (ID == chunkloaderID) {
|
|
||||||
return new ContainerChunkloader((TileChunkLoader) world.getTileEntity(new BlockPos(x, y, z)), player);
|
|
||||||
} else if (ID == assemblingmachineID) {
|
|
||||||
container = new ContainerAssemblingMachine(player, (TileAssemblingMachine) world.getTileEntity(new BlockPos(x, y, z)));
|
|
||||||
} else if (ID == dieselGeneratorID) {
|
|
||||||
return new ContainerDieselGenerator((TileDieselGenerator) world.getTileEntity(new BlockPos(x, y, z)),
|
|
||||||
player);
|
|
||||||
} else if (ID == industrialElectrolyzerID) {
|
|
||||||
return new ContainerIndustrialElectrolyzer(
|
|
||||||
(TileIndustrialElectrolyzer) world.getTileEntity(new BlockPos(x, y, z)), player);
|
|
||||||
} else if (ID == aesuID) {
|
|
||||||
return new ContainerAESU((TileAesu) world.getTileEntity(new BlockPos(x, y, z)), player);
|
|
||||||
} else if (ID == alloyFurnaceID) {
|
|
||||||
return new ContainerAlloyFurnace((TileAlloyFurnace) world.getTileEntity(new BlockPos(x, y, z)), player);
|
|
||||||
} else if (ID == sawMillID) {
|
|
||||||
return new ContainerIndustrialSawmill((TileIndustrialSawmill) world.getTileEntity(new BlockPos(x, y, z)),
|
|
||||||
player);
|
|
||||||
} else if (ID == chemicalReactorID) {
|
|
||||||
return new ContainerChemicalReactor((TileChemicalReactor) world.getTileEntity(new BlockPos(x, y, z)),
|
|
||||||
player);
|
|
||||||
} else if (ID == manuelID) {
|
|
||||||
return null;
|
|
||||||
} else if (ID == destructoPackID) {
|
|
||||||
return new ContainerDestructoPack(player);
|
|
||||||
} else if (ID == lesuID) {
|
|
||||||
return new ContainerLESU((TileLesu) world.getTileEntity(new BlockPos(x, y, z)), player);
|
|
||||||
} else if (ID == idsuID) {
|
|
||||||
return new ContainerIDSU((TileIDSU) world.getTileEntity(new BlockPos(x, y, z)), player);
|
|
||||||
} else if (ID == chargeBench) {
|
|
||||||
return new ContainerChargeBench((TileChargeBench) world.getTileEntity(new BlockPos(x, y, z)), player);
|
|
||||||
} else if (ID == fusionID) {
|
|
||||||
return new ContainerFusionReactor((TileEntityFusionController) world.getTileEntity(new BlockPos(x, y, z)),
|
|
||||||
player);
|
|
||||||
} else if (ID == vacuumFreezerID) {
|
|
||||||
return new ContainerVacuumFreezer((TileVacuumFreezer) world.getTileEntity(new BlockPos(x, y, z)), player);
|
|
||||||
} else if (ID == grinderID) {
|
|
||||||
container = new ContainerGrinder(player, (TileGrinder) world.getTileEntity(new BlockPos(x, y, z)));
|
|
||||||
} else if (ID == generatorID) {
|
|
||||||
return new ContainerGenerator((TileGenerator) world.getTileEntity(new BlockPos(x, y, z)), player);
|
|
||||||
} else if (ID == extractorID) {
|
|
||||||
container = new ContainerExtractor(player, (TileExtractor) world.getTileEntity(new BlockPos(x, y, z)));
|
|
||||||
} else if (ID == compressorID) {
|
|
||||||
return new ContainerCompressor((TileCompressor) world.getTileEntity(new BlockPos(x, y, z)), player);
|
|
||||||
} else if (ID == electricFurnaceID) {
|
|
||||||
return new ContainerElectricFurnace((TileElectricFurnace) world.getTileEntity(new BlockPos(x, y, z)),
|
|
||||||
player);
|
|
||||||
} else if (ID == ironFurnace) {
|
|
||||||
return new ContainerIronFurnace((TileIronFurnace) world.getTileEntity(new BlockPos(x, y, z)), player);
|
|
||||||
} else if (ID == recyclerID) {
|
|
||||||
return new ContainerRecycler((TileRecycler) world.getTileEntity(new BlockPos(x, y, z)), player);
|
|
||||||
} else if (ID == scrapboxinatorID) {
|
|
||||||
return new ContainerScrapboxinator((TileScrapboxinator) world.getTileEntity(new BlockPos(x, y, z)), player);
|
|
||||||
} else if (ID == batboxID) {
|
|
||||||
return new ContainerBatbox((TileBatBox) world.getTileEntity(new BlockPos(x, y, z)), player);
|
|
||||||
} else if (ID == mfsuID) {
|
|
||||||
return new ContainerMFSU((TileMFSU) world.getTileEntity(new BlockPos(x, y, z)), player);
|
|
||||||
} else if (ID == mfeID) {
|
|
||||||
return new ContainerMFE((TileMFE) world.getTileEntity(new BlockPos(x, y, z)), player);
|
|
||||||
}
|
|
||||||
if (container != null) {
|
|
||||||
if (container instanceof IContainerLayout) {
|
|
||||||
IContainerLayout layout = (IContainerLayout) container;
|
|
||||||
layout.setTile(world.getTileEntity(new BlockPos(x, y, z)));
|
|
||||||
layout.setPlayer(player);
|
|
||||||
layout.addInventorySlots();
|
|
||||||
layout.addPlayerSlots();
|
|
||||||
}
|
|
||||||
return container;
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
public Object getClientGuiElement(final int ID, final EntityPlayer player, final World world, final int x,
|
||||||
if (ID == thermalGeneratorID) {
|
final int y, final int z) {
|
||||||
return new GuiThermalGenerator(player, (TileThermalGenerator) world.getTileEntity(new BlockPos(x, y, z)));
|
final EGui gui = EGui.values()[ID];
|
||||||
} else if (ID == semifluidGeneratorID) {
|
final TileEntity tile = world.getTileEntity(new BlockPos(x, y, z));
|
||||||
return new GuiSemifluidGenerator(player,
|
|
||||||
(TileSemifluidGenerator) world.getTileEntity(new BlockPos(x, y, z)));
|
switch (gui) {
|
||||||
} else if (ID == gasTurbineID) {
|
case AESU:
|
||||||
return new GuiGasTurbine(player, (TileGasTurbine) world.getTileEntity(new BlockPos(x, y, z)));
|
return new GuiAESU(player, (TileAesu) tile);
|
||||||
} else if (ID == quantumTankID) {
|
case ALLOY_FURNACE:
|
||||||
return new GuiQuantumTank(player, (TileQuantumTank) world.getTileEntity(new BlockPos(x, y, z)));
|
return new GuiAlloyFurnace(player, (TileAlloyFurnace) tile);
|
||||||
} else if (ID == digitalChestID) {
|
case ALLOY_SMELTER:
|
||||||
return new GuiDigitalChest(player, (TileDigitalChest) world.getTileEntity(new BlockPos(x, y, z)));
|
return new GuiAlloySmelter(player, (TileAlloySmelter) tile);
|
||||||
} else if (ID == quantumChestID) {
|
case ASSEMBLING_MACHINE:
|
||||||
return new GuiQuantumChest(player, (TileQuantumChest) world.getTileEntity(new BlockPos(x, y, z)));
|
return new GuiAssemblingMachine(player, (TileAssemblingMachine) tile);
|
||||||
} else if (ID == centrifugeID) {
|
case BATBOX:
|
||||||
return new GuiCentrifuge(player, (TileCentrifuge) world.getTileEntity(new BlockPos(x, y, z)));
|
return new GuiBatbox(player, (TileBatBox) tile);
|
||||||
} else if (ID == rollingMachineID) {
|
case BLAST_FURNACE:
|
||||||
return new GuiRollingMachine(player, (TileRollingMachine) world.getTileEntity(new BlockPos(x, y, z)));
|
return new GuiBlastFurnace(player, (TileBlastFurnace) tile);
|
||||||
} else if (ID == blastFurnaceID) {
|
case CENTRIFUGE:
|
||||||
return new GuiBlastFurnace(player, (TileBlastFurnace) world.getTileEntity(new BlockPos(x, y, z)));
|
return new GuiCentrifuge(player, (TileCentrifuge) tile);
|
||||||
} else if (ID == alloySmelterID) {
|
case CHARGEBENCH:
|
||||||
return new GuiAlloySmelter(player, (TileAlloySmelter) world.getTileEntity(new BlockPos(x, y, z)));
|
return new GuiChargeBench(player, (TileChargeBench) tile);
|
||||||
} else if (ID == industrialGrinderID) {
|
case CHEMICAL_REACTOR:
|
||||||
return new GuiIndustrialGrinder(player, (TileIndustrialGrinder) world.getTileEntity(new BlockPos(x, y, z)));
|
return new GuiChemicalReactor(player, (TileChemicalReactor) tile);
|
||||||
} else if (ID == implosionCompresserID) {
|
case CHUNK_LOADER:
|
||||||
return new GuiImplosionCompressor(player,
|
return new GuiChunkLoader(player, (TileChunkLoader) tile);
|
||||||
(TileImplosionCompressor) world.getTileEntity(new BlockPos(x, y, z)));
|
case COMPRESSOR:
|
||||||
} else if (ID == matterfabID) {
|
return new GuiCompressor(player, (TileCompressor) tile);
|
||||||
return new GuiMatterFabricator(player, (TileMatterFabricator) world.getTileEntity(new BlockPos(x, y, z)));
|
case DESTRUCTOPACK:
|
||||||
} else if (ID == chunkloaderID) {
|
return new GuiDestructoPack(new ContainerDestructoPack(player));
|
||||||
return new GuiChunkLoader(player, (TileChunkLoader) world.getTileEntity(new BlockPos(x, y, z)));
|
case DIESEL_GENERATOR:
|
||||||
} else if (ID == assemblingmachineID) {
|
return new GuiDieselGenerator(player, (TileDieselGenerator) tile);
|
||||||
return new GuiAssemblingMachine(player, (TileAssemblingMachine) world.getTileEntity(new BlockPos(x, y, z)));
|
case DIGITAL_CHEST:
|
||||||
} else if (ID == dieselGeneratorID) {
|
return new GuiDigitalChest(player, (TileDigitalChest) tile);
|
||||||
return new GuiDieselGenerator(player, (TileDieselGenerator) world.getTileEntity(new BlockPos(x, y, z)));
|
case ELECTRIC_FURNACE:
|
||||||
} else if (ID == industrialElectrolyzerID) {
|
return new GuiElectricFurnace(player, (TileElectricFurnace) tile);
|
||||||
return new GuiIndustrialElectrolyzer(player,
|
case EXTRACTOR:
|
||||||
(TileIndustrialElectrolyzer) world.getTileEntity(new BlockPos(x, y, z)));
|
return new GuiExtractor(player, (TileExtractor) tile);
|
||||||
} else if (ID == aesuID) {
|
case FUSION_CONTROLLER:
|
||||||
return new GuiAESU(player, (TileAesu) world.getTileEntity(new BlockPos(x, y, z)));
|
return new GuiFusionReactor(player, (TileEntityFusionController) tile);
|
||||||
} else if (ID == alloyFurnaceID) {
|
case GAS_TURBINE:
|
||||||
return new GuiAlloyFurnace(player, (TileAlloyFurnace) world.getTileEntity(new BlockPos(x, y, z)));
|
return new GuiGasTurbine(player, (TileGasTurbine) tile);
|
||||||
} else if (ID == sawMillID) {
|
case GENERATOR:
|
||||||
return new GuiIndustrialSawmill(player, (TileIndustrialSawmill) world.getTileEntity(new BlockPos(x, y, z)));
|
return new GuiGenerator(player, (TileGenerator) tile);
|
||||||
} else if (ID == chemicalReactorID) {
|
case GRINDER:
|
||||||
return new GuiChemicalReactor(player, (TileChemicalReactor) world.getTileEntity(new BlockPos(x, y, z)));
|
return new GuiGrinder(player, (TileGrinder) tile);
|
||||||
} else if (ID == manuelID) {
|
case IDSU:
|
||||||
return new GuiManual();
|
return new GuiIDSU(player, (TileIDSU) tile);
|
||||||
} else if (ID == destructoPackID) {
|
case IMPLOSION_COMPRESSOR:
|
||||||
return new GuiDestructoPack(new ContainerDestructoPack(player));
|
return new GuiImplosionCompressor(player, (TileImplosionCompressor) tile);
|
||||||
} else if (ID == lesuID) {
|
case INDUSTRIAL_ELECTROLYZER:
|
||||||
return new GuiLESU(player, (TileLesu) world.getTileEntity(new BlockPos(x, y, z)));
|
return new GuiIndustrialElectrolyzer(player, (TileIndustrialElectrolyzer) tile);
|
||||||
} else if (ID == idsuID) {
|
case INDUSTRIAL_GRINDER:
|
||||||
return new GuiIDSU(player, (TileIDSU) world.getTileEntity(new BlockPos(x, y, z)));
|
return new GuiIndustrialGrinder(player, (TileIndustrialGrinder) tile);
|
||||||
} else if (ID == chargeBench) {
|
case IRON_FURNACE:
|
||||||
return new GuiChargeBench(player, (TileChargeBench) world.getTileEntity(new BlockPos(x, y, z)));
|
return new GuiIronFurnace(player, (TileIronFurnace) tile);
|
||||||
} else if (ID == fusionID) {
|
case LESU:
|
||||||
return new GuiFusionReactor(player,
|
return new GuiLESU(player, (TileLesu) tile);
|
||||||
(TileEntityFusionController) world.getTileEntity(new BlockPos(x, y, z)));
|
case MANUAL:
|
||||||
} else if (ID == vacuumFreezerID) {
|
return new GuiManual();
|
||||||
return new GuiVacuumFreezer(player, (TileVacuumFreezer) world.getTileEntity(new BlockPos(x, y, z)));
|
case MATTER_FABRICATOR:
|
||||||
} else if (ID == grinderID) {
|
return new GuiMatterFabricator(player, (TileMatterFabricator) tile);
|
||||||
return new GuiGrinder(player, (TileGrinder) world.getTileEntity(new BlockPos(x, y, z)));
|
case MFE:
|
||||||
} else if (ID == generatorID) {
|
return new GuiMFE(player, (TileMFE) tile);
|
||||||
return new GuiGenerator(player, (TileGenerator) world.getTileEntity(new BlockPos(x, y, z)));
|
case MFSU:
|
||||||
} else if (ID == extractorID) {
|
return new GuiMFSU(player, (TileMFSU) tile);
|
||||||
return new GuiExtractor(player, (TileExtractor) world.getTileEntity(new BlockPos(x, y, z)));
|
case QUANTUM_CHEST:
|
||||||
} else if (ID == compressorID) {
|
return new GuiQuantumChest(player, (TileQuantumChest) tile);
|
||||||
return new GuiCompressor(player, (TileCompressor) world.getTileEntity(new BlockPos(x, y, z)));
|
case QUANTUM_TANK:
|
||||||
} else if (ID == electricFurnaceID) {
|
return new GuiQuantumTank(player, (TileQuantumTank) tile);
|
||||||
return new GuiElectricFurnace(player, (TileElectricFurnace) world.getTileEntity(new BlockPos(x, y, z)));
|
case RECYCLER:
|
||||||
} else if (ID == ironFurnace) {
|
return new GuiRecycler(player, (TileRecycler) tile);
|
||||||
return new GuiIronFurnace(player, (TileIronFurnace) world.getTileEntity(new BlockPos(x, y, z)));
|
case ROLLING_MACHINE:
|
||||||
} else if (ID == recyclerID) {
|
return new GuiRollingMachine(player, (TileRollingMachine) tile);
|
||||||
return new GuiRecycler(player, (TileRecycler) world.getTileEntity(new BlockPos(x, y, z)));
|
case SAWMILL:
|
||||||
} else if (ID == scrapboxinatorID) {
|
return new GuiIndustrialSawmill(player, (TileIndustrialSawmill) tile);
|
||||||
return new GuiScrapboxinator(player, (TileScrapboxinator) world.getTileEntity(new BlockPos(x, y, z)));
|
case SCRAPBOXINATOR:
|
||||||
} else if (ID == batboxID) {
|
return new GuiScrapboxinator(player, (TileScrapboxinator) tile);
|
||||||
return new GuiBatbox(player, (TileBatBox) world.getTileEntity(new BlockPos(x, y, z)));
|
case SEMIFLUID_GENERATOR:
|
||||||
} else if (ID == mfsuID) {
|
return new GuiSemifluidGenerator(player, (TileSemifluidGenerator) tile);
|
||||||
return new GuiMFSU(player, (TileMFSU) world.getTileEntity(new BlockPos(x, y, z)));
|
case THERMAL_GENERATOR:
|
||||||
} else if (ID == mfeID) {
|
return new GuiThermalGenerator(player, (TileThermalGenerator) tile);
|
||||||
return new GuiMFE(player, (TileMFE) world.getTileEntity(new BlockPos(x, y, z)));
|
case VACUUM_FREEZER:
|
||||||
|
return new GuiVacuumFreezer(player, (TileVacuumFreezer) tile);
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,122 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.inventory.IContainerListener;
|
|
||||||
import net.minecraft.inventory.IInventory;
|
|
||||||
import net.minecraft.inventory.SlotFurnaceFuel;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotOutput;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import reborncore.api.recipe.IBaseRecipeType;
|
|
||||||
import reborncore.api.recipe.RecipeHandler;
|
|
||||||
import reborncore.common.container.RebornContainer;
|
|
||||||
import reborncore.common.recipes.RecipeTranslator;
|
|
||||||
import reborncore.common.util.ItemUtils;
|
|
||||||
import techreborn.api.recipe.machines.AlloySmelterRecipe;
|
|
||||||
import techreborn.tiles.TileAlloyFurnace;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
public class ContainerAlloyFurnace extends RebornContainer {
|
|
||||||
|
|
||||||
public int tickTime;
|
|
||||||
EntityPlayer player;
|
|
||||||
TileAlloyFurnace tile;
|
|
||||||
int currentItemBurnTime;
|
|
||||||
int burnTime;
|
|
||||||
int cookTime;
|
|
||||||
|
|
||||||
public ContainerAlloyFurnace(TileAlloyFurnace tileAlloyfurnace, EntityPlayer player) {
|
|
||||||
tile = tileAlloyfurnace;
|
|
||||||
this.player = player;
|
|
||||||
|
|
||||||
// input
|
|
||||||
this.addSlotToContainer(new SlotInputCustom(tileAlloyfurnace.inventory, 0, 47, 17, 0));
|
|
||||||
this.addSlotToContainer(new SlotInputCustom(tileAlloyfurnace.inventory, 1, 65, 17, 1));
|
|
||||||
// outputs
|
|
||||||
this.addSlotToContainer(new SlotOutput(tileAlloyfurnace.inventory, 2, 116, 35));
|
|
||||||
// Fuel
|
|
||||||
this.addSlotToContainer(new SlotFurnaceFuel(tileAlloyfurnace.inventory, 3, 56, 53));
|
|
||||||
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class SlotInputCustom extends BaseSlot {
|
|
||||||
|
|
||||||
int recipeSlot = 0;
|
|
||||||
|
|
||||||
public SlotInputCustom(IInventory inventoryIn, int index, int xPosition, int yPosition, int recipeSlot) {
|
|
||||||
super(inventoryIn, index, xPosition, yPosition);
|
|
||||||
this.recipeSlot = recipeSlot;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isItemValid(
|
|
||||||
@Nullable
|
|
||||||
ItemStack stack) {
|
|
||||||
for(IBaseRecipeType recipe : RecipeHandler.recipeList){
|
|
||||||
if(recipe instanceof AlloySmelterRecipe){
|
|
||||||
if(ItemUtils.isInputEqual(recipe.getInputs().get(recipeSlot), stack, true, true, true)){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addListener(IContainerListener crafting) {
|
|
||||||
super.addListener(crafting);
|
|
||||||
crafting.sendProgressBarUpdate(this, 0, tile.currentItemBurnTime);
|
|
||||||
crafting.sendProgressBarUpdate(this, 1, tile.burnTime);
|
|
||||||
crafting.sendProgressBarUpdate(this, 2, tile.cookTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void detectAndSendChanges() {
|
|
||||||
for (int i = 0; i < this.listeners.size(); i++) {
|
|
||||||
IContainerListener crafting = this.listeners.get(i);
|
|
||||||
if (this.currentItemBurnTime != tile.currentItemBurnTime) {
|
|
||||||
crafting.sendProgressBarUpdate(this, 0, tile.currentItemBurnTime);
|
|
||||||
}
|
|
||||||
if (this.burnTime != tile.burnTime) {
|
|
||||||
crafting.sendProgressBarUpdate(this, 1, tile.burnTime);
|
|
||||||
}
|
|
||||||
if (this.cookTime != tile.cookTime) {
|
|
||||||
crafting.sendProgressBarUpdate(this, 2, tile.cookTime);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
super.detectAndSendChanges();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateProgressBar(int id, int value) {
|
|
||||||
super.updateProgressBar(id, value);
|
|
||||||
if (id == 0) {
|
|
||||||
this.currentItemBurnTime = value;
|
|
||||||
} else if (id == 1) {
|
|
||||||
this.burnTime = value;
|
|
||||||
} else if (id == 2) {
|
|
||||||
this.cookTime = value;
|
|
||||||
}
|
|
||||||
this.tile.currentItemBurnTime = this.currentItemBurnTime;
|
|
||||||
this.tile.burnTime = this.burnTime;
|
|
||||||
this.tile.cookTime = this.cookTime;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,67 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.util.EnumFacing;
|
|
||||||
import reborncore.api.tile.IContainerLayout;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotCharge;
|
|
||||||
import reborncore.client.gui.slots.SlotInput;
|
|
||||||
import reborncore.client.gui.slots.SlotOutput;
|
|
||||||
import techreborn.api.gui.SlotUpgrade;
|
|
||||||
import techreborn.tiles.TileAlloySmelter;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class ContainerAlloySmelter extends ContainerCrafting {
|
|
||||||
|
|
||||||
public int tickTime;
|
|
||||||
EntityPlayer player;
|
|
||||||
TileAlloySmelter tile;
|
|
||||||
|
|
||||||
public ContainerAlloySmelter(EntityPlayer player, TileAlloySmelter tile) {
|
|
||||||
super(tile.crafter);
|
|
||||||
this.player = player;
|
|
||||||
this.tile = tile;
|
|
||||||
addPlayerSlots();
|
|
||||||
addInventorySlots();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void addInventorySlots() {
|
|
||||||
|
|
||||||
// input
|
|
||||||
this.addSlotToContainer(new ContainerAlloyFurnace.SlotInputCustom(tile.inventory, 0, 47, 17, 0));
|
|
||||||
this.addSlotToContainer(new ContainerAlloyFurnace.SlotInputCustom(tile.inventory, 1, 65, 17, 1));
|
|
||||||
// outputs
|
|
||||||
this.addSlotToContainer(new SlotOutput(tile.inventory, 2, 116, 35));
|
|
||||||
// battery
|
|
||||||
this.addSlotToContainer(new SlotCharge(tile.inventory, 3, 56, 53));
|
|
||||||
// upgrades
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tile.inventory, 4, 152, 8));
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tile.inventory, 5, 152, 26));
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tile.inventory, 6, 152, 44));
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tile.inventory, 7, 152, 62));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void addPlayerSlots() {
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,64 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.util.EnumFacing;
|
|
||||||
import reborncore.api.tile.IContainerLayout;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotOutput;
|
|
||||||
import techreborn.api.gui.SlotUpgrade;
|
|
||||||
import techreborn.tiles.TileAssemblingMachine;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class ContainerAssemblingMachine extends ContainerCrafting{
|
|
||||||
|
|
||||||
public int tickTime;
|
|
||||||
EntityPlayer player;
|
|
||||||
TileAssemblingMachine tile;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ContainerAssemblingMachine(EntityPlayer player, TileAssemblingMachine tile) {
|
|
||||||
super(tile.crafter);
|
|
||||||
this.player = player;
|
|
||||||
this.tile = tile;
|
|
||||||
addPlayerSlots();
|
|
||||||
addInventorySlots();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void addInventorySlots() {
|
|
||||||
// input
|
|
||||||
this.addSlotToContainer(new BaseSlot(tile.inventory, 0, 47, 17));
|
|
||||||
this.addSlotToContainer(new BaseSlot(tile.inventory, 1, 65, 17));
|
|
||||||
// outputs
|
|
||||||
this.addSlotToContainer(new SlotOutput(tile.inventory, 2, 116, 35));
|
|
||||||
// power
|
|
||||||
this.addSlotToContainer(new BaseSlot(tile.inventory, 3, 56, 53));
|
|
||||||
// upgrades
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tile.inventory, 4, 152, 8));
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tile.inventory, 5, 152, 26));
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tile.inventory, 6, 152, 44));
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tile.inventory, 7, 152, 62));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void addPlayerSlots() {
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,80 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.inventory.IContainerListener;
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotCharge;
|
|
||||||
import reborncore.common.container.RebornContainer;
|
|
||||||
import techreborn.tiles.storage.TileBatBox;
|
|
||||||
|
|
||||||
public class ContainerBatbox extends RebornContainer {
|
|
||||||
|
|
||||||
public int burnTime = 0;
|
|
||||||
public int totalBurnTime = 0;
|
|
||||||
public int energy;
|
|
||||||
public int tickTime;
|
|
||||||
EntityPlayer player;
|
|
||||||
TileBatBox tile;
|
|
||||||
|
|
||||||
public ContainerBatbox(TileBatBox tile, EntityPlayer player) {
|
|
||||||
super();
|
|
||||||
this.tile = tile;
|
|
||||||
this.player = player;
|
|
||||||
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
|
|
||||||
this.addSlotToContainer(new SlotCharge(tile.inventory, 0, 80, 17));
|
|
||||||
this.addSlotToContainer(new SlotCharge(tile.inventory, 1, 80, 53));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void detectAndSendChanges() {
|
|
||||||
super.detectAndSendChanges();
|
|
||||||
for (int i = 0; i < this.listeners.size(); i++) {
|
|
||||||
IContainerListener IContainerListener = this.listeners.get(i);
|
|
||||||
if (this.energy != (int) tile.getEnergy()) {
|
|
||||||
IContainerListener.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addListener(IContainerListener crafting) {
|
|
||||||
super.addListener(crafting);
|
|
||||||
crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@Override
|
|
||||||
public void updateProgressBar(int id, int value) {
|
|
||||||
if (id == 0) {
|
|
||||||
this.burnTime = value;
|
|
||||||
} else if (id == 1) {
|
|
||||||
this.totalBurnTime = value;
|
|
||||||
} else if (id == 2) {
|
|
||||||
this.energy = value;
|
|
||||||
}
|
|
||||||
this.tile.setEnergy(energy);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getScaledBurnTime(int i) {
|
|
||||||
return (int) (((float) burnTime / (float) totalBurnTime) * i);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,74 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.inventory.IContainerListener;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotOutput;
|
|
||||||
import techreborn.tiles.multiblock.TileBlastFurnace;
|
|
||||||
|
|
||||||
public class ContainerBlastFurnace extends ContainerCrafting {
|
|
||||||
|
|
||||||
public int heat;
|
|
||||||
public int tickTime;
|
|
||||||
EntityPlayer player;
|
|
||||||
TileBlastFurnace tile;
|
|
||||||
|
|
||||||
public ContainerBlastFurnace(TileBlastFurnace tileblastfurnace, EntityPlayer player) {
|
|
||||||
super(tileblastfurnace.crafter);
|
|
||||||
tile = tileblastfurnace;
|
|
||||||
this.player = player;
|
|
||||||
|
|
||||||
// input
|
|
||||||
this.addSlotToContainer(new BaseSlot(tileblastfurnace.inventory, 0, 40, 25));// Input
|
|
||||||
// 1
|
|
||||||
this.addSlotToContainer(new BaseSlot(tileblastfurnace.inventory, 1, 40, 43));// Input
|
|
||||||
// 2
|
|
||||||
// outputs
|
|
||||||
this.addSlotToContainer(new SlotOutput(tileblastfurnace.inventory, 2, 100, 35));// Output
|
|
||||||
// 1
|
|
||||||
this.addSlotToContainer(new SlotOutput(tileblastfurnace.inventory, 3, 118, 35));// Output
|
|
||||||
// 2
|
|
||||||
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void detectAndSendChanges() {
|
|
||||||
super.detectAndSendChanges();
|
|
||||||
for (int i = 0; i < this.listeners.size(); i++) {
|
|
||||||
IContainerListener IContainerListener = this.listeners.get(i);
|
|
||||||
if (this.heat != tile.getHeat()) {
|
|
||||||
IContainerListener.sendProgressBarUpdate(this, 10, tile.getHeat());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addListener(IContainerListener crafting) {
|
|
||||||
super.addListener(crafting);
|
|
||||||
crafting.sendProgressBarUpdate(this, 10, tile.getHeat());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateProgressBar(int id, int value) {
|
|
||||||
if (id == 10) {
|
|
||||||
this.heat = value;
|
|
||||||
}
|
|
||||||
super.updateProgressBar(id, value);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,67 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.util.EnumFacing;
|
|
||||||
import reborncore.api.tile.IContainerLayout;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotOutput;
|
|
||||||
import techreborn.api.gui.SlotUpgrade;
|
|
||||||
import techreborn.tiles.TileCentrifuge;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class ContainerCentrifuge extends ContainerCrafting {
|
|
||||||
|
|
||||||
public int tickTime;
|
|
||||||
EntityPlayer player;
|
|
||||||
TileCentrifuge tile;
|
|
||||||
|
|
||||||
public ContainerCentrifuge(EntityPlayer player, TileCentrifuge tile) {
|
|
||||||
super(tile.crafter);
|
|
||||||
this.player = player;
|
|
||||||
this.tile = tile;
|
|
||||||
addInventorySlots();
|
|
||||||
addPlayerSlots();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void addInventorySlots() {
|
|
||||||
// input
|
|
||||||
this.addSlotToContainer(new BaseSlot(tile.inventory, 0, 80, 35));
|
|
||||||
this.addSlotToContainer(new BaseSlot(tile.inventory, 1, 50, 5));
|
|
||||||
// outputs
|
|
||||||
this.addSlotToContainer(new SlotOutput(tile.inventory, 2, 80, 5));
|
|
||||||
this.addSlotToContainer(new SlotOutput(tile.inventory, 3, 110, 35));
|
|
||||||
this.addSlotToContainer(new SlotOutput(tile.inventory, 4, 80, 65));
|
|
||||||
this.addSlotToContainer(new SlotOutput(tile.inventory, 5, 50, 35));
|
|
||||||
// battery
|
|
||||||
this.addSlotToContainer(new BaseSlot(tile.inventory, 6, 8, 51));
|
|
||||||
// upgrades
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tile.inventory, 7, 152, 8));
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tile.inventory, 8, 152, 26));
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tile.inventory, 9, 152, 44));
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tile.inventory, 10, 152, 62));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void addPlayerSlots() {
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,45 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.common.container.RebornContainer;
|
|
||||||
import techreborn.tiles.TileChargeBench;
|
|
||||||
|
|
||||||
//import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
|
|
||||||
public class ContainerChargeBench extends RebornContainer {
|
|
||||||
|
|
||||||
public int tickTime;
|
|
||||||
EntityPlayer player;
|
|
||||||
TileChargeBench tile;
|
|
||||||
|
|
||||||
public ContainerChargeBench(TileChargeBench tileChargeBench, EntityPlayer player) {
|
|
||||||
tile = tileChargeBench;
|
|
||||||
this.player = player;
|
|
||||||
|
|
||||||
this.addSlotToContainer(new BaseSlot(tileChargeBench.inventory, 0, 62, 21));
|
|
||||||
this.addSlotToContainer(new BaseSlot(tileChargeBench.inventory, 1, 80, 21));
|
|
||||||
this.addSlotToContainer(new BaseSlot(tileChargeBench.inventory, 2, 98, 21));
|
|
||||||
this.addSlotToContainer(new BaseSlot(tileChargeBench.inventory, 3, 62, 39));
|
|
||||||
this.addSlotToContainer(new BaseSlot(tileChargeBench.inventory, 4, 80, 39));
|
|
||||||
this.addSlotToContainer(new BaseSlot(tileChargeBench.inventory, 5, 98, 39));
|
|
||||||
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,51 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotOutput;
|
|
||||||
import techreborn.api.gui.SlotUpgrade;
|
|
||||||
import techreborn.tiles.TileChemicalReactor;
|
|
||||||
|
|
||||||
public class ContainerChemicalReactor extends ContainerCrafting {
|
|
||||||
|
|
||||||
public int tickTime;
|
|
||||||
EntityPlayer player;
|
|
||||||
TileChemicalReactor tile;
|
|
||||||
|
|
||||||
public ContainerChemicalReactor(TileChemicalReactor tilechemicalReactor, EntityPlayer player) {
|
|
||||||
super(tilechemicalReactor.crafter);
|
|
||||||
tile = tilechemicalReactor;
|
|
||||||
this.player = player;
|
|
||||||
|
|
||||||
// input
|
|
||||||
this.addSlotToContainer(new BaseSlot(tilechemicalReactor.inventory, 0, 70, 21));
|
|
||||||
this.addSlotToContainer(new BaseSlot(tilechemicalReactor.inventory, 1, 90, 21));
|
|
||||||
// outputs
|
|
||||||
this.addSlotToContainer(new SlotOutput(tilechemicalReactor.inventory, 2, 80, 51));
|
|
||||||
// battery
|
|
||||||
this.addSlotToContainer(new BaseSlot(tilechemicalReactor.inventory, 3, 8, 51));
|
|
||||||
// upgrades
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tilechemicalReactor.inventory, 4, 152, 8));
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tilechemicalReactor.inventory, 5, 152, 26));
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tilechemicalReactor.inventory, 6, 152, 44));
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tilechemicalReactor.inventory, 7, 152, 62));
|
|
||||||
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,34 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.common.container.RebornContainer;
|
|
||||||
import techreborn.tiles.TileChunkLoader;
|
|
||||||
|
|
||||||
public class ContainerChunkloader extends RebornContainer {
|
|
||||||
|
|
||||||
EntityPlayer player;
|
|
||||||
|
|
||||||
public ContainerChunkloader(TileChunkLoader tilechunkloader, EntityPlayer player) {
|
|
||||||
this.player = player;
|
|
||||||
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer p_75145_1_) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,47 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotOutput;
|
|
||||||
import techreborn.api.gui.SlotUpgrade;
|
|
||||||
import techreborn.tiles.teir1.TileCompressor;
|
|
||||||
|
|
||||||
public class ContainerCompressor extends ContainerCrafting {
|
|
||||||
|
|
||||||
public int connectionStatus;
|
|
||||||
EntityPlayer player;
|
|
||||||
TileCompressor tile;
|
|
||||||
|
|
||||||
public ContainerCompressor(TileCompressor tileGrinder, EntityPlayer player) {
|
|
||||||
super(tileGrinder.crafter);
|
|
||||||
tile = tileGrinder;
|
|
||||||
this.player = player;
|
|
||||||
|
|
||||||
// input
|
|
||||||
this.addSlotToContainer(new BaseSlot(tileGrinder.inventory, 0, 56, 34));
|
|
||||||
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34));
|
|
||||||
|
|
||||||
// upgrades
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 2, 152, 8));
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 3, 152, 26));
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 4, 152, 44));
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 5, 152, 62));
|
|
||||||
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer p_75145_1_) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,71 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.inventory.IContainerListener;
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
import reborncore.common.container.RebornContainer;
|
|
||||||
import reborncore.common.recipes.RecipeCrafter;
|
|
||||||
|
|
||||||
public abstract class ContainerCrafting extends RebornContainer {
|
|
||||||
|
|
||||||
RecipeCrafter crafter;
|
|
||||||
|
|
||||||
int currentTickTime = 0;
|
|
||||||
int currentNeededTicks = 0;
|
|
||||||
int energy;
|
|
||||||
|
|
||||||
public ContainerCrafting(RecipeCrafter crafter) {
|
|
||||||
this();
|
|
||||||
this.crafter = crafter;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ContainerCrafting() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCrafter(RecipeCrafter crafter) {
|
|
||||||
this.crafter = crafter;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void detectAndSendChanges() {
|
|
||||||
super.detectAndSendChanges();
|
|
||||||
for (int i = 0; i < this.listeners.size(); i++) {
|
|
||||||
IContainerListener IContainerListener = this.listeners.get(i);
|
|
||||||
if (this.currentTickTime != crafter.currentTickTime || crafter.currentTickTime == -1) {
|
|
||||||
IContainerListener.sendProgressBarUpdate(this, 0, crafter.currentTickTime);
|
|
||||||
}
|
|
||||||
if (this.currentNeededTicks != crafter.currentNeededTicks) {
|
|
||||||
IContainerListener.sendProgressBarUpdate(this, 1, crafter.currentNeededTicks);
|
|
||||||
}
|
|
||||||
if (this.energy != (int) crafter.energy.getEnergy()) {
|
|
||||||
IContainerListener.sendProgressBarUpdate(this, 2, (int) crafter.energy.getEnergy());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addListener(IContainerListener crafting) {
|
|
||||||
super.addListener(crafting);
|
|
||||||
crafting.sendProgressBarUpdate(this, 0, crafter.currentTickTime);
|
|
||||||
crafting.sendProgressBarUpdate(this, 1, crafter.currentNeededTicks);
|
|
||||||
crafting.sendProgressBarUpdate(this, 2, (int) crafter.energy.getEnergy());
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@Override
|
|
||||||
public void updateProgressBar(int id, int value) {
|
|
||||||
if (id == 0) {
|
|
||||||
this.currentTickTime = value;
|
|
||||||
if (this.currentTickTime == -1) {
|
|
||||||
this.currentTickTime = 0;
|
|
||||||
}
|
|
||||||
} else if (id == 1) {
|
|
||||||
this.currentNeededTicks = value;
|
|
||||||
} else if (id == 2) {
|
|
||||||
this.energy = value;
|
|
||||||
}
|
|
||||||
this.crafter.currentTickTime = currentTickTime;
|
|
||||||
this.crafter.currentNeededTicks = currentNeededTicks;
|
|
||||||
this.crafter.energy.setEnergy(energy);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,76 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.inventory.IContainerListener;
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotFake;
|
|
||||||
import reborncore.client.gui.slots.SlotOutput;
|
|
||||||
import reborncore.common.container.RebornContainer;
|
|
||||||
import techreborn.tiles.generator.TileDieselGenerator;
|
|
||||||
|
|
||||||
public class ContainerDieselGenerator extends RebornContainer {
|
|
||||||
public TileDieselGenerator tiledieselGenerator;
|
|
||||||
public EntityPlayer player;
|
|
||||||
public int energy;
|
|
||||||
public int fluid;
|
|
||||||
|
|
||||||
public ContainerDieselGenerator(TileDieselGenerator tiledieselGenerator, EntityPlayer player) {
|
|
||||||
super();
|
|
||||||
this.tiledieselGenerator = tiledieselGenerator;
|
|
||||||
this.player = player;
|
|
||||||
|
|
||||||
this.addSlotToContainer(new BaseSlot(tiledieselGenerator.inventory, 0, 80, 17));
|
|
||||||
this.addSlotToContainer(new SlotOutput(tiledieselGenerator.inventory, 1, 80, 53));
|
|
||||||
this.addSlotToContainer(new SlotFake(tiledieselGenerator.inventory, 2, 59, 42, false, false, 1));
|
|
||||||
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void detectAndSendChanges() {
|
|
||||||
super.detectAndSendChanges();
|
|
||||||
for (int i = 0; i < this.listeners.size(); i++) {
|
|
||||||
IContainerListener IContainerListener = this.listeners.get(i);
|
|
||||||
if (this.energy != (int) tiledieselGenerator.getEnergy()) {
|
|
||||||
IContainerListener.sendProgressBarUpdate(this, 0, (int) tiledieselGenerator.getEnergy());
|
|
||||||
}
|
|
||||||
if (this.fluid != tiledieselGenerator.tank.getFluidAmount()) {
|
|
||||||
IContainerListener.sendProgressBarUpdate(this, 1, tiledieselGenerator.tank.getFluidAmount());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addListener(IContainerListener crafting) {
|
|
||||||
super.addListener(crafting);
|
|
||||||
crafting.sendProgressBarUpdate(this, 0, (int) tiledieselGenerator.getEnergy());
|
|
||||||
crafting.sendProgressBarUpdate(this, 1, tiledieselGenerator.tank.getFluidAmount());
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@Override
|
|
||||||
public void updateProgressBar(int id, int value) {
|
|
||||||
if (id == 0) {
|
|
||||||
this.energy = value;
|
|
||||||
} else if (id == 1) {
|
|
||||||
this.fluid = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,41 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotFake;
|
|
||||||
import reborncore.client.gui.slots.SlotOutput;
|
|
||||||
import reborncore.common.container.RebornContainer;
|
|
||||||
import techreborn.tiles.TileDigitalChest;
|
|
||||||
|
|
||||||
public class ContainerDigitalChest extends RebornContainer {
|
|
||||||
public TileDigitalChest tileDigitalChest;
|
|
||||||
public EntityPlayer player;
|
|
||||||
|
|
||||||
public ContainerDigitalChest(TileDigitalChest tileDigitalChest, EntityPlayer player) {
|
|
||||||
super();
|
|
||||||
this.tileDigitalChest = tileDigitalChest;
|
|
||||||
this.player = player;
|
|
||||||
|
|
||||||
this.addSlotToContainer(new BaseSlot(tileDigitalChest.inventory, 0, 80, 17));
|
|
||||||
this.addSlotToContainer(new SlotOutput(tileDigitalChest.inventory, 1, 80, 53));
|
|
||||||
this.addSlotToContainer(new SlotFake(tileDigitalChest.inventory, 2, 59, 42, false, false, Integer.MAX_VALUE));
|
|
||||||
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,59 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotOutput;
|
|
||||||
import reborncore.common.container.RebornContainer;
|
|
||||||
import techreborn.api.gui.SlotUpgrade;
|
|
||||||
import techreborn.tiles.teir1.TileElectricFurnace;
|
|
||||||
|
|
||||||
public class ContainerElectricFurnace extends RebornContainer {
|
|
||||||
|
|
||||||
public int connectionStatus;
|
|
||||||
EntityPlayer player;
|
|
||||||
TileElectricFurnace tile;
|
|
||||||
|
|
||||||
public ContainerElectricFurnace(TileElectricFurnace tileGrinder, EntityPlayer player) {
|
|
||||||
super();
|
|
||||||
tile = tileGrinder;
|
|
||||||
this.player = player;
|
|
||||||
|
|
||||||
// input
|
|
||||||
this.addSlotToContainer(new BaseSlot(tileGrinder.inventory, 0, 56, 34));
|
|
||||||
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34));
|
|
||||||
|
|
||||||
// upgrades
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 2, 152, 8));
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 3, 152, 26));
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 4, 152, 44));
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 5, 152, 62));
|
|
||||||
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer p_75145_1_) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@Override
|
|
||||||
public void updateProgressBar(int id, int value) {
|
|
||||||
if (id == 10) {
|
|
||||||
this.connectionStatus = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,51 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotInput;
|
|
||||||
import reborncore.client.gui.slots.SlotOutput;
|
|
||||||
import techreborn.api.gui.SlotUpgrade;
|
|
||||||
import techreborn.tiles.teir1.TileExtractor;
|
|
||||||
|
|
||||||
public class ContainerExtractor extends ContainerCrafting {
|
|
||||||
|
|
||||||
EntityPlayer player;
|
|
||||||
TileExtractor tileExtractor;
|
|
||||||
|
|
||||||
public ContainerExtractor(EntityPlayer player, TileExtractor tileExtractor) {
|
|
||||||
super(tileExtractor.crafter);
|
|
||||||
this.player = player;
|
|
||||||
this.tileExtractor = tileExtractor;
|
|
||||||
// input
|
|
||||||
this.addSlotToContainer(new SlotInput(tileExtractor.inventory, 0, 56, 34));
|
|
||||||
this.addSlotToContainer(new SlotOutput(tileExtractor.inventory, 1, 116, 34));
|
|
||||||
|
|
||||||
// upgrades
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tileExtractor.inventory, 2, 152, 8));
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tileExtractor.inventory, 3, 152, 26));
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tileExtractor.inventory, 4, 152, 44));
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tileExtractor.inventory, 5, 152, 62));
|
|
||||||
|
|
||||||
addPlayerSlots();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer p_75145_1_) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addPlayerSlots() {
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,111 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.inventory.IContainerListener;
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotOutput;
|
|
||||||
import reborncore.common.container.RebornContainer;
|
|
||||||
import techreborn.tiles.fusionReactor.TileEntityFusionController;
|
|
||||||
|
|
||||||
public class ContainerFusionReactor extends RebornContainer {
|
|
||||||
|
|
||||||
public int coilStatus;
|
|
||||||
public int energy;
|
|
||||||
public int tickTime;
|
|
||||||
public int finalTickTime;
|
|
||||||
public int neededEU;
|
|
||||||
|
|
||||||
TileEntityFusionController fusionController;
|
|
||||||
|
|
||||||
public ContainerFusionReactor(TileEntityFusionController tileEntityFusionController, EntityPlayer player) {
|
|
||||||
super();
|
|
||||||
this.fusionController = tileEntityFusionController;
|
|
||||||
|
|
||||||
addSlotToContainer(new BaseSlot(tileEntityFusionController, 0, 88, 17));
|
|
||||||
addSlotToContainer(new BaseSlot(tileEntityFusionController, 1, 88, 53));
|
|
||||||
addSlotToContainer(new SlotOutput(tileEntityFusionController, 2, 148, 35));
|
|
||||||
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void detectAndSendChanges() {
|
|
||||||
super.detectAndSendChanges();
|
|
||||||
for (int i = 0; i < this.listeners.size(); i++) {
|
|
||||||
IContainerListener IContainerListener = this.listeners.get(i);
|
|
||||||
if (this.coilStatus != fusionController.coilStatus) {
|
|
||||||
IContainerListener.sendProgressBarUpdate(this, 0, fusionController.coilStatus);
|
|
||||||
}
|
|
||||||
if (this.energy != (int) fusionController.getEnergy()) {
|
|
||||||
IContainerListener.sendProgressBarUpdate(this, 1, (int) fusionController.getEnergy());
|
|
||||||
}
|
|
||||||
if (this.tickTime != fusionController.crafingTickTime) {
|
|
||||||
IContainerListener.sendProgressBarUpdate(this, 2, fusionController.crafingTickTime);
|
|
||||||
}
|
|
||||||
if (this.finalTickTime != fusionController.finalTickTime) {
|
|
||||||
IContainerListener.sendProgressBarUpdate(this, 3, fusionController.finalTickTime);
|
|
||||||
}
|
|
||||||
if (this.neededEU != fusionController.neededPower) {
|
|
||||||
IContainerListener.sendProgressBarUpdate(this, 4, fusionController.neededPower);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addListener(IContainerListener crafting) {
|
|
||||||
super.addListener(crafting);
|
|
||||||
crafting.sendProgressBarUpdate(this, 0, fusionController.coilStatus);
|
|
||||||
crafting.sendProgressBarUpdate(this, 1, (int) fusionController.getEnergy());
|
|
||||||
crafting.sendProgressBarUpdate(this, 2, fusionController.crafingTickTime);
|
|
||||||
crafting.sendProgressBarUpdate(this, 3, fusionController.finalTickTime);
|
|
||||||
crafting.sendProgressBarUpdate(this, 4, fusionController.neededPower);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@Override
|
|
||||||
public void updateProgressBar(int id, int value) {
|
|
||||||
if (id == 0) {
|
|
||||||
this.coilStatus = value;
|
|
||||||
} else if (id == 1) {
|
|
||||||
this.energy = value;
|
|
||||||
} else if (id == 2) {
|
|
||||||
this.tickTime = value;
|
|
||||||
} else if (id == 3) {
|
|
||||||
this.finalTickTime = value;
|
|
||||||
} else if (id == 4) {
|
|
||||||
this.neededEU = value;
|
|
||||||
}
|
|
||||||
if (tickTime == -1) {
|
|
||||||
tickTime = 0;
|
|
||||||
}
|
|
||||||
if (finalTickTime == -1) {
|
|
||||||
finalTickTime = 0;
|
|
||||||
}
|
|
||||||
if (neededEU == -1) {
|
|
||||||
neededEU = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getProgressScaled() {
|
|
||||||
return Math.max(0, Math.min(24,
|
|
||||||
(this.tickTime > 0 ? 1 : 0) + this.tickTime * 24 / (this.finalTickTime < 1 ? 1 : this.finalTickTime)));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,40 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotFake;
|
|
||||||
import reborncore.client.gui.slots.SlotOutput;
|
|
||||||
import reborncore.common.container.RebornContainer;
|
|
||||||
import techreborn.tiles.generator.TileGasTurbine;
|
|
||||||
|
|
||||||
public class ContainerGasTurbine extends RebornContainer {
|
|
||||||
public TileGasTurbine tileGasTurbine;
|
|
||||||
public EntityPlayer player;
|
|
||||||
|
|
||||||
public ContainerGasTurbine(TileGasTurbine tileGasTurbine, EntityPlayer player) {
|
|
||||||
super();
|
|
||||||
this.tileGasTurbine = tileGasTurbine;
|
|
||||||
this.player = player;
|
|
||||||
|
|
||||||
this.addSlotToContainer(new BaseSlot(tileGasTurbine.inventory, 0, 80, 17));
|
|
||||||
this.addSlotToContainer(new SlotOutput(tileGasTurbine.inventory, 1, 80, 53));
|
|
||||||
this.addSlotToContainer(new SlotFake(tileGasTurbine.inventory, 2, 59, 42, false, false, 1));
|
|
||||||
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,92 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.inventory.IContainerListener;
|
|
||||||
import net.minecraft.inventory.SlotFurnaceFuel;
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotCharge;
|
|
||||||
import reborncore.common.container.RebornContainer;
|
|
||||||
import techreborn.tiles.generator.TileGenerator;
|
|
||||||
|
|
||||||
public class ContainerGenerator extends RebornContainer {
|
|
||||||
|
|
||||||
public int burnTime = 0;
|
|
||||||
public int totalBurnTime = 0;
|
|
||||||
public int energy;
|
|
||||||
public int tickTime;
|
|
||||||
EntityPlayer player;
|
|
||||||
TileGenerator tile;
|
|
||||||
|
|
||||||
public ContainerGenerator(TileGenerator tile, EntityPlayer player) {
|
|
||||||
super();
|
|
||||||
this.tile = tile;
|
|
||||||
this.player = player;
|
|
||||||
|
|
||||||
// fuel
|
|
||||||
this.addSlotToContainer(new SlotFurnaceFuel(tile.inventory, 0, 80, 53));
|
|
||||||
// charge
|
|
||||||
this.addSlotToContainer(new SlotCharge(tile.inventory, 1, 80, 17));
|
|
||||||
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void detectAndSendChanges() {
|
|
||||||
super.detectAndSendChanges();
|
|
||||||
for (int i = 0; i < this.listeners.size(); i++) {
|
|
||||||
IContainerListener IContainerListener = this.listeners.get(i);
|
|
||||||
if (this.burnTime != tile.burnTime) {
|
|
||||||
IContainerListener.sendProgressBarUpdate(this, 0, tile.burnTime);
|
|
||||||
}
|
|
||||||
if (this.totalBurnTime != tile.totalBurnTime) {
|
|
||||||
IContainerListener.sendProgressBarUpdate(this, 1, tile.totalBurnTime);
|
|
||||||
}
|
|
||||||
if (this.energy != (int) tile.getEnergy()) {
|
|
||||||
IContainerListener.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addListener(IContainerListener crafting) {
|
|
||||||
super.addListener(crafting);
|
|
||||||
crafting.sendProgressBarUpdate(this, 0, tile.burnTime);
|
|
||||||
crafting.sendProgressBarUpdate(this, 1, tile.totalBurnTime);
|
|
||||||
crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@Override
|
|
||||||
public void updateProgressBar(int id, int value) {
|
|
||||||
if (id == 0) {
|
|
||||||
this.burnTime = value;
|
|
||||||
} else if (id == 1) {
|
|
||||||
this.totalBurnTime = value;
|
|
||||||
} else if (id == 2) {
|
|
||||||
this.energy = value;
|
|
||||||
}
|
|
||||||
this.tile.setEnergy(energy);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getScaledBurnTime(int i) {
|
|
||||||
return (int) (((float) burnTime / (float) totalBurnTime) * i);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,56 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotInput;
|
|
||||||
import reborncore.client.gui.slots.SlotOutput;
|
|
||||||
import techreborn.api.gui.SlotUpgrade;
|
|
||||||
import techreborn.tiles.teir1.TileGrinder;
|
|
||||||
|
|
||||||
public class ContainerGrinder extends ContainerCrafting {
|
|
||||||
|
|
||||||
public int connectionStatus;
|
|
||||||
EntityPlayer player;
|
|
||||||
TileGrinder tile;
|
|
||||||
|
|
||||||
public ContainerGrinder(EntityPlayer player, TileGrinder tile) {
|
|
||||||
super(tile.crafter);
|
|
||||||
this.player = player;
|
|
||||||
this.tile = tile;
|
|
||||||
addInventorySlots();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer p_75145_1_) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addInventorySlots() {
|
|
||||||
// input
|
|
||||||
this.addSlotToContainer(new SlotInput(tile.inventory, 0, 56, 34));
|
|
||||||
this.addSlotToContainer(new SlotOutput(tile.inventory, 1, 116, 34));
|
|
||||||
|
|
||||||
// upgrades
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tile.inventory, 2, 152, 8));
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tile.inventory, 3, 152, 26));
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tile.inventory, 4, 152, 44));
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tile.inventory, 5, 152, 62));
|
|
||||||
|
|
||||||
addPlayerSlots();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addPlayerSlots() {
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,77 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.inventory.IContainerListener;
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotOutput;
|
|
||||||
import techreborn.tiles.multiblock.TileImplosionCompressor;
|
|
||||||
|
|
||||||
public class ContainerImplosionCompressor extends ContainerCrafting {
|
|
||||||
|
|
||||||
public int tickTime;
|
|
||||||
public int multIBlockState = 0;
|
|
||||||
EntityPlayer player;
|
|
||||||
TileImplosionCompressor tile;
|
|
||||||
|
|
||||||
public ContainerImplosionCompressor(TileImplosionCompressor tilecompressor, EntityPlayer player) {
|
|
||||||
super(tilecompressor.crafter);
|
|
||||||
tile = tilecompressor;
|
|
||||||
this.player = player;
|
|
||||||
|
|
||||||
// input
|
|
||||||
this.addSlotToContainer(new BaseSlot(tilecompressor.inventory, 0, 37, 26));
|
|
||||||
this.addSlotToContainer(new BaseSlot(tilecompressor.inventory, 1, 37, 44));
|
|
||||||
// outputs
|
|
||||||
this.addSlotToContainer(new SlotOutput(tilecompressor.inventory, 2, 93, 35));
|
|
||||||
this.addSlotToContainer(new SlotOutput(tilecompressor.inventory, 3, 111, 35));
|
|
||||||
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer p_75145_1_) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void detectAndSendChanges() {
|
|
||||||
super.detectAndSendChanges();
|
|
||||||
for (int i = 0; i < this.listeners.size(); i++) {
|
|
||||||
IContainerListener IContainerListener = this.listeners.get(i);
|
|
||||||
if (this.multIBlockState != getMultIBlockStateint()) {
|
|
||||||
IContainerListener.sendProgressBarUpdate(this, 3, getMultIBlockStateint());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addListener(IContainerListener crafting) {
|
|
||||||
super.addListener(crafting);
|
|
||||||
crafting.sendProgressBarUpdate(this, 3, getMultIBlockStateint());
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@Override
|
|
||||||
public void updateProgressBar(int id, int value) {
|
|
||||||
if (id == 3) {
|
|
||||||
this.multIBlockState = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getMultIBlockStateint() {
|
|
||||||
return tile.getMutliBlock() ? 1 : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,48 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotOutput;
|
|
||||||
import techreborn.tiles.TileIndustrialElectrolyzer;
|
|
||||||
|
|
||||||
public class ContainerIndustrialElectrolyzer extends ContainerCrafting {
|
|
||||||
|
|
||||||
public int tickTime;
|
|
||||||
EntityPlayer player;
|
|
||||||
TileIndustrialElectrolyzer tile;
|
|
||||||
|
|
||||||
public ContainerIndustrialElectrolyzer(TileIndustrialElectrolyzer electrolyzer, EntityPlayer player) {
|
|
||||||
super(electrolyzer.crafter);
|
|
||||||
tile = electrolyzer;
|
|
||||||
this.player = player;
|
|
||||||
|
|
||||||
// input
|
|
||||||
this.addSlotToContainer(new BaseSlot(electrolyzer.inventory, 0, 80, 51));
|
|
||||||
this.addSlotToContainer(new BaseSlot(electrolyzer.inventory, 1, 50, 51));
|
|
||||||
// outputs
|
|
||||||
this.addSlotToContainer(new SlotOutput(electrolyzer.inventory, 2, 50, 19));
|
|
||||||
this.addSlotToContainer(new SlotOutput(electrolyzer.inventory, 3, 70, 19));
|
|
||||||
this.addSlotToContainer(new SlotOutput(electrolyzer.inventory, 4, 90, 19));
|
|
||||||
this.addSlotToContainer(new SlotOutput(electrolyzer.inventory, 5, 110, 19));
|
|
||||||
|
|
||||||
// battery
|
|
||||||
this.addSlotToContainer(new BaseSlot(electrolyzer.inventory, 6, 18, 51));
|
|
||||||
|
|
||||||
int i;
|
|
||||||
for (i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,45 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotOutput;
|
|
||||||
import techreborn.tiles.multiblock.TileIndustrialGrinder;
|
|
||||||
|
|
||||||
public class ContainerIndustrialGrinder extends ContainerCrafting {
|
|
||||||
|
|
||||||
EntityPlayer player;
|
|
||||||
TileIndustrialGrinder tile;
|
|
||||||
|
|
||||||
public ContainerIndustrialGrinder(TileIndustrialGrinder tileGrinder, EntityPlayer player) {
|
|
||||||
super(tileGrinder.getRecipeCrafter());
|
|
||||||
tile = tileGrinder;
|
|
||||||
this.player = player;
|
|
||||||
|
|
||||||
// input
|
|
||||||
this.addSlotToContainer(new BaseSlot(tileGrinder.inventory, 0, 32, 26));
|
|
||||||
this.addSlotToContainer(new BaseSlot(tileGrinder.inventory, 1, 32, 44));
|
|
||||||
|
|
||||||
// outputs
|
|
||||||
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 2, 77, 35));
|
|
||||||
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 3, 95, 35));
|
|
||||||
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 4, 113, 35));
|
|
||||||
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 5, 131, 35));
|
|
||||||
|
|
||||||
for (int i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,43 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotOutput;
|
|
||||||
import reborncore.common.container.RebornContainer;
|
|
||||||
import techreborn.tiles.multiblock.TileIndustrialSawmill;
|
|
||||||
|
|
||||||
public class ContainerIndustrialSawmill extends RebornContainer {
|
|
||||||
|
|
||||||
public int tickTime;
|
|
||||||
EntityPlayer player;
|
|
||||||
TileIndustrialSawmill tile;
|
|
||||||
|
|
||||||
public ContainerIndustrialSawmill(TileIndustrialSawmill tileIndustrialSawmill, EntityPlayer player) {
|
|
||||||
tile = tileIndustrialSawmill;
|
|
||||||
this.player = player;
|
|
||||||
|
|
||||||
// input
|
|
||||||
this.addSlotToContainer(new BaseSlot(tileIndustrialSawmill.inventory, 0, 32, 26));
|
|
||||||
this.addSlotToContainer(new BaseSlot(tileIndustrialSawmill.inventory, 1, 32, 44));
|
|
||||||
// outputs
|
|
||||||
this.addSlotToContainer(new SlotOutput(tileIndustrialSawmill.inventory, 2, 84, 35));
|
|
||||||
this.addSlotToContainer(new SlotOutput(tileIndustrialSawmill.inventory, 3, 102, 35));
|
|
||||||
this.addSlotToContainer(new SlotOutput(tileIndustrialSawmill.inventory, 4, 120, 35));
|
|
||||||
|
|
||||||
for (int i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,54 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.inventory.SlotFurnaceFuel;
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotOutput;
|
|
||||||
import reborncore.common.container.RebornContainer;
|
|
||||||
import techreborn.tiles.TileIronFurnace;
|
|
||||||
|
|
||||||
public class ContainerIronFurnace extends RebornContainer {
|
|
||||||
|
|
||||||
public int connectionStatus;
|
|
||||||
EntityPlayer player;
|
|
||||||
TileIronFurnace tile;
|
|
||||||
|
|
||||||
public ContainerIronFurnace(TileIronFurnace tileGrinder, EntityPlayer player) {
|
|
||||||
super();
|
|
||||||
tile = tileGrinder;
|
|
||||||
this.player = player;
|
|
||||||
|
|
||||||
// input
|
|
||||||
this.addSlotToContainer(new BaseSlot(tileGrinder.inventory, 0, 56, 17));
|
|
||||||
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34));
|
|
||||||
// Fuel
|
|
||||||
this.addSlotToContainer(new SlotFurnaceFuel(tileGrinder.inventory, 2, 56, 53));
|
|
||||||
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@Override
|
|
||||||
public void updateProgressBar(int id, int value) {
|
|
||||||
if (id == 10) {
|
|
||||||
this.connectionStatus = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,98 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Rushmead
|
|
||||||
*/
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
|
||||||
import net.minecraft.inventory.IContainerListener;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotCharge;
|
|
||||||
import reborncore.common.container.RebornContainer;
|
|
||||||
import techreborn.tiles.storage.TileMFE;
|
|
||||||
|
|
||||||
public class ContainerMFE extends RebornContainer {
|
|
||||||
|
|
||||||
public int burnTime = 0;
|
|
||||||
public int totalBurnTime = 0;
|
|
||||||
public int energy;
|
|
||||||
public int tickTime;
|
|
||||||
EntityPlayer player;
|
|
||||||
TileMFE tile;
|
|
||||||
private static final EntityEquipmentSlot[] equipmentSlots = new EntityEquipmentSlot[] { EntityEquipmentSlot.HEAD, EntityEquipmentSlot.CHEST, EntityEquipmentSlot.LEGS, EntityEquipmentSlot.FEET };
|
|
||||||
|
|
||||||
public ContainerMFE(TileMFE tile, EntityPlayer player) {
|
|
||||||
super();
|
|
||||||
this.tile = tile;
|
|
||||||
this.player = player;
|
|
||||||
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
for (int k = 0; k < 4; k++) {
|
|
||||||
final EntityEquipmentSlot slot = equipmentSlots[k];
|
|
||||||
addSlotToContainer(new BaseSlot(player.inventory, player.inventory.getSizeInventory() - 2 - k, 44, 6 + k * 19) {
|
|
||||||
@Override
|
|
||||||
public int getSlotStackLimit() { return 1; }
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isItemValid(ItemStack stack) {
|
|
||||||
return stack != null && stack.getItem().isValidArmor(stack, slot, player);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.addSlotToContainer(new SlotCharge(tile.inventory, 0, 80, 17));
|
|
||||||
this.addSlotToContainer(new SlotCharge(tile.inventory, 1, 80, 53));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void detectAndSendChanges() {
|
|
||||||
super.detectAndSendChanges();
|
|
||||||
for (int i = 0; i < this.listeners.size(); i++) {
|
|
||||||
IContainerListener IContainerListener = this.listeners.get(i);
|
|
||||||
if (this.energy != (int) tile.getEnergy()) {
|
|
||||||
IContainerListener.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addListener(IContainerListener crafting) {
|
|
||||||
super.addListener(crafting);
|
|
||||||
crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@Override
|
|
||||||
public void updateProgressBar(int id, int value) {
|
|
||||||
if (id == 0) {
|
|
||||||
this.burnTime = value;
|
|
||||||
} else if (id == 1) {
|
|
||||||
this.totalBurnTime = value;
|
|
||||||
} else if (id == 2) {
|
|
||||||
this.energy = value;
|
|
||||||
}
|
|
||||||
this.tile.setEnergy(energy);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getScaledBurnTime(int i) {
|
|
||||||
return (int) (((float) burnTime / (float) totalBurnTime) * i);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,94 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
|
||||||
import net.minecraft.inventory.IContainerListener;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotCharge;
|
|
||||||
import reborncore.common.container.RebornContainer;
|
|
||||||
import techreborn.tiles.storage.TileMFSU;
|
|
||||||
|
|
||||||
public class ContainerMFSU extends RebornContainer {
|
|
||||||
|
|
||||||
public int burnTime = 0;
|
|
||||||
public int totalBurnTime = 0;
|
|
||||||
public int energy;
|
|
||||||
public int tickTime;
|
|
||||||
EntityPlayer player;
|
|
||||||
TileMFSU tile;
|
|
||||||
private static final EntityEquipmentSlot[] equipmentSlots = new EntityEquipmentSlot[] { EntityEquipmentSlot.HEAD, EntityEquipmentSlot.CHEST, EntityEquipmentSlot.LEGS, EntityEquipmentSlot.FEET };
|
|
||||||
|
|
||||||
public ContainerMFSU(TileMFSU tile, EntityPlayer player) {
|
|
||||||
super();
|
|
||||||
this.tile = tile;
|
|
||||||
this.player = player;
|
|
||||||
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
for (int k = 0; k < 4; k++) {
|
|
||||||
final EntityEquipmentSlot slot = equipmentSlots[k];
|
|
||||||
addSlotToContainer(new BaseSlot(player.inventory, player.inventory.getSizeInventory() - 2 - k, 44, 6 + k * 19) {
|
|
||||||
@Override
|
|
||||||
public int getSlotStackLimit() { return 1; }
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isItemValid(ItemStack stack) {
|
|
||||||
return stack != null && stack.getItem().isValidArmor(stack, slot, player);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.addSlotToContainer(new SlotCharge(tile.inventory, 0, 80, 17));
|
|
||||||
this.addSlotToContainer(new SlotCharge(tile.inventory, 1, 80, 53));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void detectAndSendChanges() {
|
|
||||||
super.detectAndSendChanges();
|
|
||||||
for (int i = 0; i < this.listeners.size(); i++) {
|
|
||||||
IContainerListener IContainerListener = this.listeners.get(i);
|
|
||||||
if (this.energy != (int) tile.getEnergy()) {
|
|
||||||
IContainerListener.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addListener(IContainerListener crafting) {
|
|
||||||
super.addListener(crafting);
|
|
||||||
crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@Override
|
|
||||||
public void updateProgressBar(int id, int value) {
|
|
||||||
if (id == 0) {
|
|
||||||
this.burnTime = value;
|
|
||||||
} else if (id == 1) {
|
|
||||||
this.totalBurnTime = value;
|
|
||||||
} else if (id == 2) {
|
|
||||||
this.energy = value;
|
|
||||||
}
|
|
||||||
this.tile.setEnergy(energy);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getScaledBurnTime(int i) {
|
|
||||||
return (int) (((float) burnTime / (float) totalBurnTime) * i);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,83 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.inventory.IContainerListener;
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotOutput;
|
|
||||||
import reborncore.common.container.RebornContainer;
|
|
||||||
import techreborn.tiles.TileMatterFabricator;
|
|
||||||
|
|
||||||
public class ContainerMatterFabricator extends RebornContainer {
|
|
||||||
|
|
||||||
public int progressTime;
|
|
||||||
EntityPlayer player;
|
|
||||||
TileMatterFabricator tile;
|
|
||||||
|
|
||||||
public ContainerMatterFabricator(TileMatterFabricator tileMatterfab, EntityPlayer player) {
|
|
||||||
tile = tileMatterfab;
|
|
||||||
this.player = player;
|
|
||||||
|
|
||||||
// input
|
|
||||||
this.addSlotToContainer(new BaseSlot(tileMatterfab.inventory, 0, 33, 17));
|
|
||||||
this.addSlotToContainer(new BaseSlot(tileMatterfab.inventory, 1, 33, 35));
|
|
||||||
this.addSlotToContainer(new BaseSlot(tileMatterfab.inventory, 2, 33, 53));
|
|
||||||
this.addSlotToContainer(new BaseSlot(tileMatterfab.inventory, 3, 51, 17));
|
|
||||||
this.addSlotToContainer(new BaseSlot(tileMatterfab.inventory, 4, 51, 35));
|
|
||||||
this.addSlotToContainer(new BaseSlot(tileMatterfab.inventory, 5, 51, 53));
|
|
||||||
|
|
||||||
// outputs
|
|
||||||
this.addSlotToContainer(new SlotOutput(tileMatterfab.inventory, 6, 116, 35));
|
|
||||||
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer p_75145_1_) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void detectAndSendChanges() {
|
|
||||||
super.detectAndSendChanges();
|
|
||||||
for (int i = 0; i < this.listeners.size(); i++) {
|
|
||||||
IContainerListener IContainerListener = this.listeners.get(i);
|
|
||||||
if (this.progressTime != tile.progresstime) {
|
|
||||||
IContainerListener.sendProgressBarUpdate(this, 0, tile.progresstime);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addListener(IContainerListener crafting) {
|
|
||||||
super.addListener(crafting);
|
|
||||||
crafting.sendProgressBarUpdate(this, 0, tile.progresstime);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@Override
|
|
||||||
public void updateProgressBar(int id, int value) {
|
|
||||||
if (id == 0) {
|
|
||||||
this.progressTime = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getProgressScaled(int scale) {
|
|
||||||
if (progressTime != 0) {
|
|
||||||
return progressTime * scale / tile.maxProgresstime();
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,41 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotFake;
|
|
||||||
import reborncore.client.gui.slots.SlotOutput;
|
|
||||||
import reborncore.common.container.RebornContainer;
|
|
||||||
import techreborn.tiles.TileQuantumChest;
|
|
||||||
|
|
||||||
public class ContainerQuantumChest extends RebornContainer {
|
|
||||||
public TileQuantumChest tileQuantumChest;
|
|
||||||
public EntityPlayer player;
|
|
||||||
|
|
||||||
public ContainerQuantumChest(TileQuantumChest tileQuantumChest, EntityPlayer player) {
|
|
||||||
super();
|
|
||||||
this.tileQuantumChest = tileQuantumChest;
|
|
||||||
this.player = player;
|
|
||||||
|
|
||||||
this.addSlotToContainer(new BaseSlot(tileQuantumChest.inventory, 0, 80, 17));
|
|
||||||
this.addSlotToContainer(new SlotOutput(tileQuantumChest.inventory, 1, 80, 53));
|
|
||||||
this.addSlotToContainer(new SlotFake(tileQuantumChest.inventory, 2, 59, 42, false, false, Integer.MAX_VALUE));
|
|
||||||
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,41 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotFake;
|
|
||||||
import reborncore.client.gui.slots.SlotFluid;
|
|
||||||
import reborncore.client.gui.slots.SlotOutput;
|
|
||||||
import reborncore.common.container.RebornContainer;
|
|
||||||
import techreborn.tiles.TileQuantumTank;
|
|
||||||
|
|
||||||
public class ContainerQuantumTank extends RebornContainer {
|
|
||||||
public TileQuantumTank tileQuantumTank;
|
|
||||||
public EntityPlayer player;
|
|
||||||
|
|
||||||
public ContainerQuantumTank(TileQuantumTank tileQuantumTank, EntityPlayer player) {
|
|
||||||
super();
|
|
||||||
this.tileQuantumTank = tileQuantumTank;
|
|
||||||
this.player = player;
|
|
||||||
|
|
||||||
this.addSlotToContainer(new SlotFluid(tileQuantumTank.inventory, 0, 80, 17));
|
|
||||||
this.addSlotToContainer(new SlotOutput(tileQuantumTank.inventory, 1, 80, 53));
|
|
||||||
this.addSlotToContainer(new SlotFake(tileQuantumTank.inventory, 2, 59, 42, false, false, 1));
|
|
||||||
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,58 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotOutput;
|
|
||||||
import reborncore.common.container.RebornContainer;
|
|
||||||
import techreborn.api.gui.SlotUpgrade;
|
|
||||||
import techreborn.tiles.teir1.TileRecycler;
|
|
||||||
|
|
||||||
public class ContainerRecycler extends RebornContainer {
|
|
||||||
|
|
||||||
public int connectionStatus;
|
|
||||||
EntityPlayer player;
|
|
||||||
TileRecycler tile;
|
|
||||||
|
|
||||||
public ContainerRecycler(TileRecycler tileGrinder, EntityPlayer player) {
|
|
||||||
super();
|
|
||||||
tile = tileGrinder;
|
|
||||||
this.player = player;
|
|
||||||
|
|
||||||
// input
|
|
||||||
this.addSlotToContainer(new BaseSlot(tileGrinder.inventory, 0, 56, 34));
|
|
||||||
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34));
|
|
||||||
|
|
||||||
// upgrades
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 2, 152, 8));
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 3, 152, 26));
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 4, 152, 44));
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 5, 152, 62));
|
|
||||||
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer p_75145_1_) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@Override
|
|
||||||
public void updateProgressBar(int id, int value) {
|
|
||||||
if (id == 10) {
|
|
||||||
this.connectionStatus = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,111 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.inventory.IContainerListener;
|
|
||||||
import net.minecraft.inventory.IInventory;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotOutput;
|
|
||||||
import reborncore.common.container.RebornContainer;
|
|
||||||
import techreborn.api.RollingMachineRecipe;
|
|
||||||
import techreborn.tiles.TileRollingMachine;
|
|
||||||
|
|
||||||
public class ContainerRollingMachine extends RebornContainer {
|
|
||||||
|
|
||||||
EntityPlayer player;
|
|
||||||
TileRollingMachine tile;
|
|
||||||
int currentItemBurnTime;
|
|
||||||
int burnTime;
|
|
||||||
int energy;
|
|
||||||
|
|
||||||
public ContainerRollingMachine(TileRollingMachine tileRollingmachine, EntityPlayer player) {
|
|
||||||
tile = tileRollingmachine;
|
|
||||||
this.player = player;
|
|
||||||
|
|
||||||
for (int l = 0; l < 3; l++) {
|
|
||||||
for (int k1 = 0; k1 < 3; k1++) {
|
|
||||||
this.addSlotToContainer(
|
|
||||||
new BaseSlot(tileRollingmachine.craftMatrix, k1 + l * 3, 30 + k1 * 18, 17 + l * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// output
|
|
||||||
this.addSlotToContainer(new SlotOutput(tileRollingmachine.inventory, 0, 124, 35));
|
|
||||||
// battery
|
|
||||||
this.addSlotToContainer(new BaseSlot(tileRollingmachine.inventory, 2, 8, 51));
|
|
||||||
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public final void onCraftMatrixChanged(IInventory inv) {
|
|
||||||
ItemStack output = RollingMachineRecipe.instance.findMatchingRecipe(tile.craftMatrix, tile.getWorld());
|
|
||||||
tile.inventory.setInventorySlotContents(1, output);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addListener(IContainerListener crafting) {
|
|
||||||
super.addListener(crafting);
|
|
||||||
crafting.sendProgressBarUpdate(this, 0, tile.runTime);
|
|
||||||
crafting.sendProgressBarUpdate(this, 1, tile.tickTime);
|
|
||||||
crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void detectAndSendChanges() {
|
|
||||||
for (int i = 0; i < this.listeners.size(); i++) {
|
|
||||||
IContainerListener crafting = this.listeners.get(i);
|
|
||||||
if (this.currentItemBurnTime != tile.runTime) {
|
|
||||||
crafting.sendProgressBarUpdate(this, 0, tile.runTime);
|
|
||||||
}
|
|
||||||
if (this.burnTime != tile.tickTime || tile.tickTime == -1) {
|
|
||||||
crafting.sendProgressBarUpdate(this, 1, tile.tickTime);
|
|
||||||
}
|
|
||||||
if (this.energy != (int) tile.getEnergy()) {
|
|
||||||
crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
super.detectAndSendChanges();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateProgressBar(int id, int value) {
|
|
||||||
super.updateProgressBar(id, value);
|
|
||||||
if (id == 0) {
|
|
||||||
this.currentItemBurnTime = value;
|
|
||||||
} else if (id == 1) {
|
|
||||||
this.burnTime = value;
|
|
||||||
} else if (id == 2) {
|
|
||||||
this.energy = value;
|
|
||||||
}
|
|
||||||
this.tile.runTime = this.currentItemBurnTime;
|
|
||||||
if (this.burnTime == -1) {
|
|
||||||
this.burnTime = 0;
|
|
||||||
}
|
|
||||||
this.tile.tickTime = this.burnTime;
|
|
||||||
this.tile.setEnergy(this.energy);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getBurnTimeRemainingScaled(int scale) {
|
|
||||||
if (burnTime == 0 || this.currentItemBurnTime == 0) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return this.burnTime * scale / this.currentItemBurnTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,58 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotOutput;
|
|
||||||
import reborncore.common.container.RebornContainer;
|
|
||||||
import techreborn.api.gui.SlotUpgrade;
|
|
||||||
import techreborn.tiles.TileScrapboxinator;
|
|
||||||
|
|
||||||
public class ContainerScrapboxinator extends RebornContainer {
|
|
||||||
|
|
||||||
public int connectionStatus;
|
|
||||||
EntityPlayer player;
|
|
||||||
TileScrapboxinator tile;
|
|
||||||
|
|
||||||
public ContainerScrapboxinator(TileScrapboxinator tileScrapboxinator, EntityPlayer player) {
|
|
||||||
super();
|
|
||||||
tile = tileScrapboxinator;
|
|
||||||
this.player = player;
|
|
||||||
|
|
||||||
// input
|
|
||||||
this.addSlotToContainer(new SlotScrapbox(tileScrapboxinator.inventory, 0, 56, 34));
|
|
||||||
this.addSlotToContainer(new SlotOutput(tileScrapboxinator.inventory, 1, 116, 34));
|
|
||||||
|
|
||||||
// upgrades
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tileScrapboxinator.inventory, 2, 152, 8));
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tileScrapboxinator.inventory, 3, 152, 26));
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tileScrapboxinator.inventory, 4, 152, 44));
|
|
||||||
this.addSlotToContainer(new SlotUpgrade(tileScrapboxinator.inventory, 5, 152, 62));
|
|
||||||
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer p_75145_1_) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
@Override
|
|
||||||
public void updateProgressBar(int id, int value) {
|
|
||||||
if (id == 10) {
|
|
||||||
this.connectionStatus = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,38 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotFake;
|
|
||||||
import reborncore.client.gui.slots.SlotOutput;
|
|
||||||
import reborncore.common.container.RebornContainer;
|
|
||||||
import techreborn.tiles.generator.TileSemifluidGenerator;
|
|
||||||
|
|
||||||
public class ContainerSemifluidGenerator extends RebornContainer {
|
|
||||||
public TileSemifluidGenerator tileSemifluidGenerator;
|
|
||||||
public EntityPlayer player;
|
|
||||||
|
|
||||||
public ContainerSemifluidGenerator(TileSemifluidGenerator tileSemifluidGenerator, EntityPlayer player) {
|
|
||||||
super();
|
|
||||||
this.tileSemifluidGenerator = tileSemifluidGenerator;
|
|
||||||
this.player = player;
|
|
||||||
|
|
||||||
this.addSlotToContainer(new BaseSlot(tileSemifluidGenerator.inventory, 0, 80, 17));
|
|
||||||
this.addSlotToContainer(new SlotOutput(tileSemifluidGenerator.inventory, 1, 80, 53));
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,41 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotFake;
|
|
||||||
import reborncore.client.gui.slots.SlotFluid;
|
|
||||||
import reborncore.client.gui.slots.SlotOutput;
|
|
||||||
import reborncore.common.container.RebornContainer;
|
|
||||||
import techreborn.tiles.generator.TileThermalGenerator;
|
|
||||||
|
|
||||||
public class ContainerThermalGenerator extends RebornContainer {
|
|
||||||
public TileThermalGenerator tileThermalGenerator;
|
|
||||||
public EntityPlayer player;
|
|
||||||
|
|
||||||
public ContainerThermalGenerator(TileThermalGenerator tileThermalGenerator, EntityPlayer player) {
|
|
||||||
super();
|
|
||||||
this.tileThermalGenerator = tileThermalGenerator;
|
|
||||||
this.player = player;
|
|
||||||
|
|
||||||
this.addSlotToContainer(new SlotFluid(tileThermalGenerator.inventory, 0, 80, 17));
|
|
||||||
this.addSlotToContainer(new SlotOutput(tileThermalGenerator.inventory, 1, 80, 53));
|
|
||||||
this.addSlotToContainer(new SlotFake(tileThermalGenerator.inventory, 2, 59, 42, false, false, 1));
|
|
||||||
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,40 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import reborncore.client.gui.slots.SlotOutput;
|
|
||||||
import techreborn.tiles.multiblock.TileVacuumFreezer;
|
|
||||||
|
|
||||||
public class ContainerVacuumFreezer extends ContainerCrafting {
|
|
||||||
|
|
||||||
EntityPlayer player;
|
|
||||||
TileVacuumFreezer tile;
|
|
||||||
|
|
||||||
public ContainerVacuumFreezer(TileVacuumFreezer tileAlloysmelter, EntityPlayer player) {
|
|
||||||
super(tileAlloysmelter.crafter);
|
|
||||||
tile = tileAlloysmelter;
|
|
||||||
this.player = player;
|
|
||||||
|
|
||||||
// input
|
|
||||||
this.addSlotToContainer(new BaseSlot(tileAlloysmelter.inventory, 0, 56, 34));
|
|
||||||
// outputs
|
|
||||||
this.addSlotToContainer(new SlotOutput(tileAlloysmelter.inventory, 1, 116, 35));
|
|
||||||
|
|
||||||
for (int i = 0; i < 3; ++i) {
|
|
||||||
for (int j = 0; j < 9; ++j) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < 9; ++i) {
|
|
||||||
this.addSlotToContainer(new BaseSlot(player.inventory, i, 8 + i * 18, 142));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInteractWith(EntityPlayer player) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
package techreborn.client.container;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
|
||||||
|
import techreborn.client.container.builder.BuiltContainer;
|
||||||
|
|
||||||
|
public interface IContainerProvider {
|
||||||
|
BuiltContainer createContainer(EntityPlayer player);
|
||||||
|
}
|
|
@ -1,21 +0,0 @@
|
||||||
package techreborn.client.container;
|
|
||||||
|
|
||||||
import net.minecraft.inventory.IInventory;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import reborncore.client.gui.slots.BaseSlot;
|
|
||||||
import techreborn.init.ModItems;
|
|
||||||
|
|
||||||
public class SlotScrapbox extends BaseSlot {
|
|
||||||
|
|
||||||
public SlotScrapbox(IInventory par1iInventory, int par2, int par3, int par4) {
|
|
||||||
super(par1iInventory, par2, par3, par4);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isItemValid(ItemStack par1ItemStack) {
|
|
||||||
return par1ItemStack.getItem() == ModItems.SCRAP_BOX;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getSlotStackLimit() {
|
|
||||||
return 64;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,264 @@
|
||||||
|
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 reborncore.common.util.ItemUtils;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
import java.util.function.IntConsumer;
|
||||||
|
import java.util.function.IntSupplier;
|
||||||
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
|
public class BuiltContainer extends Container {
|
||||||
|
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
private final Predicate<EntityPlayer> canInteract;
|
||||||
|
private final List<Range<Integer>> playerSlotRanges;
|
||||||
|
private final List<Range<Integer>> tileSlotRanges;
|
||||||
|
|
||||||
|
private final ArrayList<MutableTriple<IntSupplier, IntConsumer, Short>> shortValues;
|
||||||
|
private final ArrayList<MutableTriple<IntSupplier, IntConsumer, Integer>> integerValues;
|
||||||
|
private List<Consumer<InventoryCrafting>> craftEvents;
|
||||||
|
private Integer[] integerParts;
|
||||||
|
|
||||||
|
public BuiltContainer(final String name, final Predicate<EntityPlayer> canInteract,
|
||||||
|
final List<Range<Integer>> playerSlotRange,
|
||||||
|
final List<Range<Integer>> tileSlotRange) {
|
||||||
|
this.name = name;
|
||||||
|
|
||||||
|
this.canInteract = canInteract;
|
||||||
|
|
||||||
|
this.playerSlotRanges = playerSlotRange;
|
||||||
|
this.tileSlotRanges = tileSlotRange;
|
||||||
|
|
||||||
|
this.shortValues = new ArrayList<>();
|
||||||
|
this.integerValues = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addShortSync(final List<Pair<IntSupplier, IntConsumer>> syncables) {
|
||||||
|
|
||||||
|
for (final Pair<IntSupplier, IntConsumer> syncable : syncables)
|
||||||
|
this.shortValues.add(MutableTriple.of(syncable.getLeft(), syncable.getRight(), (short) 0));
|
||||||
|
this.shortValues.trimToSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addIntegerSync(final List<Pair<IntSupplier, IntConsumer>> syncables) {
|
||||||
|
|
||||||
|
for (final Pair<IntSupplier, IntConsumer> syncable : syncables)
|
||||||
|
this.integerValues.add(MutableTriple.of(syncable.getLeft(), syncable.getRight(), 0));
|
||||||
|
this.integerValues.trimToSize();
|
||||||
|
this.integerParts = new Integer[this.integerValues.size()];
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addCraftEvents(final List<Consumer<InventoryCrafting>> craftEvents) {
|
||||||
|
this.craftEvents = craftEvents;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addSlot(final Slot slot) {
|
||||||
|
this.addSlotToContainer(slot);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(final EntityPlayer playerIn) {
|
||||||
|
return this.canInteract.test(playerIn);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final void onCraftMatrixChanged(final IInventory inv) {
|
||||||
|
if (!this.craftEvents.isEmpty())
|
||||||
|
this.craftEvents.forEach(consumer -> consumer.accept((InventoryCrafting) inv));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void detectAndSendChanges() {
|
||||||
|
super.detectAndSendChanges();
|
||||||
|
|
||||||
|
for (final IContainerListener listener : this.listeners) {
|
||||||
|
|
||||||
|
int i = 0;
|
||||||
|
if (!this.shortValues.isEmpty())
|
||||||
|
for (final MutableTriple<IntSupplier, IntConsumer, Short> value : this.shortValues) {
|
||||||
|
final short supplied = (short) value.getLeft().getAsInt();
|
||||||
|
if (supplied != value.getRight()) {
|
||||||
|
|
||||||
|
listener.sendProgressBarUpdate(this, i, supplied);
|
||||||
|
value.setRight(supplied);
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.integerValues.isEmpty())
|
||||||
|
for (final MutableTriple<IntSupplier, IntConsumer, Integer> value : this.integerValues) {
|
||||||
|
final int supplied = value.getLeft().getAsInt();
|
||||||
|
if (supplied != value.getRight()) {
|
||||||
|
|
||||||
|
listener.sendProgressBarUpdate(this, i, supplied >> 16);
|
||||||
|
listener.sendProgressBarUpdate(this, i + 1, (short) (supplied & 0xFFFF));
|
||||||
|
value.setRight(supplied);
|
||||||
|
}
|
||||||
|
i += 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addListener(final IContainerListener listener) {
|
||||||
|
super.addListener(listener);
|
||||||
|
|
||||||
|
int i = 0;
|
||||||
|
if (!this.shortValues.isEmpty())
|
||||||
|
for (final MutableTriple<IntSupplier, IntConsumer, Short> value : this.shortValues) {
|
||||||
|
final short supplied = (short) value.getLeft().getAsInt();
|
||||||
|
|
||||||
|
listener.sendProgressBarUpdate(this, i, supplied);
|
||||||
|
value.setRight(supplied);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.integerValues.isEmpty())
|
||||||
|
for (final MutableTriple<IntSupplier, IntConsumer, Integer> value : this.integerValues) {
|
||||||
|
final int supplied = value.getLeft().getAsInt();
|
||||||
|
|
||||||
|
listener.sendProgressBarUpdate(this, i, supplied >> 16);
|
||||||
|
listener.sendProgressBarUpdate(this, i + 1, (short) (supplied & 0xFFFF));
|
||||||
|
value.setRight(supplied);
|
||||||
|
i += 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public void updateProgressBar(final int id, final int value) {
|
||||||
|
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
|
||||||
|
if ((id - this.shortValues.size()) % 2 == 0)
|
||||||
|
this.integerParts[(id - this.shortValues.size()) / 2] = value;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.integerValues.get((id - this.shortValues.size()) / 2).getMiddle().accept(
|
||||||
|
(this.integerParts[(id - this.shortValues.size()) / 2] & 0xFFFF) << 16 | value & 0xFFFF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack transferStackInSlot(final EntityPlayer player, final int index) {
|
||||||
|
|
||||||
|
ItemStack originalStack = ItemStack.EMPTY;
|
||||||
|
|
||||||
|
final Slot slot = this.inventorySlots.get(index);
|
||||||
|
|
||||||
|
if (slot != null && slot.getHasStack()) {
|
||||||
|
|
||||||
|
final ItemStack stackInSlot = slot.getStack();
|
||||||
|
originalStack = stackInSlot.copy();
|
||||||
|
|
||||||
|
boolean shifted = false;
|
||||||
|
|
||||||
|
for (final Range<Integer> range : this.playerSlotRanges)
|
||||||
|
if (range.contains(index)) {
|
||||||
|
|
||||||
|
if (this.shiftToTile(stackInSlot))
|
||||||
|
shifted = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!shifted)
|
||||||
|
for (final Range<Integer> range : this.tileSlotRanges)
|
||||||
|
if (range.contains(index)) {
|
||||||
|
if (this.shiftToPlayer(stackInSlot))
|
||||||
|
shifted = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
slot.onSlotChange(stackInSlot, originalStack);
|
||||||
|
if (stackInSlot.getCount() <= 0)
|
||||||
|
slot.putStack(ItemStack.EMPTY);
|
||||||
|
else
|
||||||
|
slot.onSlotChanged();
|
||||||
|
if (stackInSlot.getCount() == originalStack.getCount())
|
||||||
|
return ItemStack.EMPTY;
|
||||||
|
slot.onTake(player, stackInSlot);
|
||||||
|
}
|
||||||
|
return originalStack;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean shiftItemStack(final ItemStack stackToShift, final int start, final int end) {
|
||||||
|
boolean changed = false;
|
||||||
|
if (stackToShift.isStackable()) {
|
||||||
|
for (int slotIndex = start; stackToShift.getCount() > 0 && slotIndex < end; slotIndex++) {
|
||||||
|
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)) {
|
||||||
|
final int resultingStackSize = stackInSlot.getCount() + stackToShift.getCount();
|
||||||
|
final int max = Math.min(stackToShift.getMaxStackSize(), slot.getSlotStackLimit());
|
||||||
|
if (resultingStackSize <= max) {
|
||||||
|
stackToShift.setCount(0);
|
||||||
|
stackInSlot.setCount(resultingStackSize);
|
||||||
|
slot.onSlotChanged();
|
||||||
|
changed = true;
|
||||||
|
} else if (stackInSlot.getCount() < max) {
|
||||||
|
stackToShift.shrink(max - stackInSlot.getCount());
|
||||||
|
stackInSlot.setCount(max);
|
||||||
|
slot.onSlotChanged();
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (stackToShift.getCount() > 0) {
|
||||||
|
for (int slotIndex = start; stackToShift.getCount() > 0 && slotIndex < end; slotIndex++) {
|
||||||
|
final Slot slot = this.inventorySlots.get(slotIndex);
|
||||||
|
ItemStack stackInSlot = slot.getStack();
|
||||||
|
if (stackInSlot == ItemStack.EMPTY && slot.isItemValid(stackToShift)) {
|
||||||
|
final int max = Math.min(stackToShift.getMaxStackSize(), slot.getSlotStackLimit());
|
||||||
|
stackInSlot = stackToShift.copy();
|
||||||
|
stackInSlot.setCount(Math.min(stackToShift.getCount(), max));
|
||||||
|
stackToShift.setCount(-stackInSlot.getCount());
|
||||||
|
slot.putStack(stackInSlot);
|
||||||
|
slot.onSlotChanged();
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return changed;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean shiftToTile(final ItemStack stackToShift) {
|
||||||
|
for (final Range<Integer> range : this.tileSlotRanges)
|
||||||
|
if (this.shiftItemStack(stackToShift, range.getMinimum(), range.getMaximum() + 1))
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean shiftToPlayer(final ItemStack stackToShift) {
|
||||||
|
for (final Range<Integer> range : this.playerSlotRanges)
|
||||||
|
if (this.shiftItemStack(stackToShift, range.getMinimum(), range.getMaximum() + 1))
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,84 @@
|
||||||
|
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 java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
import java.util.function.IntConsumer;
|
||||||
|
import java.util.function.IntSupplier;
|
||||||
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
|
public class ContainerBuilder {
|
||||||
|
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
private Predicate<EntityPlayer> canInteract = player -> true;
|
||||||
|
|
||||||
|
final List<Slot> slots;
|
||||||
|
final List<Range<Integer>> playerInventoryRanges, tileInventoryRanges;
|
||||||
|
|
||||||
|
final List<Pair<IntSupplier, IntConsumer>> shortValues;
|
||||||
|
final List<Pair<IntSupplier, IntConsumer>> integerValues;
|
||||||
|
|
||||||
|
final List<Consumer<InventoryCrafting>> craftEvents;
|
||||||
|
|
||||||
|
public ContainerBuilder(final String name) {
|
||||||
|
|
||||||
|
this.name = name;
|
||||||
|
|
||||||
|
this.slots = new ArrayList<>();
|
||||||
|
this.playerInventoryRanges = new ArrayList<>();
|
||||||
|
this.tileInventoryRanges = new ArrayList<>();
|
||||||
|
|
||||||
|
this.shortValues = new ArrayList<>();
|
||||||
|
this.integerValues = new ArrayList<>();
|
||||||
|
|
||||||
|
this.craftEvents = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContainerBuilder interact(final Predicate<EntityPlayer> canInteract) {
|
||||||
|
this.canInteract = canInteract;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContainerPlayerInventoryBuilder player(final InventoryPlayer player) {
|
||||||
|
return new ContainerPlayerInventoryBuilder(this, player);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContainerTileInventoryBuilder tile(final IInventory tile) {
|
||||||
|
return new ContainerTileInventoryBuilder(this, tile);
|
||||||
|
}
|
||||||
|
|
||||||
|
void addPlayerInventoryRange(final Range<Integer> range) {
|
||||||
|
this.playerInventoryRanges.add(range);
|
||||||
|
}
|
||||||
|
|
||||||
|
void addTileInventoryRange(final Range<Integer> range) {
|
||||||
|
this.tileInventoryRanges.add(range);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BuiltContainer create() {
|
||||||
|
final BuiltContainer built = new BuiltContainer(this.name, this.canInteract,
|
||||||
|
this.playerInventoryRanges,
|
||||||
|
this.tileInventoryRanges);
|
||||||
|
if (!this.shortValues.isEmpty())
|
||||||
|
built.addShortSync(this.shortValues);
|
||||||
|
if (!this.integerValues.isEmpty())
|
||||||
|
built.addIntegerSync(this.integerValues);
|
||||||
|
if (!this.craftEvents.isEmpty())
|
||||||
|
built.addCraftEvents(this.craftEvents);
|
||||||
|
|
||||||
|
this.slots.forEach(built::addSlot);
|
||||||
|
|
||||||
|
this.slots.clear();
|
||||||
|
return built;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,105 @@
|
||||||
|
package techreborn.client.container.builder;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
|
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||||
|
import org.apache.commons.lang3.Range;
|
||||||
|
import reborncore.client.gui.slots.BaseSlot;
|
||||||
|
import techreborn.client.container.builder.slot.FilteredSlot;
|
||||||
|
|
||||||
|
public final class ContainerPlayerInventoryBuilder {
|
||||||
|
|
||||||
|
private final InventoryPlayer player;
|
||||||
|
private final ContainerBuilder parent;
|
||||||
|
private Range<Integer> main;
|
||||||
|
private Range<Integer> hotbar;
|
||||||
|
private Range<Integer> armor;
|
||||||
|
|
||||||
|
ContainerPlayerInventoryBuilder(final ContainerBuilder parent, final InventoryPlayer player) {
|
||||||
|
this.player = player;
|
||||||
|
this.parent = parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContainerPlayerInventoryBuilder inventory(final int xStart, final int yStart) {
|
||||||
|
final int startIndex = this.parent.slots.size();
|
||||||
|
for (int i = 0; i < 3; ++i)
|
||||||
|
for (int j = 0; j < 9; ++j)
|
||||||
|
this.parent.slots.add(new BaseSlot(this.player, j + i * 9 + 9, xStart + j * 18, yStart + i * 18));
|
||||||
|
this.main = Range.between(startIndex, this.parent.slots.size() - 1);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContainerPlayerInventoryBuilder hotbar(final int xStart, final int yStart) {
|
||||||
|
final int startIndex = this.parent.slots.size();
|
||||||
|
for (int i = 0; i < 9; ++i)
|
||||||
|
this.parent.slots.add(new BaseSlot(this.player, i, xStart + i * 18, yStart));
|
||||||
|
this.hotbar = Range.between(startIndex, this.parent.slots.size() - 1);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContainerPlayerInventoryBuilder inventory() {
|
||||||
|
return this.inventory(8, 94);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContainerPlayerInventoryBuilder hotbar() {
|
||||||
|
return this.hotbar(8, 152);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContainerPlayerArmorInventoryBuilder armor() {
|
||||||
|
return new ContainerPlayerArmorInventoryBuilder(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContainerBuilder addInventory() {
|
||||||
|
if (this.hotbar != null)
|
||||||
|
this.parent.addPlayerInventoryRange(this.hotbar);
|
||||||
|
if (this.main != null)
|
||||||
|
this.parent.addPlayerInventoryRange(this.main);
|
||||||
|
if (this.armor != null)
|
||||||
|
this.parent.addTileInventoryRange(this.armor);
|
||||||
|
|
||||||
|
return this.parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final class ContainerPlayerArmorInventoryBuilder {
|
||||||
|
private final ContainerPlayerInventoryBuilder parent;
|
||||||
|
private final int startIndex;
|
||||||
|
|
||||||
|
public ContainerPlayerArmorInventoryBuilder(final ContainerPlayerInventoryBuilder parent) {
|
||||||
|
this.parent = parent;
|
||||||
|
this.startIndex = parent.parent.slots.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
private ContainerPlayerArmorInventoryBuilder armor(final int index, final int xStart, final int yStart,
|
||||||
|
final EntityEquipmentSlot slotType) {
|
||||||
|
|
||||||
|
this.parent.parent.slots.add(new FilteredSlot(this.parent.player, index, xStart, yStart)
|
||||||
|
.setFilter(stack -> stack.getItem().isValidArmor(stack, slotType, this.parent.player.player)));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContainerPlayerArmorInventoryBuilder helmet(final int xStart, final int yStart) {
|
||||||
|
return this.armor(this.parent.player.getSizeInventory() - 2, xStart, yStart, EntityEquipmentSlot.HEAD);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContainerPlayerArmorInventoryBuilder chestplate(final int xStart, final int yStart) {
|
||||||
|
return this.armor(this.parent.player.getSizeInventory() - 3, xStart, yStart, EntityEquipmentSlot.CHEST);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContainerPlayerArmorInventoryBuilder leggings(final int xStart, final int yStart) {
|
||||||
|
return this.armor(this.parent.player.getSizeInventory() - 4, xStart, yStart, EntityEquipmentSlot.LEGS);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContainerPlayerArmorInventoryBuilder boots(final int xStart, final int yStart) {
|
||||||
|
return this.armor(this.parent.player.getSizeInventory() - 5, xStart, yStart, EntityEquipmentSlot.FEET);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContainerPlayerArmorInventoryBuilder complete(final int xStart, final int yStart) {
|
||||||
|
return this.helmet(xStart, yStart).chestplate(xStart, yStart + 18).leggings(xStart, yStart + 18 + 18)
|
||||||
|
.boots(xStart, yStart + 18 + 18 + 18);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContainerPlayerInventoryBuilder addArmor() {
|
||||||
|
this.parent.armor = Range.between(this.startIndex, this.parent.parent.slots.size() - 1);
|
||||||
|
return this.parent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,147 @@
|
||||||
|
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;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
|
import net.minecraftforge.energy.CapabilityEnergy;
|
||||||
|
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||||
|
|
||||||
|
import reborncore.api.power.IEnergyInterfaceItem;
|
||||||
|
import reborncore.api.recipe.IRecipeCrafterProvider;
|
||||||
|
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.utils.upgrade.IMachineUpgrade;
|
||||||
|
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
import java.util.function.IntConsumer;
|
||||||
|
import java.util.function.IntSupplier;
|
||||||
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
|
public class ContainerTileInventoryBuilder {
|
||||||
|
|
||||||
|
private final IInventory tile;
|
||||||
|
private final ContainerBuilder parent;
|
||||||
|
private final int rangeStart;
|
||||||
|
|
||||||
|
ContainerTileInventoryBuilder(final ContainerBuilder parent, final IInventory tile) {
|
||||||
|
this.tile = tile;
|
||||||
|
this.parent = parent;
|
||||||
|
this.rangeStart = parent.slots.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContainerTileInventoryBuilder slot(final int index, final int x, final int y) {
|
||||||
|
this.parent.slots.add(new BaseSlot(this.tile, index, x, y));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContainerTileInventoryBuilder outputSlot(final int index, final int x, final int y) {
|
||||||
|
this.parent.slots.add(new SlotOutput(this.tile, index, x, y));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContainerTileInventoryBuilder fakeSlot(final int index, final int x, final int y) {
|
||||||
|
this.parent.slots.add(new SlotFake(this.tile, index, x, y, false, false, Integer.MAX_VALUE));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContainerTileInventoryBuilder filterSlot(final int index, final int x, final int y,
|
||||||
|
final Predicate<ItemStack> filter) {
|
||||||
|
this.parent.slots.add(new FilteredSlot(this.tile, index, x, y).setFilter(filter));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@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));
|
||||||
|
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)));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
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 IMachineUpgrade));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @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));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @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));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContainerTileInventoryBuilder syncEnergyValue() {
|
||||||
|
if (this.tile instanceof TilePowerAcceptor)
|
||||||
|
return this.syncIntegerValue(() -> (int) ((TilePowerAcceptor) this.tile).getEnergy(),
|
||||||
|
((TilePowerAcceptor) this.tile)::setEnergy);
|
||||||
|
Core.logHelper.error(this.tile + " is not an instance of TilePowerAcceptor! Energy cannot be synced.");
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
Core.logHelper
|
||||||
|
.error(this.tile + " is not an instance of IRecipeCrafterProvider! Craft progress cannot be synced.");
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContainerTileInventoryBuilder onCraft(final Consumer<InventoryCrafting> onCraft) {
|
||||||
|
this.parent.craftEvents.add(onCraft);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContainerBuilder addInventory() {
|
||||||
|
this.parent.tileInventoryRanges.add(Range.between(this.rangeStart, this.parent.slots.size() - 1));
|
||||||
|
return this.parent;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package techreborn.client.container.builder.slot;
|
||||||
|
|
||||||
|
import net.minecraft.inventory.IInventory;
|
||||||
|
import net.minecraft.inventory.Slot;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
|
public class FilteredSlot extends Slot {
|
||||||
|
|
||||||
|
private Predicate<ItemStack> filter;
|
||||||
|
|
||||||
|
public FilteredSlot(final IInventory inventory, final int index, final int xPosition, final int yPosition) {
|
||||||
|
super(inventory, index, xPosition, yPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilteredSlot setFilter(final Predicate<ItemStack> filter) {
|
||||||
|
this.filter = filter;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isItemValid(final ItemStack stack) {
|
||||||
|
try {
|
||||||
|
return this.filter.test(stack);
|
||||||
|
} catch (NullPointerException e) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
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;
|
||||||
|
|
||||||
|
public class SpriteSlot extends FilteredSlot {
|
||||||
|
|
||||||
|
private final String sprite;
|
||||||
|
int stacksize;
|
||||||
|
|
||||||
|
public SpriteSlot(final IInventory inventory, final int index, final int xPosition, final int yPosition, final String sprite, final int stacksize) {
|
||||||
|
super(inventory, index, xPosition, yPosition);
|
||||||
|
this.sprite = ModInfo.MOD_ID + ":textures/gui/slot_sprites/" + sprite;
|
||||||
|
this.stacksize = stacksize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SpriteSlot(final IInventory inventory, final int index, final int xPosition, final int yPosition, final String sprite) {
|
||||||
|
this(inventory, index, xPosition, yPosition, sprite, 64);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getSlotStackLimit() {
|
||||||
|
return this.stacksize;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Nullable
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public String getSlotTexture() {
|
||||||
|
return this.sprite;
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,39 +5,36 @@ import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.util.text.translation.I18n;
|
import net.minecraft.util.text.translation.I18n;
|
||||||
import techreborn.client.container.ContainerAlloyFurnace;
|
|
||||||
import techreborn.tiles.TileAlloyFurnace;
|
import techreborn.tiles.TileAlloyFurnace;
|
||||||
|
|
||||||
public class GuiAlloyFurnace extends GuiContainer {
|
public class GuiAlloyFurnace extends GuiContainer {
|
||||||
|
|
||||||
private static final ResourceLocation texture = new ResourceLocation("techreborn",
|
private static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||||
"textures/gui/alloy_furnace.png");
|
"textures/gui/alloy_furnace.png");
|
||||||
|
|
||||||
TileAlloyFurnace alloyfurnace;
|
TileAlloyFurnace alloyfurnace;
|
||||||
|
|
||||||
ContainerAlloyFurnace containerAlloyFurnace;
|
public GuiAlloyFurnace(final EntityPlayer player, final TileAlloyFurnace alloyFurnace) {
|
||||||
|
super(alloyFurnace.createContainer(player));
|
||||||
public GuiAlloyFurnace(EntityPlayer player, TileAlloyFurnace tileAlloyFurnace) {
|
|
||||||
super(new ContainerAlloyFurnace(tileAlloyFurnace, player));
|
|
||||||
this.xSize = 176;
|
this.xSize = 176;
|
||||||
this.ySize = 167;
|
this.ySize = 167;
|
||||||
this.alloyfurnace = tileAlloyFurnace;
|
this.alloyfurnace = alloyFurnace;
|
||||||
this.containerAlloyFurnace = (ContainerAlloyFurnace) this.inventorySlots;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initGui() {
|
public void initGui() {
|
||||||
int k = (this.width - this.xSize) / 2;
|
final int k = (this.width - this.xSize) / 2;
|
||||||
int l = (this.height - this.ySize) / 2;
|
final int l = (this.height - this.ySize) / 2;
|
||||||
super.initGui();
|
super.initGui();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
protected void drawGuiContainerBackgroundLayer(final float p_146976_1_, final int p_146976_2_, final int p_146976_3_) {
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
this.mc.getTextureManager().bindTexture(texture);
|
this.mc.getTextureManager().bindTexture(GuiAlloyFurnace.texture);
|
||||||
int k = (this.width - this.xSize) / 2;
|
final int k = (this.width - this.xSize) / 2;
|
||||||
int l = (this.height - this.ySize) / 2;
|
final int l = (this.height - this.ySize) / 2;
|
||||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||||
|
|
||||||
if (this.alloyfurnace.isBurning()) {
|
if (this.alloyfurnace.isBurning()) {
|
||||||
|
@ -48,12 +45,12 @@ public class GuiAlloyFurnace extends GuiContainer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
@Override
|
||||||
String name = I18n.translateToLocal("tile.techreborn.alloyfurnace.name");
|
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,
|
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||||
4210752);
|
4210752);
|
||||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||||
this.ySize - 96 + 2, 4210752);
|
this.ySize - 96 + 2, 4210752);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,57 +5,57 @@ import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.util.text.translation.I18n;
|
import net.minecraft.util.text.translation.I18n;
|
||||||
import reborncore.common.container.RebornContainer;
|
|
||||||
import techreborn.client.container.ContainerAlloySmelter;
|
|
||||||
import techreborn.tiles.TileAlloySmelter;
|
import techreborn.tiles.TileAlloySmelter;
|
||||||
|
|
||||||
public class GuiAlloySmelter extends GuiContainer {
|
public class GuiAlloySmelter extends GuiContainer {
|
||||||
|
|
||||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||||
"textures/gui/electric_alloy_furnace.png");
|
"textures/gui/electric_alloy_furnace.png");
|
||||||
|
|
||||||
TileAlloySmelter alloysmelter;
|
TileAlloySmelter alloysmelter;
|
||||||
|
|
||||||
public GuiAlloySmelter(EntityPlayer player, TileAlloySmelter tilealloysmelter) {
|
public GuiAlloySmelter(final EntityPlayer player, final TileAlloySmelter alloySmelter) {
|
||||||
super(RebornContainer.createContainer(ContainerAlloySmelter.class, tilealloysmelter, player));
|
super(alloySmelter.createContainer(player));
|
||||||
this.xSize = 176;
|
this.xSize = 176;
|
||||||
this.ySize = 167;
|
this.ySize = 167;
|
||||||
alloysmelter = tilealloysmelter;
|
this.alloysmelter = alloySmelter;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initGui() {
|
public void initGui() {
|
||||||
int k = (this.width - this.xSize) / 2;
|
final int k = (this.width - this.xSize) / 2;
|
||||||
int l = (this.height - this.ySize) / 2;
|
final int l = (this.height - this.ySize) / 2;
|
||||||
super.initGui();
|
super.initGui();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
protected void drawGuiContainerBackgroundLayer(final float p_146976_1_, final int p_146976_2_, final int p_146976_3_) {
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
this.mc.getTextureManager().bindTexture(texture);
|
this.mc.getTextureManager().bindTexture(GuiAlloySmelter.texture);
|
||||||
int k = (this.width - this.xSize) / 2;
|
final int k = (this.width - this.xSize) / 2;
|
||||||
int l = (this.height - this.ySize) / 2;
|
final int l = (this.height - this.ySize) / 2;
|
||||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||||
|
|
||||||
int j = 0;
|
int j = 0;
|
||||||
|
|
||||||
j = alloysmelter.getProgressScaled(24);
|
j = this.alloysmelter.getProgressScaled(24);
|
||||||
if (j > 0) {
|
if (j > 0) {
|
||||||
this.drawTexturedModalRect(k + 79, l + 34, 176, 14, j + 1, 16);
|
this.drawTexturedModalRect(k + 79, l + 34, 176, 14, j + 1, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
j = alloysmelter.getEnergyScaled(12);
|
j = this.alloysmelter.getEnergyScaled(12);
|
||||||
if (j > 0) {
|
if (j > 0) {
|
||||||
this.drawTexturedModalRect(k + 56, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
this.drawTexturedModalRect(k + 56, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
@Override
|
||||||
String name = I18n.translateToLocal("tile.techreborn.alloysmelter.name");
|
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,
|
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||||
4210752);
|
4210752);
|
||||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||||
this.ySize - 96 + 2, 4210752);
|
this.ySize - 96 + 2, 4210752);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,59 +5,57 @@ import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.util.text.translation.I18n;
|
import net.minecraft.util.text.translation.I18n;
|
||||||
import reborncore.common.container.RebornContainer;
|
|
||||||
import techreborn.client.container.ContainerAssemblingMachine;
|
|
||||||
import techreborn.tiles.TileAssemblingMachine;
|
import techreborn.tiles.TileAssemblingMachine;
|
||||||
|
|
||||||
public class GuiAssemblingMachine extends GuiContainer {
|
public class GuiAssemblingMachine extends GuiContainer {
|
||||||
|
|
||||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||||
"textures/gui/assembling_machine.png");
|
"textures/gui/assembling_machine.png");
|
||||||
|
|
||||||
TileAssemblingMachine assemblingmachine;
|
TileAssemblingMachine assemblingmachine;
|
||||||
ContainerAssemblingMachine containerAssemblingMachine;
|
|
||||||
|
|
||||||
public GuiAssemblingMachine(EntityPlayer player, TileAssemblingMachine tileassemblinmachine) {
|
public GuiAssemblingMachine(final EntityPlayer player, final TileAssemblingMachine assemblingMachine) {
|
||||||
super(RebornContainer.createContainer(ContainerAssemblingMachine.class, tileassemblinmachine, player));
|
super(assemblingMachine.createContainer(player));
|
||||||
containerAssemblingMachine = (ContainerAssemblingMachine) this.inventorySlots;
|
|
||||||
this.xSize = 176;
|
this.xSize = 176;
|
||||||
this.ySize = 167;
|
this.ySize = 167;
|
||||||
assemblingmachine = tileassemblinmachine;
|
this.assemblingmachine = assemblingMachine;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initGui() {
|
public void initGui() {
|
||||||
int k = (this.width - this.xSize) / 2;
|
final int k = (this.width - this.xSize) / 2;
|
||||||
int l = (this.height - this.ySize) / 2;
|
final int l = (this.height - this.ySize) / 2;
|
||||||
super.initGui();
|
super.initGui();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
protected void drawGuiContainerBackgroundLayer(final float p_146976_1_, final int p_146976_2_, final int p_146976_3_) {
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
this.mc.getTextureManager().bindTexture(texture);
|
this.mc.getTextureManager().bindTexture(GuiAssemblingMachine.texture);
|
||||||
int k = (this.width - this.xSize) / 2;
|
final int k = (this.width - this.xSize) / 2;
|
||||||
int l = (this.height - this.ySize) / 2;
|
final int l = (this.height - this.ySize) / 2;
|
||||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||||
|
|
||||||
int j = 0;
|
int j = 0;
|
||||||
|
|
||||||
j = assemblingmachine.getProgressScaled(20);
|
j = this.assemblingmachine.getProgressScaled(20);
|
||||||
if (j > 0) {
|
if (j > 0) {
|
||||||
this.drawTexturedModalRect(k + 86, l + 34, 176, 14, j + 1, 16);
|
this.drawTexturedModalRect(k + 86, l + 34, 176, 14, j + 1, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
j = assemblingmachine.getEnergyScaled(12);
|
j = this.assemblingmachine.getEnergyScaled(12);
|
||||||
if (j > 0) {
|
if (j > 0) {
|
||||||
this.drawTexturedModalRect(k + 56, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
this.drawTexturedModalRect(k + 56, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
@Override
|
||||||
String name = I18n.translateToLocal("tile.techreborn.assemblinmachine.name");
|
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,
|
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||||
4210752);
|
4210752);
|
||||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||||
this.ySize - 96 + 2, 4210752);
|
this.ySize - 96 + 2, 4210752);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
127
src/main/java/techreborn/client/gui/GuiBase.java
Normal file
127
src/main/java/techreborn/client/gui/GuiBase.java
Normal file
|
@ -0,0 +1,127 @@
|
||||||
|
package techreborn.client.gui;
|
||||||
|
|
||||||
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||||
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.text.translation.I18n;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
import techreborn.client.container.builder.BuiltContainer;
|
||||||
|
import techreborn.client.gui.widget.GuiButtonPowerBar;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Prospector
|
||||||
|
*/
|
||||||
|
public class GuiBase extends GuiContainer {
|
||||||
|
|
||||||
|
public int xSize = 176;
|
||||||
|
public int ySize = 176;
|
||||||
|
public TRBuilder builder = new TRBuilder();
|
||||||
|
public TileEntity tile;
|
||||||
|
public BuiltContainer container;
|
||||||
|
|
||||||
|
public GuiBase(EntityPlayer player, TileEntity tile, BuiltContainer container) {
|
||||||
|
super(container);
|
||||||
|
this.tile = tile;
|
||||||
|
this.container = container;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void drawSlot(int x, int y, Layer layer) {
|
||||||
|
if (layer == Layer.BACKGROUND) {
|
||||||
|
x += guiLeft;
|
||||||
|
y += guiTop;
|
||||||
|
}
|
||||||
|
builder.drawSlot(this, x - 1, y - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void drawArmourSlots(int x, int y, Layer layer) {
|
||||||
|
if (layer == Layer.BACKGROUND) {
|
||||||
|
x += guiLeft;
|
||||||
|
y += guiTop;
|
||||||
|
}
|
||||||
|
builder.drawSlot(this, x - 1, y - 1);
|
||||||
|
builder.drawSlot(this, x - 1, y - 1 + 18);
|
||||||
|
builder.drawSlot(this, x - 1, y - 1 + 18 + 18);
|
||||||
|
builder.drawSlot(this, x - 1, y - 1 + 18 + 18 + 18);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void drawOutputSlot(int x, int y, Layer layer) {
|
||||||
|
if (layer == Layer.BACKGROUND) {
|
||||||
|
x += guiLeft;
|
||||||
|
y += guiTop;
|
||||||
|
}
|
||||||
|
builder.drawOutputSlot(this, x - 5, y - 5);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void drawSelectedStack(int x, int y, Layer layer) {
|
||||||
|
if (layer == Layer.BACKGROUND) {
|
||||||
|
x += guiLeft;
|
||||||
|
y += guiTop;
|
||||||
|
}
|
||||||
|
builder.drawSelectedStack(this, x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initGui() {
|
||||||
|
super.initGui();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
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);
|
||||||
|
builder.drawPlayerSlots(this, guiLeft + xSize / 2, guiTop + 93, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
|
||||||
|
drawTitle();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void drawTitle() {
|
||||||
|
drawCentredString(I18n.translateToLocal(tile.getBlockType().getUnlocalizedName() + ".name"), 6, 4210752, Layer.FOREGROUND);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void drawCentredString(String string, int y, int colour, Layer layer) {
|
||||||
|
drawString(string, (xSize / 2 - mc.fontRendererObj.getStringWidth(string) / 2), y, colour, layer);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void drawCentredString(String string, int y, int colour, int modifier, Layer layer) {
|
||||||
|
drawString(string, (xSize / 2 - (mc.fontRendererObj.getStringWidth(string)) / 2) + modifier, y, colour, layer);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void drawString(String string, int x, int y, int colour, Layer layer) {
|
||||||
|
int factorX = 0;
|
||||||
|
int factorY = 0;
|
||||||
|
if (layer == Layer.BACKGROUND) {
|
||||||
|
factorX = guiLeft;
|
||||||
|
factorY = guiTop;
|
||||||
|
}
|
||||||
|
mc.fontRendererObj.drawString(string, x + factorX, y + factorY, colour);
|
||||||
|
GlStateManager.color(1, 1, 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addPowerButton(int x, int y, int id, Layer layer) {
|
||||||
|
if (id == 0)
|
||||||
|
buttonList.clear();
|
||||||
|
int factorX = 0;
|
||||||
|
int factorY = 0;
|
||||||
|
if (layer == Layer.BACKGROUND) {
|
||||||
|
factorX = guiLeft;
|
||||||
|
factorY = guiTop;
|
||||||
|
}
|
||||||
|
buttonList.add(new GuiButtonPowerBar(id, x + factorX, y + factorY, this, layer));
|
||||||
|
}
|
||||||
|
|
||||||
|
//TODO
|
||||||
|
public enum SlotRender {
|
||||||
|
STANDARD, OUTPUT, NONE, SPRITE;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum Layer {
|
||||||
|
BACKGROUND, FOREGROUND
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,68 +1,38 @@
|
||||||
package techreborn.client.gui;
|
package techreborn.client.gui;
|
||||||
|
|
||||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import net.minecraft.util.text.translation.I18n;
|
|
||||||
import reborncore.common.powerSystem.PowerSystem;
|
import reborncore.common.powerSystem.PowerSystem;
|
||||||
import techreborn.client.container.ContainerBatbox;
|
|
||||||
import techreborn.tiles.storage.TileBatBox;
|
import techreborn.tiles.storage.TileBatBox;
|
||||||
|
|
||||||
public class GuiBatbox extends GuiContainer {
|
public class GuiBatbox extends GuiBase {
|
||||||
|
|
||||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/batbox.png");
|
TileBatBox tile;
|
||||||
|
|
||||||
TileBatBox generator;
|
public GuiBatbox(final EntityPlayer player, final TileBatBox tile) {
|
||||||
|
super(player, tile, tile.createContainer(player));
|
||||||
ContainerBatbox containerGenerator;
|
this.tile = tile;
|
||||||
|
|
||||||
public GuiBatbox(EntityPlayer player, TileBatBox generator) {
|
|
||||||
super(new ContainerBatbox(generator, player));
|
|
||||||
this.xSize = 176;
|
|
||||||
this.ySize = 167;
|
|
||||||
this.generator = generator;
|
|
||||||
this.containerGenerator = (ContainerBatbox) this.inventorySlots;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initGui() {
|
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
|
||||||
int k = (this.width - this.xSize) / 2;
|
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
|
||||||
int l = (this.height - this.ySize) / 2;
|
final Layer layer = Layer.BACKGROUND;
|
||||||
super.initGui();
|
|
||||||
|
this.drawSlot(62, 45, layer);
|
||||||
|
this.drawSlot(98, 45, layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
|
||||||
this.mc.getTextureManager().bindTexture(texture);
|
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||||
int k = (this.width - this.xSize) / 2;
|
final Layer layer = Layer.FOREGROUND;
|
||||||
int l = (this.height - this.ySize) / 2;
|
|
||||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
|
||||||
|
|
||||||
int j = 0;
|
GlStateManager.pushMatrix();
|
||||||
|
GlStateManager.scale(0.6, 0.6, 5);
|
||||||
|
this.drawCentredString(PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) this.tile.getEnergy()) + "/" + PowerSystem.getLocaliszedPowerFormattedNoSuffix((int) this.tile.getMaxPower()) + " " + PowerSystem.getDisplayPower().abbreviation, 35, 0, 58, layer);
|
||||||
|
GlStateManager.popMatrix();
|
||||||
|
|
||||||
j = generator.getEnergyScaled(24);
|
this.builder.drawMultiEnergyBar(this, 81, 28, (int) this.tile.getEnergy(), (int) this.tile.getMaxPower(), mouseX, mouseY, 0, layer);
|
||||||
if (j > 0) {
|
|
||||||
this.drawTexturedModalRect(k + 109, l + 21 + 12, 176, 0, j + 1, 16);
|
|
||||||
}
|
|
||||||
//
|
|
||||||
// if (containerGenerator.burnTime != 0)
|
|
||||||
// {
|
|
||||||
// j = containerGenerator.getScaledBurnTime(13);
|
|
||||||
// this.drawTexturedModalRect(k + 80, l + 38 + 12 - j, 176, 30 - j, 14,
|
|
||||||
// j + 1);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
|
||||||
String name = I18n.translateToLocal("tile.techreborn.batbox.name");
|
|
||||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
|
||||||
4210752);
|
|
||||||
|
|
||||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
|
||||||
this.ySize - 96 + 2, 4210752);
|
|
||||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(generator.getMaxPower()), 25, this.ySize - 140,
|
|
||||||
4210752);
|
|
||||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerGenerator.energy), 25, this.ySize - 150,
|
|
||||||
4210752);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,170 +2,139 @@ package techreborn.client.gui;
|
||||||
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.text.translation.I18n;
|
|
||||||
import reborncore.client.gui.GuiUtil;
|
|
||||||
import reborncore.client.multiblock.Multiblock;
|
import reborncore.client.multiblock.Multiblock;
|
||||||
import reborncore.client.multiblock.MultiblockRenderEvent;
|
import reborncore.client.multiblock.MultiblockRenderEvent;
|
||||||
import reborncore.client.multiblock.MultiblockSet;
|
import reborncore.client.multiblock.MultiblockSet;
|
||||||
import reborncore.common.misc.Location;
|
import reborncore.common.misc.Location;
|
||||||
import reborncore.common.multiblock.CoordTriplet;
|
import techreborn.client.gui.widget.GuiButtonHologram;
|
||||||
import techreborn.client.container.ContainerBlastFurnace;
|
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
import techreborn.proxies.ClientProxy;
|
import techreborn.proxies.ClientProxy;
|
||||||
import techreborn.tiles.multiblock.TileBlastFurnace;
|
import techreborn.tiles.multiblock.TileBlastFurnace;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public class GuiBlastFurnace extends GuiContainer {
|
public class GuiBlastFurnace extends GuiBase {
|
||||||
|
|
||||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
public TileBlastFurnace tile;
|
||||||
"textures/gui/industrial_blast_furnace.png");
|
|
||||||
|
|
||||||
TileBlastFurnace blastfurnace;
|
|
||||||
|
|
||||||
ContainerBlastFurnace containerBlastFurnace;
|
|
||||||
boolean hasMultiBlock;
|
boolean hasMultiBlock;
|
||||||
|
|
||||||
public GuiBlastFurnace(EntityPlayer player, TileBlastFurnace tileblastfurnace) {
|
public GuiBlastFurnace(final EntityPlayer player, final TileBlastFurnace tile) {
|
||||||
super(new ContainerBlastFurnace(tileblastfurnace, player));
|
super(player, tile, tile.createContainer(player));
|
||||||
this.xSize = 176;
|
this.tile = tile;
|
||||||
this.ySize = 167;
|
|
||||||
blastfurnace = tileblastfurnace;
|
|
||||||
this.containerBlastFurnace = (ContainerBlastFurnace) this.inventorySlots;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initGui() {
|
public void initGui() {
|
||||||
|
|
||||||
hasMultiBlock = containerBlastFurnace.heat != 0;
|
|
||||||
int k = (this.width - this.xSize) / 2;
|
|
||||||
int l = (this.height - this.ySize) / 2;
|
|
||||||
GuiButton button = new GuiButton(212, k + 4, l + 6, 20, 20, "");
|
|
||||||
buttonList.add(button);
|
|
||||||
super.initGui();
|
super.initGui();
|
||||||
CoordTriplet coordinates = new CoordTriplet(
|
this.hasMultiBlock = this.tile.getCachedHeat() != 0;
|
||||||
blastfurnace.getPos().getX() - (EnumFacing.getFront(blastfurnace.getFacingInt()).getFrontOffsetX() * 2),
|
|
||||||
blastfurnace.getPos().getY() - 1, blastfurnace.getPos().getZ()
|
|
||||||
- (EnumFacing.getFront(blastfurnace.getFacingInt()).getFrontOffsetZ() * 2));
|
|
||||||
if (coordinates.equals(ClientProxy.multiblockRenderEvent.anchor) && blastfurnace.getHeat() != 0) {
|
|
||||||
ClientProxy.multiblockRenderEvent.setMultiblock(null);
|
|
||||||
button.displayString = "B";
|
|
||||||
} else {
|
|
||||||
button.displayString = "A";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
|
||||||
|
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
|
||||||
|
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
this.mc.getTextureManager().bindTexture(texture);
|
final GuiBase.Layer layer = Layer.BACKGROUND;
|
||||||
int k = (this.width - this.xSize) / 2;
|
|
||||||
int l = (this.height - this.ySize) / 2;
|
|
||||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
|
||||||
|
|
||||||
if (containerBlastFurnace.heat == 0) {
|
drawSlot(50, 27, layer);
|
||||||
GuiUtil.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10);
|
drawSlot(50, 47, layer);
|
||||||
this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38,
|
drawSlot(92, 36, layer);
|
||||||
l + 52 + 12 - 0, -1);
|
drawSlot(110, 36, layer);
|
||||||
}
|
|
||||||
|
|
||||||
int j = 0;
|
this.builder.drawJEIButton(this, 150, 4, layer);
|
||||||
this.mc.getTextureManager().bindTexture(texture);
|
|
||||||
j = blastfurnace.getProgressScaled(24);
|
|
||||||
if (j > 0) {
|
|
||||||
this.drawTexturedModalRect(k + 64, l + 37, 176, 14, j + 1, 16);
|
|
||||||
}
|
|
||||||
|
|
||||||
j = blastfurnace.getEnergyScaled(12);
|
|
||||||
if (j > 0) {
|
|
||||||
this.drawTexturedModalRect(k + 9, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
|
||||||
super.drawGuiContainerForegroundLayer(p_146979_1_, p_146979_2_);
|
|
||||||
String name = I18n.translateToLocal("tile.techreborn.blastfurnace.name");
|
|
||||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
|
||||||
4210752);
|
|
||||||
if (containerBlastFurnace.heat != 0) {
|
|
||||||
this.fontRendererObj.drawString("Current Heat: " + containerBlastFurnace.heat, 40, 60, 4210752);
|
|
||||||
}
|
|
||||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
|
||||||
this.ySize - 96 + 2, 4210752);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(GuiButton button) throws IOException {
|
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
|
||||||
|
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||||
|
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||||
|
|
||||||
|
this.builder.drawProgressBar(this, this.tile.getProgressScaled(100), 100, 71, 40, mouseX, mouseY, TRBuilder.ProgressDirection.RIGHT, layer);
|
||||||
|
this.builder.drawMultiEnergyBar(this, 9, 18, (int) this.tile.getEnergy(), (int) this.tile.getMaxPower(), mouseX, mouseY, 0, layer);
|
||||||
|
this.builder.drawBigHeatBar(this, 31, 71, tile.getCachedHeat(), 3230, layer);
|
||||||
|
addHologramButton(6, 4, 212, layer);
|
||||||
|
builder.drawHologramButton(this, 6, 4, mouseX, mouseY, layer);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addHologramButton(int x, int y, int id, Layer layer) {
|
||||||
|
if (id == 0)
|
||||||
|
buttonList.clear();
|
||||||
|
int factorX = 0;
|
||||||
|
int factorY = 0;
|
||||||
|
if (layer == Layer.BACKGROUND) {
|
||||||
|
factorX = guiLeft;
|
||||||
|
factorY = guiTop;
|
||||||
|
}
|
||||||
|
buttonList.add(new GuiButtonHologram(id, x + factorX, y + factorY, this, layer));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(final GuiButton button) throws IOException {
|
||||||
super.actionPerformed(button);
|
super.actionPerformed(button);
|
||||||
if (button.id == 212) {
|
if (button.id == 212) {
|
||||||
if (ClientProxy.multiblockRenderEvent.currentMultiblock == null) {
|
if (ClientProxy.multiblockRenderEvent.currentMultiblock == null) {
|
||||||
{// This code here makes a basic multiblock and then sets to the
|
{
|
||||||
// selected one.
|
// This code here makes a basic multiblock and then sets to the selected one.
|
||||||
Multiblock multiblock = new Multiblock();
|
final Multiblock multiblock = new Multiblock();
|
||||||
addComponent(0, 0, 0, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(0, 0, 0, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
addComponent(1, 0, 0, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(1, 0, 0, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
addComponent(0, 0, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(0, 0, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
addComponent(-1, 0, 0, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(-1, 0, 0, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
addComponent(0, 0, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(0, 0, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
addComponent(-1, 0, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(-1, 0, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
addComponent(-1, 0, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(-1, 0, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
addComponent(1, 0, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(1, 0, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
addComponent(1, 0, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(1, 0, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
|
|
||||||
addComponent(1, 1, 0, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(1, 1, 0, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
addComponent(0, 1, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(0, 1, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
addComponent(-1, 1, 0, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(-1, 1, 0, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
addComponent(0, 1, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(0, 1, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
addComponent(-1, 1, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(-1, 1, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
addComponent(-1, 1, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(-1, 1, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
addComponent(1, 1, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(1, 1, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
addComponent(1, 1, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(1, 1, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
|
|
||||||
addComponent(1, 2, 0, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(1, 2, 0, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
addComponent(0, 2, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(0, 2, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
addComponent(-1, 2, 0, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(-1, 2, 0, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
addComponent(0, 2, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(0, 2, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
addComponent(-1, 2, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(-1, 2, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
addComponent(-1, 2, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(-1, 2, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
addComponent(1, 2, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(1, 2, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
addComponent(1, 2, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(1, 2, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
|
|
||||||
addComponent(0, 3, 0, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(0, 3, 0, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
addComponent(1, 3, 0, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(1, 3, 0, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
addComponent(0, 3, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(0, 3, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
addComponent(-1, 3, 0, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(-1, 3, 0, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
addComponent(0, 3, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(0, 3, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
addComponent(-1, 3, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(-1, 3, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
addComponent(-1, 3, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(-1, 3, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
addComponent(1, 3, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(1, 3, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
addComponent(1, 3, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
this.addComponent(1, 3, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||||
|
|
||||||
MultiblockSet set = new MultiblockSet(multiblock);
|
final MultiblockSet set = new MultiblockSet(multiblock);
|
||||||
ClientProxy.multiblockRenderEvent.setMultiblock(set);
|
ClientProxy.multiblockRenderEvent.setMultiblock(set);
|
||||||
ClientProxy.multiblockRenderEvent.parent = new Location(blastfurnace.getPos().getX(),
|
ClientProxy.multiblockRenderEvent.parent = new Location(this.tile.getPos().getX(),
|
||||||
blastfurnace.getPos().getY(), blastfurnace.getPos().getZ(), blastfurnace.getWorld());
|
this.tile.getPos().getY(), this.tile.getPos().getZ(), this.tile.getWorld());
|
||||||
MultiblockRenderEvent.anchor = new BlockPos(
|
MultiblockRenderEvent.anchor = new BlockPos(
|
||||||
blastfurnace.getPos().getX()
|
this.tile.getPos().getX()
|
||||||
- (EnumFacing.getFront(blastfurnace.getFacingInt()).getFrontOffsetX() * 2),
|
- EnumFacing.getFront(this.tile.getFacingInt()).getFrontOffsetX() * 2,
|
||||||
blastfurnace.getPos().getY() - 1, blastfurnace.getPos().getZ()
|
this.tile.getPos().getY() - 1, this.tile.getPos().getZ()
|
||||||
- (EnumFacing.getFront(blastfurnace.getFacingInt()).getFrontOffsetZ() * 2));
|
- EnumFacing.getFront(this.tile.getFacingInt()).getFrontOffsetZ() * 2);
|
||||||
}
|
}
|
||||||
button.displayString = "A";
|
|
||||||
} else {
|
} else {
|
||||||
ClientProxy.multiblockRenderEvent.setMultiblock(null);
|
ClientProxy.multiblockRenderEvent.setMultiblock(null);
|
||||||
button.displayString = "B";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addComponent(int x, int y, int z, IBlockState blockState, Multiblock multiblock) {
|
public void addComponent(final int x, final int y, final int z, final IBlockState blockState, final Multiblock multiblock) {
|
||||||
multiblock.addComponent(new BlockPos(x, y, z), blockState);
|
multiblock.addComponent(new BlockPos(x, y, z), blockState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,67 +1,41 @@
|
||||||
package techreborn.client.gui;
|
package techreborn.client.gui;
|
||||||
|
|
||||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import net.minecraft.util.text.translation.I18n;
|
|
||||||
import reborncore.common.container.RebornContainer;
|
|
||||||
import techreborn.client.container.ContainerCentrifuge;
|
|
||||||
import techreborn.tiles.TileCentrifuge;
|
import techreborn.tiles.TileCentrifuge;
|
||||||
|
|
||||||
public class GuiCentrifuge extends GuiContainer {
|
public class GuiCentrifuge extends GuiBase {
|
||||||
|
|
||||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
TileCentrifuge tile;
|
||||||
"textures/gui/industrial_centrifuge.png");
|
|
||||||
|
|
||||||
TileCentrifuge centrifuge;
|
public GuiCentrifuge(final EntityPlayer player, final TileCentrifuge tile) {
|
||||||
|
super(player, tile, tile.createContainer(player));
|
||||||
public GuiCentrifuge(EntityPlayer player, TileCentrifuge tileCentrifuge) {
|
this.tile = tile;
|
||||||
super(RebornContainer.createContainer(ContainerCentrifuge.class, tileCentrifuge, player));
|
|
||||||
this.xSize = 176;
|
|
||||||
this.ySize = 167;
|
|
||||||
centrifuge = tileCentrifuge;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initGui() {
|
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
|
||||||
int k = (this.width - this.xSize) / 2;
|
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
|
||||||
int l = (this.height - this.ySize) / 2;
|
final Layer layer = Layer.BACKGROUND;
|
||||||
super.initGui();
|
|
||||||
|
this.drawSlot(8, 72, layer);
|
||||||
|
|
||||||
|
this.drawSlot(40, 34, layer);
|
||||||
|
this.drawSlot(40, 54, layer);
|
||||||
|
|
||||||
|
this.drawSlot(82, 44, layer);
|
||||||
|
this.drawSlot(101, 25, layer);
|
||||||
|
this.drawSlot(120, 44, layer);
|
||||||
|
this.drawSlot(101, 63, layer);
|
||||||
|
|
||||||
|
this.builder.drawJEIButton(this, 150, 4, layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||||
this.mc.getTextureManager().bindTexture(texture);
|
final Layer layer = Layer.FOREGROUND;
|
||||||
int k = (this.width - this.xSize) / 2;
|
|
||||||
int l = (this.height - this.ySize) / 2;
|
|
||||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
|
||||||
|
|
||||||
int j = 0;
|
this.builder.drawProgressBar(this, this.tile.getProgressScaled(100), 100, 61, 47, mouseX, mouseY, TRBuilder.ProgressDirection.RIGHT, layer);
|
||||||
|
this.builder.drawMultiEnergyBar(this, 9, 18, (int) this.tile.getEnergy(), (int) this.tile.getMaxPower(), mouseX, mouseY, 0, layer);
|
||||||
j = centrifuge.getProgressScaled(11);
|
|
||||||
if (j > 0) {
|
|
||||||
this.drawTexturedModalRect(k + 83, l + 23 + 10 - j, 177, 15 + 10 - j, 10, j);
|
|
||||||
this.drawTexturedModalRect(k + 98, l + 38, 177, 51, j, 10);
|
|
||||||
this.drawTexturedModalRect(k + 83, l + 53, 177, 39, 10, j);
|
|
||||||
this.drawTexturedModalRect(k + 68 + 10 - j, l + 38, 177 + 10 - j, 27, j, 10);
|
|
||||||
}
|
|
||||||
|
|
||||||
j = centrifuge.getEnergyScaled(12);
|
|
||||||
|
|
||||||
if (j > 0) {
|
|
||||||
this.drawTexturedModalRect(k + 9, l + 32 + 12 - j, 176, 12 - j, 14, j + 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
|
||||||
String namePt1 = I18n.translateToLocal("tile.techreborn.industrialBlock.name");
|
|
||||||
String namePt2 = I18n.translateToLocal("tile.techreborn.centrifuge.name").replace(namePt1 + " ", "");
|
|
||||||
this.fontRendererObj.drawString(namePt1, 98, 6, 4210752);
|
|
||||||
this.fontRendererObj.drawString(namePt2, 98, 14, 4210752);
|
|
||||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
|
||||||
this.ySize - 96 + 2, 4210752);
|
|
||||||
this.fontRendererObj.drawString(centrifuge.getProgressScaled(100) + "%", 98, this.ySize - 96 + 2, 4210752);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,54 +1,35 @@
|
||||||
package techreborn.client.gui;
|
package techreborn.client.gui;
|
||||||
|
|
||||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import net.minecraft.util.text.translation.I18n;
|
|
||||||
import techreborn.client.container.ContainerChargeBench;
|
|
||||||
import techreborn.tiles.TileChargeBench;
|
import techreborn.tiles.TileChargeBench;
|
||||||
|
|
||||||
public class GuiChargeBench extends GuiContainer {
|
public class GuiChargeBench extends GuiBase {
|
||||||
|
|
||||||
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/chargebench.png");
|
TileChargeBench tile;
|
||||||
|
|
||||||
TileChargeBench chargebench;
|
public GuiChargeBench(final EntityPlayer player, final TileChargeBench tile) {
|
||||||
|
super(player, tile, tile.createContainer(player));
|
||||||
public GuiChargeBench(EntityPlayer player, TileChargeBench tile) {
|
this.tile = tile;
|
||||||
super(new ContainerChargeBench(tile, player));
|
|
||||||
this.xSize = 176;
|
|
||||||
this.ySize = 167;
|
|
||||||
chargebench = tile;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initGui() {
|
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
|
||||||
int k = (this.width - this.xSize) / 2;
|
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
|
||||||
int l = (this.height - this.ySize) / 2;
|
final Layer layer = Layer.BACKGROUND;
|
||||||
super.initGui();
|
|
||||||
|
this.drawSlot(62, 25, layer);
|
||||||
|
this.drawSlot(98, 25, layer);
|
||||||
|
this.drawSlot(62, 45, layer);
|
||||||
|
this.drawSlot(98, 45, layer);
|
||||||
|
this.drawSlot(62, 65, layer);
|
||||||
|
this.drawSlot(98, 65, layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||||
this.mc.getTextureManager().bindTexture(texture);
|
final Layer layer = Layer.FOREGROUND;
|
||||||
int k = (this.width - this.xSize) / 2;
|
|
||||||
int l = (this.height - this.ySize) / 2;
|
|
||||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
|
||||||
|
|
||||||
int j = 0;
|
this.builder.drawMultiEnergyBar(this, 81, 28, (int) this.tile.getEnergy(), (int) this.tile.getMaxPower(), mouseX, mouseY, 0, layer);
|
||||||
|
|
||||||
j = chargebench.getEnergyScaled(12);
|
|
||||||
if (j > 0) {
|
|
||||||
this.drawTexturedModalRect(k + 10, l + 32 + 12 - j, 176, 12 - j, 14, j + 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
|
||||||
String name = I18n.translateToLocal("tile.techreborn.chargebench.name");
|
|
||||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
|
||||||
4210752);
|
|
||||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
|
||||||
this.ySize - 96 + 2, 4210752);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,63 +1,38 @@
|
||||||
package techreborn.client.gui;
|
package techreborn.client.gui;
|
||||||
|
|
||||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import net.minecraft.util.text.translation.I18n;
|
|
||||||
import techreborn.client.container.ContainerChemicalReactor;
|
|
||||||
import techreborn.tiles.TileChemicalReactor;
|
import techreborn.tiles.TileChemicalReactor;
|
||||||
|
|
||||||
public class GuiChemicalReactor extends GuiContainer {
|
public class GuiChemicalReactor extends GuiBase {
|
||||||
|
|
||||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
TileChemicalReactor tile;
|
||||||
"textures/gui/chemical_reactor.png");
|
|
||||||
|
|
||||||
TileChemicalReactor chemicalReactor;
|
public GuiChemicalReactor(final EntityPlayer player, final TileChemicalReactor tile) {
|
||||||
ContainerChemicalReactor containerChemicalReactor;
|
super(player, tile, tile.createContainer(player));
|
||||||
|
this.tile = tile;
|
||||||
public GuiChemicalReactor(EntityPlayer player, TileChemicalReactor tilechemicalReactor) {
|
|
||||||
super(new ContainerChemicalReactor(tilechemicalReactor, player));
|
|
||||||
containerChemicalReactor = (ContainerChemicalReactor) this.inventorySlots;
|
|
||||||
this.xSize = 176;
|
|
||||||
this.ySize = 167;
|
|
||||||
chemicalReactor = tilechemicalReactor;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initGui() {
|
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
|
||||||
int k = (this.width - this.xSize) / 2;
|
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
|
||||||
int l = (this.height - this.ySize) / 2;
|
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||||
super.initGui();
|
|
||||||
|
this.drawSlot(8, 72, layer);
|
||||||
|
|
||||||
|
this.drawSlot(34, 47, layer);
|
||||||
|
this.drawSlot(126, 47, layer);
|
||||||
|
this.drawOutputSlot(80, 47, layer);
|
||||||
|
|
||||||
|
this.builder.drawJEIButton(this, 150, 4, layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||||
this.mc.getTextureManager().bindTexture(texture);
|
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||||
int k = (this.width - this.xSize) / 2;
|
|
||||||
int l = (this.height - this.ySize) / 2;
|
|
||||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
|
||||||
|
|
||||||
int j = 0;
|
this.builder.drawProgressBar(this, this.tile.getProgressScaled(100), 100, 55, 51, mouseX, mouseY, TRBuilder.ProgressDirection.RIGHT, layer);
|
||||||
|
this.builder.drawProgressBar(this, this.tile.getProgressScaled(100), 100, 105, 51, mouseX, mouseY, TRBuilder.ProgressDirection.LEFT, layer);
|
||||||
j = chemicalReactor.getProgressScaled(11);
|
this.builder.drawMultiEnergyBar(this, 9, 18, (int) this.tile.getEnergy(), (int) this.tile.getMaxPower(), mouseX, mouseY, 0, layer);
|
||||||
if (j > 0) {
|
|
||||||
this.drawTexturedModalRect(k + 73, l + 39, 177, 15, 30, j);
|
|
||||||
}
|
|
||||||
|
|
||||||
j = chemicalReactor.getEnergyScaled(12);
|
|
||||||
if (j > 0) {
|
|
||||||
this.drawTexturedModalRect(k + 9, l + 32 + 12 - j, 176, 12 - j, 14, j + 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
|
||||||
String name = I18n.translateToLocal("tile.techreborn.chemicalreactor.name");
|
|
||||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
|
||||||
4210752);
|
|
||||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
|
||||||
this.ySize - 96 + 2, 4210752);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,24 +6,24 @@ import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.util.text.translation.I18n;
|
import net.minecraft.util.text.translation.I18n;
|
||||||
import techreborn.client.container.ContainerChunkloader;
|
|
||||||
import techreborn.tiles.TileChunkLoader;
|
import techreborn.tiles.TileChunkLoader;
|
||||||
|
|
||||||
public class GuiChunkLoader extends GuiContainer {
|
public class GuiChunkLoader extends GuiContainer {
|
||||||
|
|
||||||
private static final ResourceLocation texture = new ResourceLocation("techreborn",
|
private static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||||
"textures/gui/industrial_chunkloader.png");
|
"textures/gui/industrial_chunkloader.png");
|
||||||
TileChunkLoader chunkloader;
|
TileChunkLoader chunkloader;
|
||||||
private GuiButton plusOneButton;
|
private GuiButton plusOneButton;
|
||||||
private GuiButton plusTenButton;
|
private GuiButton plusTenButton;
|
||||||
private GuiButton minusOneButton;
|
private GuiButton minusOneButton;
|
||||||
private GuiButton minusTenButton;
|
private GuiButton minusTenButton;
|
||||||
|
|
||||||
public GuiChunkLoader(EntityPlayer player, TileChunkLoader tilechunkloader) {
|
public GuiChunkLoader(final EntityPlayer player, final TileChunkLoader chunkLoader) {
|
||||||
super(new ContainerChunkloader(tilechunkloader, player));
|
super(chunkLoader.createContainer(player));
|
||||||
this.xSize = 176;
|
this.xSize = 176;
|
||||||
this.ySize = 167;
|
this.ySize = 167;
|
||||||
chunkloader = tilechunkloader;
|
this.chunkloader = chunkLoader;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -31,33 +31,34 @@ public class GuiChunkLoader extends GuiContainer {
|
||||||
super.initGui();
|
super.initGui();
|
||||||
this.guiLeft = this.width / 2 - this.xSize / 2;
|
this.guiLeft = this.width / 2 - this.xSize / 2;
|
||||||
this.guiTop = this.height / 2 - this.ySize / 2;
|
this.guiTop = this.height / 2 - this.ySize / 2;
|
||||||
plusOneButton = new GuiButton(0, guiLeft + 5, guiTop + 37, 40, 20, "+1");
|
this.plusOneButton = new GuiButton(0, this.guiLeft + 5, this.guiTop + 37, 40, 20, "+1");
|
||||||
plusTenButton = new GuiButton(0, guiLeft + 45, guiTop + 37, 40, 20, "+10");
|
this.plusTenButton = new GuiButton(0, this.guiLeft + 45, this.guiTop + 37, 40, 20, "+10");
|
||||||
|
|
||||||
minusOneButton = new GuiButton(0, guiLeft + 90, guiTop + 37, 40, 20, "-1");
|
this.minusOneButton = new GuiButton(0, this.guiLeft + 90, this.guiTop + 37, 40, 20, "-1");
|
||||||
minusTenButton = new GuiButton(0, guiLeft + 130, guiTop + 37, 40, 20, "-10");
|
this.minusTenButton = new GuiButton(0, this.guiLeft + 130, this.guiTop + 37, 40, 20, "-10");
|
||||||
|
|
||||||
buttonList.add(plusOneButton);
|
this.buttonList.add(this.plusOneButton);
|
||||||
buttonList.add(plusTenButton);
|
this.buttonList.add(this.plusTenButton);
|
||||||
buttonList.add(minusOneButton);
|
this.buttonList.add(this.minusOneButton);
|
||||||
buttonList.add(minusTenButton);
|
this.buttonList.add(this.minusTenButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
protected void drawGuiContainerBackgroundLayer(final float p_146976_1_, final int p_146976_2_, final int p_146976_3_) {
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
this.mc.getTextureManager().bindTexture(texture);
|
this.mc.getTextureManager().bindTexture(GuiChunkLoader.texture);
|
||||||
int k = (this.width - this.xSize) / 2;
|
final int k = (this.width - this.xSize) / 2;
|
||||||
int l = (this.height - this.ySize) / 2;
|
final int l = (this.height - this.ySize) / 2;
|
||||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
@Override
|
||||||
String name = I18n.translateToLocal("tile.techreborn.chunkloader.name");
|
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,
|
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||||
4210752);
|
4210752);
|
||||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||||
this.ySize - 96 + 2, 4210752);
|
this.ySize - 96 + 2, 4210752);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,54 +1,36 @@
|
||||||
package techreborn.client.gui;
|
package techreborn.client.gui;
|
||||||
|
|
||||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import net.minecraft.util.text.translation.I18n;
|
|
||||||
import techreborn.client.container.ContainerCompressor;
|
|
||||||
import techreborn.tiles.teir1.TileCompressor;
|
import techreborn.tiles.teir1.TileCompressor;
|
||||||
|
|
||||||
public class GuiCompressor extends GuiContainer {
|
public class GuiCompressor extends GuiBase {
|
||||||
|
|
||||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/compressor.png");
|
TileCompressor tile;
|
||||||
|
|
||||||
TileCompressor compressor;
|
public GuiCompressor(final EntityPlayer player, final TileCompressor tile) {
|
||||||
ContainerCompressor containerGrinder;
|
super(player, tile, tile.createContainer(player));
|
||||||
|
this.tile = tile;
|
||||||
public GuiCompressor(EntityPlayer player, TileCompressor tilegrinder) {
|
|
||||||
super(new ContainerCompressor(tilegrinder, player));
|
|
||||||
this.xSize = 176;
|
|
||||||
this.ySize = 167;
|
|
||||||
compressor = tilegrinder;
|
|
||||||
containerGrinder = (ContainerCompressor) this.inventorySlots;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
|
||||||
this.mc.getTextureManager().bindTexture(texture);
|
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||||
int k = (this.width - this.xSize) / 2;
|
|
||||||
int l = (this.height - this.ySize) / 2;
|
|
||||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
|
||||||
|
|
||||||
int j = 0;
|
//this.drawSlot(8, 72, layer);
|
||||||
|
|
||||||
j = compressor.getProgressScaled(24);
|
this.drawSlot(55, 45, layer);
|
||||||
if (j > 0) {
|
this.drawOutputSlot(101, 45, layer);
|
||||||
this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16);
|
|
||||||
}
|
|
||||||
|
|
||||||
j = compressor.getEnergyScaled(12);
|
this.builder.drawJEIButton(this, 150, 4, layer);
|
||||||
if (j > 0) {
|
|
||||||
this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
@Override
|
||||||
String name = I18n.translateToLocal("tile.techreborn.compressor.name");
|
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
|
||||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||||
4210752);
|
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
|
||||||
this.ySize - 96 + 2, 4210752);
|
this.builder.drawProgressBar(this, this.tile.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, TRBuilder.ProgressDirection.RIGHT, layer);
|
||||||
|
this.builder.drawMultiEnergyBar(this, 9, 18, (int) this.tile.getEnergy(), (int) this.tile.getMaxPower(), mouseX, mouseY, 0, layer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,47 +5,46 @@ import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.util.text.translation.I18n;
|
import net.minecraft.util.text.translation.I18n;
|
||||||
|
|
||||||
import reborncore.common.powerSystem.PowerSystem;
|
import reborncore.common.powerSystem.PowerSystem;
|
||||||
import techreborn.client.container.ContainerDieselGenerator;
|
|
||||||
import techreborn.tiles.generator.TileDieselGenerator;
|
import techreborn.tiles.generator.TileDieselGenerator;
|
||||||
|
|
||||||
public class GuiDieselGenerator extends GuiContainer {
|
public class GuiDieselGenerator extends GuiContainer {
|
||||||
|
|
||||||
private static final ResourceLocation texture = new ResourceLocation("techreborn",
|
private static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||||
"textures/gui/diesel_generator.png");
|
"textures/gui/diesel_generator.png");
|
||||||
|
|
||||||
TileDieselGenerator tile;
|
TileDieselGenerator dieselGenerator;
|
||||||
|
|
||||||
ContainerDieselGenerator containerDieselGenerator;
|
public GuiDieselGenerator(final EntityPlayer player, final TileDieselGenerator dieselGenerator) {
|
||||||
|
super(dieselGenerator.createContainer(player));
|
||||||
public GuiDieselGenerator(EntityPlayer player, TileDieselGenerator tile) {
|
|
||||||
super(new ContainerDieselGenerator(tile, player));
|
|
||||||
this.xSize = 176;
|
this.xSize = 176;
|
||||||
this.ySize = 167;
|
this.ySize = 167;
|
||||||
this.tile = tile;
|
this.dieselGenerator = dieselGenerator;
|
||||||
containerDieselGenerator = (ContainerDieselGenerator) this.inventorySlots;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
protected void drawGuiContainerBackgroundLayer(final float p_146976_1_, final int p_146976_2_, final int p_146976_3_) {
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
this.mc.getTextureManager().bindTexture(texture);
|
this.mc.getTextureManager().bindTexture(GuiDieselGenerator.texture);
|
||||||
int k = (this.width - this.xSize) / 2;
|
final int k = (this.width - this.xSize) / 2;
|
||||||
int l = (this.height - this.ySize) / 2;
|
final int l = (this.height - this.ySize) / 2;
|
||||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
@Override
|
||||||
String name = I18n.translateToLocal("tile.techreborn.dieselgenerator.name");
|
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,
|
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||||
4210752);
|
4210752);
|
||||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||||
this.ySize - 96 + 2, 4210752);
|
this.ySize - 96 + 2, 4210752);
|
||||||
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
|
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
|
||||||
this.fontRendererObj.drawString(containerDieselGenerator.fluid + "", 10, 30, 16448255);
|
this.fontRendererObj.drawString(this.dieselGenerator.tank.getFluidAmount() + "", 10, 30, 16448255);
|
||||||
|
|
||||||
this.fontRendererObj.drawString("Power Amount", 10, 40, 16448255);
|
this.fontRendererObj.drawString("Power Amount", 10, 40, 16448255);
|
||||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerDieselGenerator.energy) + "", 10, 50,
|
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(this.dieselGenerator.getEnergy()) + "", 10, 50,
|
||||||
16448255);
|
16448255);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,48 +1,41 @@
|
||||||
package techreborn.client.gui;
|
package techreborn.client.gui;
|
||||||
|
|
||||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import net.minecraft.util.text.translation.I18n;
|
|
||||||
import techreborn.client.container.ContainerDigitalChest;
|
|
||||||
import techreborn.tiles.TileDigitalChest;
|
import techreborn.tiles.TileDigitalChest;
|
||||||
|
|
||||||
public class GuiDigitalChest extends GuiContainer {
|
public class GuiDigitalChest extends GuiBase {
|
||||||
|
|
||||||
private static final ResourceLocation texture = new ResourceLocation("techreborn",
|
TileDigitalChest digitalChest;
|
||||||
"textures/gui/thermal_generator.png");
|
|
||||||
|
|
||||||
TileDigitalChest tile;
|
public GuiDigitalChest(final EntityPlayer player, final TileDigitalChest digitalChest) {
|
||||||
|
super(player, digitalChest, digitalChest.createContainer(player));
|
||||||
public GuiDigitalChest(EntityPlayer player, TileDigitalChest tile) {
|
this.digitalChest = digitalChest;
|
||||||
super(new ContainerDigitalChest(tile, player));
|
|
||||||
this.xSize = 176;
|
|
||||||
this.ySize = 167;
|
|
||||||
this.tile = tile;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
|
||||||
this.mc.getTextureManager().bindTexture(texture);
|
final Layer layer = Layer.BACKGROUND;
|
||||||
int k = (this.width - this.xSize) / 2;
|
|
||||||
int l = (this.height - this.ySize) / 2;
|
this.drawSlot(80, 24, layer);
|
||||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
this.drawSlot(80, 64, layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
@Override
|
||||||
String name = I18n.translateToLocal("tile.techreborn.digitalChest.name");
|
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
|
||||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||||
4210752);
|
final Layer layer = Layer.FOREGROUND;
|
||||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
|
||||||
this.ySize - 96 + 2, 4210752);
|
if (this.digitalChest.storedItem != ItemStack.EMPTY && this.digitalChest.getStackInSlot(1) != null) {
|
||||||
this.fontRendererObj.drawString("Amount", 10, 20, 16448255);
|
this.builder.drawBigBlueBar(this, 31, 43,
|
||||||
if (tile.storedItem != ItemStack.EMPTY && tile.getStackInSlot(1) != null)
|
this.digitalChest.storedItem.getCount() + this.digitalChest.getStackInSlot(1).getCount(),
|
||||||
this.fontRendererObj.drawString(tile.storedItem.getCount() + tile.getStackInSlot(1).getCount() + "", 10, 30,
|
this.digitalChest.maxCapacity, mouseX - this.guiLeft, mouseY - this.guiTop, "Stored", layer);
|
||||||
16448255);
|
}
|
||||||
if (tile.storedItem == ItemStack.EMPTY && tile.getStackInSlot(1) != null)
|
if (this.digitalChest.storedItem == ItemStack.EMPTY && this.digitalChest.getStackInSlot(1) != null) {
|
||||||
this.fontRendererObj.drawString(tile.getStackInSlot(1).getCount() + "", 10, 30, 16448255);
|
this.builder.drawBigBlueBar(this, 31, 43, this.digitalChest.getStackInSlot(1).getCount(),
|
||||||
|
this.digitalChest.maxCapacity, mouseX - this.guiLeft, mouseY - this.guiTop, "Stored", layer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,55 +1,36 @@
|
||||||
package techreborn.client.gui;
|
package techreborn.client.gui;
|
||||||
|
|
||||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import net.minecraft.util.text.translation.I18n;
|
|
||||||
import techreborn.client.container.ContainerElectricFurnace;
|
|
||||||
import techreborn.tiles.teir1.TileElectricFurnace;
|
import techreborn.tiles.teir1.TileElectricFurnace;
|
||||||
|
|
||||||
public class GuiElectricFurnace extends GuiContainer {
|
public class GuiElectricFurnace extends GuiBase {
|
||||||
|
|
||||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/compressor.png");
|
TileElectricFurnace tile;
|
||||||
|
|
||||||
TileElectricFurnace furnace;
|
public GuiElectricFurnace(final EntityPlayer player, final TileElectricFurnace tile) {
|
||||||
ContainerElectricFurnace containerGrinder;
|
super(player, tile, tile.createContainer(player));
|
||||||
|
this.tile = tile;
|
||||||
public GuiElectricFurnace(EntityPlayer player, TileElectricFurnace tilegrinder) {
|
|
||||||
super(new ContainerElectricFurnace(tilegrinder, player));
|
|
||||||
this.xSize = 176;
|
|
||||||
this.ySize = 167;
|
|
||||||
furnace = tilegrinder;
|
|
||||||
containerGrinder = (ContainerElectricFurnace) this.inventorySlots;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
|
||||||
this.mc.getTextureManager().bindTexture(texture);
|
final Layer layer = Layer.BACKGROUND;
|
||||||
int k = (this.width - this.xSize) / 2;
|
|
||||||
int l = (this.height - this.ySize) / 2;
|
|
||||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
|
||||||
|
|
||||||
int j = 0;
|
//this.drawSlot(8, 72, layer);
|
||||||
|
|
||||||
j = furnace.gaugeProgressScaled(24);
|
this.drawSlot(55, 45, layer);
|
||||||
if (j > 0) {
|
this.drawOutputSlot(101, 45, layer);
|
||||||
this.drawTexturedModalRect(k + 78, l + 34, 176, 14, j + 1, 16);
|
|
||||||
}
|
|
||||||
|
|
||||||
j = furnace.getEnergyScaled(12);
|
this.builder.drawJEIButton(this, 150, 4, layer);
|
||||||
if (j > 0) {
|
|
||||||
this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
@Override
|
||||||
String name = I18n.translateToLocal("tile.techreborn.electricfurnace.name");
|
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
|
||||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||||
4210752);
|
final Layer layer = Layer.FOREGROUND;
|
||||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
|
||||||
this.ySize - 96 + 2, 4210752);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
this.builder.drawProgressBar(this, this.tile.gaugeProgressScaled(100), 100, 76, 48, mouseX, mouseY, TRBuilder.ProgressDirection.RIGHT, layer);
|
||||||
|
this.builder.drawMultiEnergyBar(this, 9, 18, (int) this.tile.getEnergy(), (int) this.tile.getMaxPower(), mouseX, mouseY, 0, layer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,55 +1,36 @@
|
||||||
package techreborn.client.gui;
|
package techreborn.client.gui;
|
||||||
|
|
||||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import net.minecraft.util.text.translation.I18n;
|
|
||||||
import reborncore.common.container.RebornContainer;
|
|
||||||
import techreborn.client.container.ContainerExtractor;
|
|
||||||
import techreborn.tiles.teir1.TileExtractor;
|
import techreborn.tiles.teir1.TileExtractor;
|
||||||
|
|
||||||
public class GuiExtractor extends GuiContainer {
|
public class GuiExtractor extends GuiBase {
|
||||||
|
|
||||||
public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/compressor.png");
|
TileExtractor tile;
|
||||||
|
|
||||||
TileExtractor extractor;
|
public GuiExtractor(final EntityPlayer player, final TileExtractor tile) {
|
||||||
ContainerExtractor containerExtractor;
|
super(player, tile, tile.createContainer(player));
|
||||||
|
this.tile = tile;
|
||||||
public GuiExtractor(EntityPlayer player, TileExtractor tileExtractor) {
|
|
||||||
super(RebornContainer.createContainer(ContainerExtractor.class, tileExtractor, player));
|
|
||||||
this.xSize = 176;
|
|
||||||
this.ySize = 167;
|
|
||||||
this.extractor = tileExtractor;
|
|
||||||
containerExtractor = (ContainerExtractor) this.inventorySlots;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
|
||||||
this.mc.getTextureManager().bindTexture(texture);
|
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||||
int k = (this.width - this.xSize) / 2;
|
|
||||||
int l = (this.height - this.ySize) / 2;
|
|
||||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
|
||||||
|
|
||||||
int j = 0;
|
//this.drawSlot(8, 72, layer);
|
||||||
|
|
||||||
j = extractor.getProgressScaled(24);
|
this.drawSlot(55, 45, layer);
|
||||||
if (j > 0) {
|
this.drawOutputSlot(101, 45, layer);
|
||||||
this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16);
|
|
||||||
}
|
|
||||||
|
|
||||||
j = extractor.getEnergyScaled(12);
|
this.builder.drawJEIButton(this, 150, 4, layer);
|
||||||
if (j > 0) {
|
|
||||||
this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
@Override
|
||||||
String name = I18n.translateToLocal("tile.techreborn.extractor.name");
|
protected void drawGuiContainerForegroundLayer(final int mouseX, final int mouseY) {
|
||||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||||
4210752);
|
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
|
||||||
this.ySize - 96 + 2, 4210752);
|
this.builder.drawProgressBar(this, this.tile.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, TRBuilder.ProgressDirection.RIGHT, layer);
|
||||||
|
this.builder.drawMultiEnergyBar(this, 9, 18, (int) this.tile.getEnergy(), (int) this.tile.getMaxPower(), mouseX, mouseY, 0, layer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,12 +8,13 @@ import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.text.translation.I18n;
|
import net.minecraft.util.text.translation.I18n;
|
||||||
|
|
||||||
|
import reborncore.client.multiblock.MultiblockRenderEvent;
|
||||||
import reborncore.client.multiblock.MultiblockSet;
|
import reborncore.client.multiblock.MultiblockSet;
|
||||||
import reborncore.common.misc.Location;
|
import reborncore.common.misc.Location;
|
||||||
import reborncore.common.multiblock.CoordTriplet;
|
|
||||||
import reborncore.common.powerSystem.PowerSystem;
|
import reborncore.common.powerSystem.PowerSystem;
|
||||||
|
|
||||||
import techreborn.client.ClientMultiBlocks;
|
import techreborn.client.ClientMultiBlocks;
|
||||||
import techreborn.client.container.ContainerFusionReactor;
|
|
||||||
import techreborn.proxies.ClientProxy;
|
import techreborn.proxies.ClientProxy;
|
||||||
import techreborn.tiles.fusionReactor.TileEntityFusionController;
|
import techreborn.tiles.fusionReactor.TileEntityFusionController;
|
||||||
|
|
||||||
|
@ -22,49 +23,46 @@ import java.io.IOException;
|
||||||
public class GuiFusionReactor extends GuiContainer {
|
public class GuiFusionReactor extends GuiContainer {
|
||||||
|
|
||||||
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
public static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||||
"textures/gui/fusion_reactor.png");
|
"textures/gui/fusion_reactor.png");
|
||||||
|
|
||||||
ContainerFusionReactor containerFusionReactor;
|
|
||||||
TileEntityFusionController fusionController;
|
TileEntityFusionController fusionController;
|
||||||
|
|
||||||
public GuiFusionReactor(EntityPlayer player, TileEntityFusionController tileaesu) {
|
public GuiFusionReactor(final EntityPlayer player, final TileEntityFusionController fusion) {
|
||||||
super(new ContainerFusionReactor(tileaesu, player));
|
super(fusion.createContainer(player));
|
||||||
containerFusionReactor = (ContainerFusionReactor) this.inventorySlots;
|
this.fusionController = fusion;
|
||||||
this.fusionController = tileaesu;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
@Override
|
||||||
String name = I18n.translateToLocal("tile.techreborn.fusioncontrolcomputer.name");
|
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
|
||||||
|
final String name = I18n.translateToLocal("tile.techreborn.fusioncontrolcomputer.name");
|
||||||
this.fontRendererObj.drawString(name, 87, 6, 4210752);
|
this.fontRendererObj.drawString(name, 87, 6, 4210752);
|
||||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||||
this.ySize - 96 + 2, 4210752);
|
this.ySize - 96 + 2, 4210752);
|
||||||
|
|
||||||
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerFusionReactor.energy), 11, 8, 16448255);
|
this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(this.fusionController.getEnergy()), 11, 8,
|
||||||
this.fontRendererObj.drawString("Coils: " + (containerFusionReactor.coilStatus == 1 ? "Yes" : "No"), 11, 16,
|
16448255);
|
||||||
16448255);
|
this.fontRendererObj.drawString("Coils: " + (this.fusionController.getCoilStatus() == 1 ? "Yes" : "No"), 11, 16,
|
||||||
if (containerFusionReactor.neededEU > 1 && containerFusionReactor.tickTime < 1)
|
16448255);
|
||||||
this.fontRendererObj.drawString(
|
if (this.fusionController.getNeededPower() > 1 && this.fusionController.getCrafingTickTime() < 1)
|
||||||
"Start: " + percentage(containerFusionReactor.neededEU, containerFusionReactor.energy) + "%", 11,
|
this.fontRendererObj.drawString("Start: "
|
||||||
24, 16448255);
|
+ this.percentage(this.fusionController.getNeededPower(), (int) this.fusionController.getEnergy())
|
||||||
|
+ "%", 11, 24, 16448255);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initGui() {
|
public void initGui() {
|
||||||
int k = (this.width - this.xSize) / 2;
|
final int k = (this.width - this.xSize) / 2;
|
||||||
int l = (this.height - this.ySize) / 2;
|
final int l = (this.height - this.ySize) / 2;
|
||||||
GuiButton button = new GuiButton(212, k + this.xSize - 24, l + 4, 20,
|
final GuiButton button = new GuiButton(212, k + this.xSize - 24, l + 4, 20, 20, "");
|
||||||
20, "");
|
this.buttonList.add(button);
|
||||||
buttonList.add(button);
|
|
||||||
super.initGui();
|
super.initGui();
|
||||||
BlockPos coordinates = new
|
final BlockPos coordinates = new BlockPos(
|
||||||
BlockPos(fusionController.getPos().getX() -
|
this.fusionController.getPos().getX()
|
||||||
(EnumFacing.getFront(fusionController.getFacingInt()).getFrontOffsetX()
|
- EnumFacing.getFront(this.fusionController.getFacingInt()).getFrontOffsetX() * 2,
|
||||||
* 2), fusionController.getPos().getY() - 1,
|
this.fusionController.getPos().getY() - 1, this.fusionController.getPos().getZ()
|
||||||
fusionController.getPos().getZ() -
|
- EnumFacing.getFront(this.fusionController.getFacingInt()).getFrontOffsetZ() * 2);
|
||||||
(EnumFacing.getFront(fusionController.getFacingInt()).getFrontOffsetZ()
|
if (coordinates.equals(MultiblockRenderEvent.anchor)) {
|
||||||
* 2));
|
|
||||||
if (coordinates.equals(ClientProxy.multiblockRenderEvent.anchor)) {
|
|
||||||
ClientProxy.multiblockRenderEvent.setMultiblock(null);
|
ClientProxy.multiblockRenderEvent.setMultiblock(null);
|
||||||
button.displayString = "B";
|
button.displayString = "B";
|
||||||
} else {
|
} else {
|
||||||
|
@ -73,42 +71,41 @@ public class GuiFusionReactor extends GuiContainer {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
protected void drawGuiContainerBackgroundLayer(final float p_146976_1_, final int p_146976_2_,
|
||||||
|
final int p_146976_3_) {
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
this.mc.getTextureManager().bindTexture(texture);
|
this.mc.getTextureManager().bindTexture(GuiFusionReactor.texture);
|
||||||
int k = (this.width - this.xSize) / 2;
|
final int k = (this.width - this.xSize) / 2;
|
||||||
int l = (this.height - this.ySize) / 2;
|
final int l = (this.height - this.ySize) / 2;
|
||||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||||
|
|
||||||
drawTexturedModalRect(k + 88, l + 36, 176, 0, 14, 14);
|
this.drawTexturedModalRect(k + 88, l + 36, 176, 0, 14, 14);
|
||||||
|
|
||||||
// progressBar
|
// progressBar
|
||||||
drawTexturedModalRect(k + 111, l + 34, 176, 14, containerFusionReactor.getProgressScaled(), 16);
|
this.drawTexturedModalRect(k + 111, l + 34, 176, 14, this.fusionController.getProgressScaled(), 16);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int percentage(int MaxValue, int CurrentValue) {
|
public int percentage(final int MaxValue, final int CurrentValue) {
|
||||||
if (CurrentValue == 0)
|
if (CurrentValue == 0)
|
||||||
return 0;
|
return 0;
|
||||||
return (int) ((CurrentValue * 100.0f) / MaxValue);
|
return (int) (CurrentValue * 100.0f / MaxValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(GuiButton button) throws IOException {
|
public void actionPerformed(final GuiButton button) throws IOException {
|
||||||
super.actionPerformed(button);
|
super.actionPerformed(button);
|
||||||
if (button.id == 212) {
|
if (button.id == 212) {
|
||||||
if (ClientProxy.multiblockRenderEvent.currentMultiblock == null) {
|
if (ClientProxy.multiblockRenderEvent.currentMultiblock == null) {
|
||||||
//This code here makes a basic multiblock and then sets to theselected one.
|
// This code here makes a basic multiblock and then sets to
|
||||||
MultiblockSet set = new MultiblockSet(ClientMultiBlocks.reactor);
|
// theselected one.
|
||||||
ClientProxy.multiblockRenderEvent.setMultiblock(set);
|
final MultiblockSet set = new MultiblockSet(ClientMultiBlocks.reactor);
|
||||||
ClientProxy.multiblockRenderEvent.parent = new
|
ClientProxy.multiblockRenderEvent.setMultiblock(set);
|
||||||
Location(fusionController.getPos().getX(),
|
ClientProxy.multiblockRenderEvent.parent = new Location(this.fusionController.getPos().getX(),
|
||||||
fusionController.getPos().getY(), fusionController.getPos().getZ(),
|
this.fusionController.getPos().getY(), this.fusionController.getPos().getZ(),
|
||||||
fusionController.getWorld());
|
this.fusionController.getWorld());
|
||||||
ClientProxy.multiblockRenderEvent.anchor = new
|
MultiblockRenderEvent.anchor = new BlockPos(this.fusionController.getPos().getX(),
|
||||||
BlockPos(fusionController.getPos().getX(),
|
this.fusionController.getPos().getY() - 1, this.fusionController.getPos().getZ());
|
||||||
fusionController.getPos().getY() - 1,
|
|
||||||
fusionController.getPos().getZ());
|
|
||||||
|
|
||||||
button.displayString = "A";
|
button.displayString = "A";
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -5,40 +5,41 @@ import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.util.text.translation.I18n;
|
import net.minecraft.util.text.translation.I18n;
|
||||||
import techreborn.client.container.ContainerGasTurbine;
|
|
||||||
import techreborn.tiles.generator.TileGasTurbine;
|
import techreborn.tiles.generator.TileGasTurbine;
|
||||||
|
|
||||||
public class GuiGasTurbine extends GuiContainer {
|
public class GuiGasTurbine extends GuiContainer {
|
||||||
|
|
||||||
// TODO: use semifluid generator texture
|
// TODO: use semifluid generator texture
|
||||||
private static final ResourceLocation texture = new ResourceLocation("techreborn",
|
private static final ResourceLocation texture = new ResourceLocation("techreborn",
|
||||||
"textures/gui/thermal_generator.png");
|
"textures/gui/thermal_generator.png");
|
||||||
|
|
||||||
TileGasTurbine tile;
|
TileGasTurbine gasTurbine;
|
||||||
|
|
||||||
public GuiGasTurbine(EntityPlayer player, TileGasTurbine tile) {
|
public GuiGasTurbine(final EntityPlayer player, final TileGasTurbine gasTurbine) {
|
||||||
super(new ContainerGasTurbine(tile, player));
|
super(gasTurbine.createContainer(player));
|
||||||
this.xSize = 176;
|
this.xSize = 176;
|
||||||
this.ySize = 167;
|
this.ySize = 167;
|
||||||
this.tile = tile;
|
this.gasTurbine = gasTurbine;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
protected void drawGuiContainerBackgroundLayer(final float p_146976_1_, final int p_146976_2_, final int p_146976_3_) {
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
this.mc.getTextureManager().bindTexture(texture);
|
this.mc.getTextureManager().bindTexture(GuiGasTurbine.texture);
|
||||||
int k = (this.width - this.xSize) / 2;
|
final int k = (this.width - this.xSize) / 2;
|
||||||
int l = (this.height - this.ySize) / 2;
|
final int l = (this.height - this.ySize) / 2;
|
||||||
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
@Override
|
||||||
String name = "Gas Turbine";
|
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,
|
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6,
|
||||||
4210752);
|
4210752);
|
||||||
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8,
|
||||||
this.ySize - 96 + 2, 4210752);
|
this.ySize - 96 + 2, 4210752);
|
||||||
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
|
this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255);
|
||||||
this.fontRendererObj.drawString(tile.tank.getFluidAmount() + "", 10, 30, 16448255);
|
this.fontRendererObj.drawString(this.gasTurbine.tank.getFluidAmount() + "", 10, 30, 16448255);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue