mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
breeding reactor funnies
This commit is contained in:
parent
f4650eeb45
commit
e0fb379b53
@ -614,9 +614,8 @@ public class ModBlocks {
|
||||
public static Block machine_puf6_tank;
|
||||
public static final int guiID_puf6_tank = 8;
|
||||
|
||||
public static Block machine_reactor;
|
||||
public static Block machine_reactor_on;
|
||||
public static final int guiID_reactor = 9;
|
||||
public static Block machine_reactor_breeding;
|
||||
public static final int guiID_reactor_breeding = 9;
|
||||
|
||||
public static Block machine_nuke_furnace_off;
|
||||
public static Block machine_nuke_furnace_on;
|
||||
@ -973,9 +972,9 @@ public class ModBlocks {
|
||||
public static Block machine_armor_table;
|
||||
public static final int guiID_armor_table = 102;
|
||||
|
||||
public static Block machine_reactor_small;
|
||||
public static final int guiID_reactor_small = 65;
|
||||
public static Block reactor_zirnox;
|
||||
public static Block reactor_research;
|
||||
public static final int guiID_reactor_research = 65;
|
||||
public static Block machine_zirnox;
|
||||
public static final int guiID_reactor_zirnox = 124;
|
||||
public static Block zirnox_destroyed;
|
||||
|
||||
@ -1182,8 +1181,6 @@ public class ModBlocks {
|
||||
public static Block dummy_port_ams_base;
|
||||
public static Block dummy_block_radgen;
|
||||
public static Block dummy_port_radgen;
|
||||
public static Block dummy_block_reactor_small;
|
||||
public static Block dummy_port_reactor_small;
|
||||
public static Block dummy_block_vault;
|
||||
public static Block dummy_block_blast;
|
||||
public static Block dummy_block_uf6;
|
||||
@ -1710,8 +1707,7 @@ public class ModBlocks {
|
||||
|
||||
machine_puf6_tank = new MachinePuF6Tank(Material.iron).setBlockName("machine_puf6_tank").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
|
||||
machine_reactor = new MachineReactor(Material.iron).setBlockName("machine_reactor").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_reactor");
|
||||
machine_reactor_on = new MachineReactor(Material.iron).setBlockName("machine_reactor_on").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":machine_reactor_on");
|
||||
machine_reactor_breeding = new MachineReactorBreeding(Material.iron).setBlockName("machine_reactor_breeding").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_reactor");
|
||||
|
||||
machine_nuke_furnace_off = new MachineNukeFurnace(false).setBlockName("machine_nuke_furnace_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_nuke_furnace_on = new MachineNukeFurnace(true).setBlockName("machine_nuke_furnace_on").setHardness(5.0F).setLightLevel(1.0F).setResistance(10.0F);
|
||||
@ -2041,8 +2037,8 @@ public class ModBlocks {
|
||||
machine_press = new MachinePress(Material.iron).setBlockName("machine_press").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_press");
|
||||
machine_epress = new MachineEPress(Material.iron).setBlockName("machine_epress").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_epress");
|
||||
machine_selenium = new MachineSeleniumEngine(Material.iron).setBlockName("machine_selenium").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_selenium");
|
||||
machine_reactor_small = new MachineReactorSmall(Material.iron).setBlockName("machine_reactor_small").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_reactor_small");
|
||||
reactor_zirnox = new ReactorZirnox(Material.iron).setBlockName("machine_zirnox").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
reactor_research = new ReactorResearch(Material.iron).setBlockName("reactor_research").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_reactor_small");
|
||||
machine_zirnox = new ReactorZirnox(Material.iron).setBlockName("machine_zirnox").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
zirnox_destroyed = new ZirnoxDestroyed(Material.iron).setBlockName("zirnox_destroyed").setHardness(100.0F).setResistance(800.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_controller = new MachineReactorControl(Material.iron).setBlockName("machine_controller").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
|
||||
@ -2184,8 +2180,6 @@ public class ModBlocks {
|
||||
dummy_port_ams_base = new DummyBlockAMSBase(Material.iron).setBlockName("dummy_port_ams_base").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_copper");
|
||||
dummy_block_radgen = new DummyBlockRadGen(Material.iron).setBlockName("dummy_block_radgen").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_port_radgen = new DummyBlockRadGen(Material.iron).setBlockName("dummy_port_radgen").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_block_reactor_small = new DummyBlockMachine(Material.iron, guiID_reactor_small, machine_reactor_small, false).setBlockName("dummy_block_reactor_small").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_port_reactor_small = new DummyBlockMachine(Material.iron, guiID_reactor_small, machine_reactor_small, false).setBlockName("dummy_port_reactor_small").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_block_vault = new DummyBlockVault(Material.iron).setBlockName("dummy_block_vault").setHardness(10.0F).setResistance(10000.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_block_blast = new DummyBlockBlast(Material.iron).setBlockName("dummy_block_blast").setHardness(10.0F).setResistance(10000.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
dummy_block_uf6 = new DummyBlockMachine(Material.iron, guiID_uf6_tank, machine_uf6_tank, false).setBlockName("dummy_block_uf6").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_titanium");
|
||||
@ -2795,8 +2789,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(machine_crystallizer, machine_crystallizer.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_uf6_tank, machine_uf6_tank.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_puf6_tank, machine_puf6_tank.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_reactor, machine_reactor.getUnlocalizedName());
|
||||
//GameRegistry.registerBlock(machine_reactor_on, machine_reactor_on.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_reactor_breeding, machine_reactor_breeding.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_nuke_furnace_off, machine_nuke_furnace_off.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_nuke_furnace_on, machine_nuke_furnace_on.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_rtg_furnace_off, machine_rtg_furnace_off.getUnlocalizedName());
|
||||
@ -2807,8 +2800,8 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(machine_selenium, machine_selenium.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_generator, machine_generator.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_controller, machine_controller.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_reactor_small, machine_reactor_small.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(reactor_zirnox, reactor_zirnox.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(reactor_research, reactor_research.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_zirnox, machine_zirnox.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(zirnox_destroyed, zirnox_destroyed.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_industrial_generator, machine_industrial_generator.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_radgen, machine_radgen.getUnlocalizedName());
|
||||
@ -3147,8 +3140,6 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(dummy_port_ams_base, dummy_port_ams_base.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dummy_block_radgen, dummy_block_radgen.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dummy_port_radgen, dummy_port_radgen.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dummy_block_reactor_small, dummy_block_reactor_small.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dummy_port_reactor_small, dummy_port_reactor_small.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dummy_block_vault, dummy_block_vault.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dummy_block_blast, dummy_block_blast.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dummy_block_uf6, dummy_block_uf6.getUnlocalizedName());
|
||||
|
||||
@ -135,7 +135,7 @@ public class BlockCrate extends BlockFalling {
|
||||
//Metal Crate
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_press), 10);
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_difurnace_off), 9);
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_reactor), 6);
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_reactor_breeding), 6);
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_nuke_furnace_off), 7);
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_coal_off), 10);
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_diesel), 8);
|
||||
|
||||
@ -1,63 +1,64 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.TileEntityProxyInventory;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactor;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class MachineReactor extends BlockDummyable {
|
||||
|
||||
public MachineReactor(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
|
||||
if(meta >= 12)
|
||||
return new TileEntityMachineReactor();
|
||||
|
||||
return new TileEntityProxyInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(world.isRemote)
|
||||
{
|
||||
return true;
|
||||
} else if(!player.isSneaking())
|
||||
{
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
|
||||
if(pos == null)
|
||||
return false;
|
||||
|
||||
TileEntityMachineReactor entity = (TileEntityMachineReactor) world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
if(entity != null)
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_reactor, world, pos[0], pos[1], pos[2]);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] { 2, 0, 0, 0, 0, 0 };
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.IMultiblock;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.TileEntityProxyInventory;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactorBreeding;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class MachineReactorBreeding extends BlockDummyable implements IMultiblock {
|
||||
|
||||
public MachineReactorBreeding(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
|
||||
if(meta >= 12)
|
||||
return new TileEntityMachineReactorBreeding();
|
||||
|
||||
return new TileEntityProxyInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(world.isRemote)
|
||||
{
|
||||
return true;
|
||||
} else if(!player.isSneaking())
|
||||
{
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
|
||||
if(pos == null)
|
||||
return false;
|
||||
|
||||
TileEntityMachineReactorBreeding entity = (TileEntityMachineReactorBreeding) world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
if(entity != null)
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_reactor_breeding, world, pos[0], pos[1], pos[2]);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] { 2, 0, 0, 0, 0, 0 };
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -10,7 +10,7 @@ import com.hbm.handler.MultiblockHandlerXR;
|
||||
import com.hbm.interfaces.IMultiblock;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactorSmall;
|
||||
import com.hbm.tileentity.machine.TileEntityReactorResearch;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -29,9 +29,9 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineReactorSmall extends BlockDummyable implements IMultiblock {
|
||||
public class ReactorResearch extends BlockDummyable implements IMultiblock {
|
||||
|
||||
public MachineReactorSmall(Material mat) {
|
||||
public ReactorResearch(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@ -39,7 +39,7 @@ public class MachineReactorSmall extends BlockDummyable implements IMultiblock {
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
|
||||
if(meta >= 12)
|
||||
return new TileEntityMachineReactorSmall();
|
||||
return new TileEntityReactorResearch();
|
||||
if(meta >= 6)
|
||||
return new TileEntityProxyCombo(false, true, true);
|
||||
|
||||
@ -58,7 +58,7 @@ public class MachineReactorSmall extends BlockDummyable implements IMultiblock {
|
||||
if(pos == null)
|
||||
return false;
|
||||
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_reactor_small, world, pos[0], pos[1], pos[2]);
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_reactor_research, world, pos[0], pos[1], pos[2]);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@ -100,8 +100,4 @@ public class MachineReactorSmall extends BlockDummyable implements IMultiblock {
|
||||
public int getOffset() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
}
|
||||
}
|
||||
@ -160,8 +160,6 @@ public class EntityFBI extends EntityMob implements IRangedAttackMob {
|
||||
canDestroy.add(ModBlocks.dummy_block_assembler);
|
||||
canDestroy.add(ModBlocks.dummy_block_chemplant);
|
||||
canDestroy.add(ModBlocks.machine_crystallizer);
|
||||
canDestroy.add(ModBlocks.dummy_block_reactor_small);
|
||||
canDestroy.add(ModBlocks.dummy_port_reactor_small);
|
||||
canDestroy.add(ModBlocks.machine_turbine);
|
||||
canDestroy.add(ModBlocks.machine_large_turbine);
|
||||
canDestroy.add(ModBlocks.crate_iron);
|
||||
|
||||
@ -84,9 +84,9 @@ public class GUIHandler implements IGuiHandler {
|
||||
return null;
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_reactor: {
|
||||
if(entity instanceof TileEntityMachineReactor) {
|
||||
return new ContainerReactor(player.inventory, (TileEntityMachineReactor) entity);
|
||||
case ModBlocks.guiID_reactor_breeding: {
|
||||
if(entity instanceof TileEntityMachineReactorBreeding) {
|
||||
return new ContainerMachineReactorBreeding(player.inventory, (TileEntityMachineReactorBreeding) entity);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -455,9 +455,9 @@ public class GUIHandler implements IGuiHandler {
|
||||
return null;
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_reactor_small: {
|
||||
if(entity instanceof TileEntityMachineReactorSmall) {
|
||||
return new ContainerMachineReactorSmall(player.inventory, (TileEntityMachineReactorSmall) entity);
|
||||
case ModBlocks.guiID_reactor_research: {
|
||||
if(entity instanceof TileEntityReactorResearch) {
|
||||
return new ContainerReactorResearch(player.inventory, (TileEntityReactorResearch) entity);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -933,9 +933,9 @@ public class GUIHandler implements IGuiHandler {
|
||||
return null;
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_reactor: {
|
||||
if(entity instanceof TileEntityMachineReactor) {
|
||||
return new GUIMachineReactor(player.inventory, (TileEntityMachineReactor) entity);
|
||||
case ModBlocks.guiID_reactor_breeding: {
|
||||
if(entity instanceof TileEntityMachineReactorBreeding) {
|
||||
return new GUIMachineReactorBreeding(player.inventory, (TileEntityMachineReactorBreeding) entity);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -1304,9 +1304,9 @@ public class GUIHandler implements IGuiHandler {
|
||||
return null;
|
||||
}
|
||||
|
||||
case ModBlocks.guiID_reactor_small: {
|
||||
if(entity instanceof TileEntityMachineReactorSmall) {
|
||||
return new GUIMachineReactorSmall(player.inventory, (TileEntityMachineReactorSmall) entity);
|
||||
case ModBlocks.guiID_reactor_research: {
|
||||
if(entity instanceof TileEntityReactorResearch) {
|
||||
return new GUIReactorResearch(player.inventory, (TileEntityReactorResearch) entity);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -1,141 +1,119 @@
|
||||
package com.hbm.handler.nei;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.hbm.inventory.gui.GUIMachineReactor;
|
||||
import com.hbm.inventory.recipes.BreederRecipes;
|
||||
import com.hbm.inventory.recipes.BreederRecipes.BreederRecipe;
|
||||
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ReactorRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
public class BreedingSet extends TemplateRecipeHandler.CachedRecipe {
|
||||
|
||||
PositionedStack input;
|
||||
PositionedStack result;
|
||||
public int heat;
|
||||
public ArrayList<Fuel> fuels;
|
||||
|
||||
public BreedingSet(ItemStack input, ItemStack result, int heat) {
|
||||
input.stackSize = 1;
|
||||
this.input = new PositionedStack(input, 51, 6);
|
||||
this.result = new PositionedStack(result, 111, 24);
|
||||
this.heat = heat;
|
||||
|
||||
fuels = new ArrayList();
|
||||
|
||||
for(ItemStack sta : BreederRecipes.getAllFuelsFromHEAT(heat)) {
|
||||
fuels.add(new Fuel(sta));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getIngredients() {
|
||||
return getCycledIngredients(cycleticks / 48, Arrays.asList(new PositionedStack[] { input }));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getOtherStack() {
|
||||
return fuels.get((cycleticks / 48) % fuels.size()).stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getResult() {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Fuel {
|
||||
|
||||
public Fuel(ItemStack ingred) {
|
||||
|
||||
this.stack = new PositionedStack(ingred, 51, 42, false);
|
||||
}
|
||||
|
||||
public PositionedStack stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName() {
|
||||
return "Breeding Reactor";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture() {
|
||||
return GUIMachineReactor.texture.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
|
||||
if((outputId.equals("breeding")) && getClass() == ReactorRecipeHandler.class) {
|
||||
|
||||
Map<ItemStack, BreederRecipe> recipes = BreederRecipes.getAllRecipes();
|
||||
|
||||
for(Map.Entry<ItemStack, BreederRecipe> recipe : recipes.entrySet()) {
|
||||
this.arecipes.add(new BreedingSet(recipe.getKey(), recipe.getValue().output, recipe.getValue().heat));
|
||||
}
|
||||
} else {
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result) {
|
||||
|
||||
Map<ItemStack, BreederRecipe> recipes = BreederRecipes.getAllRecipes();
|
||||
|
||||
for(Map.Entry<ItemStack, BreederRecipe> recipe : recipes.entrySet()) {
|
||||
if(NEIServerUtils.areStacksSameType(recipe.getValue().output, result))
|
||||
this.arecipes.add(new BreedingSet(recipe.getKey(), recipe.getValue().output, recipe.getValue().heat));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(String inputId, Object... ingredients) {
|
||||
if((inputId.equals("breeding")) && getClass() == ReactorRecipeHandler.class) {
|
||||
loadCraftingRecipes("breeding", new Object[0]);
|
||||
} else {
|
||||
super.loadUsageRecipes(inputId, ingredients);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient) {
|
||||
|
||||
Map<ItemStack, BreederRecipe> recipes = BreederRecipes.getAllRecipes();
|
||||
|
||||
for(Map.Entry<ItemStack, BreederRecipe> recipe : recipes.entrySet()) {
|
||||
if(NEIServerUtils.areStacksSameType(ingredient, (ItemStack) recipe.getKey()))
|
||||
this.arecipes.add(new BreedingSet(recipe.getKey(), recipe.getValue().output, recipe.getValue().heat));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiContainer> getGuiClass() {
|
||||
return GUIMachineReactor.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
transferRects.add(new RecipeTransferRect(new Rectangle(74, 23, 24, 18), "breeding"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(int recipe) {
|
||||
drawProgressBar(50, 24, 176, 0, 14, 14, 48 * 3, 7);
|
||||
drawProgressBar(75, 23, 176, 16, 24, 16, 48, 0);
|
||||
|
||||
int heat = ((BreedingSet) this.arecipes.get(recipe)).heat;
|
||||
drawProgressBar(43, 24, 194, 0, 4, 16, (float) 1 - heat / 4F, 7);
|
||||
}
|
||||
}
|
||||
package com.hbm.handler.nei;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.hbm.inventory.gui.GUIMachineReactorBreeding;
|
||||
import com.hbm.inventory.recipes.BreederRecipes;
|
||||
import com.hbm.inventory.recipes.BreederRecipes.BreederRecipe;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class BreederRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
public class BreedingSet extends TemplateRecipeHandler.CachedRecipe {
|
||||
|
||||
PositionedStack input;
|
||||
PositionedStack result;
|
||||
public int flux;
|
||||
|
||||
public BreedingSet(ItemStack input, ItemStack result, int flux) {
|
||||
input.stackSize = 1;
|
||||
this.input = new PositionedStack(input, 30, 24);
|
||||
this.result = new PositionedStack(result, 120, 24);
|
||||
this.flux = flux;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getIngredients() {
|
||||
return getCycledIngredients(cycleticks / 48, Arrays.asList(new PositionedStack[] { input }));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getResult() {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName() {
|
||||
return "Breeding Reactor";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture() {
|
||||
return GUIMachineReactorBreeding.texture.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
|
||||
if((outputId.equals("breeding")) && getClass() == BreederRecipeHandler.class) {
|
||||
|
||||
Map<ItemStack, BreederRecipe> recipes = BreederRecipes.getAllRecipes();
|
||||
|
||||
for(Map.Entry<ItemStack, BreederRecipe> recipe : recipes.entrySet()) {
|
||||
this.arecipes.add(new BreedingSet(recipe.getKey(), recipe.getValue().output, recipe.getValue().flux));
|
||||
}
|
||||
} else {
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result) {
|
||||
|
||||
Map<ItemStack, BreederRecipe> recipes = BreederRecipes.getAllRecipes();
|
||||
|
||||
for(Map.Entry<ItemStack, BreederRecipe> recipe : recipes.entrySet()) {
|
||||
if(NEIServerUtils.areStacksSameType(recipe.getValue().output, result))
|
||||
this.arecipes.add(new BreedingSet(recipe.getKey(), recipe.getValue().output, recipe.getValue().flux));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(String inputId, Object... ingredients) {
|
||||
if((inputId.equals("breeding")) && getClass() == BreederRecipeHandler.class) {
|
||||
loadCraftingRecipes("breeding", new Object[0]);
|
||||
} else {
|
||||
super.loadUsageRecipes(inputId, ingredients);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient) {
|
||||
|
||||
Map<ItemStack, BreederRecipe> recipes = BreederRecipes.getAllRecipes();
|
||||
|
||||
for(Map.Entry<ItemStack, BreederRecipe> recipe : recipes.entrySet()) {
|
||||
if(NEIServerUtils.areStacksSameType(ingredient, (ItemStack) recipe.getKey()))
|
||||
this.arecipes.add(new BreedingSet(recipe.getKey(), recipe.getValue().output, recipe.getValue().flux));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiContainer> getGuiClass() {
|
||||
return GUIMachineReactorBreeding.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
transferRects.add(new RecipeTransferRect(new Rectangle(68, 9, 30, 37), "breeding"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(int recipe) {
|
||||
drawProgressBar(48, 21, 176, 0, 70, 20, 50, 0);
|
||||
|
||||
String flux = ((BreedingSet) this.arecipes.get(recipe)).flux + "";
|
||||
GuiDraw.drawString(flux, 83 - GuiDraw.fontRenderer.getStringWidth(flux) / 2, 10, 0x08FF00);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotMachineOutput;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactorBreeding;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerMachineReactorBreeding extends Container {
|
||||
|
||||
private TileEntityMachineReactorBreeding reactor;
|
||||
|
||||
public ContainerMachineReactorBreeding(InventoryPlayer invPlayer, TileEntityMachineReactorBreeding tedf) {
|
||||
|
||||
reactor = tedf;
|
||||
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 35, 35));
|
||||
this.addSlotToContainer(new SlotMachineOutput(tedf, 1, 125, 35));
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 9; j++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
|
||||
|
||||
ItemStack var3 = null;
|
||||
Slot slot = (Slot) this.inventorySlots.get(index);
|
||||
|
||||
if (slot != null && slot.getHasStack()) {
|
||||
|
||||
ItemStack stack = slot.getStack();
|
||||
var3 = stack.copy();
|
||||
|
||||
if (index <= 2) {
|
||||
if (!this.mergeItemStack(stack, 2, this.inventorySlots.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
} else if (!this.mergeItemStack(stack, 1, 2, false)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (stack.stackSize == 0) {
|
||||
slot.putStack((ItemStack) null);
|
||||
|
||||
} else {
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return var3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return reactor.isUseableByPlayer(player);
|
||||
}
|
||||
}
|
||||
@ -1,73 +0,0 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotMachineOutput;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactor;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerReactor extends Container {
|
||||
|
||||
private TileEntityMachineReactor diFurnace;
|
||||
|
||||
public ContainerReactor(InventoryPlayer invPlayer, TileEntityMachineReactor tedf) {
|
||||
|
||||
diFurnace = tedf;
|
||||
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 56, 53));
|
||||
this.addSlotToContainer(new Slot(tedf, 1, 56, 17));
|
||||
this.addSlotToContainer(new SlotMachineOutput(tedf, 2, 116, 35));
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 9; j++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) {
|
||||
|
||||
ItemStack var3 = null;
|
||||
Slot var4 = (Slot) this.inventorySlots.get(par2);
|
||||
|
||||
if (var4 != null && var4.getHasStack()) {
|
||||
|
||||
ItemStack var5 = var4.getStack();
|
||||
var3 = var5.copy();
|
||||
|
||||
if (par2 <= 2) {
|
||||
if (!this.mergeItemStack(var5, 3, this.inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
//Changing priorities without swapping the actual slots
|
||||
} else if (!this.mergeItemStack(var5, 1, 2, false)) {
|
||||
if (!this.mergeItemStack(var5, 0, 1, false))
|
||||
return null;
|
||||
}
|
||||
|
||||
if (var5.stackSize == 0) {
|
||||
var4.putStack((ItemStack) null);
|
||||
|
||||
} else {
|
||||
var4.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return var3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return diFurnace.isUseableByPlayer(player);
|
||||
}
|
||||
}
|
||||
@ -1,34 +1,34 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotMachineOutput;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactorSmall;
|
||||
import com.hbm.tileentity.machine.TileEntityReactorResearch;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerMachineReactorSmall extends Container {
|
||||
public class ContainerReactorResearch extends Container {
|
||||
|
||||
private TileEntityMachineReactorSmall seleniumEngine;
|
||||
private TileEntityReactorResearch reactor;
|
||||
|
||||
public ContainerMachineReactorSmall(InventoryPlayer invPlayer, TileEntityMachineReactorSmall tedf) {
|
||||
public ContainerReactorResearch(InventoryPlayer invPlayer, TileEntityReactorResearch tedf) {
|
||||
|
||||
seleniumEngine = tedf;
|
||||
reactor = tedf;
|
||||
|
||||
//Rods
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 98, 18));
|
||||
this.addSlotToContainer(new Slot(tedf, 1, 134, 18));
|
||||
this.addSlotToContainer(new Slot(tedf, 2, 80, 36));
|
||||
this.addSlotToContainer(new Slot(tedf, 3, 116, 36));
|
||||
this.addSlotToContainer(new Slot(tedf, 4, 152, 36));
|
||||
this.addSlotToContainer(new Slot(tedf, 5, 98, 54));
|
||||
this.addSlotToContainer(new Slot(tedf, 6, 134, 54));
|
||||
this.addSlotToContainer(new Slot(tedf, 7, 80, 72));
|
||||
this.addSlotToContainer(new Slot(tedf, 8, 116, 72));
|
||||
this.addSlotToContainer(new Slot(tedf, 9, 152, 72));
|
||||
this.addSlotToContainer(new Slot(tedf, 10, 98, 90));
|
||||
this.addSlotToContainer(new Slot(tedf, 11, 134, 90));
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 95, 22));
|
||||
this.addSlotToContainer(new Slot(tedf, 1, 131, 22));
|
||||
this.addSlotToContainer(new Slot(tedf, 2, 77, 40));
|
||||
this.addSlotToContainer(new Slot(tedf, 3, 112, 40));
|
||||
this.addSlotToContainer(new Slot(tedf, 4, 149, 40));
|
||||
this.addSlotToContainer(new Slot(tedf, 5, 95, 58));
|
||||
this.addSlotToContainer(new Slot(tedf, 6, 131, 58));
|
||||
this.addSlotToContainer(new Slot(tedf, 7, 77, 76));
|
||||
this.addSlotToContainer(new Slot(tedf, 8, 112, 76));
|
||||
this.addSlotToContainer(new Slot(tedf, 9, 149, 76));
|
||||
this.addSlotToContainer(new Slot(tedf, 10, 95, 94));
|
||||
this.addSlotToContainer(new Slot(tedf, 11, 131, 94));
|
||||
|
||||
for(int i = 0; i < 3; i++)
|
||||
{
|
||||
@ -75,6 +75,6 @@ private TileEntityMachineReactorSmall seleniumEngine;
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return seleniumEngine.isUseableByPlayer(player);
|
||||
return reactor.isUseableByPlayer(player);
|
||||
}
|
||||
}
|
||||
@ -1,74 +1,71 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerReactor;
|
||||
import com.hbm.inventory.recipes.BreederRecipes;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactor;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIMachineReactor extends GuiInfoContainer {
|
||||
|
||||
public static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/processing/gui_breeder.png");
|
||||
private TileEntityMachineReactor breeder;
|
||||
|
||||
public GUIMachineReactor(InventoryPlayer invPlayer, TileEntityMachineReactor tedf) {
|
||||
super(new ContainerReactor(invPlayer, tedf));
|
||||
breeder = tedf;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 166;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
super.drawScreen(mouseX, mouseY, f);
|
||||
|
||||
String tooltip = BreederRecipes.getHEATString(breeder.heat + " HEAT", breeder.heat);
|
||||
|
||||
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 47, guiTop + 34, 6, 18, mouseX, mouseY, new String[] { tooltip });
|
||||
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 55, guiTop + 34, 18, 18, mouseX, mouseY, new String[] { breeder.charge + " operation(s) left" });
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
String name = this.breeder.hasCustomInventoryName() ? this.breeder.getInventoryName() : I18n.format(this.breeder.getInventoryName());
|
||||
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
/*
|
||||
* A dud is a tile entity which did not survive a block state change (i.e. a furnace becoming lit) on the client.
|
||||
* Usually, most functionality is preserved since vanilla interacts with the open GUI screen rather than the TE
|
||||
* itself, though this does not apply to NTM packets. The client will think the TE bound to the GUI is invalid,
|
||||
* and therefore miss out on NTM status packets, but it will still require the old TE for slot changes. The refreshed
|
||||
* "dud" is only used for status bars, it will not replace the actual invalid TE instance in the GUI screen.
|
||||
*/
|
||||
TileEntityMachineReactor dud = breeder;
|
||||
|
||||
if(breeder.isInvalid() && breeder.getWorldObj().getTileEntity(breeder.xCoord, breeder.yCoord, breeder.zCoord) instanceof TileEntityMachineReactor)
|
||||
dud = (TileEntityMachineReactor) breeder.getWorldObj().getTileEntity(breeder.xCoord, breeder.yCoord, breeder.zCoord);
|
||||
|
||||
if(dud.hasPower())
|
||||
drawTexturedModalRect(guiLeft + 55, guiTop + 35, 176, 0, 18, 16);
|
||||
|
||||
int i = dud.getProgressScaled(23);
|
||||
drawTexturedModalRect(guiLeft + 80, guiTop + 34, 176, 16, i, 16);
|
||||
|
||||
int j = dud.getHeatScaled(16);
|
||||
drawTexturedModalRect(guiLeft + 48, guiTop + 51 - j, 194, 16 - j, 4, j);
|
||||
}
|
||||
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerMachineReactorBreeding;
|
||||
import com.hbm.inventory.recipes.BreederRecipes;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactorBreeding;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIMachineReactorBreeding extends GuiInfoContainer {
|
||||
|
||||
public static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/processing/gui_breeder.png");
|
||||
private TileEntityMachineReactorBreeding breeder;
|
||||
|
||||
public GUIMachineReactorBreeding(InventoryPlayer invPlayer, TileEntityMachineReactorBreeding tedf) {
|
||||
super(new ContainerMachineReactorBreeding(invPlayer, tedf));
|
||||
breeder = tedf;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 166;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
super.drawScreen(mouseX, mouseY, f);
|
||||
|
||||
String[] text = new String[] {
|
||||
"The reactor has to recieve",
|
||||
"neutron flux from adjacent",
|
||||
"research reactors to breed."
|
||||
};
|
||||
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 16, 16, 16, guiLeft - 8, guiTop + 16 + 16, text);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
String name = this.breeder.hasCustomInventoryName() ? this.breeder.getInventoryName() : I18n.format(this.breeder.getInventoryName());
|
||||
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString(breeder.flux + "", 88 - this.fontRendererObj.getStringWidth(breeder.flux + "") / 2, 21, 0x08FF00);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
/*
|
||||
* A dud is a tile entity which did not survive a block state change (i.e. a furnace becoming lit) on the client.
|
||||
* Usually, most functionality is preserved since vanilla interacts with the open GUI screen rather than the TE
|
||||
* itself, though this does not apply to NTM packets. The client will think the TE bound to the GUI is invalid,
|
||||
* and therefore miss out on NTM status packets, but it will still require the old TE for slot changes. The refreshed
|
||||
* "dud" is only used for status bars, it will not replace the actual invalid TE instance in the GUI screen.
|
||||
*
|
||||
* what?
|
||||
*/
|
||||
|
||||
int i = breeder.getProgressScaled(70);
|
||||
drawTexturedModalRect(guiLeft + 53, guiTop + 32, 176, 0, i, 20);
|
||||
|
||||
this.drawInfoPanel(guiLeft - 16, guiTop + 16, 16, 16, 3);
|
||||
}
|
||||
|
||||
}
|
||||
@ -5,11 +5,11 @@ import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.container.ContainerMachineReactorSmall;
|
||||
import com.hbm.inventory.container.ContainerReactorResearch;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.packet.NBTControlPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactorSmall;
|
||||
import com.hbm.tileentity.machine.TileEntityReactorResearch;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
@ -20,21 +20,23 @@ import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIMachineReactorSmall extends GuiInfoContainer {
|
||||
public class GUIReactorResearch extends GuiInfoContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_reactor_experimental.png");
|
||||
private TileEntityMachineReactorSmall reactor;
|
||||
private final NumberDisplay[] displays = new NumberDisplay[2];
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/reactors/gui_research_reactor.png");
|
||||
private TileEntityReactorResearch reactor;
|
||||
private final NumberDisplay[] displays = new NumberDisplay[3];
|
||||
byte timer;
|
||||
|
||||
private GuiTextField field;
|
||||
|
||||
public GUIMachineReactorSmall(InventoryPlayer invPlayer, TileEntityMachineReactorSmall te) {
|
||||
super(new ContainerMachineReactorSmall(invPlayer, te));
|
||||
public GUIReactorResearch(InventoryPlayer invPlayer, TileEntityReactorResearch te) {
|
||||
super(new ContainerReactorResearch(invPlayer, te));
|
||||
reactor = te;
|
||||
this.xSize = 176;
|
||||
this.ySize = 222;
|
||||
displays[0] = new NumberDisplay(12, 19).setDigitLength(4);
|
||||
displays[1] = new NumberDisplay(12, 55).setDigitLength(3);
|
||||
displays[0] = new NumberDisplay(14, 25).setDigitLength(4);
|
||||
displays[1] = new NumberDisplay(12, 63).setDigitLength(3);
|
||||
displays[2] = new NumberDisplay(5, 101).setDigitLength(3);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -46,9 +48,7 @@ public class GUIMachineReactorSmall extends GuiInfoContainer {
|
||||
|
||||
Keyboard.enableRepeatEvents(true);
|
||||
|
||||
this.field = new GuiTextField(this.fontRendererObj, guiLeft + 11, guiTop + 86, 35, 9);
|
||||
this.field.setTextColor(0x00ff00);
|
||||
this.field.setDisabledTextColour(0x008000);
|
||||
this.field = new GuiTextField(this.fontRendererObj, guiLeft + 8, guiTop + 99, 33, 16);
|
||||
this.field.setEnableBackgroundDrawing(false);
|
||||
this.field.setMaxStringLength(3);
|
||||
}
|
||||
@ -56,45 +56,33 @@ public class GUIMachineReactorSmall extends GuiInfoContainer {
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
super.drawScreen(mouseX, mouseY, f);
|
||||
|
||||
this.drawCustomInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 120, 88, 4, new String[] { "Core Temperature:", " " + Math.round((reactor.heat) * 0.00002 * 980 + 20) + "°C" });
|
||||
|
||||
String[] text = new String[] { "Coolant will move heat from the core to",
|
||||
"the hull. Water will use that heat and",
|
||||
"generate steam.",
|
||||
"Water consumption rate:",
|
||||
" 100 mB/t",
|
||||
" 2000 mB/s",
|
||||
"Coolant consumption rate:",
|
||||
" 10 mB/t",
|
||||
" 200 mB/s",
|
||||
"Water next to the reactor's open",
|
||||
"sides will pour into the tank." };
|
||||
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 36, 16, 16, guiLeft - 8, guiTop + 36 + 16, text);
|
||||
|
||||
String[] text1 = new String[] { "Raise/lower the control rods",
|
||||
"using the button next to the",
|
||||
"fluid gauges." };
|
||||
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 36 + 16, 16, 16, guiLeft - 8, guiTop + 36 + 16, text1);
|
||||
|
||||
String[] text = new String[] {
|
||||
"The reactor has to be submerged",
|
||||
"in water on its sides to cool.",
|
||||
"The neutron flux is provided to",
|
||||
"adjacent breeding reactors."
|
||||
};
|
||||
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 14, guiTop + 23, 16, 16, guiLeft - 6, guiTop + 23 + 16, text);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
String name = this.reactor.hasCustomInventoryName() ? this.reactor.getInventoryName() : I18n.format(this.reactor.getInventoryName());
|
||||
final String[] labels = { "Flux", "Heat", "Control Rods" };
|
||||
final String[] labels = { "Flux", "Heat", "Control" };
|
||||
|
||||
this.fontRendererObj.drawString(name, 124 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(name, 121 - this.fontRendererObj.getStringWidth(name) / 2, 6, 15066597);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
this.fontRendererObj.drawString(labels[0], 11, 9, 15066597);
|
||||
this.fontRendererObj.drawString(labels[1], 11, 45, 15066597);
|
||||
this.fontRendererObj.drawString(labels[2], 9, 74, 4210752);
|
||||
this.fontRendererObj.drawString(labels[0], 6, 13, 15066597);
|
||||
this.fontRendererObj.drawString(labels[1], 6, 51, 15066597);
|
||||
this.fontRendererObj.drawString(labels[2], 6, 89, 15066597);
|
||||
}
|
||||
|
||||
protected void mouseClicked(int mouseX, int mouseY, int i) {
|
||||
super.mouseClicked(mouseX, mouseY, i);
|
||||
this.field.mouseClicked(mouseX, mouseY, i);
|
||||
|
||||
if(guiLeft + 51 <= mouseX && guiLeft + 51 + 12 > mouseX && guiTop + 84 < mouseY && guiTop + 84 + 12 >= mouseY) {
|
||||
if(guiLeft + 44 <= mouseX && guiLeft + 44 + 11 > mouseX && guiTop + 97 < mouseY && guiTop + 97 + 20 >= mouseY) {
|
||||
|
||||
double level;
|
||||
|
||||
@ -108,6 +96,7 @@ public class GUIMachineReactorSmall extends GuiInfoContainer {
|
||||
|
||||
NBTTagCompound control = new NBTTagCompound();
|
||||
control.setDouble("level", level);
|
||||
timer = 15;
|
||||
|
||||
PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(control, reactor.xCoord, reactor.yCoord, reactor.zCoord));
|
||||
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("hbm:block.rbmk_az5_cover"), 0.5F));
|
||||
@ -121,33 +110,31 @@ public class GUIMachineReactorSmall extends GuiInfoContainer {
|
||||
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
if(reactor.heat > 0) {
|
||||
int i = reactor.getHeatScaled(88);
|
||||
|
||||
i = (int) Math.min(i, 160);
|
||||
|
||||
drawTexturedModalRect(guiLeft + 80, guiTop + 120, 0, 230, i, 4);
|
||||
if(reactor.level <= 0.5D) {
|
||||
for(int x = 0; x < 3; x++)
|
||||
for(int y = 0; y < 3; y++)
|
||||
drawTexturedModalRect(guiLeft + 81 + 36 * x, guiTop + 26 + 36 * y, 176, 0, 8, 8);
|
||||
}
|
||||
|
||||
if(reactor.level >= 100) {
|
||||
for(int x = 0; x < 3; x++)
|
||||
for(int y = 0; y < 3; y++)
|
||||
drawTexturedModalRect(guiLeft + 79 + 36 * x, guiTop + 17 + 36 * y, 176, 0, 18, 18);
|
||||
|
||||
} else if(reactor.level > 0) {
|
||||
for(int x = 0; x < 3; x++)
|
||||
for(int y = 0; y < 3; y++)
|
||||
drawTexturedModalRect(guiLeft + 79 + 36 * x, guiTop + 17 + 36 * y, 194, 0, 18, 18);
|
||||
|
||||
if(timer > 0) {
|
||||
drawTexturedModalRect(guiLeft + 44, guiTop + 97, 176, 8, 11, 20);
|
||||
timer--;
|
||||
}
|
||||
|
||||
for(byte i = 0; i < 2; i++)
|
||||
displays[i].drawNumber(reactor.getDisplayData()[i]);
|
||||
|
||||
this.drawInfoPanel(guiLeft - 16, guiTop + 36, 16, 16, 2);
|
||||
this.drawInfoPanel(guiLeft - 16, guiTop + 36 + 16, 16, 16, 3);
|
||||
if(NumberUtils.isDigits(field.getText())) {
|
||||
int level = (int)MathHelper.clamp_double(Double.parseDouble(field.getText()), 0, 100);
|
||||
field.setText(level + "");
|
||||
displays[2].drawNumber(level);
|
||||
} else {
|
||||
field.setText(0 + "");
|
||||
displays[2].drawNumber(0);
|
||||
}
|
||||
|
||||
this.drawInfoPanel(guiLeft - 14, guiTop + 23, 16, 16, 3);
|
||||
|
||||
this.field.drawTextBox();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -22,13 +22,6 @@ public abstract class GuiInfoContainer extends GuiContainer {
|
||||
|
||||
static final ResourceLocation guiUtil = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_utility.png");
|
||||
protected static final ResourceLocation numDisplays = new ResourceLocation(RefStrings.MODID, "textures/gui/gauges/seven_segment.pn");
|
||||
/** Default text color **/
|
||||
public static final int color0 = 4210752;
|
||||
/** Green computer color **/
|
||||
public static final int color1 = 0x00ff00;
|
||||
public static final char slimCursor = '\u2502';
|
||||
public static final char blockCursor = '\u2588';
|
||||
public static final ResourceLocation keyboard = new ResourceLocation(RefStrings.MODID, "misc.keyPress");
|
||||
|
||||
public GuiInfoContainer(Container p_i1072_1_) {
|
||||
super(p_i1072_1_);
|
||||
|
||||
@ -190,7 +190,7 @@ public class AssemblerRecipes {
|
||||
makeRecipe(new ComparableStack(ModItems.thruster_small, 1), new AStack[] {new OreDictStack(STEEL.plate(), 2), new ComparableStack(ModItems.hull_small_steel, 2), new ComparableStack(ModItems.wire_aluminium, 4), },100);
|
||||
makeRecipe(new ComparableStack(ModItems.thruster_medium, 1), new AStack[] {new ComparableStack(ModItems.thruster_small, 1), new OreDictStack(STEEL.plate(), 2), new ComparableStack(ModItems.hull_small_steel, 1), new ComparableStack(ModItems.hull_big_steel, 1), new ComparableStack(ModItems.wire_copper, 4), },150);
|
||||
makeRecipe(new ComparableStack(ModItems.thruster_large, 1), new AStack[] {new ComparableStack(ModItems.thruster_medium, 1), new OreDictStack(STEEL.plate(), 4), new ComparableStack(ModItems.hull_big_steel, 2), new ComparableStack(ModItems.wire_red_copper, 4), },200);
|
||||
makeRecipe(new ComparableStack(ModItems.thruster_nuclear, 1), new AStack[] {new ComparableStack(ModItems.thruster_large, 1), new ComparableStack(ModItems.tank_steel, 2), new ComparableStack(ModBlocks.deco_pipe_quad, 3), new ComparableStack(ModItems.board_copper, 6), new ComparableStack(ModItems.motor, 1), new ComparableStack(ModItems.circuit_targeting_tier4, 2), new ComparableStack(ModBlocks.machine_reactor_small, 1), },600);
|
||||
makeRecipe(new ComparableStack(ModItems.thruster_nuclear, 1), new AStack[] {new ComparableStack(ModItems.thruster_large, 1), new ComparableStack(ModItems.tank_steel, 2), new ComparableStack(ModBlocks.deco_pipe_quad, 3), new ComparableStack(ModItems.board_copper, 6), new ComparableStack(ModItems.motor, 1), new ComparableStack(ModItems.circuit_targeting_tier4, 2), new ComparableStack(ModBlocks.reactor_research, 1), },600);
|
||||
makeRecipe(new ComparableStack(ModItems.sat_base, 1), new AStack[] {new ComparableStack(ModItems.thruster_large, 1), new OreDictStack(STEEL.plate(), 6), new ComparableStack(ModItems.plate_desh, 4), new ComparableStack(ModItems.hull_big_titanium, 3), new ComparableStack(ModItems.fluid_barrel_full, 1, FluidType.KEROSENE.ordinal()), new ComparableStack(ModItems.photo_panel, 24), new ComparableStack(ModItems.board_copper, 12), new ComparableStack(ModItems.circuit_gold, 6), new ComparableStack(ModItems.battery_lithium_cell_6, 1), },500);
|
||||
makeRecipe(new ComparableStack(ModItems.sat_head_mapper, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 4), new OreDictStack(STEEL.plate(), 6), new ComparableStack(ModItems.hull_small_steel, 3), new ComparableStack(ModItems.plate_desh, 2), new ComparableStack(ModItems.circuit_gold, 2), new ComparableStack(ModItems.plate_polymer, 12), new OreDictStack(REDSTONE.dust(), 6), new ComparableStack(Items.diamond, 1), new ComparableStack(Blocks.glass_pane, 6), },400);
|
||||
makeRecipe(new ComparableStack(ModItems.sat_head_scanner, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 6), new OreDictStack(TI.plate(), 32), new ComparableStack(ModItems.plate_desh, 6), new ComparableStack(ModItems.magnetron, 6), new ComparableStack(ModItems.coil_advanced_torus, 2), new ComparableStack(ModItems.circuit_gold, 6), new ComparableStack(ModItems.plate_polymer, 6), new ComparableStack(Items.diamond, 1), },400);
|
||||
@ -209,6 +209,7 @@ public class AssemblerRecipes {
|
||||
makeRecipe(new ComparableStack(ModItems.circuit_aluminium, 1), new AStack[] {new ComparableStack(ModItems.circuit_raw, 1), },50);
|
||||
makeRecipe(new ComparableStack(ModItems.circuit_copper, 1), new AStack[] {new ComparableStack(ModItems.circuit_aluminium, 1), new ComparableStack(ModItems.wire_copper, 4), new OreDictStack(NETHERQUARTZ.dust(), 1), new OreDictStack(CU.plate(), 1), },100);
|
||||
makeRecipe(new ComparableStack(ModItems.circuit_red_copper, 1), new AStack[] {new ComparableStack(ModItems.circuit_copper, 1), new ComparableStack(ModItems.wire_red_copper, 4), new OreDictStack(GOLD.dust(), 1), new ComparableStack(ModItems.plate_polymer, 1), },150);
|
||||
makeRecipe(new ComparableStack(ModItems.crt_display, 8), new AStack[] {new OreDictStack(AL.dust(), 2), new ComparableStack(Blocks.glass_pane, 2), new ComparableStack(ModItems.wire_tungsten, 4), new ComparableStack(ModItems.hull_small_steel, 1) }, 100);
|
||||
makeRecipe(new ComparableStack(ModItems.tritium_deuterium_cake, 1), new AStack[] {new ComparableStack(ModItems.cell_deuterium, 6), new ComparableStack(ModItems.cell_tritium, 2), new OreDictStack(LI.ingot(), 4), },150);
|
||||
makeRecipe(new ComparableStack(ModItems.pellet_cluster, 1), new AStack[] {new OreDictStack(STEEL.plate(), 4), new ComparableStack(Blocks.tnt, 1), }, 50);
|
||||
makeRecipe(new ComparableStack(ModItems.pellet_buckshot, 1), new AStack[] {new OreDictStack(PB.nugget(), 6), }, 50);
|
||||
@ -388,7 +389,7 @@ public class AssemblerRecipes {
|
||||
makeRecipe(new ComparableStack(ModBlocks.ams_limiter, 1), new AStack[] {new ComparableStack(ModItems.board_copper, 6), new OreDictStack(STEEL.plate(), 24), new ComparableStack(ModBlocks.steel_scaffold, 20), new ComparableStack(ModItems.crystal_diamond, 1)}, 600);
|
||||
makeRecipe(new ComparableStack(ModBlocks.ams_emitter, 1), new AStack[] {new ComparableStack(ModItems.board_copper, 24), new OreDictStack(STEEL.plate(), 32), new ComparableStack(ModBlocks.steel_scaffold, 40), new ComparableStack(ModItems.crystal_redstone, 5), new ComparableStack(ModBlocks.machine_lithium_battery)}, 600);
|
||||
makeRecipe(new ComparableStack(ModBlocks.ams_base, 1), new AStack[] {new ComparableStack(ModItems.board_copper, 12), new OreDictStack(STEEL.plate(), 28), new ComparableStack(ModBlocks.steel_scaffold, 30), new ComparableStack(ModBlocks.steel_grate, 8), new ComparableStack(ModBlocks.barrel_steel, 2)}, 600);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_radar, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 8), new OreDictStack(STEEL.plate(), 16), new OreDictStack(POLYMER.ingot(), 4), new ComparableStack(ModItems.plate_polymer, 24), new ComparableStack(ModItems.magnetron, 10), new ComparableStack(ModItems.motor, 3), new ComparableStack(ModItems.circuit_gold, 4), new ComparableStack(ModItems.coil_copper, 12), },300);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_radar, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 8), new OreDictStack(STEEL.plate(), 16), new OreDictStack(POLYMER.ingot(), 4), new ComparableStack(ModItems.plate_polymer, 24), new ComparableStack(ModItems.magnetron, 10), new ComparableStack(ModItems.motor, 3), new ComparableStack(ModItems.circuit_gold, 4), new ComparableStack(ModItems.coil_copper, 12), new ComparableStack(ModItems.crt_display, 4), },300);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_forcefield, 1), new AStack[] {new OreDictStack(ALLOY.plate(), 8), new ComparableStack(ModItems.plate_desh, 4), new ComparableStack(ModItems.coil_gold_torus, 6), new ComparableStack(ModItems.coil_magnetized_tungsten, 12), new ComparableStack(ModItems.motor, 1), new ComparableStack(ModItems.upgrade_radius, 1), new ComparableStack(ModItems.upgrade_health, 1), new ComparableStack(ModItems.circuit_targeting_tier5, 1), new ComparableStack(ModBlocks.machine_transformer, 1), },1000);
|
||||
makeRecipe(new ComparableStack(ModItems.mp_thruster_10_kerosene, 1), new AStack[] {new ComparableStack(ModItems.seg_10, 1), new ComparableStack(ModBlocks.deco_pipe_quad, 1), new OreDictStack(W.ingot(), 4), new OreDictStack(STEEL.plate(), 4), },100);
|
||||
makeRecipe(new ComparableStack(ModItems.mp_thruster_10_solid, 1), new AStack[] {new ComparableStack(ModItems.seg_10, 1), new ComparableStack(ModItems.coil_tungsten, 1), new OreDictStack(DURA.ingot(), 4), new OreDictStack(STEEL.plate(), 4), },100);
|
||||
@ -515,7 +516,7 @@ public class AssemblerRecipes {
|
||||
new ComparableStack(ModItems.circuit_gold, 3),
|
||||
}, 600);
|
||||
|
||||
makeRecipe(new ComparableStack(ModBlocks.reactor_zirnox, 1), new AStack[] {
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_zirnox, 1), new AStack[] {
|
||||
new ComparableStack(ModItems.hull_big_steel, 3),
|
||||
new ComparableStack(ModItems.hull_small_steel, 6),
|
||||
new ComparableStack(ModBlocks.steel_scaffold, 4),
|
||||
@ -639,7 +640,8 @@ public class AssemblerRecipes {
|
||||
new ComparableStack(ModItems.circuit_targeting_tier3, 1),
|
||||
new ComparableStack(ModItems.pipes_steel, 1),
|
||||
new ComparableStack(ModItems.mechanism_rifle_2, 1),
|
||||
new ComparableStack(ModBlocks.crate_iron, 1)
|
||||
new ComparableStack(ModBlocks.crate_iron, 1),
|
||||
new ComparableStack(ModItems.crt_display, 1)
|
||||
}, 200);
|
||||
makeRecipe(new ComparableStack(ModBlocks.turret_friendly, 1), new AStack[] {
|
||||
new ComparableStack(ModBlocks.machine_battery, 1),
|
||||
@ -649,7 +651,8 @@ public class AssemblerRecipes {
|
||||
new ComparableStack(ModItems.circuit_targeting_tier2, 1),
|
||||
new ComparableStack(ModItems.pipes_steel, 1),
|
||||
new ComparableStack(ModItems.mechanism_rifle_1, 1),
|
||||
new ComparableStack(ModBlocks.crate_iron, 1)
|
||||
new ComparableStack(ModBlocks.crate_iron, 1),
|
||||
new ComparableStack(ModItems.crt_display, 1)
|
||||
}, 200);
|
||||
makeRecipe(new ComparableStack(ModBlocks.turret_jeremy, 1), new AStack[] {
|
||||
new ComparableStack(ModBlocks.machine_battery, 1),
|
||||
@ -660,7 +663,8 @@ public class AssemblerRecipes {
|
||||
new ComparableStack(ModItems.motor_desh, 1),
|
||||
new ComparableStack(ModItems.hull_small_steel, 3),
|
||||
new ComparableStack(ModItems.mechanism_launcher_2, 1),
|
||||
new ComparableStack(ModBlocks.crate_steel, 1)
|
||||
new ComparableStack(ModBlocks.crate_steel, 1),
|
||||
new ComparableStack(ModItems.crt_display, 1)
|
||||
}, 200);
|
||||
makeRecipe(new ComparableStack(ModBlocks.turret_tauon, 1), new AStack[] {
|
||||
new ComparableStack(ModBlocks.machine_lithium_battery, 1),
|
||||
@ -671,7 +675,8 @@ public class AssemblerRecipes {
|
||||
new ComparableStack(ModItems.motor_desh, 1),
|
||||
new OreDictStack(CU.ingot(), 32),
|
||||
new ComparableStack(ModItems.mechanism_special, 1),
|
||||
new ComparableStack(ModItems.battery_lithium, 1)
|
||||
new ComparableStack(ModItems.battery_lithium, 1),
|
||||
new ComparableStack(ModItems.crt_display, 1)
|
||||
}, 200);
|
||||
makeRecipe(new ComparableStack(ModBlocks.turret_richard, 1), new AStack[] {
|
||||
new ComparableStack(ModBlocks.machine_battery, 1),
|
||||
@ -682,7 +687,8 @@ public class AssemblerRecipes {
|
||||
new OreDictStack(POLYMER.ingot(), 2),
|
||||
new ComparableStack(ModItems.hull_small_steel, 8),
|
||||
new ComparableStack(ModItems.mechanism_launcher_2, 1),
|
||||
new ComparableStack(ModBlocks.crate_steel, 1)
|
||||
new ComparableStack(ModBlocks.crate_steel, 1),
|
||||
new ComparableStack(ModItems.crt_display, 1)
|
||||
}, 200);
|
||||
makeRecipe(new ComparableStack(ModBlocks.turret_howard, 1), new AStack[] {
|
||||
new ComparableStack(ModBlocks.machine_battery, 1),
|
||||
@ -693,7 +699,8 @@ public class AssemblerRecipes {
|
||||
new ComparableStack(ModItems.circuit_targeting_tier3, 2),
|
||||
new ComparableStack(ModItems.pipes_steel, 2),
|
||||
new ComparableStack(ModItems.mechanism_rifle_2, 2),
|
||||
new ComparableStack(ModBlocks.crate_steel, 1)
|
||||
new ComparableStack(ModBlocks.crate_steel, 1),
|
||||
new ComparableStack(ModItems.crt_display, 1)
|
||||
}, 200);
|
||||
makeRecipe(new ComparableStack(ModBlocks.turret_maxwell, 1), new AStack[] {
|
||||
new ComparableStack(ModBlocks.machine_lithium_battery, 1),
|
||||
@ -704,7 +711,8 @@ public class AssemblerRecipes {
|
||||
new ComparableStack(ModItems.pipes_steel, 1),
|
||||
new ComparableStack(ModItems.mechanism_special, 3),
|
||||
new ComparableStack(ModItems.magnetron, 16),
|
||||
new OreDictStack(TCALLOY.ingot(), 8)
|
||||
new OreDictStack(TCALLOY.ingot(), 8),
|
||||
new ComparableStack(ModItems.crt_display, 1)
|
||||
}, 200);
|
||||
makeRecipe(new ComparableStack(ModBlocks.turret_fritz, 1), new AStack[] {
|
||||
new ComparableStack(ModBlocks.machine_battery, 1),
|
||||
@ -714,7 +722,8 @@ public class AssemblerRecipes {
|
||||
new ComparableStack(ModItems.circuit_targeting_tier3, 1),
|
||||
new ComparableStack(ModItems.pipes_steel, 1),
|
||||
new ComparableStack(ModItems.mechanism_launcher_1, 1),
|
||||
new ComparableStack(ModBlocks.barrel_steel, 1)
|
||||
new ComparableStack(ModBlocks.barrel_steel, 1),
|
||||
new ComparableStack(ModItems.crt_display, 1)
|
||||
}, 200);
|
||||
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_silex, 1), new AStack[] {
|
||||
@ -791,8 +800,8 @@ public class AssemblerRecipes {
|
||||
makeRecipe(new ComparableStack(ModBlocks.reactor_conductor, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 4), new OreDictStack(CU.plate(), 12), new ComparableStack(ModItems.wire_tungsten, 4), },130);
|
||||
makeRecipe(new ComparableStack(ModBlocks.reactor_computer, 1), new AStack[] {new ComparableStack(ModBlocks.reactor_conductor, 2), new ComparableStack(ModItems.circuit_targeting_tier3, 4), new ComparableStack(ModItems.circuit_gold, 1), },250);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_radgen, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 8), new OreDictStack(STEEL.plate(), 32), new ComparableStack(ModItems.coil_magnetized_tungsten, 6), new ComparableStack(ModItems.wire_magnetized_tungsten, 24), new ComparableStack(ModItems.circuit_gold, 4), new ComparableStack(ModItems.reactor_core, 3), new OreDictStack(STAR.ingot(), 1), new OreDictStack("dyeRed", 1), },400);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_reactor, 1), new AStack[] {new ComparableStack(ModItems.reactor_core, 1), new OreDictStack(STEEL.ingot(), 12), new OreDictStack(PB.plate(), 16), new ComparableStack(ModBlocks.reinforced_glass, 4), new OreDictStack(ASBESTOS.ingot(), 4), new OreDictStack(TCALLOY.ingot(), 4)},150);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_reactor_small, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 6), new OreDictStack(POLYMER.ingot(), 4), new OreDictStack(PB.plate(), 8), new OreDictStack(CU.plate(), 4), new OreDictStack(PB.ingot(), 12), new OreDictStack(MINGRADE.ingot(), 6), new ComparableStack(ModItems.circuit_copper, 8), new ComparableStack(ModItems.circuit_red_copper, 4), },300);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_reactor_breeding, 1), new AStack[] {new ComparableStack(ModItems.reactor_core, 1), new OreDictStack(STEEL.ingot(), 12), new OreDictStack(PB.plate(), 16), new ComparableStack(ModBlocks.reinforced_glass, 4), new OreDictStack(ASBESTOS.ingot(), 4), new OreDictStack(TCALLOY.ingot(), 4), new ComparableStack(ModItems.crt_display, 1)},150);
|
||||
makeRecipe(new ComparableStack(ModBlocks.reactor_research, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 8), new OreDictStack(TCALLOY.ingot(), 4), new ComparableStack(ModItems.motor_desh, 2), new OreDictStack(B.ingot(), 5), new OreDictStack(PB.ingot(), 12), new OreDictStack(PB.plate(), 2), new OreDictStack(AL.plate(), 4), new ComparableStack(ModItems.crt_display, 3), new ComparableStack(ModItems.circuit_copper, 2), },300);
|
||||
|
||||
} else {
|
||||
addTantalium(new ComparableStack(ModBlocks.machine_centrifuge, 1), 5);
|
||||
@ -836,6 +845,7 @@ public class AssemblerRecipes {
|
||||
new ComparableStack(ModItems.plate_polymer, 16),
|
||||
new ComparableStack(ModItems.circuit_gold, 5),
|
||||
new ComparableStack(ModItems.circuit_tantalium, 20),
|
||||
new ComparableStack(ModItems.crt_display, 8),
|
||||
}, 300);
|
||||
|
||||
makeRecipe(new ComparableStack(ModBlocks.hadron_core, 1), new AStack[] {
|
||||
@ -846,6 +856,7 @@ public class AssemblerRecipes {
|
||||
new ComparableStack(ModItems.circuit_gold, 5),
|
||||
new ComparableStack(ModItems.circuit_schrabidium, 5),
|
||||
new ComparableStack(ModItems.circuit_tantalium, 192),
|
||||
new ComparableStack(ModItems.crt_display, 1),
|
||||
}, 300);
|
||||
|
||||
makeRecipe(new ComparableStack(ModBlocks.struct_launcher_core, 1), new AStack[] {
|
||||
|
||||
@ -18,120 +18,64 @@ import net.minecraft.util.EnumChatFormatting;
|
||||
public class BreederRecipes {
|
||||
|
||||
private static HashMap<ComparableStack, BreederRecipe> recipes = new HashMap();
|
||||
private static HashMap<ComparableStack, int[]> fuels = new HashMap();
|
||||
//for the int array: [0] => level (1-4) [1] => amount of operations
|
||||
|
||||
public static void registerRecipes() {
|
||||
|
||||
//lithium and impure rods
|
||||
recipes.put(new ComparableStack(ModItems.rod_lithium), new BreederRecipe(ModItems.rod_tritium, 1));
|
||||
recipes.put(new ComparableStack(ModItems.rod_dual_lithium), new BreederRecipe(ModItems.rod_dual_tritium, 1));
|
||||
recipes.put(new ComparableStack(ModItems.rod_quad_lithium), new BreederRecipe(ModItems.rod_quad_tritium, 1));
|
||||
recipes.put(new ComparableStack(ModItems.rod_uranium), new BreederRecipe(ModItems.rod_plutonium, 4));
|
||||
recipes.put(new ComparableStack(ModItems.rod_dual_uranium), new BreederRecipe(ModItems.rod_dual_plutonium, 4));
|
||||
recipes.put(new ComparableStack(ModItems.rod_quad_uranium), new BreederRecipe(ModItems.rod_quad_plutonium, 4));
|
||||
recipes.put(new ComparableStack(ModItems.rod_plutonium), new BreederRecipe(ModItems.rod_waste, 4));
|
||||
recipes.put(new ComparableStack(ModItems.rod_dual_plutonium), new BreederRecipe(ModItems.rod_dual_waste, 4));
|
||||
recipes.put(new ComparableStack(ModItems.rod_quad_plutonium), new BreederRecipe(ModItems.rod_quad_waste, 4));
|
||||
recipes.put(new ComparableStack(ModItems.rod_lithium), new BreederRecipe(ModItems.rod_tritium, 100));
|
||||
recipes.put(new ComparableStack(ModItems.rod_dual_lithium), new BreederRecipe(ModItems.rod_dual_tritium, 200));
|
||||
recipes.put(new ComparableStack(ModItems.rod_quad_lithium), new BreederRecipe(ModItems.rod_quad_tritium, 400));
|
||||
recipes.put(new ComparableStack(ModItems.rod_uranium), new BreederRecipe(ModItems.rod_plutonium, 1000));
|
||||
recipes.put(new ComparableStack(ModItems.rod_dual_uranium), new BreederRecipe(ModItems.rod_dual_plutonium, 2000));
|
||||
recipes.put(new ComparableStack(ModItems.rod_quad_uranium), new BreederRecipe(ModItems.rod_quad_plutonium, 4000));
|
||||
recipes.put(new ComparableStack(ModItems.rod_plutonium), new BreederRecipe(ModItems.rod_waste, 500));
|
||||
recipes.put(new ComparableStack(ModItems.rod_dual_plutonium), new BreederRecipe(ModItems.rod_dual_waste, 1000));
|
||||
recipes.put(new ComparableStack(ModItems.rod_quad_plutonium), new BreederRecipe(ModItems.rod_quad_waste, 2000));
|
||||
|
||||
//isotopes
|
||||
recipes.put(new ComparableStack(ModItems.rod_th232), new BreederRecipe(ModItems.rod_u233, 2));
|
||||
recipes.put(new ComparableStack(ModItems.rod_dual_th232), new BreederRecipe(ModItems.rod_dual_u233, 2));
|
||||
recipes.put(new ComparableStack(ModItems.rod_quad_th232), new BreederRecipe(ModItems.rod_quad_u233, 2));
|
||||
recipes.put(new ComparableStack(ModItems.rod_u233), new BreederRecipe(ModItems.rod_u235, 2));
|
||||
recipes.put(new ComparableStack(ModItems.rod_dual_u233), new BreederRecipe(ModItems.rod_dual_u235, 2));
|
||||
recipes.put(new ComparableStack(ModItems.rod_quad_u233), new BreederRecipe(ModItems.rod_quad_u235, 2));
|
||||
recipes.put(new ComparableStack(ModItems.rod_u235), new BreederRecipe(ModItems.rod_neptunium, 3));
|
||||
recipes.put(new ComparableStack(ModItems.rod_dual_u235), new BreederRecipe(ModItems.rod_dual_neptunium, 3));
|
||||
recipes.put(new ComparableStack(ModItems.rod_quad_u235), new BreederRecipe(ModItems.rod_quad_neptunium, 3));
|
||||
recipes.put(new ComparableStack(ModItems.rod_u238), new BreederRecipe(ModItems.rod_pu239, 3));
|
||||
recipes.put(new ComparableStack(ModItems.rod_dual_u238), new BreederRecipe(ModItems.rod_dual_pu239, 3));
|
||||
recipes.put(new ComparableStack(ModItems.rod_quad_u238), new BreederRecipe(ModItems.rod_quad_pu239, 3));
|
||||
recipes.put(new ComparableStack(ModItems.rod_neptunium), new BreederRecipe(ModItems.rod_pu238, 3));
|
||||
recipes.put(new ComparableStack(ModItems.rod_dual_neptunium), new BreederRecipe(ModItems.rod_dual_pu238, 3));
|
||||
recipes.put(new ComparableStack(ModItems.rod_quad_neptunium), new BreederRecipe(ModItems.rod_quad_pu238, 3));
|
||||
recipes.put(new ComparableStack(ModItems.rod_pu238), new BreederRecipe(ModItems.rod_pu239, 4));
|
||||
recipes.put(new ComparableStack(ModItems.rod_dual_pu238), new BreederRecipe(ModItems.rod_dual_pu239, 4));
|
||||
recipes.put(new ComparableStack(ModItems.rod_quad_pu238), new BreederRecipe(ModItems.rod_quad_pu239, 4));
|
||||
recipes.put(new ComparableStack(ModItems.rod_pu239), new BreederRecipe(ModItems.rod_pu240, 2));
|
||||
recipes.put(new ComparableStack(ModItems.rod_dual_pu239), new BreederRecipe(ModItems.rod_dual_pu240, 2));
|
||||
recipes.put(new ComparableStack(ModItems.rod_quad_pu239), new BreederRecipe(ModItems.rod_quad_pu240, 2));
|
||||
recipes.put(new ComparableStack(ModItems.rod_pu240), new BreederRecipe(ModItems.rod_waste, 3));
|
||||
recipes.put(new ComparableStack(ModItems.rod_dual_pu240), new BreederRecipe(ModItems.rod_dual_waste, 3));
|
||||
recipes.put(new ComparableStack(ModItems.rod_quad_pu240), new BreederRecipe(ModItems.rod_quad_waste, 3));
|
||||
recipes.put(new ComparableStack(ModItems.rod_th232), new BreederRecipe(ModItems.rod_u233, 1000));
|
||||
recipes.put(new ComparableStack(ModItems.rod_dual_th232), new BreederRecipe(ModItems.rod_dual_u233, 2000));
|
||||
recipes.put(new ComparableStack(ModItems.rod_quad_th232), new BreederRecipe(ModItems.rod_quad_u233, 4000));
|
||||
recipes.put(new ComparableStack(ModItems.rod_u233), new BreederRecipe(ModItems.rod_u235, 1000));
|
||||
recipes.put(new ComparableStack(ModItems.rod_dual_u233), new BreederRecipe(ModItems.rod_dual_u235, 2000));
|
||||
recipes.put(new ComparableStack(ModItems.rod_quad_u233), new BreederRecipe(ModItems.rod_quad_u235, 4000));
|
||||
recipes.put(new ComparableStack(ModItems.rod_u235), new BreederRecipe(ModItems.rod_neptunium, 500));
|
||||
recipes.put(new ComparableStack(ModItems.rod_dual_u235), new BreederRecipe(ModItems.rod_dual_neptunium, 1000));
|
||||
recipes.put(new ComparableStack(ModItems.rod_quad_u235), new BreederRecipe(ModItems.rod_quad_neptunium, 2000));
|
||||
recipes.put(new ComparableStack(ModItems.rod_u238), new BreederRecipe(ModItems.rod_pu239, 1000));
|
||||
recipes.put(new ComparableStack(ModItems.rod_dual_u238), new BreederRecipe(ModItems.rod_dual_pu239, 2000));
|
||||
recipes.put(new ComparableStack(ModItems.rod_quad_u238), new BreederRecipe(ModItems.rod_quad_pu239, 4000));
|
||||
recipes.put(new ComparableStack(ModItems.rod_neptunium), new BreederRecipe(ModItems.rod_pu238, 250));
|
||||
recipes.put(new ComparableStack(ModItems.rod_dual_neptunium), new BreederRecipe(ModItems.rod_dual_pu238, 500));
|
||||
recipes.put(new ComparableStack(ModItems.rod_quad_neptunium), new BreederRecipe(ModItems.rod_quad_pu238, 1000));
|
||||
recipes.put(new ComparableStack(ModItems.rod_pu238), new BreederRecipe(ModItems.rod_pu239, 1000));
|
||||
recipes.put(new ComparableStack(ModItems.rod_dual_pu238), new BreederRecipe(ModItems.rod_dual_pu239, 2000));
|
||||
recipes.put(new ComparableStack(ModItems.rod_quad_pu238), new BreederRecipe(ModItems.rod_quad_pu239, 4000));
|
||||
recipes.put(new ComparableStack(ModItems.rod_pu239), new BreederRecipe(ModItems.rod_pu240, 500));
|
||||
recipes.put(new ComparableStack(ModItems.rod_dual_pu239), new BreederRecipe(ModItems.rod_dual_pu240, 1000));
|
||||
recipes.put(new ComparableStack(ModItems.rod_quad_pu239), new BreederRecipe(ModItems.rod_quad_pu240, 2000));
|
||||
recipes.put(new ComparableStack(ModItems.rod_pu240), new BreederRecipe(ModItems.rod_waste, 500));
|
||||
recipes.put(new ComparableStack(ModItems.rod_dual_pu240), new BreederRecipe(ModItems.rod_dual_waste, 1000));
|
||||
recipes.put(new ComparableStack(ModItems.rod_quad_pu240), new BreederRecipe(ModItems.rod_quad_waste, 2000));
|
||||
|
||||
//advanced
|
||||
recipes.put(new ComparableStack(ModItems.rod_schrabidium), new BreederRecipe(ModItems.rod_solinium, 3));
|
||||
recipes.put(new ComparableStack(ModItems.rod_dual_schrabidium), new BreederRecipe(ModItems.rod_dual_solinium, 3));
|
||||
recipes.put(new ComparableStack(ModItems.rod_quad_schrabidium), new BreederRecipe(ModItems.rod_quad_solinium, 3));
|
||||
recipes.put(new ComparableStack(ModItems.rod_quad_solinium), new BreederRecipe(ModItems.rod_quad_euphemium, 4));
|
||||
recipes.put(new ComparableStack(ModItems.rod_balefire), new BreederRecipe(ModItems.rod_balefire_blazing, 4));
|
||||
recipes.put(new ComparableStack(ModItems.rod_dual_balefire), new BreederRecipe(ModItems.rod_dual_balefire_blazing, 4));
|
||||
recipes.put(new ComparableStack(ModItems.rod_quad_balefire), new BreederRecipe(ModItems.rod_quad_balefire_blazing, 4));
|
||||
recipes.put(new ComparableStack(ModItems.rod_schrabidium), new BreederRecipe(ModItems.rod_solinium, 2000));
|
||||
recipes.put(new ComparableStack(ModItems.rod_dual_schrabidium), new BreederRecipe(ModItems.rod_dual_solinium, 4000));
|
||||
recipes.put(new ComparableStack(ModItems.rod_quad_schrabidium), new BreederRecipe(ModItems.rod_quad_solinium, 8000));
|
||||
recipes.put(new ComparableStack(ModItems.rod_quad_solinium), new BreederRecipe(ModItems.rod_quad_euphemium, 2000));
|
||||
recipes.put(new ComparableStack(ModItems.rod_balefire), new BreederRecipe(ModItems.rod_balefire_blazing, 2000));
|
||||
recipes.put(new ComparableStack(ModItems.rod_dual_balefire), new BreederRecipe(ModItems.rod_dual_balefire_blazing, 4000));
|
||||
recipes.put(new ComparableStack(ModItems.rod_quad_balefire), new BreederRecipe(ModItems.rod_quad_balefire_blazing, 8000));
|
||||
|
||||
//rocks
|
||||
recipes.put(new ComparableStack(Blocks.stone), new BreederRecipe(new ItemStack(ModBlocks.sellafield_0), 2));
|
||||
recipes.put(new ComparableStack(ModBlocks.sellafield_0), new BreederRecipe(new ItemStack(ModBlocks.sellafield_1), 2));
|
||||
recipes.put(new ComparableStack(ModBlocks.sellafield_1), new BreederRecipe(new ItemStack(ModBlocks.sellafield_2), 3));
|
||||
recipes.put(new ComparableStack(ModBlocks.sellafield_2), new BreederRecipe(new ItemStack(ModBlocks.sellafield_3), 3));
|
||||
recipes.put(new ComparableStack(ModBlocks.sellafield_3), new BreederRecipe(new ItemStack(ModBlocks.sellafield_4), 4));
|
||||
recipes.put(new ComparableStack(ModBlocks.sellafield_4), new BreederRecipe(new ItemStack(ModBlocks.sellafield_core), 4));
|
||||
recipes.put(new ComparableStack(Blocks.stone), new BreederRecipe(new ItemStack(ModBlocks.sellafield_0), 250));
|
||||
recipes.put(new ComparableStack(ModBlocks.sellafield_0), new BreederRecipe(new ItemStack(ModBlocks.sellafield_1), 250));
|
||||
recipes.put(new ComparableStack(ModBlocks.sellafield_1), new BreederRecipe(new ItemStack(ModBlocks.sellafield_2), 500));
|
||||
recipes.put(new ComparableStack(ModBlocks.sellafield_2), new BreederRecipe(new ItemStack(ModBlocks.sellafield_3), 500));
|
||||
recipes.put(new ComparableStack(ModBlocks.sellafield_3), new BreederRecipe(new ItemStack(ModBlocks.sellafield_4), 1000));
|
||||
recipes.put(new ComparableStack(ModBlocks.sellafield_4), new BreederRecipe(new ItemStack(ModBlocks.sellafield_core), 1000));
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.meteorite_sword_etched), new BreederRecipe(new ItemStack(ModItems.meteorite_sword_bred), 4));
|
||||
}
|
||||
|
||||
public static void registerFuels() {
|
||||
fuels.put(new ComparableStack(ModItems.rod_u233), new int[] {2, 2});
|
||||
fuels.put(new ComparableStack(ModItems.rod_dual_u233), new int[] {2, 4});
|
||||
fuels.put(new ComparableStack(ModItems.rod_quad_u233), new int[] {2, 8});
|
||||
|
||||
fuels.put(new ComparableStack(ModItems.rod_u235), new int[] {2, 3});
|
||||
fuels.put(new ComparableStack(ModItems.rod_dual_u235), new int[] {2, 6});
|
||||
fuels.put(new ComparableStack(ModItems.rod_quad_u235), new int[] {2, 12});
|
||||
|
||||
fuels.put(new ComparableStack(ModItems.rod_u238), new int[] {1, 1});
|
||||
fuels.put(new ComparableStack(ModItems.rod_dual_u238), new int[] {1, 2});
|
||||
fuels.put(new ComparableStack(ModItems.rod_quad_u238), new int[] {1, 4});
|
||||
|
||||
fuels.put(new ComparableStack(ModItems.rod_neptunium), new int[] {2, 3});
|
||||
fuels.put(new ComparableStack(ModItems.rod_dual_neptunium), new int[] {2, 6});
|
||||
fuels.put(new ComparableStack(ModItems.rod_quad_neptunium), new int[] {2, 12});
|
||||
|
||||
fuels.put(new ComparableStack(ModItems.rod_pu238), new int[] {1, 2});
|
||||
fuels.put(new ComparableStack(ModItems.rod_dual_pu238), new int[] {1, 4});
|
||||
fuels.put(new ComparableStack(ModItems.rod_quad_pu238), new int[] {1, 8});
|
||||
|
||||
fuels.put(new ComparableStack(ModItems.rod_pu239), new int[] {3, 5});
|
||||
fuels.put(new ComparableStack(ModItems.rod_dual_pu239), new int[] {3, 10});
|
||||
fuels.put(new ComparableStack(ModItems.rod_quad_pu239), new int[] {3, 20});
|
||||
|
||||
fuels.put(new ComparableStack(ModItems.rod_pu240), new int[] {1, 2});
|
||||
fuels.put(new ComparableStack(ModItems.rod_dual_pu240), new int[] {1, 4});
|
||||
fuels.put(new ComparableStack(ModItems.rod_quad_pu240), new int[] {1, 8});
|
||||
|
||||
fuels.put(new ComparableStack(ModItems.rod_schrabidium), new int[] {3, 10});
|
||||
fuels.put(new ComparableStack(ModItems.rod_dual_schrabidium), new int[] {3, 20});
|
||||
fuels.put(new ComparableStack(ModItems.rod_quad_schrabidium), new int[] {3, 40});
|
||||
|
||||
fuels.put(new ComparableStack(ModItems.rod_solinium), new int[] {3, 15});
|
||||
fuels.put(new ComparableStack(ModItems.rod_dual_solinium), new int[] {3, 30});
|
||||
fuels.put(new ComparableStack(ModItems.rod_quad_solinium), new int[] {3, 60});
|
||||
|
||||
fuels.put(new ComparableStack(ModItems.rod_polonium), new int[] {4, 2});
|
||||
fuels.put(new ComparableStack(ModItems.rod_dual_polonium), new int[] {4, 4});
|
||||
fuels.put(new ComparableStack(ModItems.rod_quad_polonium), new int[] {4, 8});
|
||||
|
||||
fuels.put(new ComparableStack(ModItems.rod_tritium), new int[] {1, 1});
|
||||
fuels.put(new ComparableStack(ModItems.rod_dual_tritium), new int[] {1, 2});
|
||||
fuels.put(new ComparableStack(ModItems.rod_quad_tritium), new int[] {1, 4});
|
||||
|
||||
fuels.put(new ComparableStack(ModItems.rod_balefire), new int[] {2, 150});
|
||||
fuels.put(new ComparableStack(ModItems.rod_dual_balefire), new int[] {2, 300});
|
||||
fuels.put(new ComparableStack(ModItems.rod_quad_balefire), new int[] {2, 600});
|
||||
|
||||
fuels.put(new ComparableStack(ModItems.rod_balefire_blazing), new int[] {4, 75});
|
||||
fuels.put(new ComparableStack(ModItems.rod_dual_balefire_blazing), new int[] {4, 150});
|
||||
fuels.put(new ComparableStack(ModItems.rod_quad_balefire_blazing), new int[] {4, 300});
|
||||
recipes.put(new ComparableStack(ModItems.meteorite_sword_etched), new BreederRecipe(new ItemStack(ModItems.meteorite_sword_bred), 1000));
|
||||
}
|
||||
|
||||
public static HashMap<ItemStack, BreederRecipe> getAllRecipes() {
|
||||
@ -145,20 +89,6 @@ public class BreederRecipes {
|
||||
return map;
|
||||
}
|
||||
|
||||
public static List<ItemStack> getAllFuelsFromHEAT(int heat) {
|
||||
|
||||
List<ItemStack> list = new ArrayList();
|
||||
|
||||
for(Map.Entry<ComparableStack, int[]> fuel : fuels.entrySet()) {
|
||||
|
||||
if(fuel.getValue()[0] >= heat) {
|
||||
list.add(fuel.getKey().toStack());
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public static BreederRecipe getOutput(ItemStack stack) {
|
||||
|
||||
if(stack == null)
|
||||
@ -168,51 +98,19 @@ public class BreederRecipes {
|
||||
return BreederRecipes.recipes.get(sta);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an integer array of the fuel value of a certain stack
|
||||
* @param stack
|
||||
* @return an integer array (possibly null) with two fields, the HEAT value and the amount of operations
|
||||
*/
|
||||
public static int[] getFuelValue(ItemStack stack) {
|
||||
|
||||
if(stack == null)
|
||||
return null;
|
||||
|
||||
ComparableStack sta = new ComparableStack(stack);
|
||||
int[] ret = BreederRecipes.fuels.get(sta);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static String getHEATString(String string, int heat) {
|
||||
|
||||
if(heat == 1)
|
||||
string = EnumChatFormatting.GREEN + string;
|
||||
if(heat == 2)
|
||||
string = EnumChatFormatting.YELLOW + string;
|
||||
if(heat == 3)
|
||||
string = EnumChatFormatting.GOLD + string;
|
||||
if(heat == 4)
|
||||
string = EnumChatFormatting.RED + string;
|
||||
|
||||
return string; //strings are reference types I GET IT
|
||||
}
|
||||
|
||||
//nicer than opaque object arrays
|
||||
public static class BreederRecipe {
|
||||
|
||||
public ItemStack output;
|
||||
public int heat;
|
||||
public int flux;
|
||||
|
||||
public BreederRecipe() { }
|
||||
|
||||
public BreederRecipe(Item output, int heat) {
|
||||
this(new ItemStack(output), heat);
|
||||
public BreederRecipe(Item output, int flux) {
|
||||
this(new ItemStack(output), flux);
|
||||
}
|
||||
|
||||
public BreederRecipe(ItemStack output, int heat) {
|
||||
public BreederRecipe(ItemStack output, int flux) {
|
||||
this.output = output;
|
||||
this.heat = heat;
|
||||
this.flux = flux;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -173,7 +173,8 @@ public class AnvilRecipes {
|
||||
new OreDictStack(POLYMER.ingot(), 4),
|
||||
new ComparableStack(ModItems.generator_steel, 2),
|
||||
new ComparableStack(ModItems.turbine_titanium, 1),
|
||||
new ComparableStack(ModItems.thermo_element, 3)
|
||||
new ComparableStack(ModItems.thermo_element, 3),
|
||||
new ComparableStack(ModItems.crt_display, 1)
|
||||
}, new AnvilOutput(new ItemStack(ModBlocks.machine_industrial_generator))).setTier(2));
|
||||
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(
|
||||
@ -586,7 +587,7 @@ public class AnvilRecipes {
|
||||
new AnvilOutput(new ItemStack(ModItems.pipes_steel, 2))
|
||||
}).setTier(4));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(
|
||||
new ComparableStack(ModBlocks.machine_reactor_small), new AnvilOutput[] {
|
||||
new ComparableStack(ModBlocks.reactor_research), new AnvilOutput[] {
|
||||
new AnvilOutput(new ItemStack(ModItems.ingot_steel, 6)),
|
||||
new AnvilOutput(new ItemStack(ModItems.ingot_polymer, 1)),
|
||||
new AnvilOutput(new ItemStack(ModItems.ingot_polymer, 1), 0.75F),
|
||||
|
||||
@ -510,6 +510,7 @@ public class ModItems {
|
||||
public static Item circuit_bismuth;
|
||||
public static Item circuit_tantalium_raw;
|
||||
public static Item circuit_tantalium;
|
||||
public static Item crt_display;
|
||||
public static ItemEnumMulti circuit_star_piece;
|
||||
public static ItemEnumMulti circuit_star_component;
|
||||
public static Item circuit_star;
|
||||
@ -862,9 +863,9 @@ public class ModItems {
|
||||
public static Item radaway_flush;
|
||||
public static Item radx;
|
||||
public static Item siox;
|
||||
public static Item pirfenidone;
|
||||
public static Item xanax;
|
||||
public static Item fmn;
|
||||
public static Item pirfenidone;
|
||||
public static Item five_htp;
|
||||
public static Item med_bag;
|
||||
public static Item pill_iodine;
|
||||
@ -3050,6 +3051,7 @@ public class ModItems {
|
||||
circuit_bismuth = new ItemCustomLore().setRarity(EnumRarity.uncommon).setUnlocalizedName("circuit_bismuth").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":circuit_bismuth");
|
||||
circuit_tantalium_raw = new Item().setUnlocalizedName("circuit_tantalium_raw").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":circuit_tantalium_raw");
|
||||
circuit_tantalium = new ItemCustomLore().setRarity(EnumRarity.uncommon).setUnlocalizedName("circuit_tantalium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":circuit_tantalium");
|
||||
crt_display = new Item().setUnlocalizedName("crt_display").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":crt_display");
|
||||
circuit_star_piece = (ItemEnumMulti) new ItemEnumMulti(ScrapType.class, true, true).setUnlocalizedName("circuit_star_piece").setCreativeTab(null);
|
||||
circuit_star_component = (ItemEnumMulti) new ItemCircuitStarComponent().setUnlocalizedName("circuit_star_component").setCreativeTab(null);
|
||||
circuit_star = new ItemCustomLore().setRarity(EnumRarity.uncommon).setUnlocalizedName("circuit_star").setCreativeTab(null).setTextureName(RefStrings.MODID + ":circuit_star");
|
||||
@ -3314,10 +3316,9 @@ public class ModItems {
|
||||
med_bag = new ItemSyringe().setUnlocalizedName("med_bag").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":med_bag");
|
||||
radx = new ItemPill(0).setUnlocalizedName("radx").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":radx");
|
||||
siox = new ItemPill(0).setUnlocalizedName("siox").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":siox");
|
||||
xanax = new ItemPill(0).setUnlocalizedName("xanax").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":xanax_2");
|
||||
chocolate = new ItemPill(0).setUnlocalizedName("chocolate").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":chocolate");
|
||||
fmn = new ItemPill(0).setUnlocalizedName("fmn").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":tablet");
|
||||
pirfenidone = new ItemPill(0).setUnlocalizedName("pirfenidone").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":pirfenidone");
|
||||
xanax = new ItemPill(0).setUnlocalizedName("xanax").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":xanax_2");
|
||||
fmn = new ItemPill(0).setUnlocalizedName("fmn").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":tablet");
|
||||
five_htp = new ItemPill(0).setUnlocalizedName("five_htp").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":5htp");
|
||||
pill_iodine = new ItemPill(0).setUnlocalizedName("pill_iodine").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":pill_iodine");
|
||||
plan_c = new ItemPill(0).setUnlocalizedName("plan_c").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":plan_c");
|
||||
@ -3410,6 +3411,7 @@ public class ModItems {
|
||||
chocolate_milk = new ItemEnergy().setUnlocalizedName("chocolate_milk").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":chocolate_milk");
|
||||
coffee = new ItemEnergy().setUnlocalizedName("coffee").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":coffee");
|
||||
coffee_radium = new ItemEnergy().setUnlocalizedName("coffee_radium").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":coffee_radium");
|
||||
chocolate = new ItemPill(0).setUnlocalizedName("chocolate").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":chocolate");
|
||||
cap_nuka = new Item().setUnlocalizedName("cap_nuka").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":cap_nuka");
|
||||
cap_quantum = new Item().setUnlocalizedName("cap_quantum").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":cap_quantum");
|
||||
cap_sparkle = new Item().setUnlocalizedName("cap_sparkle").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":cap_sparkle");
|
||||
@ -3586,11 +3588,11 @@ public class ModItems {
|
||||
pile_rod_source = new ItemPileRod().setUnlocalizedName("pile_rod_source").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":pile_rod_source");
|
||||
pile_rod_boron = new ItemPileRod().setUnlocalizedName("pile_rod_boron").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":pile_rod_boron");
|
||||
|
||||
plate_fuel_u233 = new ItemPlateFuel(1100000).setFunction(FunctionEnum.SQUARE_ROOT, 50).setUnlocalizedName("plate_fuel_u233").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":plate_fuel_u233");
|
||||
plate_fuel_u235 = new ItemPlateFuel(1100000).setFunction(FunctionEnum.SQUARE_ROOT, 40).setUnlocalizedName("plate_fuel_u235").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":plate_fuel_u235");
|
||||
plate_fuel_mox = new ItemPlateFuel(1400000).setFunction(FunctionEnum.LOGARITHM, 50).setUnlocalizedName("plate_fuel_mox").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":plate_fuel_mox");
|
||||
plate_fuel_pu239 = new ItemPlateFuel(1000000).setFunction(FunctionEnum.NEGATIVE_QUADRATIC, 25).setUnlocalizedName("plate_fuel_pu239").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":plate_fuel_pu239");
|
||||
plate_fuel_sa326 = new ItemPlateFuel(1000000).setFunction(FunctionEnum.LINEAR, 60).setUnlocalizedName("plate_fuel_sa326").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":plate_fuel_sa326");
|
||||
plate_fuel_u233 = new ItemPlateFuel(2200000).setFunction(FunctionEnum.SQUARE_ROOT, 50).setUnlocalizedName("plate_fuel_u233").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":plate_fuel_u233");
|
||||
plate_fuel_u235 = new ItemPlateFuel(2200000).setFunction(FunctionEnum.SQUARE_ROOT, 40).setUnlocalizedName("plate_fuel_u235").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":plate_fuel_u235");
|
||||
plate_fuel_mox = new ItemPlateFuel(2400000).setFunction(FunctionEnum.LOGARITHM, 50).setUnlocalizedName("plate_fuel_mox").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":plate_fuel_mox");
|
||||
plate_fuel_pu239 = new ItemPlateFuel(2000000).setFunction(FunctionEnum.NEGATIVE_QUADRATIC, 25).setUnlocalizedName("plate_fuel_pu239").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":plate_fuel_pu239");
|
||||
plate_fuel_sa326 = new ItemPlateFuel(2000000).setFunction(FunctionEnum.LINEAR, 60).setUnlocalizedName("plate_fuel_sa326").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":plate_fuel_sa326");
|
||||
|
||||
rbmk_lid = new ItemRBMKLid().setUnlocalizedName("rbmk_lid").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":rbmk_lid");
|
||||
rbmk_lid_glass = new ItemRBMKLid().setUnlocalizedName("rbmk_lid_glass").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":rbmk_lid_glass");
|
||||
@ -6105,6 +6107,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(circuit_bismuth, circuit_bismuth.getUnlocalizedName());
|
||||
GameRegistry.registerItem(circuit_tantalium_raw, circuit_tantalium_raw.getUnlocalizedName());
|
||||
GameRegistry.registerItem(circuit_tantalium, circuit_tantalium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(crt_display, crt_display.getUnlocalizedName());
|
||||
GameRegistry.registerItem(circuit_star_piece, circuit_star_piece.getUnlocalizedName());
|
||||
GameRegistry.registerItem(circuit_star_component, circuit_star_component.getUnlocalizedName());
|
||||
GameRegistry.registerItem(circuit_star, circuit_star.getUnlocalizedName());
|
||||
@ -7490,11 +7493,10 @@ public class ModItems {
|
||||
GameRegistry.registerItem(radaway_flush, radaway_flush.getUnlocalizedName());
|
||||
GameRegistry.registerItem(radx, radx.getUnlocalizedName());
|
||||
GameRegistry.registerItem(siox, siox.getUnlocalizedName());
|
||||
GameRegistry.registerItem(pirfenidone, pirfenidone.getUnlocalizedName());
|
||||
GameRegistry.registerItem(pill_iodine, pill_iodine.getUnlocalizedName());
|
||||
GameRegistry.registerItem(xanax, xanax.getUnlocalizedName());
|
||||
GameRegistry.registerItem(chocolate, chocolate.getUnlocalizedName());
|
||||
GameRegistry.registerItem(fmn, fmn.getUnlocalizedName());
|
||||
GameRegistry.registerItem(pirfenidone, pirfenidone.getUnlocalizedName());
|
||||
GameRegistry.registerItem(five_htp, five_htp.getUnlocalizedName());
|
||||
GameRegistry.registerItem(plan_c, plan_c.getUnlocalizedName());
|
||||
GameRegistry.registerItem(stealth_boy, stealth_boy.getUnlocalizedName());
|
||||
@ -7537,6 +7539,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(canteen_vodka, canteen_vodka.getUnlocalizedName());
|
||||
GameRegistry.registerItem(canteen_fab, canteen_fab.getUnlocalizedName());
|
||||
GameRegistry.registerItem(mucho_mango, mucho_mango.getUnlocalizedName());
|
||||
GameRegistry.registerItem(chocolate, chocolate.getUnlocalizedName());
|
||||
|
||||
//Energy Drinks
|
||||
GameRegistry.registerItem(can_empty, can_empty.getUnlocalizedName());
|
||||
|
||||
@ -18,8 +18,7 @@ public class ItemReactorSensor extends Item {
|
||||
|
||||
Block b = world.getBlock(x, y, z);
|
||||
|
||||
if (b == ModBlocks.machine_reactor_small || b == ModBlocks.dummy_block_reactor_small
|
||||
|| b == ModBlocks.dummy_port_reactor_small) {
|
||||
if (b == ModBlocks.reactor_research) {
|
||||
|
||||
if (stack.stackTagCompound == null)
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
|
||||
@ -107,11 +107,11 @@ public class ItemStarterKit extends Item {
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_difurnace_off, 1));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_gascent, 1));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_puf6_tank, 1));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_reactor, 1));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_reactor_breeding, 1));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_nuke_furnace_off, 1));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_assembler, 1));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_chemplant, 1));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_reactor_small, 1));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.reactor_research, 1));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_turbine, 2));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.radaway, 8));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.radx, 2));
|
||||
@ -182,9 +182,9 @@ public class ItemStarterKit extends Item {
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_centrifuge, 2));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_uf6_tank, 2));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_puf6_tank, 2));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_reactor, 2));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_reactor_breeding, 2));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_rtg_furnace_off, 2));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_reactor_small, 4));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.reactor_research, 4));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_turbine, 4));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_radgen, 1));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_rtg_grey, 1));
|
||||
@ -256,7 +256,7 @@ public class ItemStarterKit extends Item {
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_nuke_furnace_off, 2));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_rtg_furnace_off, 3));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_rtg_grey, 2));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_reactor_small, 8));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.reactor_research, 8));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_turbine, 16));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_lithium_battery, 4));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.red_cable, 32));
|
||||
|
||||
@ -175,7 +175,6 @@ public class Library {
|
||||
world.getBlock(x, y, z) == ModBlocks.dummy_port_ams_limiter ||
|
||||
world.getBlock(x, y, z) == ModBlocks.dummy_port_ams_emitter ||
|
||||
world.getBlock(x, y, z) == ModBlocks.dummy_port_ams_base ||
|
||||
world.getBlock(x, y, z) == ModBlocks.dummy_port_reactor_small ||
|
||||
world.getBlock(x, y, z) == ModBlocks.dummy_port_compact_launcher ||
|
||||
world.getBlock(x, y, z) == ModBlocks.dummy_port_launch_table ||
|
||||
world.getBlock(x, y, z) == ModBlocks.rbmk_loader) {
|
||||
@ -541,11 +540,6 @@ public class Library {
|
||||
{
|
||||
tileentity = worldObj.getTileEntity(((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetX, ((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetY, ((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetZ);
|
||||
}
|
||||
//Small Nuclear Reactor
|
||||
if(block == ModBlocks.dummy_port_reactor_small)
|
||||
{
|
||||
tileentity = worldObj.getTileEntity(((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetX, ((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetY, ((TileEntityDummy)worldObj.getTileEntity(x, y, z)).targetZ);
|
||||
}
|
||||
//Launchers
|
||||
if(block == ModBlocks.dummy_port_compact_launcher || block == ModBlocks.dummy_port_launch_table)
|
||||
{
|
||||
|
||||
@ -191,7 +191,7 @@ public class ClientProxy extends ServerProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineRadGen.class, new RenderRadGen());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineRadar.class, new RenderRadar());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineSeleniumEngine.class, new RenderSelenium());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineReactorSmall.class, new RenderSmallReactor());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityReactorResearch.class, new RenderSmallReactor());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineShredderLarge.class, new RenderMachineShredder());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTesla.class, new RenderTesla());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBarrel.class, new RenderFluidBarrel());
|
||||
@ -203,7 +203,7 @@ public class ClientProxy extends ServerProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityForceField.class, new RenderMachineForceField());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineFENSU.class, new RenderFENSU());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineLargeTurbine.class, new RenderBigTurbine());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineReactor.class, new RenderBreeder());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineReactorBreeding.class, new RenderBreeder());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySolarBoiler.class, new RenderSolarBoiler());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityStorageDrum.class, new RenderStorageDrum());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityChungus.class, new RenderChungus());
|
||||
|
||||
@ -777,7 +777,7 @@ public class CraftingManager {
|
||||
addRecipeAuto(new ItemStack(ModBlocks.rbmk_reflector, 1), new Object[] { "GGG", "GRG", "GGG", 'G', OreDictManager.getReflector(), 'R', ModBlocks.rbmk_blank });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.rbmk_control, 1), new Object[] { " B ", "GRG", " B ", 'G', GRAPHITE.ingot(), 'B', ModItems.motor, 'R', ModBlocks.rbmk_absorber });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.rbmk_control_mod, 1), new Object[] { "BGB", "GRG", "BGB", 'G', GRAPHITE.block(), 'R', ModBlocks.rbmk_control, 'B', ModItems.nugget_bismuth });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.rbmk_control_auto, 1), new Object[] { "C", "R", "C", 'C', ModItems.circuit_targeting_tier1, 'R', ModBlocks.rbmk_control });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.rbmk_control_auto, 1), new Object[] { "C", "R", "D", 'C', ModItems.circuit_targeting_tier1, 'R', ModBlocks.rbmk_control, 'D', ModItems.crt_display });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.rbmk_rod_reasim, 1), new Object[] { "ZCZ", "ZRZ", "ZCZ", 'C', ModItems.hull_small_steel, 'R', ModBlocks.rbmk_blank, 'Z', ZR.ingot() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.rbmk_rod_reasim_mod, 1), new Object[] { "BGB", "GRG", "BGB", 'G', GRAPHITE.block(), 'R', ModBlocks.rbmk_rod_reasim, 'B', TCALLOY.ingot() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.rbmk_outgasser, 1), new Object[] { "GHG", "GRG", "GTG", 'G', ModBlocks.steel_grate, 'H', Blocks.hopper, 'T', ModItems.tank_steel, 'R', ModBlocks.rbmk_blank });
|
||||
|
||||
@ -83,6 +83,7 @@ import com.hbm.saveddata.satellites.Satellite;
|
||||
import com.hbm.tileentity.TileMappings;
|
||||
import com.hbm.tileentity.bomb.TileEntityNukeCustom;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactorLarge;
|
||||
import com.hbm.tileentity.machine.TileEntityNukeFurnace;
|
||||
import com.hbm.tileentity.machine.rbmk.RBMKDials;
|
||||
import com.hbm.util.ArmorUtil;
|
||||
import com.hbm.world.feature.SchistStratum;
|
||||
@ -945,7 +946,7 @@ public class MainRegistry {
|
||||
ShredderRecipes.registerOverrides();
|
||||
CrystallizerRecipes.register();
|
||||
CentrifugeRecipes.register();
|
||||
BreederRecipes.registerFuels();
|
||||
TileEntityNukeFurnace.registerFuels();
|
||||
BreederRecipes.registerRecipes();
|
||||
AssemblerRecipes.loadRecipes();
|
||||
CyclotronRecipes.register();
|
||||
|
||||
@ -51,6 +51,7 @@ import com.hbm.sound.MovingSoundXVL1456;
|
||||
import com.hbm.tileentity.bomb.TileEntityNukeCustom;
|
||||
import com.hbm.tileentity.bomb.TileEntityNukeCustom.CustomNukeEntry;
|
||||
import com.hbm.tileentity.bomb.TileEntityNukeCustom.EnumEntryType;
|
||||
import com.hbm.tileentity.machine.TileEntityNukeFurnace;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKBase;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.ArmorRegistry;
|
||||
@ -562,12 +563,10 @@ public class ModEventHandlerClient {
|
||||
}
|
||||
}
|
||||
|
||||
/// BREEDING ///
|
||||
int[] breeder = BreederRecipes.getFuelValue(stack);
|
||||
/// NUCLEAR FURNACE FUELS ///
|
||||
int[] breeder = TileEntityNukeFurnace.getFuelValue(stack);
|
||||
|
||||
if(breeder != null) {
|
||||
list.add(BreederRecipes.getHEATString("[" + I18nUtil.resolveKey("trait.heat", breeder[0]) + "]", breeder[0]));
|
||||
list.add(EnumChatFormatting.YELLOW + I18nUtil.resolveKey("trait.breeding", breeder[1]));
|
||||
list.add(EnumChatFormatting.YELLOW + I18nUtil.resolveKey("trait.furnace", (breeder[0] * breeder[1] * 5)));
|
||||
}
|
||||
|
||||
|
||||
@ -20,8 +20,8 @@ public class NEIConfig implements IConfigureNEI {
|
||||
API.registerUsageHandler(new CentrifugeRecipeHandler());
|
||||
API.registerRecipeHandler(new GasCentrifugeRecipeHandler());
|
||||
API.registerUsageHandler(new GasCentrifugeRecipeHandler());
|
||||
API.registerRecipeHandler(new ReactorRecipeHandler());
|
||||
API.registerUsageHandler(new ReactorRecipeHandler());
|
||||
API.registerRecipeHandler(new BreederRecipeHandler());
|
||||
API.registerUsageHandler(new BreederRecipeHandler());
|
||||
API.registerRecipeHandler(new ShredderRecipeHandler());
|
||||
API.registerUsageHandler(new ShredderRecipeHandler());
|
||||
API.registerRecipeHandler(new CMBFurnaceRecipeHandler());
|
||||
@ -95,7 +95,6 @@ public class NEIConfig implements IConfigureNEI {
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_block_ams_base));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_block_ams_emitter));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_block_ams_limiter));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_block_reactor_small));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_block_radgen));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_block_vault));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_block_blast));
|
||||
@ -115,7 +114,6 @@ public class NEIConfig implements IConfigureNEI {
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_port_ams_base));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_port_ams_emitter));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_port_ams_limiter));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_port_reactor_small));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_port_radgen));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_port_compact_launcher));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_port_launch_table));
|
||||
|
||||
@ -15,7 +15,7 @@ import com.hbm.tileentity.machine.TileEntityMachineBattery;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineMiningLaser;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineMissileAssembly;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactorLarge;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactorSmall;
|
||||
import com.hbm.tileentity.machine.TileEntityReactorResearch;
|
||||
import com.hbm.tileentity.machine.TileEntityRadioRec;
|
||||
import com.hbm.tileentity.machine.TileEntityReactorControl;
|
||||
import com.hbm.tileentity.machine.TileEntityReactorZirnox;
|
||||
|
||||
@ -23,7 +23,7 @@ import com.hbm.tileentity.machine.TileEntityMachineReactorLarge;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactorLarge.ReactorFuelType;
|
||||
import com.hbm.tileentity.turret.TileEntityTurretCIWS;
|
||||
import com.hbm.tileentity.turret.TileEntityTurretCheapo;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactorSmall;
|
||||
import com.hbm.tileentity.machine.TileEntityReactorResearch;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineSeleniumEngine;
|
||||
import com.hbm.tileentity.machine.TileEntityRadioRec;
|
||||
|
||||
|
||||
@ -125,7 +125,7 @@ public class ItemRenderLibrary {
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}});
|
||||
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.machine_reactor), new ItemRenderBase() {
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.machine_reactor_breeding), new ItemRenderBase() {
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -4, 0);
|
||||
GL11.glScaled(4.5, 4.5, 4.5);
|
||||
@ -172,7 +172,7 @@ public class ItemRenderLibrary {
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
}});
|
||||
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.machine_reactor_small), new ItemRenderBase() {
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.reactor_research), new ItemRenderBase() {
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -4, 0);
|
||||
GL11.glScaled(4, 4, 4);
|
||||
@ -1160,7 +1160,7 @@ public class ItemRenderLibrary {
|
||||
}
|
||||
});
|
||||
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.reactor_zirnox), new ItemRenderBase( ) {
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.machine_zirnox), new ItemRenderBase( ) {
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -2, 0);
|
||||
GL11.glScaled(2.8, 2.8, 2.8);
|
||||
|
||||
@ -5,7 +5,7 @@ import org.lwjgl.opengl.GL11;
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.util.RenderSparks;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactor;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactorBreeding;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@ -30,9 +30,9 @@ public class RenderBreeder extends TileEntitySpecialRenderer {
|
||||
case 5: GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
}
|
||||
|
||||
TileEntityMachineReactor breeder = (TileEntityMachineReactor) tile;
|
||||
TileEntityMachineReactorBreeding breeder = (TileEntityMachineReactorBreeding) tile;
|
||||
|
||||
if(breeder.progress > 0)
|
||||
if(breeder.progress > 0.0F)
|
||||
for(int i = 0; i < 3; i++) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef((float) (Math.PI * i), 0F, 1F, 0F);
|
||||
|
||||
@ -5,7 +5,7 @@ import java.util.Random;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactorSmall;
|
||||
import com.hbm.tileentity.machine.TileEntityReactorResearch;
|
||||
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
@ -21,7 +21,7 @@ public class RenderSmallReactor extends TileEntitySpecialRenderer {
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glRotatef(180, 0F, 1F, 0F);
|
||||
|
||||
TileEntityMachineReactorSmall reactor = (TileEntityMachineReactorSmall) tileEntity;
|
||||
TileEntityReactorResearch reactor = (TileEntityReactorResearch) tileEntity;
|
||||
|
||||
bindTexture(ResourceManager.reactor_small_base_tex);
|
||||
ResourceManager.reactor_small_base.renderAll();
|
||||
@ -49,7 +49,7 @@ public class RenderSmallReactor extends TileEntitySpecialRenderer {
|
||||
for(double d = 0.285; d < 0.7; d += 0.025) {
|
||||
|
||||
tess.startDrawingQuads();
|
||||
tess.setColorRGBA_F(0.4F, 0.9F, 1.0F, 0.025F + (float) (Math.random() * 0.02F) + 0.125F * (reactor.totalFlux / 1000F));
|
||||
tess.setColorRGBA_F(0.4F, 0.9F, 1.0F, 0.025F + (float) (Math.random() * 0.015F) + (0.125F * reactor.totalFlux / 1000F));
|
||||
|
||||
double top = 1.375;
|
||||
double bottom = 1.375;
|
||||
|
||||
@ -32,7 +32,7 @@ public class TileMappings {
|
||||
put(TileEntityNukeMan.class, "tileentity_nukeman");
|
||||
put(TileEntityMachineUF6Tank.class, "tileentity_uf6_tank");
|
||||
put(TileEntityMachinePuF6Tank.class, "tileentity_puf6_tank");
|
||||
put(TileEntityMachineReactor.class, "tileentity_reactor");
|
||||
put(TileEntityMachineReactorBreeding.class, "tileentity_reactor");
|
||||
put(TileEntityNukeFurnace.class, "tileentity_nukefurnace");
|
||||
put(TileEntityRtgFurnace.class, "tileentity_rtgfurnace");
|
||||
put(TileEntityMachineGenerator.class, "tileentity_generator");
|
||||
@ -110,7 +110,7 @@ public class TileMappings {
|
||||
put(TileEntityCelPrimeTanks.class, "tileentity_cel_prime_storage");
|
||||
put(TileEntityMachineSeleniumEngine.class, "tileentity_selenium_engine");
|
||||
put(TileEntityMachineSatLinker.class, "tileentity_satlinker");
|
||||
put(TileEntityMachineReactorSmall.class, "tileentity_small_reactor");
|
||||
put(TileEntityReactorResearch.class, "tileentity_small_reactor");
|
||||
put(TileEntityVaultDoor.class, "tileentity_vault_door");
|
||||
put(TileEntityRadiobox.class, "tileentity_radio_broadcaster");
|
||||
put(TileEntityRadioRec.class, "tileentity_radio_receiver");
|
||||
|
||||
@ -208,7 +208,7 @@ public class TileEntityITER extends TileEntityMachineBase implements IEnergyUser
|
||||
|
||||
int level = FusionRecipes.getBreedingLevel(plasma.getTankType());
|
||||
|
||||
if(out.heat > level) {
|
||||
if(out.flux > level) {
|
||||
this.progress = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1,270 +0,0 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.inventory.recipes.BreederRecipes;
|
||||
import com.hbm.inventory.recipes.BreederRecipes.BreederRecipe;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
public class TileEntityMachineReactor extends TileEntityMachineBase {
|
||||
|
||||
public int progress;
|
||||
public int charge;
|
||||
public int heat;
|
||||
public static final int maxPower = 1000;
|
||||
public static final int processingSpeed = 1000;
|
||||
|
||||
private static final int[] slots_top = new int[] { 1 };
|
||||
private static final int[] slots_bottom = new int[] { 2, 0 };
|
||||
private static final int[] slots_side = new int[] { 0 };
|
||||
|
||||
public TileEntityMachineReactor() {
|
||||
super(3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int i) {
|
||||
return slots[i];
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "container.reactor";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
boolean markDirty = false;
|
||||
|
||||
if(charge == 0) {
|
||||
heat = 0;
|
||||
}
|
||||
|
||||
if(hasItemPower(slots[0]) && charge == 0) {
|
||||
|
||||
charge += getItemPower(slots[0]);
|
||||
heat = getItemHeat(slots[0]);
|
||||
|
||||
if(slots[0] != null) {
|
||||
|
||||
slots[0].stackSize--;
|
||||
|
||||
if(slots[0].stackSize == 0) {
|
||||
slots[0] = slots[0].getItem().getContainerItem(slots[0]);
|
||||
}
|
||||
|
||||
markDirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(hasPower() && canProcess()) {
|
||||
|
||||
progress++;
|
||||
|
||||
if(this.progress == TileEntityMachineReactor.processingSpeed) {
|
||||
this.progress = 0;
|
||||
this.charge--;
|
||||
this.processItem();
|
||||
markDirty = true;
|
||||
}
|
||||
} else {
|
||||
progress = 0;
|
||||
}
|
||||
|
||||
boolean trigger = true;
|
||||
|
||||
if(hasPower() && canProcess() && this.progress == 0)
|
||||
trigger = false;
|
||||
|
||||
if(trigger) {
|
||||
markDirty = true;
|
||||
}
|
||||
|
||||
if(markDirty)
|
||||
this.markDirty();
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setShort("charge", (short)charge);
|
||||
data.setShort("progress", (short)progress);
|
||||
data.setByte("heat", (byte)heat);
|
||||
this.networkPack(data, 20);
|
||||
}
|
||||
}
|
||||
|
||||
public void networkUnpack(NBTTagCompound data) {
|
||||
|
||||
charge = data.getShort("charge");
|
||||
progress = data.getShort("progress");
|
||||
heat = data.getByte("heat");
|
||||
}
|
||||
|
||||
public boolean canProcess() {
|
||||
|
||||
if(slots[1] == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BreederRecipe recipe = BreederRecipes.getOutput(slots[1]);
|
||||
|
||||
if(recipe == null)
|
||||
return false;
|
||||
|
||||
if(this.heat < recipe.heat)
|
||||
return false;
|
||||
|
||||
if(slots[2] == null)
|
||||
return true;
|
||||
|
||||
if(!slots[2].isItemEqual(recipe.output))
|
||||
return false;
|
||||
|
||||
if(slots[2].stackSize < getInventoryStackLimit() && slots[2].stackSize < slots[2].getMaxStackSize())
|
||||
return true;
|
||||
else
|
||||
return slots[2].stackSize < recipe.output.getMaxStackSize();
|
||||
}
|
||||
|
||||
private void processItem() {
|
||||
|
||||
if(canProcess()) {
|
||||
|
||||
BreederRecipe rec = BreederRecipes.getOutput(slots[1]);
|
||||
|
||||
if(rec == null)
|
||||
return;
|
||||
|
||||
ItemStack itemStack = rec.output;
|
||||
|
||||
if(slots[2] == null) {
|
||||
slots[2] = itemStack.copy();
|
||||
} else if(slots[2].isItemEqual(itemStack)) {
|
||||
slots[2].stackSize += itemStack.stackSize;
|
||||
}
|
||||
|
||||
for(int i = 1; i < 2; i++) {
|
||||
if(slots[i].stackSize <= 0) {
|
||||
slots[i] = new ItemStack(slots[i].getItem().setFull3D());
|
||||
} else {
|
||||
slots[i].stackSize--;
|
||||
}
|
||||
if(slots[i].stackSize <= 0) {
|
||||
slots[i] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasItemPower(ItemStack stack) {
|
||||
return BreederRecipes.getFuelValue(stack) != null;
|
||||
}
|
||||
|
||||
private static int getItemPower(ItemStack stack) {
|
||||
|
||||
int[] power = BreederRecipes.getFuelValue(stack);
|
||||
|
||||
if(power == null)
|
||||
return 0;
|
||||
|
||||
return power[1];
|
||||
}
|
||||
|
||||
private static int getItemHeat(ItemStack stack) {
|
||||
|
||||
int[] power = BreederRecipes.getFuelValue(stack);
|
||||
|
||||
if(power == null)
|
||||
return 0;
|
||||
|
||||
return power[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
return side == 0 ? slots_bottom : (side == 1 ? slots_top : slots_side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
return i == 2 ? false : (i == 0 ? hasItemPower(itemStack) : true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
|
||||
if(i == 0) {
|
||||
if(!hasItemPower(slots[0])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getProgressScaled(int i) {
|
||||
return (progress * i) / processingSpeed;
|
||||
}
|
||||
|
||||
public int getHeatScaled(int i) {
|
||||
return (heat * i) / 4;
|
||||
}
|
||||
|
||||
public boolean hasPower() {
|
||||
return charge > 0;
|
||||
}
|
||||
|
||||
public boolean isProcessing() {
|
||||
return this.progress > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
|
||||
charge = nbt.getShort("charge");
|
||||
heat = nbt.getShort("heat");
|
||||
progress = nbt.getShort("progress");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
|
||||
nbt.setShort("charge", (short) charge);
|
||||
nbt.setShort("heat", (short) heat);
|
||||
nbt.setShort("progress", (short) progress);
|
||||
}
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
|
||||
if(bb == null) {
|
||||
bb = AxisAlignedBB.getBoundingBox(
|
||||
xCoord,
|
||||
yCoord,
|
||||
zCoord,
|
||||
xCoord + 1,
|
||||
yCoord + 3,
|
||||
zCoord + 1
|
||||
);
|
||||
}
|
||||
|
||||
return bb;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,204 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.machine.ReactorResearch;
|
||||
import com.hbm.inventory.recipes.BreederRecipes;
|
||||
import com.hbm.inventory.recipes.BreederRecipes.BreederRecipe;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineReactorBreeding extends TileEntityMachineBase {
|
||||
|
||||
public int flux;
|
||||
public float progress;
|
||||
|
||||
private static final int[] slots_io = new int[] { 0, 1 };
|
||||
|
||||
public TileEntityMachineReactorBreeding() {
|
||||
super(2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "container.reactorBreeding";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
this.flux = 0;
|
||||
getInteractions();
|
||||
|
||||
if(canProcess()) {
|
||||
|
||||
progress += 0.005F * (this.flux / BreederRecipes.getOutput(slots[0]).flux);
|
||||
|
||||
if(this.progress >= 1.0F) {
|
||||
this.progress = 0F;
|
||||
this.processItem();
|
||||
this.markDirty();
|
||||
}
|
||||
} else {
|
||||
progress = 0.0F;
|
||||
}
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setInteger("flux", flux);
|
||||
data.setFloat("progress", progress);
|
||||
this.networkPack(data, 20);
|
||||
}
|
||||
}
|
||||
|
||||
public void networkUnpack(NBTTagCompound data) {
|
||||
flux = data.getInteger("flux");
|
||||
progress = data.getFloat("progress");
|
||||
}
|
||||
|
||||
public void getInteractions() {
|
||||
|
||||
for(byte d = 2; d < 6; d++) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(d);
|
||||
|
||||
Block b = worldObj.getBlock(xCoord + dir.offsetX, yCoord, zCoord + dir.offsetZ);
|
||||
TileEntity te = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord, zCoord + dir.offsetZ);
|
||||
|
||||
if(b == ModBlocks.reactor_research) {
|
||||
|
||||
int[] pos = ((ReactorResearch) ModBlocks.reactor_research).findCore(worldObj, xCoord + dir.offsetX, yCoord, zCoord + dir.offsetZ);
|
||||
|
||||
if(pos != null) {
|
||||
|
||||
TileEntity tile = worldObj.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
|
||||
if(tile instanceof TileEntityReactorResearch) {
|
||||
|
||||
TileEntityReactorResearch reactor = (TileEntityReactorResearch) tile;
|
||||
|
||||
this.flux += reactor.totalFlux;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canProcess() {
|
||||
|
||||
if(slots[0] == null)
|
||||
return false;
|
||||
|
||||
BreederRecipe recipe = BreederRecipes.getOutput(slots[0]);
|
||||
|
||||
if(recipe == null)
|
||||
return false;
|
||||
|
||||
if(this.flux < recipe.flux)
|
||||
return false;
|
||||
|
||||
if(slots[1] == null)
|
||||
return true;
|
||||
|
||||
if(!slots[1].isItemEqual(recipe.output))
|
||||
return false;
|
||||
|
||||
if(slots[1].stackSize < slots[1].getMaxStackSize())
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
private void processItem() {
|
||||
|
||||
if(canProcess()) {
|
||||
|
||||
BreederRecipe rec = BreederRecipes.getOutput(slots[0]);
|
||||
|
||||
if(rec == null)
|
||||
return;
|
||||
|
||||
ItemStack itemStack = rec.output;
|
||||
|
||||
if(slots[1] == null) {
|
||||
slots[1] = itemStack.copy();
|
||||
} else if(slots[1].isItemEqual(itemStack)) {
|
||||
slots[1].stackSize += itemStack.stackSize;
|
||||
}
|
||||
|
||||
slots[0].stackSize--;
|
||||
|
||||
if(slots[0].stackSize <= 0) {
|
||||
slots[0] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
return slots_io;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
return i == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
return i == 1;
|
||||
}
|
||||
|
||||
public int getProgressScaled(int i) {
|
||||
return (int) (this.progress * i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
|
||||
flux = nbt.getInteger("flux");
|
||||
progress = nbt.getFloat("progress");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
|
||||
nbt.setInteger("flux", flux);
|
||||
nbt.setFloat("progress", progress);
|
||||
}
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
|
||||
if(bb == null) {
|
||||
bb = AxisAlignedBB.getBoundingBox(
|
||||
xCoord,
|
||||
yCoord,
|
||||
zCoord,
|
||||
xCoord + 1,
|
||||
yCoord + 3,
|
||||
zCoord + 1
|
||||
);
|
||||
}
|
||||
|
||||
return bb;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,9 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.hbm.blocks.machine.MachineNukeFurnace;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.recipes.BreederRecipes;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.special.ItemCustomLore;
|
||||
@ -111,7 +114,7 @@ public class TileEntityNukeFurnace extends TileEntity implements ISidedInventory
|
||||
return 0;
|
||||
} else {
|
||||
|
||||
int[] power = BreederRecipes.getFuelValue(stack);
|
||||
int[] power = getFuelValue(stack);
|
||||
|
||||
if(power == null)
|
||||
return 0;
|
||||
@ -346,5 +349,82 @@ public class TileEntityNukeFurnace extends TileEntity implements ISidedInventory
|
||||
this.markDirty();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static HashMap<ComparableStack, int[]> fuels = new HashMap();
|
||||
//for the int array: [0] => level (1-4) [1] => amount of operations
|
||||
|
||||
/*
|
||||
* I really don't want to have to do this, but it's better then making a new class, for one TE, for not even recipes but just *fuels*
|
||||
*
|
||||
* Who even uses this furnace? Nobody, but it's better then removing it without prior approval
|
||||
*/
|
||||
public static void registerFuels() {
|
||||
fuels.put(new ComparableStack(ModItems.rod_u233), new int[] {2, 2});
|
||||
fuels.put(new ComparableStack(ModItems.rod_dual_u233), new int[] {2, 4});
|
||||
fuels.put(new ComparableStack(ModItems.rod_quad_u233), new int[] {2, 8});
|
||||
|
||||
fuels.put(new ComparableStack(ModItems.rod_u235), new int[] {2, 3});
|
||||
fuels.put(new ComparableStack(ModItems.rod_dual_u235), new int[] {2, 6});
|
||||
fuels.put(new ComparableStack(ModItems.rod_quad_u235), new int[] {2, 12});
|
||||
|
||||
fuels.put(new ComparableStack(ModItems.rod_u238), new int[] {1, 1});
|
||||
fuels.put(new ComparableStack(ModItems.rod_dual_u238), new int[] {1, 2});
|
||||
fuels.put(new ComparableStack(ModItems.rod_quad_u238), new int[] {1, 4});
|
||||
|
||||
fuels.put(new ComparableStack(ModItems.rod_neptunium), new int[] {2, 3});
|
||||
fuels.put(new ComparableStack(ModItems.rod_dual_neptunium), new int[] {2, 6});
|
||||
fuels.put(new ComparableStack(ModItems.rod_quad_neptunium), new int[] {2, 12});
|
||||
|
||||
fuels.put(new ComparableStack(ModItems.rod_pu238), new int[] {1, 2});
|
||||
fuels.put(new ComparableStack(ModItems.rod_dual_pu238), new int[] {1, 4});
|
||||
fuels.put(new ComparableStack(ModItems.rod_quad_pu238), new int[] {1, 8});
|
||||
|
||||
fuels.put(new ComparableStack(ModItems.rod_pu239), new int[] {3, 5});
|
||||
fuels.put(new ComparableStack(ModItems.rod_dual_pu239), new int[] {3, 10});
|
||||
fuels.put(new ComparableStack(ModItems.rod_quad_pu239), new int[] {3, 20});
|
||||
|
||||
fuels.put(new ComparableStack(ModItems.rod_pu240), new int[] {1, 2});
|
||||
fuels.put(new ComparableStack(ModItems.rod_dual_pu240), new int[] {1, 4});
|
||||
fuels.put(new ComparableStack(ModItems.rod_quad_pu240), new int[] {1, 8});
|
||||
|
||||
fuels.put(new ComparableStack(ModItems.rod_schrabidium), new int[] {3, 10});
|
||||
fuels.put(new ComparableStack(ModItems.rod_dual_schrabidium), new int[] {3, 20});
|
||||
fuels.put(new ComparableStack(ModItems.rod_quad_schrabidium), new int[] {3, 40});
|
||||
|
||||
fuels.put(new ComparableStack(ModItems.rod_solinium), new int[] {3, 15});
|
||||
fuels.put(new ComparableStack(ModItems.rod_dual_solinium), new int[] {3, 30});
|
||||
fuels.put(new ComparableStack(ModItems.rod_quad_solinium), new int[] {3, 60});
|
||||
|
||||
fuels.put(new ComparableStack(ModItems.rod_polonium), new int[] {4, 2});
|
||||
fuels.put(new ComparableStack(ModItems.rod_dual_polonium), new int[] {4, 4});
|
||||
fuels.put(new ComparableStack(ModItems.rod_quad_polonium), new int[] {4, 8});
|
||||
|
||||
fuels.put(new ComparableStack(ModItems.rod_tritium), new int[] {1, 1});
|
||||
fuels.put(new ComparableStack(ModItems.rod_dual_tritium), new int[] {1, 2});
|
||||
fuels.put(new ComparableStack(ModItems.rod_quad_tritium), new int[] {1, 4});
|
||||
|
||||
fuels.put(new ComparableStack(ModItems.rod_balefire), new int[] {2, 150});
|
||||
fuels.put(new ComparableStack(ModItems.rod_dual_balefire), new int[] {2, 300});
|
||||
fuels.put(new ComparableStack(ModItems.rod_quad_balefire), new int[] {2, 600});
|
||||
|
||||
fuels.put(new ComparableStack(ModItems.rod_balefire_blazing), new int[] {4, 75});
|
||||
fuels.put(new ComparableStack(ModItems.rod_dual_balefire_blazing), new int[] {4, 150});
|
||||
fuels.put(new ComparableStack(ModItems.rod_quad_balefire_blazing), new int[] {4, 300});
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an integer array of the fuel value of a certain stack
|
||||
* @param stack
|
||||
* @return an integer array (possibly null) with two fields, the HEAT value and the amount of operations
|
||||
*/
|
||||
public static int[] getFuelValue(ItemStack stack) {
|
||||
|
||||
if(stack == null)
|
||||
return null;
|
||||
|
||||
ComparableStack sta = new ComparableStack(stack);
|
||||
int[] ret = fuels.get(sta);
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,410 +1,388 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.machine.MachineReactor;
|
||||
import com.hbm.blocks.machine.MachineReactorSmall;
|
||||
import com.hbm.config.MobConfig;
|
||||
import com.hbm.explosion.ExplosionNukeGeneric;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemPlateFuel;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.tileentity.machine.rbmk.RBMKDials;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
//TODO: fix reactor control; revamp gui; revamp breeder to rely on reactor and use total flux calcs;
|
||||
public class TileEntityMachineReactorSmall extends TileEntityMachineBase implements IControlReceiver {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double lastLevel;
|
||||
public double level;
|
||||
public double speed = 0.04;
|
||||
public double targetLevel;
|
||||
|
||||
public int heat;
|
||||
public final int maxHeat = 50000;
|
||||
public int[] slotFlux = new int[12];
|
||||
public int totalFlux = 0;
|
||||
|
||||
private static final int[] slot_io = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
|
||||
|
||||
public TileEntityMachineReactorSmall() {
|
||||
super(12);
|
||||
}
|
||||
|
||||
private static final HashMap<ComparableStack, ItemStack> fuelMap = new HashMap<ComparableStack, ItemStack>();
|
||||
static {
|
||||
fuelMap.put(new ComparableStack(ModItems.plate_fuel_u233), new ItemStack(ModItems.waste_plate_u233, 1, 1));
|
||||
fuelMap.put(new ComparableStack(ModItems.plate_fuel_u235), new ItemStack(ModItems.waste_plate_u235, 1, 1));
|
||||
fuelMap.put(new ComparableStack(ModItems.plate_fuel_mox), new ItemStack(ModItems.waste_plate_mox, 1, 1));
|
||||
fuelMap.put(new ComparableStack(ModItems.plate_fuel_pu239), new ItemStack(ModItems.waste_plate_pu239, 1, 1));
|
||||
fuelMap.put(new ComparableStack(ModItems.plate_fuel_sa326), new ItemStack(ModItems.waste_plate_sa326, 1, 1));
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return "container.reactorSmall";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
if(i < 12 && i <= 0)
|
||||
if(itemStack.getItem().getClass() == ItemPlateFuel.class)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
heat = nbt.getInteger("heat");
|
||||
level = nbt.getDouble("level");
|
||||
targetLevel = nbt.getDouble("targetLevel");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setInteger("heat", heat);
|
||||
nbt.setDouble("level", level);
|
||||
nbt.setDouble("targetLevel", targetLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
return slot_io;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack stack, int j) {
|
||||
if(i < 12 && i >= 0)
|
||||
if(fuelMap.containsValue(stack))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
public int getHeatScaled(int i) {
|
||||
return (heat * i) / maxHeat;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
rodControl();
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
totalFlux = 0;
|
||||
|
||||
if(level > 0) {
|
||||
reaction();
|
||||
}
|
||||
|
||||
getInteractions();
|
||||
|
||||
if(this.heat > 0) {
|
||||
byte water = getWater();
|
||||
|
||||
if(water > 0) {
|
||||
this.heat -= (this.heat * (float) 0.07 * water / 12);
|
||||
} else if(water == 0) {
|
||||
this.heat -= 1;
|
||||
}
|
||||
|
||||
if(this.heat < 0)
|
||||
this.heat = 0;
|
||||
}
|
||||
|
||||
if(this.heat > maxHeat) {
|
||||
this.explode();
|
||||
}
|
||||
|
||||
//change to 3D rad like demon-core
|
||||
if(level > 0 && heat > 0 && !(blocksRad(xCoord + 1, yCoord + 1, zCoord) && blocksRad(xCoord - 1, yCoord + 1, zCoord) && blocksRad(xCoord, yCoord + 1, zCoord + 1) && blocksRad(xCoord, yCoord + 1, zCoord - 1))) {
|
||||
float rad = (float) heat / (float) maxHeat * 50F;
|
||||
ChunkRadiationManager.proxy.incrementRad(worldObj, xCoord, yCoord, zCoord, rad);
|
||||
}
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setInteger("heat", heat);
|
||||
data.setDouble("level", level);
|
||||
data.setDouble("targetLevel", targetLevel);
|
||||
data.setIntArray("slotFlux", slotFlux);
|
||||
data.setInteger("totalFlux", totalFlux);
|
||||
this.networkPack(data, 150);
|
||||
}
|
||||
}
|
||||
|
||||
public void networkUnpack(NBTTagCompound data) {
|
||||
this.heat = data.getInteger("heat");
|
||||
this.level = data.getDouble("level");
|
||||
this.targetLevel = data.getDouble("targetLevel");
|
||||
this.slotFlux = data.getIntArray("slotFlux");
|
||||
this.totalFlux = data.getInteger("totalFlux");
|
||||
}
|
||||
|
||||
private byte getWater() {
|
||||
byte water = 0;
|
||||
|
||||
for(byte d = 0; d < 6; d++) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(d);
|
||||
if(d < 2) {
|
||||
if(worldObj.getBlock(xCoord, yCoord + 1 + dir.offsetY * 2, zCoord).getMaterial() == Material.water)
|
||||
water++;
|
||||
} else {
|
||||
for(byte i = 0; i < 3; i++) {
|
||||
if(worldObj.getBlock(xCoord + dir.offsetX, yCoord + i, zCoord + dir.offsetZ).getMaterial() == Material.water)
|
||||
water++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return water;
|
||||
}
|
||||
|
||||
public boolean isSubmerged() {
|
||||
|
||||
return worldObj.getBlock(xCoord + 1, yCoord + 1, zCoord).getMaterial() == Material.water ||
|
||||
worldObj.getBlock(xCoord, yCoord + 1, zCoord + 1).getMaterial() == Material.water ||
|
||||
worldObj.getBlock(xCoord - 1, yCoord + 1, zCoord).getMaterial() == Material.water ||
|
||||
worldObj.getBlock(xCoord, yCoord + 1, zCoord - 1).getMaterial() == Material.water;
|
||||
}
|
||||
|
||||
private void getInteractions() {
|
||||
getInteractionForBlock(xCoord + 1, yCoord + 1, zCoord);
|
||||
getInteractionForBlock(xCoord - 1, yCoord + 1, zCoord);
|
||||
getInteractionForBlock(xCoord, yCoord + 1, zCoord + 1);
|
||||
getInteractionForBlock(xCoord, yCoord + 1, zCoord - 1);
|
||||
}
|
||||
|
||||
private void getInteractionForBlock(int x, int y, int z) {
|
||||
|
||||
Block b = worldObj.getBlock(x, y, z);
|
||||
TileEntity te = worldObj.getTileEntity(x, y, z);
|
||||
|
||||
if(b == ModBlocks.machine_reactor) {
|
||||
|
||||
int[] pos = ((MachineReactor) ModBlocks.machine_reactor).findCore(worldObj, x, y, z);
|
||||
|
||||
if(pos != null) {
|
||||
|
||||
TileEntity tile = worldObj.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
|
||||
if(tile instanceof TileEntityMachineReactor) {
|
||||
|
||||
TileEntityMachineReactor reactor = (TileEntityMachineReactor) tile;
|
||||
|
||||
if(reactor.charge <= 1 && this.totalFlux > 0) {
|
||||
reactor.charge = 1;
|
||||
reactor.heat = (int) Math.floor(heat * 4 / maxHeat) + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean blocksRad(int x, int y, int z) {
|
||||
|
||||
Block b = worldObj.getBlock(x, y, z);
|
||||
|
||||
if(b == ModBlocks.block_lead || b == ModBlocks.block_desh || b == ModBlocks.machine_reactor_small || b == ModBlocks.machine_reactor)
|
||||
return true;
|
||||
|
||||
if(b.getExplosionResistance(null) >= 100)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private int[] getNeighboringSlots(int id) {
|
||||
|
||||
switch(id) {
|
||||
case 0:
|
||||
return new int[] { 1, 5 };
|
||||
case 1:
|
||||
return new int[] { 0, 6 };
|
||||
case 2:
|
||||
return new int[] { 3, 7 };
|
||||
case 3:
|
||||
return new int[] { 2, 4, 8 };
|
||||
case 4:
|
||||
return new int[] { 3, 9 };
|
||||
case 5:
|
||||
return new int[] { 0, 6, 0xA };
|
||||
case 6:
|
||||
return new int[] { 1, 5, 0xB };
|
||||
case 7:
|
||||
return new int[] { 2, 8 };
|
||||
case 8:
|
||||
return new int[] { 3, 7, 9 };
|
||||
case 9:
|
||||
return new int[] { 4, 8 };
|
||||
case 10:
|
||||
return new int[] { 5, 0xB };
|
||||
case 11:
|
||||
return new int[] { 6, 0xA };
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private void reaction() {
|
||||
for(byte i = 0; i < 12; i++) {
|
||||
if(slots[i] == null) {
|
||||
slotFlux[i] = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(slots[i].getItem() instanceof ItemPlateFuel) {
|
||||
ItemPlateFuel rod = (ItemPlateFuel) slots[i].getItem();
|
||||
|
||||
int outFlux = rod.react(worldObj, slots[i], slotFlux[i] + 1);
|
||||
this.heat += outFlux * 2;
|
||||
slotFlux[i] = 0;
|
||||
totalFlux += outFlux;
|
||||
|
||||
int[] neighborSlots = getNeighboringSlots(i);
|
||||
|
||||
if(ItemPlateFuel.getLifeTime(slots[i]) > rod.lifeTime) {
|
||||
slots[i] = fuelMap.get(new ComparableStack(slots[i])).copy();
|
||||
}
|
||||
|
||||
for(byte j = 0; j < neighborSlots.length; j++) {
|
||||
slotFlux[neighborSlots[j]] += (int) (outFlux * level);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if(slots[i].getItem() == ModItems.meteorite_sword_bred)
|
||||
slots[i] = new ItemStack(ModItems.meteorite_sword_irradiated);
|
||||
|
||||
slotFlux[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private void explode() {
|
||||
|
||||
for(int i = 0; i < slots.length; i++) {
|
||||
this.slots[i] = null;
|
||||
}
|
||||
|
||||
worldObj.setBlockToAir(this.xCoord, this.yCoord, this.zCoord);
|
||||
|
||||
for(byte d = 0; d < 6; d++) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(d);
|
||||
if(d < 2) {
|
||||
if(worldObj.getBlock(xCoord, yCoord + 1 + dir.offsetY * 2, zCoord).getMaterial() == Material.water)
|
||||
worldObj.setBlockToAir(xCoord, yCoord + 1 + dir.offsetY * 2, zCoord);
|
||||
} else {
|
||||
for(byte i = 0; i < 3; i++) {
|
||||
if(worldObj.getBlock(xCoord + dir.offsetX, yCoord + i, zCoord + dir.offsetZ).getMaterial() == Material.water)
|
||||
worldObj.setBlockToAir(xCoord + dir.offsetX, yCoord + i, zCoord + dir.offsetZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
worldObj.createExplosion(null, this.xCoord, this.yCoord, this.zCoord, 18.0F, true);
|
||||
worldObj.setBlock(this.xCoord, this.yCoord, this.zCoord, ModBlocks.deco_steel);
|
||||
worldObj.setBlock(this.xCoord, this.yCoord + 1, this.zCoord, ModBlocks.corium_block);
|
||||
worldObj.setBlock(this.xCoord, this.yCoord + 2, this.zCoord, ModBlocks.deco_steel);
|
||||
|
||||
ChunkRadiationManager.proxy.incrementRad(worldObj, xCoord, yCoord, zCoord, 50);
|
||||
|
||||
if(MobConfig.enableElementals) {
|
||||
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5).expand(100, 100, 100));
|
||||
|
||||
for(EntityPlayer player : players) {
|
||||
player.getEntityData().getCompoundTag(player.PERSISTED_NBT_TAG).setBoolean("radMark", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Control Rods
|
||||
@Override
|
||||
public boolean hasPermission(EntityPlayer player) {
|
||||
return Vec3.createVectorHelper(xCoord - player.posX, yCoord - player.posY, zCoord - player.posZ).lengthVector() < 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveControl(NBTTagCompound data) {
|
||||
if(data.hasKey("level")) {
|
||||
this.setTarget(data.getDouble("level"));
|
||||
}
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.reactorStop", 1.0F, 1.0F);
|
||||
|
||||
this.markDirty();
|
||||
}
|
||||
|
||||
public void setTarget(double target) {
|
||||
this.targetLevel = target;
|
||||
}
|
||||
|
||||
public void rodControl() {
|
||||
if(worldObj.isRemote) {
|
||||
|
||||
this.lastLevel = this.level;
|
||||
|
||||
} else {
|
||||
|
||||
if(level < targetLevel) {
|
||||
|
||||
level += speed;
|
||||
|
||||
if(level >= targetLevel)
|
||||
level = targetLevel;
|
||||
}
|
||||
|
||||
if(level > targetLevel) {
|
||||
|
||||
level -= speed;
|
||||
|
||||
if(level <= targetLevel)
|
||||
level = targetLevel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int[] getDisplayData() {
|
||||
int[] data = new int[2];
|
||||
data[0] = this.totalFlux;
|
||||
data[1] = (int) Math.round((this.heat) * 0.00002 * 980 + 20);
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
return TileEntity.INFINITE_EXTENT_AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.machine.MachineReactorBreeding;
|
||||
import com.hbm.blocks.machine.ReactorResearch;
|
||||
import com.hbm.config.MobConfig;
|
||||
import com.hbm.explosion.ExplosionNukeGeneric;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemPlateFuel;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.tileentity.machine.rbmk.RBMKDials;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
//TODO: fix reactor control;
|
||||
public class TileEntityReactorResearch extends TileEntityMachineBase implements IControlReceiver {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double lastLevel;
|
||||
public double level;
|
||||
public double speed = 0.04;
|
||||
public double targetLevel;
|
||||
|
||||
public int heat;
|
||||
public final int maxHeat = 50000;
|
||||
public int[] slotFlux = new int[12];
|
||||
public int totalFlux = 0;
|
||||
|
||||
private static final int[] slot_io = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
|
||||
|
||||
public TileEntityReactorResearch() {
|
||||
super(12);
|
||||
}
|
||||
|
||||
private static final HashMap<ComparableStack, ItemStack> fuelMap = new HashMap<ComparableStack, ItemStack>();
|
||||
static {
|
||||
fuelMap.put(new ComparableStack(ModItems.plate_fuel_u233), new ItemStack(ModItems.waste_plate_u233, 1, 1));
|
||||
fuelMap.put(new ComparableStack(ModItems.plate_fuel_u235), new ItemStack(ModItems.waste_plate_u235, 1, 1));
|
||||
fuelMap.put(new ComparableStack(ModItems.plate_fuel_mox), new ItemStack(ModItems.waste_plate_mox, 1, 1));
|
||||
fuelMap.put(new ComparableStack(ModItems.plate_fuel_pu239), new ItemStack(ModItems.waste_plate_pu239, 1, 1));
|
||||
fuelMap.put(new ComparableStack(ModItems.plate_fuel_sa326), new ItemStack(ModItems.waste_plate_sa326, 1, 1));
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return "container.reactorResearch";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
if(i < 12 && i <= 0)
|
||||
if(itemStack.getItem().getClass() == ItemPlateFuel.class)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
heat = nbt.getInteger("heat");
|
||||
level = nbt.getDouble("level");
|
||||
targetLevel = nbt.getDouble("targetLevel");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setInteger("heat", heat);
|
||||
nbt.setDouble("level", level);
|
||||
nbt.setDouble("targetLevel", targetLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
return slot_io;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack stack, int j) {
|
||||
if(i < 12 && i >= 0)
|
||||
if(fuelMap.containsValue(stack))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
rodControl();
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
totalFlux = 0;
|
||||
|
||||
if(level > 0) {
|
||||
reaction();
|
||||
}
|
||||
|
||||
//getInteractions();
|
||||
|
||||
if(this.heat > 0) {
|
||||
byte water = getWater();
|
||||
|
||||
if(water > 0) {
|
||||
this.heat -= (this.heat * (float) 0.07 * water / 12);
|
||||
} else if(water == 0) {
|
||||
this.heat -= 1;
|
||||
}
|
||||
|
||||
if(this.heat < 0)
|
||||
this.heat = 0;
|
||||
}
|
||||
|
||||
if(this.heat > maxHeat) {
|
||||
this.explode();
|
||||
}
|
||||
|
||||
//change to 3D rad like demon-core
|
||||
if(level > 0 && heat > 0 && !(blocksRad(xCoord + 1, yCoord + 1, zCoord) && blocksRad(xCoord - 1, yCoord + 1, zCoord) && blocksRad(xCoord, yCoord + 1, zCoord + 1) && blocksRad(xCoord, yCoord + 1, zCoord - 1))) {
|
||||
float rad = (float) heat / (float) maxHeat * 50F;
|
||||
ChunkRadiationManager.proxy.incrementRad(worldObj, xCoord, yCoord, zCoord, rad);
|
||||
}
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setInteger("heat", heat);
|
||||
data.setDouble("level", level);
|
||||
data.setDouble("targetLevel", targetLevel);
|
||||
data.setIntArray("slotFlux", slotFlux);
|
||||
data.setInteger("totalFlux", totalFlux);
|
||||
this.networkPack(data, 150);
|
||||
}
|
||||
}
|
||||
|
||||
public void networkUnpack(NBTTagCompound data) {
|
||||
this.heat = data.getInteger("heat");
|
||||
this.level = data.getDouble("level");
|
||||
this.targetLevel = data.getDouble("targetLevel");
|
||||
this.slotFlux = data.getIntArray("slotFlux");
|
||||
this.totalFlux = data.getInteger("totalFlux");
|
||||
}
|
||||
|
||||
private byte getWater() {
|
||||
byte water = 0;
|
||||
|
||||
for(byte d = 0; d < 6; d++) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(d);
|
||||
if(d < 2) {
|
||||
if(worldObj.getBlock(xCoord, yCoord + 1 + dir.offsetY * 2, zCoord).getMaterial() == Material.water)
|
||||
water++;
|
||||
} else {
|
||||
for(byte i = 0; i < 3; i++) {
|
||||
if(worldObj.getBlock(xCoord + dir.offsetX, yCoord + i, zCoord + dir.offsetZ).getMaterial() == Material.water)
|
||||
water++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return water;
|
||||
}
|
||||
|
||||
public boolean isSubmerged() {
|
||||
|
||||
return worldObj.getBlock(xCoord + 1, yCoord + 1, zCoord).getMaterial() == Material.water ||
|
||||
worldObj.getBlock(xCoord, yCoord + 1, zCoord + 1).getMaterial() == Material.water ||
|
||||
worldObj.getBlock(xCoord - 1, yCoord + 1, zCoord).getMaterial() == Material.water ||
|
||||
worldObj.getBlock(xCoord, yCoord + 1, zCoord - 1).getMaterial() == Material.water;
|
||||
}
|
||||
|
||||
/*private void getInteractions() {
|
||||
getInteractionForBlock(xCoord + 1, yCoord + 1, zCoord);
|
||||
getInteractionForBlock(xCoord - 1, yCoord + 1, zCoord);
|
||||
getInteractionForBlock(xCoord, yCoord + 1, zCoord + 1);
|
||||
getInteractionForBlock(xCoord, yCoord + 1, zCoord - 1);
|
||||
}
|
||||
|
||||
private void getInteractionForBlock(int x, int y, int z) {
|
||||
|
||||
Block b = worldObj.getBlock(x, y, z);
|
||||
TileEntity te = worldObj.getTileEntity(x, y, z);
|
||||
}*/
|
||||
|
||||
private boolean blocksRad(int x, int y, int z) {
|
||||
|
||||
Block b = worldObj.getBlock(x, y, z);
|
||||
|
||||
if(b == ModBlocks.block_lead || b == ModBlocks.block_desh || b == ModBlocks.reactor_research || b == ModBlocks.machine_reactor_breeding)
|
||||
return true;
|
||||
|
||||
if(b.getExplosionResistance(null) >= 100)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private int[] getNeighboringSlots(int id) {
|
||||
|
||||
switch(id) {
|
||||
case 0:
|
||||
return new int[] { 1, 5 };
|
||||
case 1:
|
||||
return new int[] { 0, 6 };
|
||||
case 2:
|
||||
return new int[] { 3, 7 };
|
||||
case 3:
|
||||
return new int[] { 2, 4, 8 };
|
||||
case 4:
|
||||
return new int[] { 3, 9 };
|
||||
case 5:
|
||||
return new int[] { 0, 6, 0xA };
|
||||
case 6:
|
||||
return new int[] { 1, 5, 0xB };
|
||||
case 7:
|
||||
return new int[] { 2, 8 };
|
||||
case 8:
|
||||
return new int[] { 3, 7, 9 };
|
||||
case 9:
|
||||
return new int[] { 4, 8 };
|
||||
case 10:
|
||||
return new int[] { 5, 0xB };
|
||||
case 11:
|
||||
return new int[] { 6, 0xA };
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private void reaction() {
|
||||
for(byte i = 0; i < 12; i++) {
|
||||
if(slots[i] == null) {
|
||||
slotFlux[i] = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(slots[i].getItem() instanceof ItemPlateFuel) {
|
||||
ItemPlateFuel rod = (ItemPlateFuel) slots[i].getItem();
|
||||
|
||||
int outFlux = rod.react(worldObj, slots[i], slotFlux[i] + 1);
|
||||
this.heat += outFlux * 2;
|
||||
slotFlux[i] = 0;
|
||||
totalFlux += outFlux;
|
||||
|
||||
int[] neighborSlots = getNeighboringSlots(i);
|
||||
|
||||
if(ItemPlateFuel.getLifeTime(slots[i]) > rod.lifeTime) {
|
||||
slots[i] = fuelMap.get(new ComparableStack(slots[i])).copy();
|
||||
}
|
||||
|
||||
for(byte j = 0; j < neighborSlots.length; j++) {
|
||||
slotFlux[neighborSlots[j]] += (int) (outFlux * level);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if(slots[i].getItem() == ModItems.meteorite_sword_bred)
|
||||
slots[i] = new ItemStack(ModItems.meteorite_sword_irradiated);
|
||||
|
||||
slotFlux[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private void explode() {
|
||||
|
||||
for(int i = 0; i < slots.length; i++) {
|
||||
this.slots[i] = null;
|
||||
}
|
||||
|
||||
worldObj.setBlockToAir(this.xCoord, this.yCoord, this.zCoord);
|
||||
|
||||
for(byte d = 0; d < 6; d++) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(d);
|
||||
if(d < 2) {
|
||||
if(worldObj.getBlock(xCoord, yCoord + 1 + dir.offsetY * 2, zCoord).getMaterial() == Material.water)
|
||||
worldObj.setBlockToAir(xCoord, yCoord + 1 + dir.offsetY * 2, zCoord);
|
||||
} else {
|
||||
for(byte i = 0; i < 3; i++) {
|
||||
if(worldObj.getBlock(xCoord + dir.offsetX, yCoord + i, zCoord + dir.offsetZ).getMaterial() == Material.water)
|
||||
worldObj.setBlockToAir(xCoord + dir.offsetX, yCoord + i, zCoord + dir.offsetZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
worldObj.createExplosion(null, this.xCoord, this.yCoord, this.zCoord, 18.0F, true);
|
||||
worldObj.setBlock(this.xCoord, this.yCoord, this.zCoord, ModBlocks.deco_steel);
|
||||
worldObj.setBlock(this.xCoord, this.yCoord + 1, this.zCoord, ModBlocks.corium_block);
|
||||
worldObj.setBlock(this.xCoord, this.yCoord + 2, this.zCoord, ModBlocks.deco_steel);
|
||||
|
||||
ChunkRadiationManager.proxy.incrementRad(worldObj, xCoord, yCoord, zCoord, 50);
|
||||
|
||||
if(MobConfig.enableElementals) {
|
||||
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5).expand(100, 100, 100));
|
||||
|
||||
for(EntityPlayer player : players) {
|
||||
player.getEntityData().getCompoundTag(player.PERSISTED_NBT_TAG).setBoolean("radMark", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Control Rods
|
||||
@Override
|
||||
public boolean hasPermission(EntityPlayer player) {
|
||||
return Vec3.createVectorHelper(xCoord - player.posX, yCoord - player.posY, zCoord - player.posZ).lengthVector() < 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveControl(NBTTagCompound data) {
|
||||
if(data.hasKey("level")) {
|
||||
this.setTarget(data.getDouble("level"));
|
||||
|
||||
if(targetLevel != level)
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.reactorStop", 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
this.markDirty();
|
||||
}
|
||||
|
||||
public void setTarget(double target) {
|
||||
this.targetLevel = target;
|
||||
}
|
||||
|
||||
public void rodControl() {
|
||||
if(worldObj.isRemote) {
|
||||
|
||||
this.lastLevel = this.level;
|
||||
|
||||
} else {
|
||||
|
||||
if(level < targetLevel) {
|
||||
|
||||
level += speed;
|
||||
|
||||
if(level >= targetLevel)
|
||||
level = targetLevel;
|
||||
}
|
||||
|
||||
if(level > targetLevel) {
|
||||
|
||||
level -= speed;
|
||||
|
||||
if(level <= targetLevel)
|
||||
level = targetLevel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int[] getDisplayData() {
|
||||
int[] data = new int[2];
|
||||
data[0] = this.totalFlux;
|
||||
data[1] = (int) Math.round((this.heat) * 0.00002 * 980 + 20);
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
return TileEntity.INFINITE_EXTENT_AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
}
|
||||
@ -383,10 +383,10 @@ container.rbmkOutgasser=RBMK Irradiation Channel
|
||||
container.rbmkReaSim=RBMK Fuel Rod (ReaSim)
|
||||
container.rbmkRod=RBMK Fuel Rod
|
||||
container.rbmkStorage=RBMK Storage Column
|
||||
container.reactor=Breeding Reactor
|
||||
container.reactorBreeding=Breeding Reactor
|
||||
container.reactorControl=Reactor Remote Control Block
|
||||
container.reactorLarge=Big Nuclear Reactor
|
||||
container.reactorSmall=Nuclear Reactor
|
||||
container.reactorResearch=Research Reactor
|
||||
container.reix=Rei-X Mainframe
|
||||
container.rtg=RT Generator
|
||||
container.rtgFurnace=RTG Furnace
|
||||
@ -1273,6 +1273,7 @@ item.crystal_trixite.name=Trixite Crystals
|
||||
item.crystal_tungsten.name=Tungsten Crystals
|
||||
item.crystal_uranium.name=Uranium Crystals
|
||||
item.crystal_xen.name=Artificial Xen Crystal
|
||||
item.crt_display.name= Cathode Ray Tube
|
||||
item.cube_power.name=Electronium Cube
|
||||
item.custom_amat.name=Custom Nuke Antimatter Rod
|
||||
item.custom_dirty.name=Custom Nuke Dirty Rod
|
||||
@ -3328,9 +3329,7 @@ tile.machine_puf6_tank.name=Plutonium Hexafluoride Tank
|
||||
tile.machine_pumpjack.name=Pumpjack
|
||||
tile.machine_radar.name=Radar
|
||||
tile.machine_radgen.name=Radiation-Powered Engine
|
||||
tile.machine_reactor.name=Breeding Reactor
|
||||
tile.machine_reactor_on.name=Breeding Reactor
|
||||
tile.machine_reactor_small.name=Nuclear Reactor
|
||||
tile.machine_reactor_breeding.name=Breeding Reactor
|
||||
tile.machine_refinery.name=Oil Refinery
|
||||
tile.machine_reix_mainframe.name=Rei-X Mainframe (WIP)
|
||||
tile.machine_rtg_blue.name=Convection Generator
|
||||
@ -3367,7 +3366,6 @@ tile.machine_turbofan.name=Turbofan
|
||||
tile.machine_uf6_tank.name=Uranium Hexafluoride Tank
|
||||
tile.machine_waste_drum.name=Spent Fuel Pool Drum
|
||||
tile.machine_well.name=Oil Derrick
|
||||
tile.machine_zirnox.name=ZIRNOX Nuclear Reactor
|
||||
tile.marker_structure.name=Multiblock Structure Marker
|
||||
tile.meteor_battery.name=Starmetal Static Electricity Generator
|
||||
tile.meteor_brick.name=Meteor Bricks
|
||||
@ -3512,6 +3510,8 @@ tile.reactor_ejector.name=Reactor Waste Ejector
|
||||
tile.reactor_element.name=Reactor Chamber
|
||||
tile.reactor_hatch.name=Reactor Access Hatch
|
||||
tile.reactor_inserter.name=Reactor Fuel Inserter
|
||||
tile.reactor_research.name=Research Reactor
|
||||
tile.reactor_zirnox.name=ZIRNOX Nuclear Reactor
|
||||
tile.red_barrel.name=Explosive Barrel
|
||||
tile.red_cable.name=Red Copper Cable
|
||||
tile.red_connector.name=Electricity Connector
|
||||
@ -3634,7 +3634,6 @@ tile.yellow_barrel.name=Radioactive Barrel
|
||||
|
||||
trait.asbestos=Asbestos
|
||||
trait.blinding=Blinding
|
||||
trait.breeding=Worth %s operations in breeding reactor
|
||||
trait.coal=Coal Dust
|
||||
trait.digamma=Digamma Radiation
|
||||
trait.drop=Dangerous Drop
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.6 KiB |
BIN
src/main/resources/assets/hbm/textures/items/crt_display.png
Normal file
BIN
src/main/resources/assets/hbm/textures/items/crt_display.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 298 B |
Loading…
x
Reference in New Issue
Block a user