mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Added universal fluid tanks, fixed chemplant not outputting
This commit is contained in:
parent
fcad4fd888
commit
7a7713d6a7
@ -598,6 +598,8 @@ item.canister_lightoil.name=Leichtölkanister
|
||||
item.gas_empty.name=Leerer Gastank
|
||||
item.gas_full.name=Gastank
|
||||
item.gas_petroleum.name=Petroleumgastank
|
||||
item.fluid_tank_empty.name=Leere universelle Flüssigkeitszelle
|
||||
item.fluid_tank_full.name=Universelle Flüssigkeitszelle:
|
||||
|
||||
item.rod_empty.name=Leerer Brennstab
|
||||
item.rod_uranium.name=Uranbrennstab
|
||||
|
||||
@ -598,6 +598,8 @@ item.canister_lightoil.name=Light Oil Canister
|
||||
item.gas_empty.name=Empty Gas Tank
|
||||
item.gas_full.name=Gas Tank
|
||||
item.gas_petroleum.name=Petroleum Gas Tank
|
||||
item.fluid_tank_empty.name=Empty Universal Fluid Tank
|
||||
item.fluid_tank_full.name=Universal Fluid Tank:
|
||||
|
||||
item.rod_empty.name=Emty Rod
|
||||
item.rod_uranium.name=Uranium Rod
|
||||
|
||||
BIN
assets/hbm/textures/items/fluid_tank.png
Normal file
BIN
assets/hbm/textures/items/fluid_tank.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 173 B |
BIN
assets/hbm/textures/items/fluid_tank_overlay.png
Normal file
BIN
assets/hbm/textures/items/fluid_tank_overlay.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 143 B |
@ -2581,19 +2581,19 @@ public class MachineRecipes {
|
||||
input[1] = new FluidStack(2000, FluidType.STEAM);
|
||||
break;
|
||||
case CC_I:
|
||||
input[0] = new FluidStack(800, FluidType.HEAVYOIL);
|
||||
input[0] = new FluidStack(800, FluidType.SMEAR);
|
||||
input[1] = new FluidStack(1800, FluidType.WATER);
|
||||
break;
|
||||
case CC_HEATING:
|
||||
input[0] = new FluidStack(800, FluidType.SMEAR);
|
||||
input[0] = new FluidStack(800, FluidType.HEATINGOIL);
|
||||
input[1] = new FluidStack(2000, FluidType.STEAM);
|
||||
break;
|
||||
case CC_HEAVY:
|
||||
input[0] = new FluidStack(600, FluidType.SMEAR);
|
||||
input[0] = new FluidStack(600, FluidType.HEAVYOIL);
|
||||
input[1] = new FluidStack(1400, FluidType.WATER);
|
||||
break;
|
||||
case CC_NAPHTHA:
|
||||
input[0] = new FluidStack(1200, FluidType.HEAVYOIL);
|
||||
input[0] = new FluidStack(1200, FluidType.NAPHTHA);
|
||||
input[1] = new FluidStack(2400, FluidType.STEAM);
|
||||
break;
|
||||
default:
|
||||
|
||||
@ -43,5 +43,11 @@ public class GUIMachineMiningDrill extends GuiContainer {
|
||||
int i = diFurnace.getPowerScaled(52);
|
||||
drawTexturedModalRect(guiLeft + 8, guiTop + 69 - i, 176, 52 - i, 16, i);
|
||||
}
|
||||
|
||||
int k = diFurnace.warning;
|
||||
if(k == 2)
|
||||
drawTexturedModalRect(guiLeft + 44, guiTop + 17, 192, 0, 16, 16);
|
||||
if(k == 1)
|
||||
drawTexturedModalRect(guiLeft + 44, guiTop + 17, 208, 52, 16, 16);
|
||||
}
|
||||
}
|
||||
|
||||
@ -365,6 +365,9 @@ public class ModItems {
|
||||
public static Item gas_full;
|
||||
public static Item gas_petroleum;
|
||||
|
||||
public static Item fluid_tank_full;
|
||||
public static Item fluid_tank_empty;
|
||||
|
||||
public static Item syringe_empty;
|
||||
public static Item syringe_antidote;
|
||||
public static Item syringe_poison;
|
||||
@ -1682,6 +1685,8 @@ public class ModItems {
|
||||
assembly_template = new ItemAssemblyTemplate().setUnlocalizedName("assembly_template").setMaxStackSize(1).setCreativeTab(MainRegistry.tabMachine).setTextureName(RefStrings.MODID + ":assembly_template");
|
||||
chemistry_template = new ItemChemistryTemplate().setUnlocalizedName("chemistry_template").setMaxStackSize(1).setCreativeTab(MainRegistry.tabMachine).setTextureName(RefStrings.MODID + ":chemistry_template");
|
||||
fluid_identifier = new ItemFluidIdentifier().setUnlocalizedName("fluid_identifier").setMaxStackSize(1).setCreativeTab(MainRegistry.tabMachine).setTextureName(RefStrings.MODID + ":fluid_identifier");
|
||||
fluid_tank_full = new ItemFluidTank().setUnlocalizedName("fluid_tank_full").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":fluid_tank");
|
||||
fluid_tank_empty = new Item().setUnlocalizedName("fluid_tank_empty").setCreativeTab(MainRegistry.tabParts).setTextureName(RefStrings.MODID + ":fluid_tank");
|
||||
|
||||
euphemium_helmet = new ArmorEuphemium(MainRegistry.enumArmorMaterialEuphemium, 6, 0).setUnlocalizedName("astatine_helmet").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":euphemium_helmet");
|
||||
euphemium_plate = new ArmorEuphemium(MainRegistry.enumArmorMaterialEuphemium, 6, 1).setUnlocalizedName("astatine_plate").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":euphemium_plate");
|
||||
@ -2259,11 +2264,15 @@ public class ModItems {
|
||||
GameRegistry.registerItem(canister_napalm, canister_napalm.getUnlocalizedName());
|
||||
GameRegistry.registerItem(canister_NITAN, canister_NITAN.getUnlocalizedName());
|
||||
|
||||
//Gastanks
|
||||
//Gas Tanks
|
||||
GameRegistry.registerItem(gas_empty, gas_empty.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gas_full, gas_full.getUnlocalizedName());
|
||||
GameRegistry.registerItem(gas_petroleum, gas_petroleum.getUnlocalizedName());
|
||||
|
||||
//Universal Tank
|
||||
GameRegistry.registerItem(fluid_tank_empty, fluid_tank_empty.getUnlocalizedName());
|
||||
GameRegistry.registerItem(fluid_tank_full, fluid_tank_full.getUnlocalizedName());
|
||||
|
||||
//Batteries
|
||||
GameRegistry.registerItem(battery_generic, battery_generic.getUnlocalizedName());
|
||||
GameRegistry.registerItem(battery_red_cell, battery_red_cell.getUnlocalizedName());
|
||||
|
||||
98
com/hbm/items/tool/ItemFluidTank.java
Normal file
98
com/hbm/items/tool/ItemFluidTank.java
Normal file
@ -0,0 +1,98 @@
|
||||
package com.hbm.items.tool;
|
||||
|
||||
import java.util.List;
|
||||
import com.hbm.handler.FluidTypeHandler.FluidType;
|
||||
import com.hbm.inventory.MachineRecipes;
|
||||
import com.hbm.tileentity.TileEntityFluidDuct;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemFluidTank extends Item {
|
||||
|
||||
IIcon overlayIcon;
|
||||
|
||||
public ItemFluidTank()
|
||||
{
|
||||
this.setHasSubtypes(true);
|
||||
this.setMaxDamage(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tabs, List list)
|
||||
{
|
||||
for (int i = 0; i < FluidType.values().length; ++i)
|
||||
{
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
public String getItemStackDisplayName(ItemStack stack)
|
||||
{
|
||||
String s = ("" + StatCollector.translateToLocal(this.getUnlocalizedName() + ".name")).trim();
|
||||
String s1 = ("" + StatCollector.translateToLocal(FluidType.getEnum(stack.getItemDamage()).getUnlocalizedName())).trim();
|
||||
|
||||
if (s1 != null)
|
||||
{
|
||||
s = s + " " + s1;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean requiresMultipleRenderPasses()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister p_94581_1_)
|
||||
{
|
||||
super.registerIcons(p_94581_1_);
|
||||
|
||||
this.overlayIcon = p_94581_1_.registerIcon("hbm:fluid_tank_overlay");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamageForRenderPass(int p_77618_1_, int p_77618_2_)
|
||||
{
|
||||
return p_77618_2_ == 1 ? this.overlayIcon : super.getIconFromDamageForRenderPass(p_77618_1_, p_77618_2_);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getColorFromItemStack(ItemStack stack, int p_82790_2_)
|
||||
{
|
||||
if (p_82790_2_ == 0)
|
||||
{
|
||||
return 16777215;
|
||||
}
|
||||
else
|
||||
{
|
||||
int j = FluidType.getEnum(stack.getItemDamage()).getMSAColor();
|
||||
|
||||
if (j < 0)
|
||||
{
|
||||
j = 16777215;
|
||||
}
|
||||
|
||||
return j;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -23,6 +23,7 @@ import cpw.mods.fml.common.Mod.Instance;
|
||||
import cpw.mods.fml.common.Mod.Metadata;
|
||||
import cpw.mods.fml.common.ModMetadata;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
@ -834,6 +835,10 @@ public class MainRegistry
|
||||
FluidContainerRegistry.instance.registerContainer(new FluidContainer(new ItemStack(ModItems.cell_puf6), new ItemStack(ModItems.cell_empty), FluidType.PUF6, 1000));
|
||||
FluidContainerRegistry.instance.registerContainer(new FluidContainer(new ItemStack(ModItems.cell_antimatter), new ItemStack(ModItems.cell_empty), FluidType.AMAT, 1000));
|
||||
FluidContainerRegistry.instance.registerContainer(new FluidContainer(new ItemStack(ModItems.cell_anti_schrabidium), new ItemStack(ModItems.cell_empty), FluidType.ASCHRAB, 1000));
|
||||
|
||||
for(int i = 1; i < FluidType.values().length; i++) {
|
||||
FluidContainerRegistry.instance.registerContainer(new FluidContainer(new ItemStack(ModItems.fluid_tank_full, 1, i), new ItemStack(ModItems.fluid_tank_empty), FluidType.getEnum(i), 1000));
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
||||
@ -37,6 +37,7 @@ import net.minecraft.tileentity.TileEntityHopper;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
//TODO: remove obso1337 cases for accptr/src cases to prevent conflicting tanks when multiple have the same type
|
||||
public class TileEntityMachineChemplant extends TileEntity implements ISidedInventory, IConsumer, IFluidContainer, IFluidAcceptor, IFluidSource {
|
||||
|
||||
private ItemStack slots[];
|
||||
@ -785,10 +786,10 @@ public class TileEntityMachineChemplant extends TileEntity implements ISidedInve
|
||||
tanks[0].setFill(i);
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
tanks[1].setFill(i);
|
||||
else if(type.name().equals(tanks[2].getTankType().name()))
|
||||
/*else if(type.name().equals(tanks[2].getTankType().name()))
|
||||
tanks[2].setFill(i);
|
||||
else if(type.name().equals(tanks[3].getTankType().name()))
|
||||
tanks[3].setFill(i);
|
||||
tanks[3].setFill(i);*/
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -797,21 +798,21 @@ public class TileEntityMachineChemplant extends TileEntity implements ISidedInve
|
||||
return tanks[0].getFill();
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
return tanks[1].getFill();
|
||||
else if(type.name().equals(tanks[2].getTankType().name()))
|
||||
else /*if(type.name().equals(tanks[2].getTankType().name()))
|
||||
return tanks[2].getFill();
|
||||
else if(type.name().equals(tanks[3].getTankType().name()))
|
||||
return tanks[3].getFill();
|
||||
return tanks[3].getFill();*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSFluidFill(int i, FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
/*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);
|
||||
else if(type.name().equals(tanks[2].getTankType().name()))
|
||||
else */if(type.name().equals(tanks[2].getTankType().name()))
|
||||
tanks[2].setFill(i);
|
||||
else if(type.name().equals(tanks[3].getTankType().name()))
|
||||
tanks[3].setFill(i);
|
||||
@ -819,11 +820,11 @@ public class TileEntityMachineChemplant extends TileEntity implements ISidedInve
|
||||
|
||||
@Override
|
||||
public int getSFluidFill(FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
/*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();
|
||||
else if(type.name().equals(tanks[2].getTankType().name()))
|
||||
else*/ if(type.name().equals(tanks[2].getTankType().name()))
|
||||
return tanks[2].getFill();
|
||||
else if(type.name().equals(tanks[3].getTankType().name()))
|
||||
return tanks[3].getFill();
|
||||
@ -837,10 +838,10 @@ public class TileEntityMachineChemplant extends TileEntity implements ISidedInve
|
||||
return tanks[0].getMaxFill();
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
return tanks[1].getMaxFill();
|
||||
else if(type.name().equals(tanks[2].getTankType().name()))
|
||||
else /*if(type.name().equals(tanks[2].getTankType().name()))
|
||||
return tanks[2].getMaxFill();
|
||||
else if(type.name().equals(tanks[3].getTankType().name()))
|
||||
return tanks[3].getMaxFill();
|
||||
return tanks[3].getMaxFill();*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -863,19 +864,18 @@ public class TileEntityMachineChemplant extends TileEntity implements ISidedInve
|
||||
}
|
||||
|
||||
if(meta == 2) {
|
||||
fillFluid(this.xCoord + 2, this.yCoord, this.zCoord, getTact(), type);
|
||||
fillFluid(this.xCoord + 2, this.yCoord, this.zCoord - 1, getTact(), type);
|
||||
fillFluid(this.xCoord - 3, this.yCoord, this.zCoord, getTact(), type);
|
||||
fillFluid(this.xCoord - 3, this.yCoord, this.zCoord - 1, getTact(), type);
|
||||
}
|
||||
|
||||
if(meta == 4) {
|
||||
fillFluid(this.xCoord, this.yCoord, this.zCoord + 2, getTact(), type);
|
||||
fillFluid(this.xCoord + 1, this.yCoord, this.zCoord + 2, getTact(), type);
|
||||
fillFluid(this.xCoord, this.yCoord, this.zCoord - 3, getTact(), type);
|
||||
fillFluid(this.xCoord + 1, this.yCoord, this.zCoord - 3, getTact(), type);
|
||||
}
|
||||
fillFluid(this.xCoord, this.yCoord - 1, this.zCoord, getTact(), type);
|
||||
|
||||
if(meta == 4) {
|
||||
fillFluid(this.xCoord + 2, this.yCoord, this.zCoord, getTact(), type);
|
||||
fillFluid(this.xCoord + 2, this.yCoord, this.zCoord - 1, getTact(), type);
|
||||
fillFluid(this.xCoord - 3, this.yCoord, this.zCoord, getTact(), type);
|
||||
fillFluid(this.xCoord - 3, this.yCoord, this.zCoord - 1, getTact(), type);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -363,9 +363,7 @@ public class TileEntityMachineRefinery extends TileEntity implements ISidedInven
|
||||
|
||||
@Override
|
||||
public int getSFluidFill(FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
return tanks[0].getFill();
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
if(type.name().equals(tanks[1].getTankType().name()))
|
||||
return tanks[1].getFill();
|
||||
else if(type.name().equals(tanks[2].getTankType().name()))
|
||||
return tanks[2].getFill();
|
||||
@ -379,9 +377,7 @@ public class TileEntityMachineRefinery extends TileEntity implements ISidedInven
|
||||
|
||||
@Override
|
||||
public void setSFluidFill(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()))
|
||||
if(type.name().equals(tanks[1].getTankType().name()))
|
||||
tanks[1].setFill(i);
|
||||
else if(type.name().equals(tanks[2].getTankType().name()))
|
||||
tanks[2].setFill(i);
|
||||
@ -420,46 +416,22 @@ public class TileEntityMachineRefinery extends TileEntity implements ISidedInven
|
||||
public void setAFluidFill(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);
|
||||
else if(type.name().equals(tanks[2].getTankType().name()))
|
||||
tanks[2].setFill(i);
|
||||
else if(type.name().equals(tanks[3].getTankType().name()))
|
||||
tanks[3].setFill(i);
|
||||
else if(type.name().equals(tanks[4].getTankType().name()))
|
||||
tanks[4].setFill(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAFluidFill(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();
|
||||
else if(type.name().equals(tanks[2].getTankType().name()))
|
||||
return tanks[2].getFill();
|
||||
else if(type.name().equals(tanks[3].getTankType().name()))
|
||||
return tanks[3].getFill();
|
||||
else if(type.name().equals(tanks[4].getTankType().name()))
|
||||
return tanks[4].getFill();
|
||||
|
||||
return 0;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxAFluidFill(FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
return tanks[0].getMaxFill();
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
return tanks[1].getMaxFill();
|
||||
else if(type.name().equals(tanks[2].getTankType().name()))
|
||||
return tanks[2].getMaxFill();
|
||||
else if(type.name().equals(tanks[3].getTankType().name()))
|
||||
return tanks[3].getMaxFill();
|
||||
else if(type.name().equals(tanks[4].getTankType().name()))
|
||||
return tanks[4].getMaxFill();
|
||||
|
||||
return 0;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user