mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
coker texture, rendering, energy fix
This commit is contained in:
parent
750500a8e1
commit
ba3a0a1669
@ -10,4 +10,10 @@ public interface IEnergyGenerator extends IEnergyUser {
|
||||
public default long transferPower(long power) {
|
||||
return power;
|
||||
}
|
||||
|
||||
/* should stop making non-receivers from interfering by applying their weight which doesn't even matter */
|
||||
@Override
|
||||
public default long getTransferWeight() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,12 +1,15 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.handler.MultiblockHandlerXR;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineCoker;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineCoker extends BlockDummyable {
|
||||
|
||||
@ -18,6 +21,7 @@ public class MachineCoker extends BlockDummyable {
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
|
||||
if(meta >= 12) return new TileEntityMachineCoker();
|
||||
if(meta >= 6) return new TileEntityProxyCombo().inventory().fluid();
|
||||
|
||||
return null;
|
||||
}
|
||||
@ -29,11 +33,47 @@ public class MachineCoker extends BlockDummyable {
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {4, 0, 2, 2, 2, 2};
|
||||
return new int[] {22, 0, 1, 1, 1, 1};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
if(super.checkRequirement(world, x, y, z, dir, o)) {
|
||||
|
||||
x += dir.offsetX * o;
|
||||
z += dir.offsetZ * o;
|
||||
|
||||
return MultiblockHandlerXR.checkSpace(world, x, y + 1, z, new int[] {5, 0, 2, 2, 2, 2}, x, y, z, ForgeDirection.NORTH) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + 2, y + 1, z + 2, new int[] {0, 1, 0, 0, 0, 0}, x, y, z, ForgeDirection.NORTH) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + 2, y + 1, z - 2, new int[] {0, 1, 0, 0, 0, 0}, x, y, z, ForgeDirection.NORTH) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x - 2, y + 1, z + 2, new int[] {0, 1, 0, 0, 0, 0}, x, y, z, ForgeDirection.NORTH) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x - 2, y + 1, z - 2, new int[] {0, 1, 0, 0, 0, 0}, x, y, z, ForgeDirection.NORTH);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
|
||||
x += dir.offsetX * o;
|
||||
z += dir.offsetZ * o;
|
||||
|
||||
MultiblockHandlerXR.fillSpace(world, x, y + 1, z, new int[] {5, 0, 2, 2, 2, 2}, this, ForgeDirection.NORTH);
|
||||
MultiblockHandlerXR.fillSpace(world, x + 2, y + 1, z + 2, new int[] {0, 1, 0, 0, 0, 0}, this, ForgeDirection.NORTH);
|
||||
MultiblockHandlerXR.fillSpace(world, x + 2, y + 1, z - 2, new int[] {0, 1, 0, 0, 0, 0}, this, ForgeDirection.NORTH);
|
||||
MultiblockHandlerXR.fillSpace(world, x - 2, y + 1, z + 2, new int[] {0, 1, 0, 0, 0, 0}, this, ForgeDirection.NORTH);
|
||||
MultiblockHandlerXR.fillSpace(world, x - 2, y + 1, z - 2, new int[] {0, 1, 0, 0, 0, 0}, this, ForgeDirection.NORTH);
|
||||
|
||||
this.makeExtra(world, x + 1, y, z + 1);
|
||||
this.makeExtra(world, x + 1, y, z - 1);
|
||||
this.makeExtra(world, x - 1, y, z + 1);
|
||||
this.makeExtra(world, x - 1, y, z - 1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,11 +25,14 @@ public class GUIMachineCoker extends GuiInfoContainer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
super.drawScreen(mouseX, mouseY, f);
|
||||
public void drawScreen(int x, int y, float f) {
|
||||
super.drawScreen(x, y, f);
|
||||
|
||||
refinery.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 35, guiTop + 18, 16, 52);
|
||||
refinery.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 125, guiTop + 18, 16, 52);
|
||||
refinery.tanks[0].renderTankInfo(this, x, y, guiLeft + 35, guiTop + 18, 16, 52);
|
||||
refinery.tanks[1].renderTankInfo(this, x, y, guiLeft + 125, guiTop + 18, 16, 52);
|
||||
|
||||
this.drawCustomInfoStat(x, y, guiLeft + 60, guiTop + 45, 54, 7, x, y, new String[] { String.format("%,d", refinery.progress) + " / " + String.format("%,d", refinery.processTime) + "TU" });
|
||||
this.drawCustomInfoStat(x, y, guiLeft + 60, guiTop + 54, 54, 7, x, y, new String[] { String.format("%,d", refinery.heat) + " / " + String.format("%,d", refinery.maxHeat) + "TU" });
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -46,6 +49,12 @@ public class GUIMachineCoker extends GuiInfoContainer {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
int p = refinery.progress * 53 / refinery.processTime;
|
||||
drawTexturedModalRect(guiLeft + 61, guiTop + 46, 176, 0, p, 5);
|
||||
|
||||
int h = refinery.heat * 52 / refinery.maxHeat;
|
||||
drawTexturedModalRect(guiLeft + 61, guiTop + 55, 176, 5, h, 5);
|
||||
|
||||
refinery.tanks[0].renderTank(guiLeft + 35, guiTop + 70, this.zLevel, 16, 52);
|
||||
refinery.tanks[1].renderTank(guiLeft + 125, guiTop + 70, this.zLevel, 16, 52);
|
||||
}
|
||||
|
||||
@ -30,45 +30,47 @@ public class CokerRecipes extends SerializableRecipe {
|
||||
@Override
|
||||
public void registerDefaults() {
|
||||
|
||||
registerAuto(HEAVYOIL, new FluidStack(Fluids.OIL_COKER, 20));
|
||||
registerAuto(HEAVYOIL_VACUUM, new FluidStack(Fluids.REFORMATE, 20));
|
||||
registerAuto(COALCREOSOTE, new FluidStack(Fluids.NAPHTHA_COKER, 20));
|
||||
registerAuto(WOODOIL, new FluidStack(Fluids.NAPHTHA_COKER, 20));
|
||||
registerAuto(SMEAR, new FluidStack(Fluids.OIL_COKER, 20));
|
||||
registerAuto(HEATINGOIL, new FluidStack(Fluids.OIL_COKER, 20));
|
||||
registerAuto(HEATINGOIL_VACUUM, new FluidStack(Fluids.OIL_COKER, 20));
|
||||
registerAuto(RECLAIMED, new FluidStack(Fluids.NAPHTHA_COKER, 20));
|
||||
registerAuto(NAPHTHA, new FluidStack(Fluids.NAPHTHA_COKER, 20));
|
||||
registerAuto(NAPHTHA_CRACK, new FluidStack(Fluids.NAPHTHA_COKER, 20));
|
||||
registerAuto(DIESEL, new FluidStack(Fluids.NAPHTHA_COKER, 20));
|
||||
registerAuto(DIESEL_REFORM, new FluidStack(Fluids.NAPHTHA_COKER, 20));
|
||||
registerAuto(DIESEL_CRACK, new FluidStack(Fluids.GAS_COKER, 20));
|
||||
registerAuto(DIESEL_CRACK_REFORM, new FluidStack(Fluids.GAS_COKER, 20));
|
||||
registerAuto(LIGHTOIL, new FluidStack(Fluids.GAS_COKER, 20));
|
||||
registerAuto(LIGHTOIL_CRACK, new FluidStack(Fluids.GAS_COKER, 20));
|
||||
registerAuto(LIGHTOIL_VACUUM, new FluidStack(Fluids.GAS_COKER, 20));
|
||||
registerAuto(BIOFUEL, new FluidStack(Fluids.GAS_COKER, 20));
|
||||
registerAuto(AROMATICS, new FluidStack(Fluids.GAS_COKER, 20));
|
||||
registerAuto(REFORMATE, new FluidStack(Fluids.GAS_COKER, 20));
|
||||
registerAuto(XYLENE, new FluidStack(Fluids.GAS_COKER, 20));
|
||||
registerAuto(HEAVYOIL, Fluids.OIL_COKER);
|
||||
registerAuto(HEAVYOIL_VACUUM, Fluids.REFORMATE);
|
||||
registerAuto(COALCREOSOTE, Fluids.NAPHTHA_COKER);
|
||||
registerAuto(WOODOIL, Fluids.NAPHTHA_COKER);
|
||||
registerAuto(SMEAR, Fluids.OIL_COKER);
|
||||
registerAuto(HEATINGOIL, Fluids.OIL_COKER);
|
||||
registerAuto(HEATINGOIL_VACUUM, Fluids.OIL_COKER);
|
||||
registerAuto(RECLAIMED, Fluids.NAPHTHA_COKER);
|
||||
registerAuto(NAPHTHA, Fluids.NAPHTHA_COKER);
|
||||
registerAuto(NAPHTHA_CRACK, Fluids.NAPHTHA_COKER);
|
||||
registerAuto(DIESEL, Fluids.NAPHTHA_COKER);
|
||||
registerAuto(DIESEL_REFORM, Fluids.NAPHTHA_COKER);
|
||||
registerAuto(DIESEL_CRACK, Fluids.GAS_COKER);
|
||||
registerAuto(DIESEL_CRACK_REFORM, Fluids.GAS_COKER);
|
||||
registerAuto(LIGHTOIL, Fluids.GAS_COKER);
|
||||
registerAuto(LIGHTOIL_CRACK, Fluids.GAS_COKER);
|
||||
registerAuto(LIGHTOIL_VACUUM, Fluids.GAS_COKER);
|
||||
registerAuto(BIOFUEL, Fluids.GAS_COKER);
|
||||
registerAuto(AROMATICS, Fluids.GAS_COKER);
|
||||
registerAuto(REFORMATE, Fluids.GAS_COKER);
|
||||
registerAuto(XYLENE, Fluids.GAS_COKER);
|
||||
}
|
||||
|
||||
private static void registerAuto(FluidType fluid, FluidStack byproduct) {
|
||||
registerSFAuto(fluid, 800_000L, DictFrame.fromOne(ModItems.coke, EnumCokeType.PETROLEUM), byproduct); //3200 burntime * 1.25 burntime bonus * 200 TU/t
|
||||
private static void registerAuto(FluidType fluid, FluidType type) {
|
||||
registerSFAuto(fluid, 820_000L, DictFrame.fromOne(ModItems.coke, EnumCokeType.PETROLEUM), type); //3200 burntime * 1.25 burntime bonus * 200 TU/t + 20000TU per operation
|
||||
}
|
||||
private static void registerSFAuto(FluidType fluid, long tuPerSF, ItemStack fuel, FluidStack byproduct) {
|
||||
private static void registerSFAuto(FluidType fluid, long tuPerSF, ItemStack fuel, FluidType type) {
|
||||
long tuFlammable = fluid.hasTrait(FT_Flammable.class) ? fluid.getTrait(FT_Flammable.class).getHeatEnergy() : 0;
|
||||
long tuCombustible = fluid.hasTrait(FT_Combustible.class) ? fluid.getTrait(FT_Combustible.class).getCombustionEnergy() : 0;
|
||||
|
||||
long tuPerBucket = Math.max(tuFlammable, tuCombustible);
|
||||
|
||||
double penalty = 1.1D;
|
||||
double penalty = 1;//1.1D; //no penalty
|
||||
|
||||
int mB = (int) (tuPerSF * 1000L * penalty / tuPerBucket);
|
||||
|
||||
if(mB > 10_000) mB -= (mB % 1000);
|
||||
else if(mB > 1_000) mB -= (mB % 100);
|
||||
else if(mB > 100) mB -= (mB % 10);
|
||||
|
||||
FluidStack byproduct = type == null ? null : new FluidStack(type, Math.max(10, mB / 10));
|
||||
|
||||
registerRecipe(fluid, mB, fuel, byproduct);
|
||||
}
|
||||
|
||||
@ -273,6 +273,7 @@ public class ClientProxy extends ServerProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineAutosaw.class, new RenderAutosaw());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineVacuumDistill.class, new RenderVacuumDistill());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineCatalyticReformer.class, new RenderCatalyticReformer());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineCoker.class, new RenderCoker());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFan.class, new RenderFan());
|
||||
//Foundry
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFoundryBasin.class, new RenderFoundry());
|
||||
|
||||
@ -76,6 +76,7 @@ public class ResourceManager {
|
||||
public static final IModelCustom catalytic_reformer = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/catalytic_reformer.obj"));
|
||||
public static final IModelCustom liquefactor = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/liquefactor.obj"));
|
||||
public static final IModelCustom solidifier = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/solidifier.obj"));
|
||||
public static final IModelCustom coker = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/coker.obj"));
|
||||
|
||||
//Flare Stack
|
||||
public static final IModelCustom oilflare = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/flare_stack.obj"));
|
||||
@ -401,6 +402,7 @@ public class ResourceManager {
|
||||
public static final ResourceLocation catalytic_reformer_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/catalytic_reformer.png");
|
||||
public static final ResourceLocation liquefactor_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/liquefactor.png");
|
||||
public static final ResourceLocation solidifier_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/solidifier.png");
|
||||
public static final ResourceLocation coker_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/coker.png");
|
||||
|
||||
//Flare Stack
|
||||
public static final ResourceLocation oilflare_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/flare_stack.png");
|
||||
|
||||
54
src/main/java/com/hbm/render/tileentity/RenderCoker.java
Normal file
54
src/main/java/com/hbm/render/tileentity/RenderCoker.java
Normal file
@ -0,0 +1,54 @@
|
||||
package com.hbm.render.tileentity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.item.ItemRenderBase;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
public class RenderCoker extends TileEntitySpecialRenderer implements IItemRendererProvider {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float interp) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.coker_tex);
|
||||
ResourceManager.coker.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemForRenderer() {
|
||||
return Item.getItemFromBlock(ModBlocks.machine_coker);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemRenderer getRenderer() {
|
||||
return new ItemRenderBase() {
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -5, 0);
|
||||
GL11.glScaled(2.75, 2.75, 2.75);
|
||||
}
|
||||
public void renderCommon() {
|
||||
GL11.glScaled(0.25, 0.25, 0.25);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.coker_tex);
|
||||
ResourceManager.coker.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
}};
|
||||
}
|
||||
}
|
||||
@ -306,6 +306,7 @@ public class TileMappings {
|
||||
put(TileEntitySpacer.class, "tileentity_fraction_spacer");
|
||||
put(TileEntityMachineCatalyticCracker.class, "tileentity_catalytic_cracker");
|
||||
put(TileEntityMachineCatalyticReformer.class, "tileentity_catalytic_reformer");
|
||||
put(TileEntityMachineCoker.class, "tileentity_coker");
|
||||
|
||||
put(TileEntityReactorZirnox.class, "tileentity_zirnox");
|
||||
put(TileEntityZirnoxDestroyed.class, "tileentity_zirnox_destroyed");
|
||||
|
||||
@ -215,12 +215,16 @@ public class TileEntityFurnaceCombination extends TileEntityMachineBase implemen
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
this.tank.readFromNBT(nbt, "tank");
|
||||
this.progress = nbt.getInteger("prog");
|
||||
this.heat = nbt.getInteger("heat");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
this.tank.writeToNBT(nbt, "tank");
|
||||
nbt.setInteger("prog", progress);
|
||||
nbt.setInteger("heat", heat);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -6,9 +6,12 @@ import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.gui.GUIMachineCoker;
|
||||
import com.hbm.inventory.recipes.CokerRecipes;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.Tuple.Triplet;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import api.hbm.tile.IHeatSource;
|
||||
@ -20,10 +23,12 @@ import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityMachineCoker extends TileEntityMachineBase implements IFluidStandardTransceiver, IGUIProvider {
|
||||
|
||||
|
||||
public boolean wasOn;
|
||||
public int progress;
|
||||
public static int processTime = 20_000;
|
||||
|
||||
@ -52,11 +57,20 @@ public class TileEntityMachineCoker extends TileEntityMachineBase implements IFl
|
||||
|
||||
this.tryPullHeat();
|
||||
this.tanks[0].setType(0, slots);
|
||||
|
||||
if(worldObj.getTotalWorldTime() % 20 == 0) {
|
||||
for(DirPos pos : getConPos()) {
|
||||
this.trySubscribe(tanks[0].getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
}
|
||||
}
|
||||
|
||||
this.wasOn = false;
|
||||
|
||||
if(canProcess()) {
|
||||
int burn = heat / 100;
|
||||
|
||||
if(burn > 0) {
|
||||
this.wasOn = true;
|
||||
this.progress += burn;
|
||||
this.heat -= burn;
|
||||
|
||||
@ -86,13 +100,52 @@ public class TileEntityMachineCoker extends TileEntityMachineBase implements IFl
|
||||
}
|
||||
}
|
||||
|
||||
for(DirPos pos : getConPos()) {
|
||||
if(this.tanks[1].getFill() > 0) this.sendFluid(tanks[1].getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
}
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setBoolean("wasOn", this.wasOn);
|
||||
data.setInteger("heat", this.heat);
|
||||
data.setInteger("progress", this.progress);
|
||||
tanks[0].writeToNBT(data, "t0");
|
||||
tanks[1].writeToNBT(data, "t1");
|
||||
this.networkPack(data, 25);
|
||||
} else {
|
||||
|
||||
if(this.wasOn) {
|
||||
|
||||
if(worldObj.getTotalWorldTime() % 2 == 0) {
|
||||
NBTTagCompound fx = new NBTTagCompound();
|
||||
fx.setString("type", "tower");
|
||||
fx.setFloat("lift", 10F);
|
||||
fx.setFloat("base", 0.75F);
|
||||
fx.setFloat("max", 3F);
|
||||
fx.setInteger("life", 200 + worldObj.rand.nextInt(50));
|
||||
fx.setInteger("color",0x404040);
|
||||
fx.setDouble("posX", xCoord + 0.5);
|
||||
fx.setDouble("posY", yCoord + 22);
|
||||
fx.setDouble("posZ", zCoord + 0.5);
|
||||
MainRegistry.proxy.effectNT(fx);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public DirPos[] getConPos() {
|
||||
|
||||
return new DirPos[] {
|
||||
new DirPos(xCoord + 2, yCoord, zCoord + 1, Library.POS_X),
|
||||
new DirPos(xCoord + 2, yCoord, zCoord - 1, Library.POS_X),
|
||||
new DirPos(xCoord - 2, yCoord, zCoord + 1, Library.NEG_X),
|
||||
new DirPos(xCoord - 2, yCoord, zCoord - 1, Library.NEG_X),
|
||||
new DirPos(xCoord + 1, yCoord, zCoord + 2, Library.POS_Z),
|
||||
new DirPos(xCoord - 1, yCoord, zCoord + 2, Library.POS_Z),
|
||||
new DirPos(xCoord + 1, yCoord, zCoord - 2, Library.NEG_Z),
|
||||
new DirPos(xCoord - 1, yCoord, zCoord - 2, Library.NEG_Z)
|
||||
};
|
||||
}
|
||||
|
||||
public boolean canProcess() {
|
||||
Triplet<Integer, ItemStack, FluidStack> recipe = CokerRecipes.getOutput(tanks[0].getTankType());
|
||||
|
||||
@ -104,7 +157,7 @@ public class TileEntityMachineCoker extends TileEntityMachineBase implements IFl
|
||||
|
||||
if(byproduct != null) tanks[1].setTankType(byproduct.type);
|
||||
|
||||
if(tanks[0].getFill() < recipe.getX()) return false;
|
||||
if(tanks[0].getFill() < fillReq) return false;
|
||||
if(byproduct != null && byproduct.fill + tanks[1].getFill() > tanks[1].getMaxFill()) return false;
|
||||
|
||||
if(output != null && slots[1] != null) {
|
||||
@ -118,6 +171,9 @@ public class TileEntityMachineCoker extends TileEntityMachineBase implements IFl
|
||||
|
||||
@Override
|
||||
public void networkUnpack(NBTTagCompound nbt) {
|
||||
this.wasOn = nbt.getBoolean("wasOn");
|
||||
this.heat = nbt.getInteger("heat");
|
||||
this.progress = nbt.getInteger("progress");
|
||||
tanks[0].readFromNBT(nbt, "t0");
|
||||
tanks[1].readFromNBT(nbt, "t1");
|
||||
}
|
||||
@ -148,6 +204,24 @@ public class TileEntityMachineCoker extends TileEntityMachineBase implements IFl
|
||||
|
||||
this.heat = Math.max(this.heat - Math.max(this.heat / 1000, 1), 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
this.tanks[0].readFromNBT(nbt, "t0");
|
||||
this.tanks[1].readFromNBT(nbt, "t1");
|
||||
this.progress = nbt.getInteger("prog");
|
||||
this.heat = nbt.getInteger("heat");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
this.tanks[0].writeToNBT(nbt, "t0");
|
||||
this.tanks[1].writeToNBT(nbt, "t1");
|
||||
nbt.setInteger("prog", progress);
|
||||
nbt.setInteger("heat", heat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getAllTanks() {
|
||||
@ -163,6 +237,31 @@ public class TileEntityMachineCoker extends TileEntityMachineBase implements IFl
|
||||
public FluidTank[] getReceivingTanks() {
|
||||
return new FluidTank[] { tanks[0] };
|
||||
}
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
|
||||
if(bb == null) {
|
||||
bb = AxisAlignedBB.getBoundingBox(
|
||||
xCoord - 2,
|
||||
yCoord,
|
||||
zCoord - 2,
|
||||
xCoord + 3,
|
||||
yCoord + 23,
|
||||
zCoord + 3
|
||||
);
|
||||
}
|
||||
|
||||
return bb;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
|
||||
@ -326,6 +326,7 @@ container.leadBox=Sicherheitsbehälter
|
||||
container.machineBoiler=Ölwärmer
|
||||
container.machineCMB=CMB-Stahl Hochofen
|
||||
container.machineCoal=Verbrennungsgenerator
|
||||
container.machineCoker=Koker-Anlage
|
||||
container.machineCrucible=Schmelztiegel
|
||||
container.machineDiesel=Dieselgenerator
|
||||
container.machineElectricBoiler=Elektrischer Ölwärmer
|
||||
@ -3873,6 +3874,7 @@ tile.machine_chungus.name=Leviathan-Dampfturbine
|
||||
tile.machine_chungus.desc=Effizienz: 85%%
|
||||
tile.machine_coal_off.name=Verbrennungsgenerator
|
||||
tile.machine_coal_on.name=Verbrennungsgenerator
|
||||
tile.machine_coker.name=Koker-Anlage
|
||||
tile.machine_combine_factory.name=CMB-Stahl Hochofen
|
||||
tile.machine_combustion_engine.name=Industrieller Verbrennungsmotor
|
||||
tile.machine_condenser.name=Dampfkondensierer
|
||||
|
||||
@ -618,6 +618,7 @@ container.leadBox=Containment Box
|
||||
container.machineBoiler=Oil Heater
|
||||
container.machineCMB=CMB Steel Furnace
|
||||
container.machineCoal=Combustion Generator
|
||||
container.machineCoker=Coker Unit
|
||||
container.machineCrucible=Crucible
|
||||
container.machineDiesel=Diesel Generator
|
||||
container.machineElectricBoiler=Electric Oil Heater
|
||||
@ -4686,6 +4687,7 @@ tile.machine_chungus.name=Leviathan Steam Turbine
|
||||
tile.machine_chungus.desc=Efficiency: 85%%
|
||||
tile.machine_coal_off.name=Combustion Generator
|
||||
tile.machine_coal_on.name=Combustion Generator
|
||||
tile.machine_coker.name=Coker Unit
|
||||
tile.machine_combine_factory.name=CMB Steel Furnace
|
||||
tile.machine_combustion_engine.name=Industrial Combustion Engine
|
||||
tile.machine_condenser.name=Steam Condenser
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.1 KiB |
BIN
src/main/resources/assets/hbm/textures/models/machines/coker.png
Normal file
BIN
src/main/resources/assets/hbm/textures/models/machines/coker.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.4 KiB |
Loading…
x
Reference in New Issue
Block a user