mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
the smooth taste of NEO, wake up and taste the PAIN
This commit is contained in:
parent
4a3db6adba
commit
71b40de7a7
@ -50,6 +50,8 @@
|
||||
* Re-solidifcation of bedrock ore crumbs now requires ore slop instead of nitric acid
|
||||
* Due to ore slop being only obtainable from processing raw bedrock ore, this places a hard cap on how many times a single ore can be re-solidified out of crumbs
|
||||
* This approach means that crumb yields don't have to be nerfed, and prevents that issue from popping up again should there ever be a new, more efficient processing path
|
||||
* Rewrote the ore layer generator (hematite, bauxite) to be way more performant during worldgen
|
||||
* The mining laser can now be stopped by applying a redstone signal to one of the ports
|
||||
|
||||
## Fixed
|
||||
* Fixed arc furnace only allowing electrodes to be inserted when the lid is down instead of up
|
||||
@ -65,3 +67,4 @@
|
||||
* Fixed bismuth armor not having a valid repair material
|
||||
* Fixed compressors needing at least one mB of fluid more to process a recipe than necessary
|
||||
* Fixed many NTM structure spawn conditions being hardcoded (again) preventing them from spawning in modded biomes that would otherwise be a fit
|
||||
* Fixed spawn offset for some structures which caused them to float in the air
|
||||
|
||||
@ -1,15 +1,27 @@
|
||||
package com.hbm.blocks.machine.fusion;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.fusion.TileEntityFusionBoiler;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.i18n.I18nUtil;
|
||||
|
||||
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.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineFusionBoiler extends BlockDummyable {
|
||||
public class MachineFusionBoiler extends BlockDummyable implements ILookOverlay, ITooltipProvider {
|
||||
|
||||
public MachineFusionBoiler() {
|
||||
super(Material.iron);
|
||||
@ -18,7 +30,7 @@ public class MachineFusionBoiler extends BlockDummyable {
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityFusionBoiler();
|
||||
if(meta >= 6) return new TileEntityProxyCombo().power().fluid();
|
||||
if(meta >= 6) return new TileEntityProxyCombo().fluid();
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -40,5 +52,42 @@ public class MachineFusionBoiler extends BlockDummyable {
|
||||
@Override
|
||||
public 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;
|
||||
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
//this.makeExtra(world, x + dir.offsetX * 4, y + 2, z + dir.offsetZ * 4);
|
||||
this.makeExtra(world, x - dir.offsetX * 1 + rot.offsetX, y, z - dir.offsetZ * 1 + rot.offsetZ);
|
||||
this.makeExtra(world, x - dir.offsetX * 1 - rot.offsetX, y, z - dir.offsetZ * 1 - rot.offsetZ);
|
||||
this.makeExtra(world, x + dir.offsetX * 2 + rot.offsetX, y, z + dir.offsetZ * 2 + rot.offsetZ);
|
||||
this.makeExtra(world, x + dir.offsetX * 2 - rot.offsetX, y, z + dir.offsetZ * 2 - rot.offsetZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
if(pos == null) return;
|
||||
|
||||
TileEntity te = world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
|
||||
if(!(te instanceof TileEntityFusionBoiler)) return;
|
||||
TileEntityFusionBoiler boiler = (TileEntityFusionBoiler) te;
|
||||
|
||||
List<String> text = new ArrayList();
|
||||
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + BobMathUtil.format(boiler.plasmaEnergy) + " TU");
|
||||
|
||||
for(int i = 0; i < boiler.getAllTanks().length; i++) {
|
||||
FluidTank tank = boiler.getAllTanks()[i];
|
||||
text.add((i == 0 ? (EnumChatFormatting.GREEN + "-> ") : (EnumChatFormatting.RED + "<- ")) + EnumChatFormatting.RESET + tank.getTankType().getLocalizedName() + ": " + tank.getFill() + "/" + tank.getMaxFill() + "mB");
|
||||
}
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
addStandardInfo(stack, player, list, ext);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,16 +1,20 @@
|
||||
package com.hbm.blocks.machine.fusion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.fusion.TileEntityFusionBreeder;
|
||||
|
||||
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.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineFusionBreeder extends BlockDummyable {
|
||||
public class MachineFusionBreeder extends BlockDummyable implements ITooltipProvider {
|
||||
|
||||
public MachineFusionBreeder() {
|
||||
super(Material.iron);
|
||||
@ -58,4 +62,9 @@ public class MachineFusionBreeder extends BlockDummyable {
|
||||
this.makeExtra(world, x + dir.offsetX - rot.offsetX, y, z + dir.offsetZ - rot.offsetZ);
|
||||
this.makeExtra(world, x + dir.offsetX * 2, y + 2, z + dir.offsetZ * 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
addStandardInfo(stack, player, list, ext);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,14 +1,19 @@
|
||||
package com.hbm.blocks.machine.fusion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.tileentity.machine.fusion.TileEntityFusionCollector;
|
||||
|
||||
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.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineFusionCollector extends BlockDummyable {
|
||||
public class MachineFusionCollector extends BlockDummyable implements ITooltipProvider {
|
||||
|
||||
public MachineFusionCollector() {
|
||||
super(Material.iron);
|
||||
@ -39,4 +44,9 @@ public class MachineFusionCollector extends BlockDummyable {
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
addStandardInfo(stack, player, list, ext);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,17 +1,21 @@
|
||||
package com.hbm.blocks.machine.fusion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.handler.MultiblockHandlerXR;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.fusion.TileEntityFusionKlystron;
|
||||
|
||||
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.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineFusionKlystron extends BlockDummyable {
|
||||
public class MachineFusionKlystron extends BlockDummyable implements ITooltipProvider {
|
||||
|
||||
public MachineFusionKlystron() {
|
||||
super(Material.iron);
|
||||
@ -60,4 +64,9 @@ public class MachineFusionKlystron extends BlockDummyable {
|
||||
this.makeExtra(world, x + rot.offsetX * 2, y, z + rot.offsetZ * 2);
|
||||
this.makeExtra(world, x - rot.offsetX * 2, y, z - rot.offsetZ * 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
addStandardInfo(stack, player, list, ext);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,16 +1,28 @@
|
||||
package com.hbm.blocks.machine.fusion;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.handler.MultiblockHandlerXR;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.fusion.TileEntityFusionMHDT;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.i18n.I18nUtil;
|
||||
|
||||
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.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineFusionMHDT extends BlockDummyable {
|
||||
public class MachineFusionMHDT extends BlockDummyable implements ILookOverlay, ITooltipProvider {
|
||||
|
||||
public MachineFusionMHDT() {
|
||||
super(Material.iron);
|
||||
@ -52,5 +64,44 @@ public class MachineFusionMHDT extends BlockDummyable {
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y, z + dir.offsetZ * o, new int[] {3, -2, -3, 5, 2, 2}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y, z + dir.offsetZ * o, new int[] {4, -3, -3, 5, 1, 1}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * (o + 3), y, z + dir.offsetZ * (o + 3), new int[] {1, 0, 0, 1, 3, 3}, this, dir);
|
||||
|
||||
x += dir.offsetX * o;
|
||||
z += dir.offsetZ * o;
|
||||
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
this.makeExtra(world, x + dir.offsetX * 4 + rot.offsetX * 3, y, z + dir.offsetZ * 4 + rot.offsetZ * 3);
|
||||
this.makeExtra(world, x + dir.offsetX * 4 - rot.offsetX * 3, y, z + dir.offsetZ * 4 - rot.offsetZ * 3);
|
||||
this.makeExtra(world, x + dir.offsetX * 7, y + 1, z + dir.offsetZ * 7);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
if(pos == null) return;
|
||||
|
||||
TileEntity te = world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
|
||||
if(!(te instanceof TileEntityFusionMHDT)) return;
|
||||
TileEntityFusionMHDT turbine = (TileEntityFusionMHDT) te;
|
||||
|
||||
boolean isCool = turbine.isCool();
|
||||
|
||||
List<String> text = new ArrayList();
|
||||
text.add(EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + BobMathUtil.getShortNumber(turbine.plasmaEnergy) + " TU/t");
|
||||
text.add(EnumChatFormatting.RED + "<- " + EnumChatFormatting.RESET + BobMathUtil.getShortNumber(!isCool ? 0 : (long) Math.floor(turbine.plasmaEnergy * turbine.PLASMA_EFFICIENCY)) + "HE/t");
|
||||
|
||||
for(int i = 0; i < turbine.getAllTanks().length; i++) {
|
||||
FluidTank tank = turbine.getAllTanks()[i];
|
||||
text.add((i == 0 ? (EnumChatFormatting.GREEN + "-> ") : (EnumChatFormatting.RED + "<- ")) + EnumChatFormatting.RESET + tank.getTankType().getLocalizedName() + ": " + tank.getFill() + "/" + tank.getMaxFill() + "mB");
|
||||
}
|
||||
|
||||
if(!isCool) text.add("&[" + (BobMathUtil.getBlink() ? 0xff0000 : 0xffff00) + "&]! ! ! INSUFFICIENT COOLING ! ! !");
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
addStandardInfo(stack, player, list, ext);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,16 +1,20 @@
|
||||
package com.hbm.blocks.machine.fusion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.fusion.TileEntityFusionTorus;
|
||||
|
||||
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.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineFusionTorus extends BlockDummyable {
|
||||
public class MachineFusionTorus extends BlockDummyable implements ITooltipProvider {
|
||||
|
||||
public static final int[][][] layout = new int[][][] {
|
||||
|
||||
@ -193,4 +197,9 @@ public class MachineFusionTorus extends BlockDummyable {
|
||||
this.makeExtra(world, x - 2, y, z - 6);
|
||||
this.makeExtra(world, x - 2, y + 4, z - 6);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
addStandardInfo(stack, player, list, ext);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,14 +1,16 @@
|
||||
package com.hbm.handler.nei;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.machine.fusion.MachineFusionTorus;
|
||||
import com.hbm.inventory.material.Mats;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.util.ItemStackUtil;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
public class ConstructionHandler extends NEIUniversalHandler {
|
||||
|
||||
@ -54,9 +56,9 @@ public class ConstructionHandler extends NEIUniversalHandler {
|
||||
/* ITER */
|
||||
ItemStack[] iter = new ItemStack[] {
|
||||
new ItemStack(ModBlocks.fusion_conductor, 36),
|
||||
ItemStackUtil.addTooltipToStack(new ItemStack(ModBlocks.fusion_conductor, 256), EnumChatFormatting.RED + "4x64"),
|
||||
ItemStackUtil.addStackSizeLabel(new ItemStack(ModBlocks.fusion_conductor, 256)),
|
||||
new ItemStack(ModItems.plate_cast, 36, Mats.MAT_STEEL.id),
|
||||
ItemStackUtil.addTooltipToStack(new ItemStack(ModItems.plate_cast, 256, Mats.MAT_STEEL.id), EnumChatFormatting.RED + "4x64"),
|
||||
ItemStackUtil.addStackSizeLabel(new ItemStack(ModItems.plate_cast, 256, Mats.MAT_STEEL.id)),
|
||||
new ItemStack(ModBlocks.fusion_center, 64),
|
||||
new ItemStack(ModBlocks.fusion_motor, 4),
|
||||
new ItemStack(ModBlocks.reinforced_glass, 8),
|
||||
@ -92,11 +94,11 @@ public class ConstructionHandler extends NEIUniversalHandler {
|
||||
/* SOYUZ LAUNCHER */
|
||||
ItemStack[] soysauce = new ItemStack[] {
|
||||
new ItemStack(ModBlocks.struct_launcher, 30),
|
||||
ItemStackUtil.addTooltipToStack(new ItemStack(ModBlocks.struct_launcher, 384), EnumChatFormatting.RED + "6x64"),
|
||||
ItemStackUtil.addStackSizeLabel(new ItemStack(ModBlocks.struct_launcher, 384)),
|
||||
new ItemStack(ModBlocks.struct_scaffold, 63),
|
||||
ItemStackUtil.addTooltipToStack(new ItemStack(ModBlocks.struct_scaffold, 384), EnumChatFormatting.RED + "6x64"),
|
||||
ItemStackUtil.addStackSizeLabel(new ItemStack(ModBlocks.struct_scaffold, 384)),
|
||||
new ItemStack(ModBlocks.concrete_smooth, 38),
|
||||
ItemStackUtil.addTooltipToStack(new ItemStack(ModBlocks.concrete_smooth, 320), EnumChatFormatting.RED + "5x64"),};
|
||||
ItemStackUtil.addStackSizeLabel(new ItemStack(ModBlocks.concrete_smooth, 320))};
|
||||
|
||||
bufferedRecipes.put(soysauce, new ItemStack(ModBlocks.soyuz_launcher));
|
||||
bufferedTools.put(soysauce, new ItemStack(ModBlocks.struct_soyuz_core));
|
||||
@ -104,17 +106,44 @@ public class ConstructionHandler extends NEIUniversalHandler {
|
||||
/* ICF */
|
||||
ItemStack[] icf = new ItemStack[] {
|
||||
new ItemStack(ModBlocks.icf_component, 50, 0),
|
||||
ItemStackUtil.addTooltipToStack(new ItemStack(ModBlocks.icf_component, 240, 3), EnumChatFormatting.RED + "3x64 + 48"),
|
||||
ItemStackUtil.addTooltipToStack(Mats.MAT_DURA.make(ModItems.bolt, 960), EnumChatFormatting.RED + "15x64"),
|
||||
ItemStackUtil.addTooltipToStack(Mats.MAT_STEEL.make(ModItems.plate_cast, 240), EnumChatFormatting.RED + "3x64 + 48"),
|
||||
ItemStackUtil.addTooltipToStack(new ItemStack(ModBlocks.icf_component, 117, 1), EnumChatFormatting.RED + "64 + 53"),
|
||||
ItemStackUtil.addTooltipToStack(Mats.MAT_BBRONZE.make(ModItems.plate_cast, 117), EnumChatFormatting.RED + "64 + 53"),
|
||||
ItemStackUtil.addStackSizeLabel(new ItemStack(ModBlocks.icf_component, 240, 3)),
|
||||
ItemStackUtil.addStackSizeLabel(Mats.MAT_DURA.make(ModItems.bolt, 960)),
|
||||
ItemStackUtil.addStackSizeLabel(Mats.MAT_STEEL.make(ModItems.plate_cast, 240)),
|
||||
ItemStackUtil.addStackSizeLabel(new ItemStack(ModBlocks.icf_component, 117, 1)),
|
||||
ItemStackUtil.addStackSizeLabel(Mats.MAT_BBRONZE.make(ModItems.plate_cast, 117)),
|
||||
new ItemStack(ModItems.blowtorch),
|
||||
new ItemStack(ModItems.boltgun) };
|
||||
|
||||
bufferedRecipes.put(icf, new ItemStack(ModBlocks.icf));
|
||||
bufferedTools.put(icf, new ItemStack(ModBlocks.struct_icf_core));
|
||||
|
||||
/* FUSION TORUS */
|
||||
int wallCount = 0;
|
||||
int blanketCount = 0;
|
||||
int pipeCount = -1; // one block is replaced by the core
|
||||
|
||||
for(int iy = 0; iy < 5; iy++) {
|
||||
int l = iy > 2 ? 4 - iy : iy;
|
||||
int[][] layer = MachineFusionTorus.layout[l];
|
||||
for(int ix = 0; ix < layer.length; ix++) for(int iz = 0; iz < layer.length; iz++) {
|
||||
int meta = layer[ix][iz];
|
||||
if(meta == 1) wallCount++;
|
||||
if(meta == 2) blanketCount++;
|
||||
if(meta == 3) pipeCount++;
|
||||
}
|
||||
}
|
||||
|
||||
List<ItemStack> torusItems = new ArrayList();
|
||||
while(wallCount > 0) { int a = Math.min(wallCount, 256); torusItems.add(new ItemStack(ModBlocks.fusion_component, a, 1)); wallCount -= a; }
|
||||
while(blanketCount > 0) { int a = Math.min(blanketCount, 256); torusItems.add(new ItemStack(ModBlocks.fusion_component, a, 2)); blanketCount -= a; }
|
||||
while(pipeCount > 0) { int a = Math.min(pipeCount, 256); torusItems.add(new ItemStack(ModBlocks.fusion_component, a, 3)); pipeCount -= a; }
|
||||
torusItems.add(new ItemStack(ModItems.blowtorch));
|
||||
for(ItemStack stack : torusItems) ItemStackUtil.addStackSizeLabel(stack);
|
||||
ItemStack[] torus = torusItems.toArray(new ItemStack[0]);
|
||||
|
||||
bufferedRecipes.put(torus, new ItemStack(ModBlocks.fusion_torus));
|
||||
bufferedTools.put(torus, new ItemStack(ModBlocks.struct_torus_core));
|
||||
|
||||
return recipes ? bufferedRecipes : bufferedTools;
|
||||
}
|
||||
}
|
||||
|
||||
16
src/main/java/com/hbm/handler/nei/FusionBreederHandler.java
Normal file
16
src/main/java/com/hbm/handler/nei/FusionBreederHandler.java
Normal file
@ -0,0 +1,16 @@
|
||||
package com.hbm.handler.nei;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.recipes.FluidBreederRecipes;
|
||||
|
||||
public class FusionBreederHandler extends NEIUniversalHandler {
|
||||
|
||||
public FusionBreederHandler() {
|
||||
super(ModBlocks.fusion_breeder.getLocalizedName(), ModBlocks.fusion_breeder, FluidBreederRecipes.getRecipes());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return "ntmFluidBreeder";
|
||||
}
|
||||
}
|
||||
@ -210,7 +210,13 @@ public abstract class NEIUniversalHandler extends TemplateRecipeHandler implemen
|
||||
};
|
||||
}
|
||||
|
||||
return new int[count][2];
|
||||
int[][] slots = new int[count][2];
|
||||
|
||||
for(int i = 0; i < count; i++) {
|
||||
slots[i] = new int[] {i % 4 * 18, i / 4 * 18};
|
||||
}
|
||||
|
||||
return slots;
|
||||
}
|
||||
|
||||
public static int[][] getOutputCoords(int count) {
|
||||
@ -258,7 +264,13 @@ public abstract class NEIUniversalHandler extends TemplateRecipeHandler implemen
|
||||
};
|
||||
}
|
||||
|
||||
return new int[count][2];
|
||||
int[][] slots = new int[count][2];
|
||||
|
||||
for(int i = 0; i < count; i++) {
|
||||
slots[i] = new int[] {i % 4 * 18, i / 4 * 18};
|
||||
}
|
||||
|
||||
return slots;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -6,10 +6,12 @@ import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.gui.GUIRBMKOutgasser;
|
||||
import com.hbm.inventory.recipes.OutgasserRecipes;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class OutgasserHandler extends NEIUniversalHandler {
|
||||
|
||||
public OutgasserHandler() {
|
||||
super(ModBlocks.rbmk_outgasser.getLocalizedName(), ModBlocks.rbmk_outgasser, OutgasserRecipes.getRecipes());
|
||||
super(ModBlocks.rbmk_outgasser.getLocalizedName(), new ItemStack[] {new ItemStack(ModBlocks.rbmk_outgasser), new ItemStack(ModBlocks.fusion_breeder)}, OutgasserRecipes.getRecipes());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -0,0 +1,72 @@
|
||||
package com.hbm.inventory.recipes;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.recipes.loader.SerializableRecipe;
|
||||
import com.hbm.items.machine.ItemFluidIcon;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
|
||||
// i'm gonna be honest, i got so carried away with the new fusion reactor stuff that i forgot what fluid irradiation was even supposed to be for
|
||||
public class FluidBreederRecipes extends SerializableRecipe {
|
||||
|
||||
public static Map<FluidType, Pair<Integer, FluidStack>> recipes = new HashMap();
|
||||
|
||||
@Override
|
||||
public void registerDefaults() {
|
||||
|
||||
register(new FluidStack(Fluids.GAS, 1_000), new FluidStack(Fluids.SYNGAS, 1_000));
|
||||
register(new FluidStack(Fluids.LIGHTOIL, 1_000), new FluidStack(Fluids.REFORMGAS, 1_000));
|
||||
register(new FluidStack(Fluids.LIGHTOIL_CRACK, 1_000), new FluidStack(Fluids.REFORMGAS, 1_000));
|
||||
}
|
||||
|
||||
public static void register(FluidStack input, FluidStack output) {
|
||||
recipes.put(input.type, new Pair(input.fill, output));
|
||||
}
|
||||
|
||||
public static Pair<Integer, FluidStack> getOutput(FluidType type) {
|
||||
return recipes.get(type);
|
||||
}
|
||||
|
||||
public static HashMap getRecipes() {
|
||||
|
||||
HashMap<Object, Object> recipes = new HashMap<Object, Object>();
|
||||
|
||||
for(Entry<FluidType, Pair<Integer, FluidStack>> entry : FluidBreederRecipes.recipes.entrySet()) {
|
||||
recipes.put(ItemFluidIcon.make(entry.getKey(), entry.getValue().getKey()), ItemFluidIcon.make(entry.getValue().getValue()));
|
||||
}
|
||||
|
||||
return recipes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readRecipe(JsonElement recipe) {
|
||||
JsonObject obj = (JsonObject) recipe;
|
||||
|
||||
FluidStack input = this.readFluidStack(obj.get("input").getAsJsonArray());
|
||||
FluidStack output = this.readFluidStack(obj.get("output").getAsJsonArray());
|
||||
this.recipes.put(input.type, new Pair(input.fill, output));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeRecipe(Object recipe, JsonWriter writer) throws IOException {
|
||||
Entry<FluidType, Pair<Integer, FluidStack>> rec = (Entry<FluidType, Pair<Integer, FluidStack>>) recipe;
|
||||
|
||||
writer.name("input");
|
||||
this.writeFluidStack(new FluidStack(rec.getKey(), rec.getValue().getKey()), writer);
|
||||
writer.name("output");
|
||||
this.writeFluidStack(rec.getValue().getValue(), writer);
|
||||
}
|
||||
|
||||
@Override public String getFileName() { return "hbmIrradiationFluids.json"; }
|
||||
@Override public Object getRecipeObject() { return recipes; }
|
||||
@Override public void deleteRecipes() { recipes.clear(); }
|
||||
}
|
||||
@ -73,6 +73,7 @@ public abstract class SerializableRecipe {
|
||||
recipeHandlers.add(new FuelPoolRecipes());
|
||||
recipeHandlers.add(new MixerRecipes());
|
||||
recipeHandlers.add(new OutgasserRecipes());
|
||||
recipeHandlers.add(new FluidBreederRecipes());
|
||||
recipeHandlers.add(new CompressorRecipes());
|
||||
recipeHandlers.add(new ElectrolyserFluidRecipes());
|
||||
recipeHandlers.add(new ElectrolyserMetalRecipes());
|
||||
|
||||
@ -63,6 +63,7 @@ public class NEIRegistry {
|
||||
handlers.add(new SawmillHandler());
|
||||
handlers.add(new MixerHandler());
|
||||
handlers.add(new OutgasserHandler());
|
||||
handlers.add(new FusionBreederHandler());
|
||||
handlers.add(new ElectrolyserFluidHandler());
|
||||
handlers.add(new ElectrolyserMetalHandler());
|
||||
handlers.add(new AshpitHandler());
|
||||
|
||||
@ -6,6 +6,7 @@ import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.item.ItemRenderBase;
|
||||
import com.hbm.tileentity.machine.fusion.TileEntityFusionMHDT;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.Item;
|
||||
@ -32,8 +33,10 @@ public class RenderFusionMHDT extends TileEntitySpecialRenderer implements IItem
|
||||
bindTexture(ResourceManager.fusion_mhdt_tex);
|
||||
ResourceManager.fusion_mhdt.renderPart("Turbine");
|
||||
|
||||
TileEntityFusionMHDT turbine = (TileEntityFusionMHDT) tile;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
double rot = (System.currentTimeMillis() / 10) % 30D;
|
||||
float rot = (turbine.prevRotor + (turbine.rotor - turbine.prevRotor) * interp) % 30;
|
||||
rot -= 15;
|
||||
GL11.glTranslated(0, 1.5, 0);
|
||||
GL11.glRotated(rot, 1, 0, 0);
|
||||
@ -64,7 +67,7 @@ public class RenderFusionMHDT extends TileEntitySpecialRenderer implements IItem
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.fusion_mhdt_tex);
|
||||
ResourceManager.fusion_mhdt.renderPart("Turbine");
|
||||
double rot = (System.currentTimeMillis() / 10) % 30D;
|
||||
double rot = (System.currentTimeMillis() / 5) % 30D;
|
||||
rot -= 15;
|
||||
GL11.glTranslated(0, 1.5, 0);
|
||||
GL11.glRotated(rot, 1, 0, 0);
|
||||
|
||||
@ -1,11 +1,146 @@
|
||||
package com.hbm.tileentity.machine.fusion;
|
||||
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.fluid.trait.FT_Heatable;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.uninos.GenNode;
|
||||
import com.hbm.uninos.UniNodespace;
|
||||
import com.hbm.uninos.networkproviders.PlasmaNetworkProvider;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.fluidmk2.IFluidStandardTransceiverMK2;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityFusionBoiler extends TileEntity {
|
||||
public class TileEntityFusionBoiler extends TileEntityLoadedBase implements IFluidStandardTransceiverMK2, IFusionPowerReceiver {
|
||||
|
||||
protected GenNode plasmaNode;
|
||||
|
||||
public long plasmaEnergy;
|
||||
public long plasmaEnergySync;
|
||||
public FluidTank[] tanks;
|
||||
|
||||
public TileEntityFusionBoiler() {
|
||||
this.tanks = new FluidTank[2];
|
||||
this.tanks[0] = new FluidTank(Fluids.WATER, 32_000);
|
||||
this.tanks[1] = new FluidTank(Fluids.SUPERHOTSTEAM, 32_000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
this.plasmaEnergySync = this.plasmaEnergy;
|
||||
this.plasmaEnergy = 0;
|
||||
|
||||
for(DirPos pos : getConPos()) {
|
||||
if(tanks[0].getTankType() != Fluids.NONE) this.trySubscribe(tanks[0].getTankType(), worldObj, pos);
|
||||
if(tanks[1].getFill() > 0) this.tryProvide(tanks[1], worldObj, pos);
|
||||
}
|
||||
|
||||
if(plasmaNode == null || plasmaNode.expired) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10).getOpposite();
|
||||
plasmaNode = UniNodespace.getNode(worldObj, xCoord + dir.offsetX * 4, yCoord + 2, zCoord + dir.offsetZ * 4, PlasmaNetworkProvider.THE_PROVIDER);
|
||||
|
||||
if(plasmaNode == null) {
|
||||
plasmaNode = new GenNode(PlasmaNetworkProvider.THE_PROVIDER,
|
||||
new BlockPos(xCoord + dir.offsetX * 4, yCoord + 2, zCoord + dir.offsetZ * 4))
|
||||
.setConnections(new DirPos(xCoord + dir.offsetX * 5, yCoord + 2, zCoord + dir.offsetZ * 5, dir));
|
||||
|
||||
UniNodespace.createNode(worldObj, plasmaNode);
|
||||
}
|
||||
}
|
||||
|
||||
if(plasmaNode != null && plasmaNode.hasValidNet()) plasmaNode.net.addReceiver(this);
|
||||
|
||||
this.networkPackNT(50);
|
||||
}
|
||||
}
|
||||
|
||||
public DirPos[] getConPos() {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10);
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
return new DirPos[] {
|
||||
//new DirPos(xCoord + dir.offsetX * 5, yCoord + 2, zCoord + dir.offsetZ * 5, dir),
|
||||
new DirPos(xCoord - dir.offsetX * 1 + rot.offsetX * 3, yCoord, zCoord - dir.offsetZ * 1 + rot.offsetZ * 3, rot),
|
||||
new DirPos(xCoord - dir.offsetX * 1 - rot.offsetX * 3, yCoord, zCoord - dir.offsetZ * 1 - rot.offsetZ * 3, rot.getOpposite()),
|
||||
new DirPos(xCoord + dir.offsetX * 2 + rot.offsetX * 3, yCoord, zCoord + dir.offsetZ * 2 + rot.offsetZ * 3, rot),
|
||||
new DirPos(xCoord + dir.offsetX * 2 - rot.offsetX * 3, yCoord, zCoord + dir.offsetZ * 2 - rot.offsetZ * 3, rot.getOpposite())
|
||||
};
|
||||
}
|
||||
|
||||
@Override public boolean receivesFusionPower() { return true; }
|
||||
|
||||
@Override
|
||||
public void receiveFusionPower(long fusionPower, double neutronPower) {
|
||||
this.plasmaEnergy = fusionPower;
|
||||
|
||||
int waterCycles = Math.min(tanks[0].getFill(), tanks[1].getMaxFill() - tanks[1].getFill());
|
||||
int steamCycles = (int) (Math.min(fusionPower / tanks[0].getTankType().getTrait(FT_Heatable.class).getFirstStep().heatReq, waterCycles));
|
||||
// the Math.min call was mushed into the steam cycles call instead of doing it afterwards as usual
|
||||
// in order to prevent issues when casting, should the fusion reactor output truly absurd amounts of power
|
||||
// due to the water cycles being effectively capped via the buffer size
|
||||
|
||||
if(steamCycles > 0) {
|
||||
tanks[0].setFill(tanks[0].getFill() - steamCycles);
|
||||
tanks[1].setFill(tanks[1].getFill() - steamCycles);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(ByteBuf buf) {
|
||||
super.serialize(buf);
|
||||
buf.writeLong(plasmaEnergySync);
|
||||
|
||||
this.tanks[0].serialize(buf);
|
||||
this.tanks[1].serialize(buf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deserialize(ByteBuf buf) {
|
||||
super.deserialize(buf);
|
||||
this.plasmaEnergy = buf.readLong();
|
||||
|
||||
this.tanks[0].deserialize(buf);
|
||||
this.tanks[1].deserialize(buf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
|
||||
this.tanks[0].readFromNBT(nbt, "t0");
|
||||
this.tanks[1].readFromNBT(nbt, "t1");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
|
||||
this.tanks[0].writeToNBT(nbt, "t0");
|
||||
this.tanks[1].writeToNBT(nbt, "t1");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
super.invalidate();
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
if(this.plasmaNode != null) UniNodespace.destroyNode(worldObj, plasmaNode);
|
||||
}
|
||||
}
|
||||
|
||||
@Override public FluidTank[] getAllTanks() { return tanks; }
|
||||
@Override public FluidTank[] getReceivingTanks() { return new FluidTank[] {tanks[0]}; }
|
||||
@Override public FluidTank[] getSendingTanks() { return new FluidTank[] {tanks[1]}; }
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ import com.hbm.inventory.container.ContainerFusionBreeder;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.gui.GUIFusionBreeder;
|
||||
import com.hbm.inventory.recipes.FluidBreederRecipes;
|
||||
import com.hbm.inventory.recipes.OutgasserRecipes;
|
||||
import com.hbm.items.machine.IItemFluidIdentifier;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
@ -57,7 +58,7 @@ public class TileEntityFusionBreeder extends TileEntityMachineBase implements IF
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
if(!canProcessSolid()) {
|
||||
if(!canProcessSolid() && !canProcessLiquid()) {
|
||||
this.progress = 0;
|
||||
}
|
||||
|
||||
@ -111,6 +112,21 @@ public class TileEntityFusionBreeder extends TileEntityMachineBase implements IF
|
||||
return slots[2].getItem() == out.getItem() && slots[2].getItemDamage() == out.getItemDamage() && slots[2].stackSize + out.stackSize <= slots[2].getMaxStackSize();
|
||||
}
|
||||
|
||||
public boolean canProcessLiquid() {
|
||||
|
||||
Pair<Integer, FluidStack> output = FluidBreederRecipes.getOutput(tanks[0].getTankType());
|
||||
if(output == null) return false;
|
||||
if(tanks[0].getFill() < output.getKey()) return false;
|
||||
|
||||
FluidStack fluid = output.getValue();
|
||||
|
||||
if(tanks[1].getTankType() != fluid.type && tanks[1].getFill() > 0) return false;
|
||||
tanks[1].setTankType(fluid.type);
|
||||
if(tanks[1].getFill() + fluid.fill > tanks[1].getMaxFill()) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void processSolid() {
|
||||
|
||||
Pair<ItemStack, FluidStack> output = OutgasserRecipes.getOutput(slots[1]);
|
||||
@ -131,6 +147,13 @@ public class TileEntityFusionBreeder extends TileEntityMachineBase implements IF
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void processLiquid() {
|
||||
|
||||
Pair<Integer, FluidStack> output = FluidBreederRecipes.getOutput(tanks[0].getTankType());
|
||||
tanks[0].setFill(tanks[0].getFill() - output.getKey());
|
||||
tanks[1].setFill(tanks[1].getFill() + output.getValue().fill);
|
||||
}
|
||||
|
||||
public void doProgress() {
|
||||
|
||||
@ -141,6 +164,15 @@ public class TileEntityFusionBreeder extends TileEntityMachineBase implements IF
|
||||
progress = 0;
|
||||
this.markDirty();
|
||||
}
|
||||
} else if(canProcessLiquid()) {
|
||||
this.progress += this.neutronEnergy;
|
||||
if(progress > capacity) {
|
||||
processLiquid();
|
||||
progress = 0;
|
||||
this.markDirty();
|
||||
}
|
||||
} else {
|
||||
progress = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -160,7 +192,7 @@ public class TileEntityFusionBreeder extends TileEntityMachineBase implements IF
|
||||
new DirPos(xCoord + rot.offsetX * 3, yCoord, zCoord + rot.offsetZ * 3, rot),
|
||||
new DirPos(xCoord - rot.offsetX * 3, yCoord, zCoord - rot.offsetZ * 3, rot.getOpposite()),
|
||||
new DirPos(xCoord + dir.offsetX + rot.offsetX * 3, yCoord, zCoord + dir.offsetX + rot.offsetZ * 3, rot),
|
||||
new DirPos(xCoord - dir.offsetX - rot.offsetX * 3, yCoord, zCoord - dir.offsetX - rot.offsetZ * 3, rot.getOpposite())
|
||||
new DirPos(xCoord + dir.offsetX - rot.offsetX * 3, yCoord, zCoord + dir.offsetX - rot.offsetZ * 3, rot.getOpposite())
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -123,6 +123,7 @@ public class TileEntityFusionKlystron extends TileEntityMachineBase implements I
|
||||
}
|
||||
|
||||
this.networkPackNT(100);
|
||||
|
||||
} else {
|
||||
|
||||
double mult = TileEntityFusionTorus.getSpeedScaled(outputTarget, output);
|
||||
|
||||
@ -1,11 +1,170 @@
|
||||
package com.hbm.tileentity.machine.fusion;
|
||||
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.uninos.GenNode;
|
||||
import com.hbm.uninos.UniNodespace;
|
||||
import com.hbm.uninos.networkproviders.PlasmaNetworkProvider;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.energymk2.IEnergyProviderMK2;
|
||||
import api.hbm.fluidmk2.IFluidStandardTransceiverMK2;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityFusionMHDT extends TileEntity {
|
||||
public class TileEntityFusionMHDT extends TileEntityLoadedBase implements IEnergyProviderMK2, IFluidStandardTransceiverMK2, IFusionPowerReceiver {
|
||||
|
||||
protected GenNode plasmaNode;
|
||||
|
||||
public long plasmaEnergy;
|
||||
public long plasmaEnergySync;
|
||||
public long power;
|
||||
|
||||
public float rotor;
|
||||
public float prevRotor;
|
||||
public float rotorSpeed;
|
||||
public static final float ROTOR_ACCELERATION = 0.125F;
|
||||
|
||||
public static final double PLASMA_EFFICIENCY = 1.35D;
|
||||
public static final int COOLANT_USE = 50;
|
||||
|
||||
public FluidTank[] tanks;
|
||||
|
||||
public TileEntityFusionMHDT() {
|
||||
this.tanks = new FluidTank[2];
|
||||
this.tanks[0] = new FluidTank(Fluids.PERFLUOROMETHYL_COLD, 4_000);
|
||||
this.tanks[1] = new FluidTank(Fluids.PERFLUOROMETHYL, 4_000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
this.plasmaEnergySync = this.plasmaEnergy;
|
||||
|
||||
if(isCool()) {
|
||||
this.power = (long) Math.floor(this.plasmaEnergy * PLASMA_EFFICIENCY);
|
||||
tanks[0].setFill(tanks[0].getFill() - COOLANT_USE);
|
||||
tanks[1].setFill(tanks[1].getFill() + COOLANT_USE);
|
||||
}
|
||||
|
||||
for(DirPos pos : getConPos()) {
|
||||
this.tryProvide(worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
if(tanks[0].getTankType() != Fluids.NONE) this.trySubscribe(tanks[0].getTankType(), worldObj, pos);
|
||||
if(tanks[1].getFill() > 0) this.tryProvide(tanks[1], worldObj, pos);
|
||||
}
|
||||
|
||||
if(plasmaNode == null || plasmaNode.expired) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10).getOpposite();
|
||||
plasmaNode = UniNodespace.getNode(worldObj, xCoord + dir.offsetX * 6, yCoord + 2, zCoord + dir.offsetZ * 6, PlasmaNetworkProvider.THE_PROVIDER);
|
||||
|
||||
if(plasmaNode == null) {
|
||||
plasmaNode = new GenNode(PlasmaNetworkProvider.THE_PROVIDER,
|
||||
new BlockPos(xCoord + dir.offsetX * 6, yCoord + 2, zCoord + dir.offsetZ * 6))
|
||||
.setConnections(new DirPos(xCoord + dir.offsetX * 7, yCoord + 2, zCoord + dir.offsetZ * 7, dir));
|
||||
|
||||
UniNodespace.createNode(worldObj, plasmaNode);
|
||||
}
|
||||
}
|
||||
|
||||
if(plasmaNode != null && plasmaNode.hasValidNet()) plasmaNode.net.addReceiver(this);
|
||||
|
||||
this.networkPackNT(150);
|
||||
this.plasmaEnergy = 0;
|
||||
|
||||
} else {
|
||||
|
||||
if(this.plasmaEnergy > 0 && isCool()) this.rotorSpeed += ROTOR_ACCELERATION;
|
||||
else this.rotorSpeed -= ROTOR_ACCELERATION;
|
||||
|
||||
this.rotorSpeed = MathHelper.clamp_float(this.rotorSpeed, 0F, 15F);
|
||||
|
||||
this.prevRotor = this.rotor;
|
||||
this.rotor += this.rotorSpeed;
|
||||
|
||||
if(this.rotor >= 360F) {
|
||||
this.rotor -= 360F;
|
||||
this.prevRotor -= 360F;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isCool() {
|
||||
return tanks[0].getFill() >= COOLANT_USE && tanks[1].getFill() + COOLANT_USE <= tanks[1].getMaxFill();
|
||||
}
|
||||
|
||||
public DirPos[] getConPos() {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10);
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
return new DirPos[] {
|
||||
new DirPos(xCoord + dir.offsetX * 4 + rot.offsetX * 4, yCoord, zCoord + dir.offsetZ * 4 + rot.offsetZ * 4, rot),
|
||||
new DirPos(xCoord + dir.offsetX * 4 - rot.offsetX * 4, yCoord, zCoord + dir.offsetZ * 4 - rot.offsetZ * 4, rot.getOpposite()),
|
||||
new DirPos(xCoord + dir.offsetX * 8, yCoord + 1, zCoord + dir.offsetZ * 8, dir)
|
||||
};
|
||||
}
|
||||
|
||||
@Override public boolean receivesFusionPower() { return true; }
|
||||
@Override public void receiveFusionPower(long fusionPower, double neutronPower) { this.plasmaEnergy = fusionPower; }
|
||||
|
||||
@Override
|
||||
public void serialize(ByteBuf buf) {
|
||||
super.serialize(buf);
|
||||
buf.writeLong(plasmaEnergySync);
|
||||
|
||||
this.tanks[0].serialize(buf);
|
||||
this.tanks[1].serialize(buf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deserialize(ByteBuf buf) {
|
||||
super.deserialize(buf);
|
||||
this.plasmaEnergy = buf.readLong();
|
||||
|
||||
this.tanks[0].deserialize(buf);
|
||||
this.tanks[1].deserialize(buf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
|
||||
this.tanks[0].readFromNBT(nbt, "t0");
|
||||
this.tanks[1].readFromNBT(nbt, "t1");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
|
||||
this.tanks[0].writeToNBT(nbt, "t0");
|
||||
this.tanks[1].writeToNBT(nbt, "t1");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
super.invalidate();
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
if(this.plasmaNode != null) UniNodespace.destroyNode(worldObj, plasmaNode);
|
||||
}
|
||||
}
|
||||
|
||||
@Override public long getPower() { return power; }
|
||||
@Override public void setPower(long power) { this.power = power; }
|
||||
@Override public long getMaxPower() { return power; }
|
||||
|
||||
@Override public FluidTank[] getAllTanks() { return tanks; }
|
||||
@Override public FluidTank[] getReceivingTanks() { return new FluidTank[] {tanks[0]}; }
|
||||
@Override public FluidTank[] getSendingTanks() { return new FluidTank[] {tanks[1]}; }
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
|
||||
@ -187,6 +187,9 @@ public class BobMathUtil {
|
||||
public static String format(int amount) {
|
||||
return String.format(Locale.US, "%,d", amount);
|
||||
}
|
||||
public static String format(long amount) {
|
||||
return String.format(Locale.US, "%,d", amount);
|
||||
}
|
||||
|
||||
public static boolean getBlink() {
|
||||
return System.currentTimeMillis() % 1000 < 500;
|
||||
|
||||
@ -107,6 +107,22 @@ public class ItemStackUtil {
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
/**
|
||||
* Automatically adds multistack labels for displays that use a ton of items (like construction recipe handlers).
|
||||
* @param stack
|
||||
* @return
|
||||
*/
|
||||
public static ItemStack addStackSizeLabel(ItemStack stack) {
|
||||
|
||||
if(stack.stackSize > 64) {
|
||||
int stacks = stack.stackSize / 64;
|
||||
int items = stack.stackSize % 64;
|
||||
addTooltipToStack(stack, EnumChatFormatting.RED + "" + stacks + "x64" + (items > 0 ? (" + " + items) : ""));
|
||||
}
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
public static void addStacksToNBT(ItemStack stack, ItemStack... stacks) {
|
||||
|
||||
|
||||
@ -366,7 +366,10 @@ container.furnaceBrick=Ziegelofen
|
||||
container.furnaceCombination=Kombinationsofen
|
||||
container.furnaceIron=Eiserner Ofen
|
||||
container.furnaceSteel=Stahlofen
|
||||
container.fusionBreeder=Brutkammer
|
||||
container.fusionKlystron=Klystron
|
||||
container.fusionMultiblock=Großer Fusionsreaktor
|
||||
container.fusionTorus=Fusionsreaktor-Plasmagefäß
|
||||
container.fusionaryWatzPlant=Fusionares Watzwerk
|
||||
container.gasCentrifuge=Gaszentrifuge
|
||||
container.gasFlare=Abfackelturm
|
||||
@ -4281,13 +4284,25 @@ tile.furnace_iron.name=Eiserner Ofen
|
||||
tile.furnace_iron.desc=Größerer und effizienterer Ofen,$verschwended keinen Brennstoff im Leerlauf.
|
||||
tile.furnace_steel.name=Stahlofen
|
||||
tile.furnace_steel.desc=Sehr großer Ofen mit Produktionsboni.$Benötigt externe Hitzequelle.$Wärmetransferrate: ΔT*0.05 TU/t$(Δ heißt Differenz, T heißt Temparatur)
|
||||
tile.fusion_boiler.name=Fusionsreaktor-Boiler
|
||||
tile.fusion_boiler.desc=Nutzt Plasmaenergie aus einem Fusionsreaktor$um Wasser zu superverdichtetem Dampf zu machen.
|
||||
tile.fusion_breeder.name=Fusionsreaktor-Brutkammer
|
||||
tile.fusion_breeder.desc=Verwendet Neutronenflux von einem$Fusionsreaktor um Materialien zu verarbeiten.$Nützlich für Tritiumbrennstoff.
|
||||
tile.fusion_center.name=Zentralmagnetstück
|
||||
tile.fusion_collector.name=Fusionsreaktor-Kollektor
|
||||
tile.fusion_collector.desc=Erhöht Nebenprodukt-Produktion$von einem Fusionsreaktor.
|
||||
tile.fusion_conductor.name=Supraleiter-Magnet
|
||||
tile.fusion_conductor_welded.name=Supraleiter-Magnet (Verschweißt)
|
||||
tile.fusion_core.name=Fusionsreaktorsteuerung
|
||||
tile.fusion_hatch.name=Fusionsreaktorzugriffsluke
|
||||
tile.fusion_heater.name=Plasmaerhitzer-Komponente
|
||||
tile.fusion_klystron.name=Klystron
|
||||
tile.fusion_klystron.desc=Energiequelle für einen Fusionsreaktor.$Benötigt Kühlung mittles Druckluft.
|
||||
tile.fusion_mhdt.name=MHD-Turbine
|
||||
tile.fusion_mhdt.desc=Wandelt Plasmaenergie in verwendbare$elektrische Energie um. Effizienter als ein$konventioneller Boiler.$Benötigt Kühlung!
|
||||
tile.fusion_motor.name=Magnetmotorstück
|
||||
tile.fusion_torus.name=Fusionsreaktor-Plasmagefäß
|
||||
tile.fusion_torus.desc=Hauptkomponente des Reaktors.$Benötigt Energie von einem Klystron zur Zündung,$erzeugt Plasmaenergie und Neutronenflux.$Benötigt Kühlung!
|
||||
tile.fwatz_computer.name=Watzwerkrechenmatrix
|
||||
tile.fwatz_conductor.name=4000K Supraleiter-Magnet
|
||||
tile.fwatz_cooler.name=Kühlmitteltankhülle
|
||||
|
||||
@ -772,8 +772,10 @@ container.furnaceBrick=Bricked Furnace
|
||||
container.furnaceCombination=Combination Oven
|
||||
container.furnaceIron=Iron Furnace
|
||||
container.furnaceSteel=Steel Furnace
|
||||
container.fusionBreeder=Fusion Reactor Breeder
|
||||
container.fusionKlystron=Klystron
|
||||
container.fusionMultiblock=Big Fusion Reactor
|
||||
container.fusionaryWatzPlant=Fusionary Watz Plant
|
||||
container.fusionTorus=Fusion Reactor Vessel
|
||||
container.gasCentrifuge=Gas Centrifuge
|
||||
container.gasFlare=Flare Stack
|
||||
container.generator=Nuclear Reactor
|
||||
@ -5537,13 +5539,25 @@ tile.furnace_iron.name=Iron Furnace
|
||||
tile.furnace_iron.desc=Larger and more efficient furnace,$does not waste fuel when idle.
|
||||
tile.furnace_steel.name=Steel Furnace
|
||||
tile.furnace_steel.desc=Very large furnace that can provide bonus items$when smelting ores. Requires external heat source.$Heat transfer rate: ΔT*0.05 TU/t$(Δ means difference and T means temperature)
|
||||
tile.fusion_boiler.name=Fusion Reactor Boiler
|
||||
tile.fusion_boiler.desc=Uses plasma energy from a fusion reactor$to boil water into super dense steam.
|
||||
tile.fusion_breeder.name=Fusion Reactor Breeding Chamber
|
||||
tile.fusion_breeder.desc=Uses output neutron flux from$a fusion reactor to process materials.$Useful for making tritium fuel.
|
||||
tile.fusion_center.name=Central Magnet Piece
|
||||
tile.fusion_collector.name=Fusion Reactor Collector Chamber
|
||||
tile.fusion_collector.desc=Can be connected to the main vessel$to increase byproduct yield.
|
||||
tile.fusion_conductor.name=Superconducting Magnet
|
||||
tile.fusion_conductor_welded.name=Superconducting Magnet (Welded)
|
||||
tile.fusion_core.name=Fusion Reactor Control
|
||||
tile.fusion_hatch.name=Duct Deco Block
|
||||
tile.fusion_heater.name=Plasma Heater Component
|
||||
tile.fusion_klystron.name=Klystron
|
||||
tile.fusion_klystron.desc=Power source for fusion reactors.$Requires cooling via compressed air.
|
||||
tile.fusion_mhdt.name=MHD Turbine
|
||||
tile.fusion_mhdt.desc=Turns plasma energy into usable$electricity directly. More efficient$than a conventional boiler.$Requires cooling!
|
||||
tile.fusion_motor.name=Magnet Motor Piece
|
||||
tile.fusion_torus.name=Fusion Reactor Vessel
|
||||
tile.fusion_torus.desc=Fusion reactor main component.$Requires klystron input energy to ignite plasma,$produces plasma energy and neutron flux.$Requires cooling!
|
||||
tile.fwatz_computer.name=Fusionary Watz Reactor Calculation Matrix
|
||||
tile.fwatz_conductor.name=4000K Superconducting Magnet
|
||||
tile.fwatz_cooler.name=Regenerative Coolant Fluid Tank Shell
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.6 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 16 KiB |
Loading…
x
Reference in New Issue
Block a user