boilers
BIN
assets/hbm/textures/blocks/machine_boiler_base.png
Normal file
|
After Width: | Height: | Size: 295 B |
BIN
assets/hbm/textures/blocks/machine_boiler_electric_front.png
Normal file
|
After Width: | Height: | Size: 425 B |
BIN
assets/hbm/textures/blocks/machine_boiler_electric_front_lit.png
Normal file
|
After Width: | Height: | Size: 423 B |
BIN
assets/hbm/textures/blocks/machine_boiler_front.png
Normal file
|
After Width: | Height: | Size: 407 B |
BIN
assets/hbm/textures/blocks/machine_boiler_front_lit.png
Normal file
|
After Width: | Height: | Size: 536 B |
BIN
assets/hbm/textures/blocks/machine_boiler_port.png
Normal file
|
After Width: | Height: | Size: 357 B |
BIN
assets/hbm/textures/blocks/machine_boiler_side.png
Normal file
|
After Width: | Height: | Size: 351 B |
BIN
assets/hbm/textures/gui/gui_boiler.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
assets/hbm/textures/gui/gui_boiler_electric.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
assets/hbm/textures/gui/gui_nei_boiler.png
Normal file
|
After Width: | Height: | Size: 1011 B |
@ -441,6 +441,14 @@ public class ModBlocks {
|
||||
public static Block machine_refinery;
|
||||
public static final int guiID_machine_refinery = 43;
|
||||
|
||||
public static Block machine_boiler_off;
|
||||
public static Block machine_boiler_on;
|
||||
public static final int guiID_machine_boiler = 72;
|
||||
|
||||
public static Block machine_boiler_electric_off;
|
||||
public static Block machine_boiler_electric_on;
|
||||
public static final int guiID_machine_boiler_electric = 73;
|
||||
|
||||
public static Block machine_drill;
|
||||
public static Block drill_pipe;
|
||||
public static final int guiID_machine_drill = 45;
|
||||
@ -950,6 +958,11 @@ public class ModBlocks {
|
||||
machine_selenium = new MachineSeleniumEngine(Material.iron).setBlockName("machine_selenium").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_selenium");
|
||||
machine_reactor_small = new MachineReactorSmall(Material.iron).setBlockName("machine_reactor_small").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_reactor_small");
|
||||
|
||||
machine_boiler_off = new MachineBoiler(false).setBlockName("machine_boiler_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_boiler_off");
|
||||
machine_boiler_on = new MachineBoiler(true).setBlockName("machine_boiler_on").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_boiler_on");
|
||||
machine_boiler_electric_off = new MachineBoiler(false).setBlockName("machine_boiler_electric_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_boiler_electric_off");
|
||||
machine_boiler_electric_on = new MachineBoiler(true).setBlockName("machine_boiler_electric_on").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_boiler_electric_on");
|
||||
|
||||
machine_schrabidium_transmutator = new MachineSchrabidiumTransmutator(Material.iron).setBlockName("machine_schrabidium_transmutator").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
|
||||
machine_reix_mainframe = new MachineReiXMainframe(Material.iron).setBlockName("machine_reix_mainframe").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
@ -1321,6 +1334,10 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(machine_assembler, machine_assembler.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_chemplant, machine_chemplant.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_fluidtank, machine_fluidtank.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_boiler_off, machine_boiler_off.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_boiler_on, machine_boiler_on.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_boiler_electric_on, machine_boiler_electric_on.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_boiler_electric_off, machine_boiler_electric_off.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_shredder, machine_shredder.getUnlocalizedName());
|
||||
//GameRegistry.registerBlock(machine_deuterium, machine_deuterium.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_well, machine_well.getUnlocalizedName());
|
||||
|
||||
342
com/hbm/blocks/machine/MachineBoiler.java
Normal file
@ -0,0 +1,342 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineBoiler;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineBoilerElectric;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineCoal;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class MachineBoiler extends BlockContainer {
|
||||
|
||||
private final Random field_149933_a = new Random();
|
||||
private Random rand;
|
||||
private final boolean isActive;
|
||||
private static boolean keepInventory;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconFront;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconSide;
|
||||
|
||||
public MachineBoiler(boolean blockState) {
|
||||
super(Material.iron);
|
||||
rand = new Random();
|
||||
isActive = blockState;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
|
||||
if(this == ModBlocks.machine_boiler_off || this == ModBlocks.machine_boiler_on) {
|
||||
this.iconFront = iconRegister.registerIcon(RefStrings.MODID + (this.isActive ? ":machine_boiler_front_lit" : ":machine_boiler_front"));
|
||||
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":machine_boiler_base");
|
||||
this.iconSide = iconRegister.registerIcon(RefStrings.MODID + ":machine_boiler_side");
|
||||
}
|
||||
|
||||
if(this == ModBlocks.machine_boiler_electric_off || this == ModBlocks.machine_boiler_electric_on) {
|
||||
this.iconFront = iconRegister.registerIcon(RefStrings.MODID + (this.isActive ? ":machine_boiler_electric_front_lit" : ":machine_boiler_electric_front"));
|
||||
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":machine_boiler_port");
|
||||
this.iconSide = iconRegister.registerIcon(RefStrings.MODID + ":machine_boiler_side");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
|
||||
if(side == 0 || side == 1)
|
||||
return this.blockIcon;
|
||||
|
||||
return metadata == 0 && side == 3 ? this.iconFront : (side == metadata ? this.iconFront : this.iconSide);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
|
||||
{
|
||||
if(this == ModBlocks.machine_boiler_off || this == ModBlocks.machine_boiler_on)
|
||||
return Item.getItemFromBlock(ModBlocks.machine_boiler_off);
|
||||
if(this == ModBlocks.machine_boiler_electric_off || this == ModBlocks.machine_boiler_electric_on)
|
||||
return Item.getItemFromBlock(ModBlocks.machine_boiler_electric_off);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World world, int x, int y, int z) {
|
||||
super.onBlockAdded(world, x, y, z);
|
||||
this.setDefaultDirection(world, x, y, z);
|
||||
}
|
||||
|
||||
private void setDefaultDirection(World world, int x, int y, int z) {
|
||||
if(!world.isRemote)
|
||||
{
|
||||
Block block1 = world.getBlock(x, y, z - 1);
|
||||
Block block2 = world.getBlock(x, y, z + 1);
|
||||
Block block3 = world.getBlock(x - 1, y, z);
|
||||
Block block4 = world.getBlock(x + 1, y, z);
|
||||
|
||||
byte b0 = 3;
|
||||
|
||||
if(block1.func_149730_j() && !block2.func_149730_j())
|
||||
{
|
||||
b0 = 3;
|
||||
}
|
||||
if(block2.func_149730_j() && !block1.func_149730_j())
|
||||
{
|
||||
b0 = 2;
|
||||
}
|
||||
if(block3.func_149730_j() && !block4.func_149730_j())
|
||||
{
|
||||
b0 = 5;
|
||||
}
|
||||
if(block4.func_149730_j() && !block3.func_149730_j())
|
||||
{
|
||||
b0 = 4;
|
||||
}
|
||||
|
||||
world.setBlockMetadataWithNotify(x, y, z, b0, 2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
|
||||
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
|
||||
if(i == 0)
|
||||
{
|
||||
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
||||
}
|
||||
if(i == 1)
|
||||
{
|
||||
world.setBlockMetadataWithNotify(x, y, z, 5, 2);
|
||||
}
|
||||
if(i == 2)
|
||||
{
|
||||
world.setBlockMetadataWithNotify(x, y, z, 3, 2);
|
||||
}
|
||||
if(i == 3)
|
||||
{
|
||||
world.setBlockMetadataWithNotify(x, y, z, 4, 2);
|
||||
}
|
||||
|
||||
if(itemStack.hasDisplayName())
|
||||
{
|
||||
((TileEntityMachineCoal)world.getTileEntity(x, y, z)).setCustomName(itemStack.getDisplayName());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(world.isRemote)
|
||||
{
|
||||
return true;
|
||||
} else if(!player.isSneaking())
|
||||
{
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(te instanceof TileEntityMachineBoiler) {
|
||||
|
||||
TileEntityMachineBoiler entity = (TileEntityMachineBoiler) te;
|
||||
if(entity != null)
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_machine_boiler, world, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
if(te instanceof TileEntityMachineBoilerElectric) {
|
||||
|
||||
TileEntityMachineBoilerElectric entity = (TileEntityMachineBoilerElectric) te;
|
||||
if(entity != null)
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_machine_boiler_electric, world, x, y, z);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
|
||||
if(this == ModBlocks.machine_boiler_off || this == ModBlocks.machine_boiler_on)
|
||||
return new TileEntityMachineBoiler();
|
||||
if(this == ModBlocks.machine_boiler_electric_off || this == ModBlocks.machine_boiler_electric_on)
|
||||
return new TileEntityMachineBoilerElectric();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void updateBlockState(boolean isProcessing, World world, int x, int y, int z) {
|
||||
int i = world.getBlockMetadata(x, y, z);
|
||||
Block block = world.getBlock(x, y, z);
|
||||
TileEntity entity = world.getTileEntity(x, y, z);
|
||||
keepInventory = true;
|
||||
|
||||
if(block == ModBlocks.machine_boiler_off || block == ModBlocks.machine_boiler_on)
|
||||
if(isProcessing)
|
||||
{
|
||||
world.setBlock(x, y, z, ModBlocks.machine_boiler_on);
|
||||
} else {
|
||||
world.setBlock(x, y, z, ModBlocks.machine_boiler_off);
|
||||
}
|
||||
|
||||
if(block == ModBlocks.machine_boiler_electric_off || block == ModBlocks.machine_boiler_electric_on)
|
||||
if(isProcessing)
|
||||
{
|
||||
world.setBlock(x, y, z, ModBlocks.machine_boiler_electric_on);
|
||||
} else {
|
||||
world.setBlock(x, y, z, ModBlocks.machine_boiler_electric_off);
|
||||
}
|
||||
|
||||
keepInventory = false;
|
||||
world.setBlockMetadataWithNotify(x, y, z, i, 2);
|
||||
|
||||
if(entity != null) {
|
||||
entity.validate();
|
||||
world.setTileEntity(x, y, z, entity);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
|
||||
{
|
||||
if (!keepInventory)
|
||||
{
|
||||
ISidedInventory tileentityfurnace = (ISidedInventory)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_);
|
||||
|
||||
if (tileentityfurnace != null)
|
||||
{
|
||||
for (int i1 = 0; i1 < tileentityfurnace.getSizeInventory(); ++i1)
|
||||
{
|
||||
ItemStack itemstack = tileentityfurnace.getStackInSlot(i1);
|
||||
|
||||
if (itemstack != null)
|
||||
{
|
||||
float f = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
float f1 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
float f2 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
|
||||
while (itemstack.stackSize > 0)
|
||||
{
|
||||
int j1 = this.field_149933_a.nextInt(21) + 10;
|
||||
|
||||
if (j1 > itemstack.stackSize)
|
||||
{
|
||||
j1 = itemstack.stackSize;
|
||||
}
|
||||
|
||||
itemstack.stackSize -= j1;
|
||||
EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
|
||||
|
||||
if (itemstack.hasTagCompound())
|
||||
{
|
||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
|
||||
}
|
||||
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
|
||||
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
|
||||
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
|
||||
p_149749_1_.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
p_149749_1_.func_147453_f(p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_);
|
||||
}
|
||||
}
|
||||
|
||||
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World p_149734_1_, int x, int y, int z, Random rand)
|
||||
{
|
||||
if (isActive) {
|
||||
|
||||
if(this == ModBlocks.machine_boiler_on) {
|
||||
int l = p_149734_1_.getBlockMetadata(x, y, z);
|
||||
float f = x + 0.5F;
|
||||
float f1 = y + 0.25F + rand.nextFloat() * 6.0F / 16.0F;
|
||||
float f2 = z + 0.5F;
|
||||
float f3 = 0.52F;
|
||||
float f4 = rand.nextFloat() * 0.6F - 0.3F;
|
||||
float f5 = rand.nextFloat();
|
||||
float f6 = rand.nextFloat();
|
||||
|
||||
if (l == 4)
|
||||
{
|
||||
p_149734_1_.spawnParticle("smoke", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
|
||||
p_149734_1_.spawnParticle("flame", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
else if (l == 5)
|
||||
{
|
||||
p_149734_1_.spawnParticle("smoke", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
|
||||
p_149734_1_.spawnParticle("flame", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
else if (l == 2)
|
||||
{
|
||||
p_149734_1_.spawnParticle("smoke", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
|
||||
p_149734_1_.spawnParticle("flame", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
else if (l == 3)
|
||||
{
|
||||
p_149734_1_.spawnParticle("smoke", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
|
||||
p_149734_1_.spawnParticle("flame", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
} else {
|
||||
int l = p_149734_1_.getBlockMetadata(x, y, z);
|
||||
float f = x + 0.5F;
|
||||
float f1 = y + 0.25F + rand.nextFloat() * 6.0F / 16.0F;
|
||||
float f2 = z + 0.5F;
|
||||
float f3 = 0.52F;
|
||||
float f4 = rand.nextFloat() * 0.6F - 0.3F;
|
||||
float f5 = rand.nextFloat();
|
||||
float f6 = rand.nextFloat();
|
||||
|
||||
if (l == 4)
|
||||
{
|
||||
p_149734_1_.spawnParticle("reddust", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
else if (l == 5)
|
||||
{
|
||||
p_149734_1_.spawnParticle("reddust", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
else if (l == 2)
|
||||
{
|
||||
p_149734_1_.spawnParticle("reddust", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
else if (l == 3)
|
||||
{
|
||||
p_149734_1_.spawnParticle("reddust", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -33,6 +33,7 @@ import com.hbm.tileentity.machine.TileEntityFWatzCore;
|
||||
import com.hbm.tileentity.machine.TileEntityFusionMultiblock;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineAssembler;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineBattery;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineBoiler;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineCMBFactory;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineCentrifuge;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineChemplant;
|
||||
@ -718,6 +719,15 @@ public class GUIHandler implements IGuiHandler {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_machine_boiler:
|
||||
{
|
||||
if(entity instanceof TileEntityMachineBoiler)
|
||||
{
|
||||
return new ContainerMachineBoiler(player.inventory, (TileEntityMachineBoiler) entity);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -1358,6 +1368,15 @@ public class GUIHandler implements IGuiHandler {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_machine_boiler:
|
||||
{
|
||||
if(entity instanceof TileEntityMachineBoiler)
|
||||
{
|
||||
return new GUIMachineBoiler(player.inventory, (TileEntityMachineBoiler) entity);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//CLIENTONLY GUIS
|
||||
|
||||
@ -471,6 +471,18 @@ public class MachineRecipes {
|
||||
return list;
|
||||
}
|
||||
|
||||
//return: FluidType, amount produced, amount required, heat required (°C * 100)
|
||||
@SuppressWarnings("incomplete-switch")
|
||||
public static Object[] getBoilerOutput(FluidType type) {
|
||||
|
||||
switch(type) {
|
||||
case WATER: return new Object[] { FluidType.STEAM, 5, 5, 10000 };
|
||||
case OIL: return new Object[] { FluidType.HOTOIL, 5, 5, 35000 };
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<Item> stamps_flat = new ArrayList<Item>() {{
|
||||
add(ModItems.stamp_stone_flat);
|
||||
add(ModItems.stamp_iron_flat);
|
||||
|
||||
95
com/hbm/inventory/container/ContainerMachineBoiler.java
Normal file
@ -0,0 +1,95 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotMachineOutput;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineBoiler;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineGasCent;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerMachineBoiler extends Container {
|
||||
|
||||
private TileEntityMachineBoiler diFurnace;
|
||||
|
||||
public ContainerMachineBoiler(InventoryPlayer invPlayer, TileEntityMachineBoiler tedf) {
|
||||
|
||||
diFurnace = tedf;
|
||||
|
||||
//Fluid ID
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 8, 17));
|
||||
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 1, 8, 53));
|
||||
//Input IO
|
||||
this.addSlotToContainer(new Slot(tedf, 2, 44, 17));
|
||||
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 3, 44, 53));
|
||||
//Fuel
|
||||
this.addSlotToContainer(new Slot(tedf, 4, 98, 53));
|
||||
//Output IO
|
||||
this.addSlotToContainer(new Slot(tedf, 5, 152, 17));
|
||||
this.addSlotToContainer(new SlotMachineOutput(invPlayer.player, tedf, 6, 152, 53));
|
||||
|
||||
for(int i = 0; i < 3; i++)
|
||||
{
|
||||
for(int j = 0; j < 9; j++)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCraftingToCrafters(ICrafting crafting) {
|
||||
super.addCraftingToCrafters(crafting);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2)
|
||||
{
|
||||
ItemStack var3 = null;
|
||||
Slot var4 = (Slot) this.inventorySlots.get(par2);
|
||||
|
||||
if (var4 != null && var4.getHasStack())
|
||||
{
|
||||
ItemStack var5 = var4.getStack();
|
||||
var3 = var5.copy();
|
||||
|
||||
if (par2 <= 6) {
|
||||
if (!this.mergeItemStack(var5, 7, this.inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (!this.mergeItemStack(var5, 4, 5, false))
|
||||
{
|
||||
if (!this.mergeItemStack(var5, 2, 3, false))
|
||||
if (!this.mergeItemStack(var5, 5, 6, false))
|
||||
if (!this.mergeItemStack(var5, 0, 1, false))
|
||||
return null;
|
||||
}
|
||||
|
||||
if (var5.stackSize == 0)
|
||||
{
|
||||
var4.putStack((ItemStack) null);
|
||||
}
|
||||
else
|
||||
{
|
||||
var4.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return var3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return diFurnace.isUseableByPlayer(player);
|
||||
}
|
||||
}
|
||||
66
com/hbm/inventory/gui/GUIMachineBoiler.java
Normal file
@ -0,0 +1,66 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.container.ContainerMachineBoiler;
|
||||
import com.hbm.inventory.container.ContainerMachineGasCent;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineBoiler;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineGasCent;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIMachineBoiler extends GuiInfoContainer {
|
||||
|
||||
public static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_boiler.png");
|
||||
private TileEntityMachineBoiler diFurnace;
|
||||
|
||||
public GUIMachineBoiler(InventoryPlayer invPlayer, TileEntityMachineBoiler tedf) {
|
||||
super(new ContainerMachineBoiler(invPlayer, tedf));
|
||||
diFurnace = tedf;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 168;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
super.drawScreen(mouseX, mouseY, f);
|
||||
|
||||
diFurnace.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 62, guiTop + 69 - 52, 16, 52);
|
||||
diFurnace.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 134, guiTop + 69 - 52, 16, 52);
|
||||
|
||||
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 102, guiTop + 16, 8, 18, mouseX, mouseY, new String[] { String.valueOf((int)((double)diFurnace.heat / 100D)) + "°C"});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
String name = this.diFurnace.hasCustomInventoryName() ? this.diFurnace.getInventoryName() : I18n.format(this.diFurnace.getInventoryName());
|
||||
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
/*int i = (int)diFurnace.getPowerRemainingScaled(34);
|
||||
drawTexturedModalRect(guiLeft + 8, guiTop + 51 - i, 176, 34 - i, 16, i);*/
|
||||
|
||||
int j = (int)diFurnace.getHeatScaled(17);
|
||||
drawTexturedModalRect(guiLeft + 103, guiTop + 33 - j, 194, 16 - j, 6, j);
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(diFurnace.tanks[0].getSheet());
|
||||
diFurnace.tanks[0].renderTank(this, guiLeft + 62, guiTop + 69, diFurnace.tanks[0].getTankType().textureX() * FluidTank.x, diFurnace.tanks[0].getTankType().textureY() * FluidTank.y, 16, 52);
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(diFurnace.tanks[1].getSheet());
|
||||
diFurnace.tanks[1].renderTank(this, guiLeft + 134, guiTop + 69, diFurnace.tanks[1].getTankType().textureX() * FluidTank.x, diFurnace.tanks[1].getTankType().textureY() * FluidTank.y, 16, 52);
|
||||
}
|
||||
}
|
||||
@ -274,6 +274,8 @@ import com.hbm.tileentity.machine.TileEntityFusionMultiblock;
|
||||
import com.hbm.tileentity.machine.TileEntityHatch;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineAssembler;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineBattery;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineBoiler;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineBoilerElectric;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineCMBFactory;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineCentrifuge;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineChemplant;
|
||||
@ -722,6 +724,8 @@ public class MainRegistry
|
||||
GameRegistry.registerTileEntity(TileEntityBlastDoor.class, "tileentity_blast_door");
|
||||
GameRegistry.registerTileEntity(TileEntitySafe.class, "tileentity_safe");
|
||||
GameRegistry.registerTileEntity(TileEntityMachineGasCent.class, "tileentity_gas_centrifuge");
|
||||
GameRegistry.registerTileEntity(TileEntityMachineBoiler.class, "tileentity_boiler");
|
||||
GameRegistry.registerTileEntity(TileEntityMachineBoilerElectric.class, "tileentity_electric_boiler");
|
||||
|
||||
EntityRegistry.registerModEntity(EntityRocket.class, "entity_rocket", 0, this, 250, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityNukeExplosion.class, "entity_nuke_explosion", 1, this, 250, 1, true);
|
||||
|
||||
@ -8,6 +8,7 @@ import com.hbm.tileentity.deco.TileEntityBomber;
|
||||
import com.hbm.tileentity.machine.TileEntityAMSBase;
|
||||
import com.hbm.tileentity.machine.TileEntityAMSEmitter;
|
||||
import com.hbm.tileentity.machine.TileEntityAMSLimiter;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineBoiler;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineCentrifuge;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineDiesel;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineGasCent;
|
||||
@ -167,6 +168,14 @@ public class AuxGaugePacket implements IMessage {
|
||||
if(m.id == 1)
|
||||
cent.isProgressing = m.value == 1;
|
||||
}
|
||||
if (te instanceof TileEntityMachineBoiler) {
|
||||
TileEntityMachineBoiler boiler = (TileEntityMachineBoiler)te;
|
||||
|
||||
if(m.id == 0)
|
||||
boiler.heat = m.value;
|
||||
if(m.id == 1)
|
||||
boiler.burnTime = m.value;
|
||||
}
|
||||
|
||||
} catch (Exception x) { }
|
||||
return null;
|
||||
|
||||
394
com/hbm/tileentity/machine/TileEntityMachineBoiler.java
Normal file
@ -0,0 +1,394 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.machine.MachineBoiler;
|
||||
import com.hbm.blocks.machine.MachineCoal;
|
||||
import com.hbm.handler.FluidTypeHandler.FluidType;
|
||||
import com.hbm.interfaces.IConsumer;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.inventory.FluidContainerRegistry;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.MachineRecipes;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.special.ItemBattery;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
|
||||
public class TileEntityMachineBoiler extends TileEntity implements ISidedInventory, IFluidContainer, IFluidAcceptor, IFluidSource {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
public int burnTime;
|
||||
public int heat;
|
||||
public static final int maxHeat = 50000;
|
||||
public int age = 0;
|
||||
public List<IFluidAcceptor> list = new ArrayList();
|
||||
public FluidTank[] tanks;
|
||||
|
||||
private static final int[] slots_top = new int[] {4};
|
||||
private static final int[] slots_bottom = new int[] {6};
|
||||
private static final int[] slots_side = new int[] {4};
|
||||
|
||||
private String customName;
|
||||
|
||||
public TileEntityMachineBoiler() {
|
||||
slots = new ItemStack[7];
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(FluidType.WATER, 8000, 0);
|
||||
tanks[1] = new FluidTank(FluidType.STEAM, 8000, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return slots.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int i) {
|
||||
return slots[i];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int i) {
|
||||
if(slots[i] != null)
|
||||
{
|
||||
ItemStack itemStack = slots[i];
|
||||
slots[i] = null;
|
||||
return itemStack;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int i, ItemStack itemStack) {
|
||||
slots[i] = itemStack;
|
||||
if(itemStack != null && itemStack.stackSize > getInventoryStackLimit())
|
||||
{
|
||||
itemStack.stackSize = getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return this.hasCustomInventoryName() ? this.customName : "container.machineBoiler";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return this.customName != null && this.customName.length() > 0;
|
||||
}
|
||||
|
||||
public void setCustomName(String name) {
|
||||
this.customName = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return 64;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer player) {
|
||||
if(worldObj.getTileEntity(xCoord, yCoord, zCoord) != this)
|
||||
{
|
||||
return false;
|
||||
}else{
|
||||
return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64;
|
||||
}
|
||||
}
|
||||
|
||||
//You scrubs aren't needed for anything (right now)
|
||||
@Override
|
||||
public void openInventory() {}
|
||||
@Override
|
||||
public void closeInventory() {}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack stack) {
|
||||
|
||||
if(i == 4)
|
||||
if(TileEntityFurnace.getItemBurnTime(stack) > 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int i, int j) {
|
||||
if(slots[i] != null)
|
||||
{
|
||||
if(slots[i].stackSize <= j)
|
||||
{
|
||||
ItemStack itemStack = slots[i];
|
||||
slots[i] = null;
|
||||
return itemStack;
|
||||
}
|
||||
ItemStack itemStack1 = slots[i].splitStack(j);
|
||||
if (slots[i].stackSize == 0)
|
||||
{
|
||||
slots[i] = null;
|
||||
}
|
||||
|
||||
return itemStack1;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
NBTTagList list = nbt.getTagList("items", 10);
|
||||
|
||||
heat = nbt.getInteger("heat");
|
||||
burnTime = nbt.getInteger("burnTime");
|
||||
tanks[0].readFromNBT(nbt, "water");
|
||||
tanks[1].readFromNBT(nbt, "steam");
|
||||
slots = new ItemStack[getSizeInventory()];
|
||||
|
||||
for(int i = 0; i < list.tagCount(); i++)
|
||||
{
|
||||
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
|
||||
byte b0 = nbt1.getByte("slot");
|
||||
if(b0 >= 0 && b0 < slots.length)
|
||||
{
|
||||
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setInteger("heat", heat);
|
||||
nbt.setInteger("burnTime", burnTime);
|
||||
tanks[0].writeToNBT(nbt, "water");
|
||||
tanks[1].writeToNBT(nbt, "steam");
|
||||
NBTTagList list = new NBTTagList();
|
||||
|
||||
for(int i = 0; i < slots.length; i++)
|
||||
{
|
||||
if(slots[i] != null)
|
||||
{
|
||||
NBTTagCompound nbt1 = new NBTTagCompound();
|
||||
nbt1.setByte("slot", (byte)i);
|
||||
slots[i].writeToNBT(nbt1);
|
||||
list.appendTag(nbt1);
|
||||
}
|
||||
}
|
||||
nbt.setTag("items", list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int p_94128_1_)
|
||||
{
|
||||
return p_94128_1_ == 0 ? slots_bottom : (p_94128_1_ == 1 ? slots_top : slots_side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int i, ItemStack itemStack, int j) {
|
||||
return this.isItemValidForSlot(i, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getHeatScaled(int i) {
|
||||
return (heat * i) / maxHeat;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote)
|
||||
{
|
||||
age++;
|
||||
if(age >= 20)
|
||||
{
|
||||
age = 0;
|
||||
}
|
||||
|
||||
if(age == 9 || age == 19)
|
||||
fillFluidInit(tanks[1].getTankType());
|
||||
|
||||
tanks[0].setType(0, 1, slots);
|
||||
tanks[0].loadTank(2, 3, slots);
|
||||
//TODO: set tanks[1]'s type accordingly
|
||||
|
||||
Object[] outs = MachineRecipes.getBoilerOutput(tanks[0].getTankType());
|
||||
|
||||
if(outs == null) {
|
||||
tanks[1].setTankType(FluidType.NONE);
|
||||
} else {
|
||||
tanks[1].setTankType((FluidType) outs[0]);
|
||||
}
|
||||
|
||||
tanks[1].unloadTank(5, 6, slots);
|
||||
|
||||
for(int i = 0; i < 2; i++)
|
||||
tanks[i].updateTank(xCoord, yCoord, zCoord);
|
||||
|
||||
boolean flag1 = false;
|
||||
|
||||
if(heat > 0) {
|
||||
heat -= 15;
|
||||
}
|
||||
|
||||
if(burnTime > 0) {
|
||||
burnTime--;
|
||||
heat += 50;
|
||||
flag1 = true;
|
||||
}
|
||||
|
||||
if(burnTime == 0 && !flag1)
|
||||
MachineBoiler.updateBlockState(false, worldObj, xCoord, yCoord, zCoord);
|
||||
|
||||
if(heat > maxHeat)
|
||||
heat = maxHeat;
|
||||
|
||||
if(burnTime == 0 && TileEntityFurnace.getItemBurnTime(slots[4]) > 0) {
|
||||
burnTime = (int) (TileEntityFurnace.getItemBurnTime(slots[4]) * 0.25);
|
||||
slots[4].stackSize--;
|
||||
|
||||
if(slots[4].stackSize <= 0)
|
||||
slots[4] = null;
|
||||
|
||||
if(!flag1)
|
||||
MachineBoiler.updateBlockState(true, worldObj, xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
if(outs != null) {
|
||||
|
||||
for(int i = 0; i < (heat / ((Integer)outs[3]).intValue()); i++) {
|
||||
if(tanks[0].getFill() >= ((Integer)outs[2]).intValue() && tanks[1].getFill() + ((Integer)outs[1]).intValue() <= tanks[1].getMaxFill()) {
|
||||
tanks[0].setFill(tanks[0].getFill() - ((Integer)outs[2]).intValue());
|
||||
tanks[1].setFill(tanks[1].getFill() + ((Integer)outs[1]).intValue());
|
||||
|
||||
if(i == 0)
|
||||
heat -= 25;
|
||||
else
|
||||
heat -= 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(heat < 0) {
|
||||
heat = 0;
|
||||
}
|
||||
|
||||
PacketDispatcher.wrapper.sendToAll(new AuxGaugePacket(xCoord, yCoord, zCoord, heat, 0));
|
||||
PacketDispatcher.wrapper.sendToAll(new AuxGaugePacket(xCoord, yCoord, zCoord, burnTime, 1));
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isItemValid() {
|
||||
|
||||
if(slots[1] != null && TileEntityFurnace.getItemBurnTime(slots[1]) > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillFluidInit(FluidType type) {
|
||||
|
||||
fillFluid(this.xCoord + 1, this.yCoord, this.zCoord, getTact(), type);
|
||||
fillFluid(this.xCoord - 1, this.yCoord, this.zCoord, getTact(), type);
|
||||
fillFluid(this.xCoord, this.yCoord + 1, this.zCoord, getTact(), type);
|
||||
fillFluid(this.xCoord, this.yCoord - 1, this.zCoord, getTact(), type);
|
||||
fillFluid(this.xCoord, this.yCoord, this.zCoord + 1, getTact(), type);
|
||||
fillFluid(this.xCoord, this.yCoord, this.zCoord - 1, getTact(), type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillFluid(int x, int y, int z, boolean newTact, FluidType type) {
|
||||
Library.transmitFluid(x, y, z, newTact, this, worldObj, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getTact() {
|
||||
if(age >= 0 && age < 10)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
tanks[0].setFill(i);
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
tanks[1].setFill(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
return tanks[0].getFill();
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
return tanks[1].getFill();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
return tanks[0].getMaxFill();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tanks[0]);
|
||||
list.add(tanks[1]);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IFluidAcceptor> getFluidList(FluidType type) {
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearFluidList(FluidType type) {
|
||||
list.clear();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileEntityMachineBoilerElectric extends TileEntity {
|
||||
|
||||
}
|
||||
@ -734,6 +734,7 @@ public class TileEntityWatzCore extends TileEntity implements ISidedInventory, I
|
||||
public void setType(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillFluidInit(FluidType type) {
|
||||
fillFluid(this.xCoord + 4, this.yCoord, this.zCoord, getTact(), type);
|
||||
@ -742,22 +743,27 @@ public class TileEntityWatzCore extends TileEntity implements ISidedInventory, I
|
||||
fillFluid(this.xCoord, this.yCoord, this.zCoord - 4, getTact(), type);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillFluid(int x, int y, int z, boolean newTact, FluidType type) {
|
||||
Library.transmitFluid(x, y, z, newTact, this, worldObj, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
return tank.getFill();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
tank.setFill(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IFluidAcceptor> getFluidList(FluidType type) {
|
||||
return list1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearFluidList(FluidType type) {
|
||||
list1.clear();
|
||||
|
||||