ignition!

This commit is contained in:
Bob 2024-05-05 18:44:34 +02:00
parent 39ca87d7a9
commit d88dd38f20
19 changed files with 338 additions and 28 deletions

View File

@ -5,6 +5,16 @@
* Each ore smelts into 16 items, except for cobalt which yields only 4 ingots
* All meteorite ores are now equally likely to spawn
* The new ores can only be smelted, shredding or other processing is not possible
* ICF (WIP!)
* A new tier of fusion reactor that replaces the FWatz
* Powered by external lasers which are dynamic multiblocks, using fuel pellets
* Construction of lasers: Place a controller, then a straight line of cells behind it, surround those with flash tubes, those with capacitors and optionally those with turbochargers (not recommended as of now)
* Stuff left unfinished:
* Pellet creation and recycling
* Final balancing (especially for lasers and cooling)
* Uses for stellar flux
* Crafting and assembling
* Cooling this reactor is exceedingly difficult due to the limitations of heat exchangers and the relatively low heat capacitor of most available coolants, there will most likely be more powerful ICF-exclusive coolants in the future (liquid lead? sodium compounds?)
## Changed
* The Souyz' recipe is now available in the standard template folder
@ -29,6 +39,9 @@
* Rubber can now be made from acidizing latex with sour gas (requires just 25mB)
* Heating oil can now be reformed into naphtha
* Coker naphtha can now also be reformed like the other naphtha types (yields refgas instead of petgas as a byproduct)
* Drainage pipes will now violently explode when voiding antimatter
* Seeding slurry can now place grass over dead grass
* Added an extra digit to the heat exchanger's configuration panel, allowing effective utilization of all 24,000mB per tick
## Fixed
* Fixed DFC receivers not outputting power

View File

@ -7,14 +7,22 @@ import java.util.Locale;
import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ILookOverlay;
import com.hbm.blocks.ITooltipProvider;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.items.machine.IItemFluidIdentifier;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.TileEntityProxyCombo;
import com.hbm.tileentity.machine.TileEntityHeaterHeatex;
import com.hbm.util.I18nUtil;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
import net.minecraftforge.common.util.ForgeDirection;
@ -45,7 +53,34 @@ public class HeaterHeatex extends BlockDummyable implements ILookOverlay, IToolt
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
return this.standardOpenBehavior(world, x, y, z, player, 0);
if(world.isRemote) {
return true;
} else {
int[] pos = this.findCore(world, x, y, z);
if(pos == null)
return false;
if(player.isSneaking()) {
TileEntityHeaterHeatex trialEntity = (TileEntityHeaterHeatex) world.getTileEntity(pos[0], pos[1], pos[2]);
if(trialEntity != null) {
if(player.getHeldItem() != null && player.getHeldItem().getItem() instanceof IItemFluidIdentifier) {
FluidType type = ((IItemFluidIdentifier) player.getHeldItem().getItem()).getType(world, pos[0], pos[1], pos[2], player.getHeldItem());
trialEntity.tanks[0].setTankType(type);
trialEntity.markDirty();
player.addChatComponentMessage(new ChatComponentText("Changed type to ").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)).appendSibling(new ChatComponentTranslation(type.getConditionalName())).appendSibling(new ChatComponentText("!")));
return true;
}
}
} else {
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, pos[0], pos[1], pos[2]);
}
return true;
}
}
@Override

View File

@ -101,17 +101,17 @@ public class MachineBigAssTank9000 extends BlockDummyable implements IPersistent
TileEntityMachineBAT9000 trialEntity = (TileEntityMachineBAT9000) world.getTileEntity(pos[0], pos[1], pos[2]);
if(trialEntity != null) {
if(player.getHeldItem() != null && player.getHeldItem().getItem() instanceof IItemFluidIdentifier) {
FluidType type = ((IItemFluidIdentifier) player.getHeldItem().getItem()).getType(world, pos[0], pos[1], pos[2], player.getHeldItem());
if(player.getHeldItem() != null && player.getHeldItem().getItem() instanceof IItemFluidIdentifier) {
FluidType type = ((IItemFluidIdentifier) player.getHeldItem().getItem()).getType(world, pos[0], pos[1], pos[2], player.getHeldItem());
trialEntity.tank.setTankType(type);
trialEntity.markDirty();
player.addChatComponentMessage(new ChatComponentText("Changed type to ").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)).appendSibling(new ChatComponentTranslation(type.getConditionalName())).appendSibling(new ChatComponentText("!")));
trialEntity.tank.setTankType(type);
trialEntity.markDirty();
player.addChatComponentMessage(new ChatComponentText("Changed type to ").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)).appendSibling(new ChatComponentTranslation(type.getConditionalName())).appendSibling(new ChatComponentText("!")));
}
}
}
return true;
}else {
} else {
return true;
}
}

View File

@ -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.TileEntityICF;
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 MachineICF extends BlockDummyable {
@ -17,6 +20,7 @@ public class MachineICF extends BlockDummyable {
@Override
public TileEntity createNewTileEntity(World world, int meta) {
if(meta >= 12) return new TileEntityICF();
if(meta >= 6) return new TileEntityProxyCombo().inventory().fluid();
return null;
}
@ -29,6 +33,31 @@ public class MachineICF extends BlockDummyable {
public int getOffset() {
return 1;
}
@Override
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
super.fillSpace(world, x, y, z, dir, o);
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y + 3, z + dir.offsetZ * o, new int[] {1, 1, -1, 2, 8, 8}, this, dir);
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y + 3, z + dir.offsetZ * o, new int[] {1, 1, 2, -1, 8, 8}, this, dir);
x += dir.offsetX * o;
z += dir.offsetZ * o;
this.makeExtra(world, x , y + 5, z);
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
this.makeExtra(world, x + dir.offsetX * 2 + rot.offsetX * 6 , y + 3, z + dir.offsetZ * 2 + rot.offsetZ * 6);
this.makeExtra(world, x + dir.offsetX * 2 - rot.offsetX * 6 , y + 3, z + dir.offsetZ * 2 - rot.offsetZ * 6);
this.makeExtra(world, x - dir.offsetX * 2 + rot.offsetX * 6 , y + 3, z - dir.offsetZ * 2 + rot.offsetZ * 6);
this.makeExtra(world, x - dir.offsetX * 2 - rot.offsetX * 6 , y + 3, z - dir.offsetZ * 2 - rot.offsetZ * 6);
}
@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)) return false;
//if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {4, -3, 1, 1, 1, 1}, x, y, z, dir)) return false;
return true;
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {

View File

@ -1,17 +1,25 @@
package com.hbm.blocks.machine;
import java.util.List;
import com.hbm.blocks.ITooltipProvider;
import com.hbm.lib.RefStrings;
import com.hbm.util.I18nUtil;
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.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
public class MachineICFPress extends BlockContainer {
public class MachineICFPress extends BlockContainer implements ITooltipProvider {
@SideOnly(Side.CLIENT) private IIcon iconTop;
@ -36,4 +44,9 @@ public class MachineICFPress extends BlockContainer {
public IIcon getIcon(int side, int metadata) {
return side == 1 ? this.iconTop : (side == 0 ? this.iconTop : this.blockIcon);
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
for(String s : I18nUtil.resolveKeyArray(((Block)this).getUnlocalizedName() + ".desc")) list.add(EnumChatFormatting.YELLOW + s);
}
}

View File

@ -478,6 +478,7 @@ public class EntityChemical extends EntityThrowableNT {
int meta = worldObj.getBlockMetadata(x, y, z);
if(block == Blocks.cobblestone) worldObj.setBlock(x, y, z, Blocks.mossy_cobblestone);
if(block == Blocks.stonebrick && meta == 0) worldObj.setBlock(x, y, z, Blocks.stonebrick, 1, 3);
if(block == ModBlocks.waste_earth) worldObj.setBlock(x, y, z, Blocks.grass);
if(block == ModBlocks.brick_concrete) worldObj.setBlock(x, y, z, ModBlocks.brick_concrete_mossy);
if(block == ModBlocks.concrete_brick_slab && meta % 8 == 0) worldObj.setBlock(x, y, z, ModBlocks.concrete_brick_slab, meta + 1, 3);
if(block == ModBlocks.brick_concrete_stairs) worldObj.setBlock(x, y, z, ModBlocks.brick_concrete_mossy_stairs, meta, 3);

View File

@ -578,19 +578,19 @@ public class Fluids {
HOTCRACKOIL.addTraits(new FT_Coolable(CRACKOIL, 1, 1, 10).setEff(CoolingType.HEATEXCHANGER, 1.0D));
HOTCRACKOIL_DS.addTraits(new FT_Coolable(CRACKOIL_DS, 1, 1, 10).setEff(CoolingType.HEATEXCHANGER, 1.0D));
COOLANT.addTraits(new FT_Heatable().setEff(HeatingType.HEATEXCHANGER, 1.0D).setEff(HeatingType.PWR, 1.0D).addStep(300, 1, COOLANT_HOT, 1));
COOLANT.addTraits(new FT_Heatable().setEff(HeatingType.HEATEXCHANGER, 1.0D).setEff(HeatingType.PWR, 1.0D).setEff(HeatingType.ICF, 1.0D).addStep(300, 1, COOLANT_HOT, 1));
COOLANT_HOT.addTraits(new FT_Coolable(COOLANT, 1, 1, 300).setEff(CoolingType.HEATEXCHANGER, 1.0D));
MUG.addTraits(new FT_Heatable().setEff(HeatingType.HEATEXCHANGER, 1.0D).setEff(HeatingType.PWR, 1.0D).addStep(400, 1, MUG_HOT, 1), new FT_PWRModerator(1.15D));
MUG.addTraits(new FT_Heatable().setEff(HeatingType.HEATEXCHANGER, 1.0D).setEff(HeatingType.PWR, 1.0D).setEff(HeatingType.ICF, 1.25D).addStep(400, 1, MUG_HOT, 1), new FT_PWRModerator(1.15D));
MUG_HOT.addTraits(new FT_Coolable(MUG, 1, 1, 400).setEff(CoolingType.HEATEXCHANGER, 1.0D));
BLOOD.addTraits(new FT_Heatable().setEff(HeatingType.HEATEXCHANGER, 1.0D).addStep(500, 1, BLOOD_HOT, 1));
BLOOD.addTraits(new FT_Heatable().setEff(HeatingType.HEATEXCHANGER, 1.0D).setEff(HeatingType.ICF, 1.25D).addStep(500, 1, BLOOD_HOT, 1));
BLOOD_HOT.addTraits(new FT_Coolable(BLOOD, 1, 1, 500).setEff(CoolingType.HEATEXCHANGER, 1.0D));
HEAVYWATER.addTraits(new FT_Heatable().setEff(HeatingType.PWR, 1.0D).addStep(300, 1, HEAVYWATER_HOT, 1), new FT_PWRModerator(1.25D));
HEAVYWATER_HOT.addTraits(new FT_Coolable(HEAVYWATER, 1, 1, 300).setEff(CoolingType.HEATEXCHANGER, 1.0D));
SODIUM.addTraits(new FT_Heatable().setEff(HeatingType.PWR, 2.5D).addStep(400, 1, SODIUM_HOT, 1));
SODIUM.addTraits(new FT_Heatable().setEff(HeatingType.PWR, 2.5D).setEff(HeatingType.ICF, 3D).addStep(400, 1, SODIUM_HOT, 1));
SODIUM_HOT.addTraits(new FT_Coolable(SODIUM, 1, 1, 400).setEff(CoolingType.HEATEXCHANGER, 1.0D));
THORIUM_SALT.addTraits(new FT_Heatable().setEff(HeatingType.PWR, 1.0D).addStep(400, 1, THORIUM_SALT_HOT, 1), new FT_PWRModerator(2.5D));

View File

@ -70,7 +70,8 @@ public class FT_Heatable extends FluidTrait {
public static enum HeatingType {
BOILER("Boilable"),
HEATEXCHANGER("Heatable"),
PWR("PWR Coolant");
PWR("PWR Coolant"),
ICF("ICF Coolant");
public String name;

View File

@ -39,11 +39,11 @@ public class GUIHeaterHeatex extends GuiInfoContainer {
super.initGui();
Keyboard.enableRepeatEvents(true);
this.fieldCycles = new GuiTextField(this.fontRendererObj, guiLeft + 74, guiTop + 31, 28, 10);
this.fieldCycles = new GuiTextField(this.fontRendererObj, guiLeft + 73, guiTop + 31, 30, 10);
initText(this.fieldCycles);
this.fieldCycles.setText(String.valueOf(heater.amountToCool));
this.fieldDelay = new GuiTextField(this.fontRendererObj, guiLeft + 74, guiTop + 49, 28, 10);
this.fieldDelay = new GuiTextField(this.fontRendererObj, guiLeft + 73, guiTop + 49, 30, 10);
initText(this.fieldDelay);
this.fieldDelay.setText(String.valueOf(heater.tickDelay));
}
@ -52,7 +52,7 @@ public class GUIHeaterHeatex extends GuiInfoContainer {
field.setTextColor(0x00ff00);
field.setDisabledTextColour(0x00ff00);
field.setEnableBackgroundDrawing(false);
field.setMaxStringLength(4);
field.setMaxStringLength(5);
}
@Override

View File

@ -33,6 +33,7 @@ public class GUIICF extends GuiInfoContainer {
icf.tanks[2].renderTankInfo(this, x, y, guiLeft + 224, guiTop + 18, 16, 70);
this.drawCustomInfoStat(x, y, guiLeft + 8, guiTop + 18, 16, 70, x, y, icf.maxLaser <= 0 ? "OFFLINE" : (BobMathUtil.getShortNumber(icf.laser) + "TU - " + (icf.laser * 1000 / icf.maxLaser) / 10D + "%"));
this.drawCustomInfoStat(x, y, guiLeft + 187, guiTop + 89, 18, 18, x, y, BobMathUtil.getShortNumber(icf.heat) + " / " + BobMathUtil.getShortNumber(icf.maxHeat) + "TU");
}
@Override
@ -53,7 +54,7 @@ public class GUIICF extends GuiInfoContainer {
drawTexturedModalRect(guiLeft + 8, guiTop + 88 - p, 212, 192 - p, 16, p);
}
GaugeUtil.drawSmoothGauge(guiLeft + 196, guiTop + 98, this.zLevel, 0D, 5, 2, 1, 0xFF00AF);
GaugeUtil.drawSmoothGauge(guiLeft + 196, guiTop + 98, this.zLevel, (double) icf.heat / (double) icf.maxHeat, 5, 2, 1, 0xFF00AF);
icf.tanks[0].renderTank(guiLeft + 44, guiTop + 88, this.zLevel, 16, 70);
icf.tanks[1].renderTank(guiLeft + 188, guiTop + 88, this.zLevel, 16, 70);

View File

@ -3841,8 +3841,8 @@ public class ModItems {
watz_pellet_depleted = new ItemWatzPellet().setUnlocalizedName("watz_pellet_depleted").setTextureName(RefStrings.MODID + ":watz_pellet");
icf_pellet_empty = new Item().setUnlocalizedName("icf_pellet_empty").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":icf_pellet_empty");
icf_pellet = new Item().setUnlocalizedName("icf_pellet").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":icf_pellet");
icf_pellet_depleted = new Item().setUnlocalizedName("icf_pellet_depleted").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":icf_pellet");
icf_pellet = new ItemICFPellet().setUnlocalizedName("icf_pellet").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":icf_pellet");
icf_pellet_depleted = new Item().setUnlocalizedName("icf_pellet_depleted").setCreativeTab(MainRegistry.controlTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":icf_pellet");
trinitite = new ItemNuclearWaste().setUnlocalizedName("trinitite").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":trinitite_new");
nuclear_waste_long = new ItemWasteLong().setUnlocalizedName("nuclear_waste_long").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nuclear_waste_long");

View File

@ -0,0 +1,74 @@
package com.hbm.items.machine;
import com.hbm.lib.RefStrings;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.IIcon;
public class ItemICFPellet extends Item {
protected IIcon iconBG;
public ItemICFPellet() {
this.setMaxStackSize(1);
}
public static long getMaxDepletion(ItemStack stack) {
if(!stack.hasTagCompound()) return 10_000_000_000L;
//TODO: type-dependent
return 50_000_000_000L;
}
public static long getDepletion(ItemStack stack) {
if(!stack.hasTagCompound()) return 0L;
return stack.stackTagCompound.getLong("depletion");
}
public static long react(ItemStack stack, long heat) {
if(!stack.hasTagCompound()) stack.stackTagCompound = new NBTTagCompound();
//TODO: type-dependent
stack.stackTagCompound.setLong("depletion", stack.stackTagCompound.getLong("depletion") + heat);
return heat * 2;
}
@Override
public boolean showDurabilityBar(ItemStack stack) {
return getDurabilityForDisplay(stack) > 0D;
}
@Override
public double getDurabilityForDisplay(ItemStack stack) {
return (double) getDepletion(stack) / (double) getMaxDepletion(stack);
}
@Override
@SideOnly(Side.CLIENT)
public boolean requiresMultipleRenderPasses() {
return true;
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister reg) {
super.registerIcons(reg);
this.iconBG = reg.registerIcon(RefStrings.MODID + ":icf_pellet_bg");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamageForRenderPass(int meta, int pass) {
return pass == 1 ? super.getIconFromDamageForRenderPass(meta, pass) : this.iconBG;
}
@Override
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack stack, int pass) {
if(pass == 0) return 0x4040ff;
return 0xffffff;
}
}

View File

@ -23,6 +23,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
@ -227,7 +228,7 @@ public class TileEntityHeaterHeatex extends TileEntityMachineBase implements IHe
@Override
public void receiveControl(NBTTagCompound data) {
if(data.hasKey("toCool")) this.amountToCool = Math.max(data.getInteger("toCool"), 1);
if(data.hasKey("toCool")) this.amountToCool = MathHelper.clamp_int(data.getInteger("toCool"), 1, tanks[0].getMaxFill());
if(data.hasKey("delay")) this.tickDelay = Math.max(data.getInteger("delay"), 1);
this.markChanged();

View File

@ -3,9 +3,16 @@ package com.hbm.tileentity.machine;
import com.hbm.inventory.container.ContainerICF;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.fluid.tank.FluidTank;
import com.hbm.inventory.fluid.trait.FT_Heatable;
import com.hbm.inventory.fluid.trait.FT_Heatable.HeatingStep;
import com.hbm.inventory.fluid.trait.FT_Heatable.HeatingType;
import com.hbm.inventory.gui.GUIICF;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemICFPellet;
import com.hbm.lib.Library;
import com.hbm.tileentity.IGUIProvider;
import com.hbm.tileentity.TileEntityMachineBase;
import com.hbm.util.fauxpointtwelve.DirPos;
import api.hbm.fluid.IFluidStandardTransceiver;
import cpw.mods.fml.relauncher.Side;
@ -15,22 +22,26 @@ import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityICF extends TileEntityMachineBase implements IGUIProvider, IFluidStandardTransceiver {
public long laser;
public long maxLaser;
public long heat;
public static final long maxHeat = 1_000_000_000_000L;
public FluidTank[] tanks;
public TileEntityICF() {
super(12);
this.tanks = new FluidTank[3];
this.tanks[0] = new FluidTank(Fluids.COOLANT, 256_000);
this.tanks[1] = new FluidTank(Fluids.COOLANT_HOT, 256_000);
this.tanks[2] = new FluidTank(Fluids.STELLAR_FLUX, 16_000);
this.tanks[0] = new FluidTank(Fluids.SODIUM, 512_000);
this.tanks[1] = new FluidTank(Fluids.SODIUM_HOT, 512_000);
this.tanks[2] = new FluidTank(Fluids.STELLAR_FLUX, 24_000);
}
@Override
@ -43,18 +54,98 @@ public class TileEntityICF extends TileEntityMachineBase implements IGUIProvider
if(!worldObj.isRemote) {
for(int i = 0; i < 3; i++) tanks[i].setFill(tanks[i].getMaxFill());
tanks[0].setType(11, slots);
for(DirPos pos : getConPos()) {
this.trySubscribe(tanks[0].getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
}
this.heat += this.laser * 0.25D;
boolean markDirty = false;
//eject depleted pellet
if(slots[5] != null && slots[5].getItem() == ModItems.icf_pellet_depleted) {
for(int i = 6; i < 11; i++) {
if(slots[i] == null) {
slots[i] = slots[5].copy();
slots[5] = null;
markDirty = true;
break;
}
}
}
//insert fresh pellet
if(slots[5] == null) {
for(int i = 0; i < 5; i++) {
if(slots[i] != null && slots[i].getItem() == ModItems.icf_pellet) {
slots[5] = slots[i].copy();
slots[i] = null;
markDirty = true;
break;
}
}
}
if(slots[5] != null && slots[5].getItem() == ModItems.icf_pellet) {
this.heat += ItemICFPellet.react(slots[5], this.laser);
if(ItemICFPellet.getDepletion(slots[5]) >= ItemICFPellet.getMaxDepletion(slots[5])) {
slots[5] = new ItemStack(ModItems.icf_pellet_depleted);
markDirty = true;
}
tanks[2].setFill(tanks[2].getFill() + (int) Math.ceil(this.heat * 10D / this.maxHeat));
if(tanks[2].getFill() > tanks[2].getMaxFill()) tanks[2].setFill(tanks[2].getMaxFill());
}
if(tanks[0].getTankType().hasTrait(FT_Heatable.class)) {
FT_Heatable trait = tanks[0].getTankType().getTrait(FT_Heatable.class);
HeatingStep step = trait.getFirstStep();
tanks[1].setTankType(step.typeProduced);
int coolingCycles = tanks[0].getFill() / step.amountReq;
int heatingCycles = (tanks[1].getMaxFill() - tanks[1].getFill()) / step.amountProduced;
int heatCycles = (int) (this.heat / 4 / step.heatReq * trait.getEfficiency(HeatingType.ICF)); //25% cooling per tick
int cycles = Math.min(coolingCycles, Math.min(heatingCycles, heatCycles));
tanks[0].setFill(tanks[0].getFill() - step.amountReq * cycles);
tanks[1].setFill(tanks[1].getFill() + step.amountProduced * cycles);
this.heat -= step.heatReq * cycles;
}
for(DirPos pos : getConPos()) {
this.sendFluid(tanks[1], worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
this.sendFluid(tanks[2], worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
}
this.heat *= 0.999D;
if(this.heat > this.maxHeat) this.heat = this.maxHeat;
if(markDirty) this.markDirty();
this.networkPackNT(150);
this.laser = 0;
this.maxLaser = 0;
}
}
public DirPos[] getConPos() {
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10);
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
return new DirPos[] {
new DirPos(xCoord, yCoord + 6, zCoord, Library.POS_Y),
new DirPos(xCoord, yCoord - 1, zCoord, Library.NEG_Y),
new DirPos(xCoord + dir.offsetX * 3 + rot.offsetX * 6, yCoord + 3, zCoord + dir.offsetZ * 3 + rot.offsetZ * 6, dir),
new DirPos(xCoord + dir.offsetX * 3 - rot.offsetX * 6, yCoord + 3, zCoord + dir.offsetZ * 3 - rot.offsetZ * 6, dir),
new DirPos(xCoord - dir.offsetX * 3 + rot.offsetX * 6, yCoord + 3, zCoord - dir.offsetZ * 3 + rot.offsetZ * 6, dir.getOpposite()),
new DirPos(xCoord - dir.offsetX * 3 - rot.offsetX * 6, yCoord + 3, zCoord - dir.offsetZ * 3 - rot.offsetZ * 6, dir.getOpposite())
};
}
@Override public void serialize(ByteBuf buf) {
super.serialize(buf);
buf.writeLong(laser);
buf.writeLong(maxLaser);
buf.writeLong(heat);
for(int i = 0; i < 3; i++) tanks[i].serialize(buf);
}
@ -62,12 +153,13 @@ public class TileEntityICF extends TileEntityMachineBase implements IGUIProvider
super.deserialize(buf);
this.laser = buf.readLong();
this.maxLaser = buf.readLong();
this.heat = buf.readLong();
for(int i = 0; i < 3; i++) tanks[i].deserialize(buf);
}
@Override
public boolean isItemValidForSlot(int slot, ItemStack stack) {
return slot < 5;
return slot < 5 && stack.getItem() == ModItems.icf_pellet;
}
@Override
@ -81,6 +173,22 @@ public class TileEntityICF extends TileEntityMachineBase implements IGUIProvider
public int[] getAccessibleSlotsFromSide(int side) {
return io;
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
for(int i = 0; i < 3; i++) tanks[i].readFromNBT(nbt, "t" + i);
this.heat = nbt.getLong("heat");
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
for(int i = 0; i < 3; i++) tanks[i].writeToNBT(nbt, "t" + i);
nbt.setLong("heat", heat);
}
@Override
public boolean isUseableByPlayer(EntityPlayer player) {

View File

@ -220,7 +220,7 @@ public class TileEntityICFController extends TileEntityTickingBase implements IE
@Override
public long getMaxPower() {
return (long) (Math.sqrt(capacitorCount) * 5_000_000 + Math.sqrt(Math.min(turbochargerCount, capacitorCount)) * 10_000_000);
return (long) (Math.sqrt(capacitorCount) * 2_500_000 + Math.sqrt(Math.min(turbochargerCount, capacitorCount)) * 5_000_000);
}
AxisAlignedBB bb = null;

View File

@ -7,6 +7,7 @@ import com.hbm.inventory.fluid.tank.FluidTank;
import com.hbm.inventory.fluid.trait.FT_Flammable;
import com.hbm.inventory.fluid.trait.FT_Polluting;
import com.hbm.inventory.fluid.trait.FluidTrait.FluidReleaseType;
import com.hbm.inventory.fluid.trait.FluidTraitSimple.FT_Amat;
import com.hbm.inventory.fluid.trait.FluidTraitSimple.FT_Gaseous;
import com.hbm.inventory.fluid.trait.FluidTraitSimple.FT_Liquid;
import com.hbm.inventory.fluid.trait.FluidTraitSimple.FT_Viscous;
@ -49,6 +50,10 @@ public class TileEntityMachineDrain extends TileEntityLoadedBase implements IFlu
PacketDispatcher.wrapper.sendToAllAround(new BufPacket(xCoord, yCoord, zCoord, this), new TargetPoint(this.worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
if(tank.getFill() > 0) {
if(tank.getTankType().hasTrait(FT_Amat.class)) {
worldObj.newExplosion(null, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, 10F, true, true);
return;
}
int toSpill = Math.max(tank.getFill() / 2, 1);
tank.setFill(tank.getFill() - toSpill);
FT_Polluting.pollute(worldObj, xCoord, yCoord, zCoord, tank.getTankType(), FluidReleaseType.SPILL, toSpill);

View File

@ -362,6 +362,7 @@ container.machineElectricBoiler=Elektrischer Ölwärmer
container.machineElectrolyser=Electrolysegerät
container.machineFEL=FEL
container.machineFunnel=Kombinationstrichter
container.machineICF=ICF
container.machineITER=Kernfusionsreaktor
container.machineLargeTurbine=Industrielle Dampfturbine
container.machineLiquefactor=Verflüssiger
@ -766,6 +767,7 @@ hbmfluid.solvent=Lösungsmittel
hbmfluid.sourgas=Saures Gas
hbmfluid.spentsteam=Niedrigdruckdampf
hbmfluid.steam=Dampf
hbmfluid.stellar_flux=Sternenflux
hbmfluid.sulfuric_acid=Schwefelsäure
hbmfluid.sunfloweroil=Sonnenblumenkernöl
hbmfluid.superhotsteam=Superverdichteter Dampf
@ -2099,6 +2101,9 @@ item.hull_big_steel.name=Große Stahlhülle
item.hull_big_titanium.name=Große Titanhülle
item.hull_small_aluminium.name=Kleine Aluminiumhülle
item.hull_small_steel.name=Kleine Stahlhülle
item.icf_pellet.name=ICF-Brennstoffpellet
item.icf_pellet_depleted.name=Erschöpftes ICF-Brennstoffpellet
item.icf_pellet_empty.name=Leeres ICF-Brennstoffpellet
item.igniter.name=Zünder
item.industrial_magnet.name=Industriemagnet
item.inf_antimatter.name=Unendlicher Antimaterietank
@ -4081,6 +4086,15 @@ tile.heater_oven.desc=Erzeugt Wärme aus Festbrennstoff.$Nimmt von unten Wärme
tile.hev_battery.name=Anzugs-Batterie
tile.machine_hydrotreater.name=Hydrotreater
tile.impact_dirt.name=Versengte Erde
tile.icf.name=Trägheitsfusionsreaktor (ICF)
tile.icf_block.name=ICF-Laser
tile.icf_controller.name=ICF-Lasersteuerung
tile.icf_laser_component.capacitor.name=ICF-Laser-Kondensator
tile.icf_laser_component.casing.name=ICF-Laser-Gehäuse
tile.icf_laser_component.cell.name=ICF-Laser-Zelle
tile.icf_laser_component.emitter.name=ICF-Laser-Blitzröhre
tile.icf_laser_component.port.name=ICF-Laser-Anschluss
tile.icf_laser_component.turbo.name=ICF-Laser-Turbolader
tile.iter.name=Kernfusionsreaktor
tile.ladder_aluminium.name=Aluminiumleiter
tile.ladder_cobalt.name=Kobaltleiter

View File

@ -755,6 +755,7 @@ container.machineElectricBoiler=Electric Oil Heater
container.machineElectrolyser=Electrolysis Machine
container.machineFEL=FEL
container.machineFunnel=Combinator Funnel
container.machineICF=ICF
container.machineITER=Fusion Reactor
container.machineLargeTurbine=Industrial Steam Turbine
container.machineLiquefactor=Liquefactor
@ -1457,6 +1458,7 @@ hbmfluid.solvent=Solvent
hbmfluid.sourgas=Sour Gas
hbmfluid.spentsteam=Low-Pressure Steam
hbmfluid.steam=Steam
hbmfluid.stellar_flux=Stellar Flux
hbmfluid.sulfuric_acid=Sulfuric Acid
hbmfluid.sunfloweroil=Sunflower Seed Oil
hbmfluid.superhotsteam=Super Dense Steam
@ -2884,6 +2886,9 @@ item.hull_big_titanium.name=Big Titanium Shell
item.hull_small_aluminium.name=Small Aluminium Shell
item.hull_small_aluminium.desc=Can be inserted into drilled graphite
item.hull_small_steel.name=Small Steel Shell
item.icf_pellet.name=ICF Fuel Pellet
item.icf_pellet_depleted.name=Depleted ICF Fuel Pellet
item.icf_pellet_empty.name=Empty ICF Fuel Pellet
item.igniter.name=Igniter
item.igniter.desc=(Used by right-clicking the Prototype)$It's a green metal handle with a$bright red button and a small lid.$At the bottom, the initials N.E. are$engraved. Whoever N.E. was, he had$a great taste in shades of green.
item.industrial_magnet.name=Industrial Magnet
@ -5141,6 +5146,15 @@ tile.heater_oven.desc=Burns solid fuel to produce heat.$Accepts heat from the bo
tile.hev_battery.name=Suit Battery
tile.machine_hydrotreater.name=Hydrotreater
tile.impact_dirt.name=Scorched Dirt
tile.icf.name=Inertial Confinement Fusion Reactor (ICF)
tile.icf_block.name=ICF Laser
tile.icf_controller.name=ICF Laser Controller
tile.icf_laser_component.capacitor.name=ICF Laser Capacitor
tile.icf_laser_component.casing.name=ICF Laser Casing
tile.icf_laser_component.cell.name=ICF Laser Cell
tile.icf_laser_component.emitter.name=ICF Laser Flash Tube
tile.icf_laser_component.port.name=ICF Laser Port
tile.icf_laser_component.turbo.name=ICF Laser Turbocharger
tile.iter.name=Fusion Reactor
tile.ladder_aluminium.name=Aluminium Ladder
tile.ladder_cobalt.name=Cobalt Ladder
@ -5241,6 +5255,7 @@ tile.machine_gascent.name=Gas Centrifuge
tile.machine_generator.name=Nuclear Reactor (Old)
tile.machine_geo.name=Geothermal Electric Generator
tile.machine_hephaestus.name=Geothermal Heat Exchanger
tile.machine_icf_press.desc=If only there was something that would tell me how or if this thing works$Something like a changelog or something like that$Alas, I'm too fucking stupid to read something like that anyway
tile.machine_industrial_boiler.name=Industrial Boiler
tile.machine_industrial_boiler.desc=Large boiler that can boil water or heat up oil.$Requires external heat source.$Heat transfer rate: ΔT*0.01 TU/t$Cannot explode
tile.machine_industrial_generator.name=Industrial Generator

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB