diff --git a/changelog b/changelog index b9c3bc58e..fdc381f0e 100644 --- a/changelog +++ b/changelog @@ -12,7 +12,7 @@ * Adjusted the nuclear flash's intensity, the flash will now deal less and less radiation the longer it goes on * The nuclear flash now bypasses radiation resistance, being only affected by blocks and distance * Mushroom clouds' initial scale is now based on the total scale instead of all spawning roughly at the same size, causing fireballs to be comically small for huge bombs -* Removed the old mining drill, combustion generator, old watz core, structure marker and CMB furnace for good +* Removed the old mining drill, combustion generator, old watz core, structure marker, all old large reactor parts and CMB furnace for good ## Fixed * Fixed a rare crash caused by radars force-loading chunks conflicting with certain mods' chunk loading changes diff --git a/src/main/java/com/hbm/blocks/ModBlocks.java b/src/main/java/com/hbm/blocks/ModBlocks.java index 7e2d27e99..c7ecebe51 100644 --- a/src/main/java/com/hbm/blocks/ModBlocks.java +++ b/src/main/java/com/hbm/blocks/ModBlocks.java @@ -902,14 +902,6 @@ public class ModBlocks { public static Block pwr_port; public static Block pwr_controller; public static Block pwr_block; - - @Deprecated public static Block reactor_element; - @Deprecated public static Block reactor_control; - @Deprecated public static Block reactor_hatch; - @Deprecated public static Block reactor_ejector; - @Deprecated public static Block reactor_inserter; - @Deprecated public static Block reactor_conductor; - @Deprecated public static Block reactor_computer; public static Block fusion_conductor; public static Block fusion_center; @@ -1271,8 +1263,6 @@ public class ModBlocks { public static Block pink_double_slab; public static Block pink_stairs; - public static Block ff; - public static Material materialGas = new MaterialGas(); private static void initializeBlock() { @@ -2068,14 +2058,6 @@ public class ModBlocks { pwr_port = new BlockGenericPWR(Material.iron).setBlockName("pwr_port").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":pwr_port"); pwr_controller = new MachinePWRController(Material.iron).setBlockName("pwr_controller").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":pwr_casing_blank"); pwr_block = new BlockPWR(Material.iron).setBlockName("pwr_block").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":pwr_block"); - - reactor_element = new BlockPillar(Material.iron, RefStrings.MODID + ":reactor_element_top", RefStrings.MODID + ":reactor_element_base").setBlockName("reactor_element").setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":reactor_element_side"); - reactor_control = new BlockPillar(Material.iron, RefStrings.MODID + ":reactor_control_top").setBlockName("reactor_control").setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":reactor_control_side"); - reactor_hatch = new ReactorHatch(Material.iron).setBlockName("reactor_hatch").setHardness(5.0F).setResistance(1000.0F).setBlockTextureName(RefStrings.MODID + ":brick_concrete"); - reactor_ejector = new BlockRotatable(Material.iron).setBlockName("reactor_ejector").setHardness(5.0F).setResistance(1000.0F).setBlockTextureName(RefStrings.MODID + ":brick_concrete"); - reactor_inserter = new BlockRotatable(Material.iron).setBlockName("reactor_inserter").setHardness(5.0F).setResistance(1000.0F).setBlockTextureName(RefStrings.MODID + ":brick_concrete"); - reactor_conductor = new BlockPillar(Material.iron, RefStrings.MODID + ":reactor_conductor_top").setBlockName("reactor_conductor").setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":reactor_conductor_side"); - reactor_computer = new ReactorCore(Material.iron).setBlockName("reactor_computer").setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":reactor_computer"); fusion_conductor = new BlockToolConversionPillar(Material.iron).addVariant("_welded").setBlockName("fusion_conductor").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fusion_conductor"); fusion_center = new BlockPillar(Material.iron, RefStrings.MODID + ":fusion_center_top_alt").setBlockName("fusion_center").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fusion_center_side_alt"); @@ -2441,8 +2423,6 @@ public class ModBlocks { pink_slab = new BlockPinkSlab(false, Material.wood).setBlockName("pink_slab").setStepSound(Block.soundTypeWood).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":pink_planks"); pink_double_slab = new BlockPinkSlab(true, Material.wood).setBlockName("pink_double_slab").setStepSound(Block.soundTypeWood).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":pink_planks"); pink_stairs = new BlockGenericStairs(pink_planks, 0).setBlockName("pink_stairs").setStepSound(Block.soundTypeWood).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":pink_planks"); - - ff = new BlockFF(Material.iron).setBlockName("ff").setHardness(0.5F).setStepSound(Block.soundTypeGravel).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":code"); } private static void registerBlock() { @@ -3440,14 +3420,6 @@ public class ModBlocks { register(pwr_block); //Multiblock Generators - GameRegistry.registerBlock(reactor_element, reactor_element.getUnlocalizedName()); - GameRegistry.registerBlock(reactor_control, reactor_control.getUnlocalizedName()); - GameRegistry.registerBlock(reactor_hatch, reactor_hatch.getUnlocalizedName()); - GameRegistry.registerBlock(reactor_ejector, reactor_ejector.getUnlocalizedName()); - GameRegistry.registerBlock(reactor_inserter, reactor_inserter.getUnlocalizedName()); - GameRegistry.registerBlock(reactor_conductor, reactor_conductor.getUnlocalizedName()); - GameRegistry.registerBlock(reactor_computer, reactor_computer.getUnlocalizedName()); - register(fusion_conductor); GameRegistry.registerBlock(fusion_center, fusion_center.getUnlocalizedName()); GameRegistry.registerBlock(fusion_motor, fusion_motor.getUnlocalizedName()); @@ -3606,7 +3578,6 @@ public class ModBlocks { GameRegistry.registerBlock(pink_slab, pink_slab.getUnlocalizedName()); GameRegistry.registerBlock(pink_double_slab, pink_double_slab.getUnlocalizedName()); GameRegistry.registerBlock(pink_stairs, pink_stairs.getUnlocalizedName()); - GameRegistry.registerBlock(ff, ff.getUnlocalizedName()); } private static void register(Block b) { diff --git a/src/main/java/com/hbm/blocks/generic/BlockOre.java b/src/main/java/com/hbm/blocks/generic/BlockOre.java index d862c4ea5..97aae0c8c 100644 --- a/src/main/java/com/hbm/blocks/generic/BlockOre.java +++ b/src/main/java/com/hbm/blocks/generic/BlockOre.java @@ -127,7 +127,7 @@ public class BlockOre extends Block { case 23: return Item.getItemFromBlock(ModBlocks.fusion_conductor); case 24: - return Item.getItemFromBlock(ModBlocks.reactor_computer); + return Item.getItemFromBlock(ModBlocks.pwr_fuel); case 25: return Item.getItemFromBlock(ModBlocks.machine_diesel); case 26: diff --git a/src/main/java/com/hbm/blocks/machine/BlockPillar.java b/src/main/java/com/hbm/blocks/machine/BlockPillar.java index a030210b0..8158e9416 100644 --- a/src/main/java/com/hbm/blocks/machine/BlockPillar.java +++ b/src/main/java/com/hbm/blocks/machine/BlockPillar.java @@ -1,23 +1,15 @@ package com.hbm.blocks.machine; -import com.hbm.blocks.ModBlocks; -import com.hbm.inventory.fluid.FluidType; -import com.hbm.inventory.fluid.Fluids; import com.hbm.lib.RefStrings; -import api.hbm.fluid.IFluidConnectorBlock; 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.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -public class BlockPillar extends Block implements IFluidConnectorBlock { +public class BlockPillar extends Block { @SideOnly(Side.CLIENT) private IIcon iconTop; @@ -37,18 +29,13 @@ public class BlockPillar extends Block implements IFluidConnectorBlock { textureAlt = bottom; } - public Block setBlockTextureName(String name) { - - if(textureTop.isEmpty()) - textureTop = name; - - if(textureAlt.isEmpty()) - textureAlt = name; - - this.textureName = name; - - return this; - } + public Block setBlockTextureName(String name) { + + if(textureTop.isEmpty()) textureTop = name; + if(textureAlt.isEmpty()) textureAlt = name; + this.textureName = name; + return this; + } @Override @SideOnly(Side.CLIENT) @@ -62,37 +49,6 @@ public class BlockPillar extends Block implements IFluidConnectorBlock { @Override @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int metadata) { - - if(this == ModBlocks.reactor_element && metadata == 1) - return side == 1 ? this.iconTop : (side == 0 ? this.iconTop : this.iconAlt); - return side == 1 ? this.iconTop : (side == 0 ? this.iconTop : this.blockIcon); } - - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - - if(this != ModBlocks.reactor_element) - return super.onBlockActivated(world, x, y, z, player, side, hitX, hitY, hitZ); - - if(player.isSneaking()) - { - if(world.getBlockMetadata(x, y, z) == 0) { - world.setBlockMetadataWithNotify(x, y, z, 1, 3); - } else { - world.setBlockMetadataWithNotify(x, y, z, 0, 3); - } - - return true; - } - - return false; - } - - @Override - public boolean canConnect(FluidType type, IBlockAccess world, int x, int y, int z, ForgeDirection dir) { - if(this != ModBlocks.reactor_conductor) return false; - return type == Fluids.WATER || type == Fluids.COOLANT || type == Fluids.STEAM || type == Fluids.HOTSTEAM || type == Fluids.SUPERHOTSTEAM || type == Fluids.ULTRAHOTSTEAM; - } } diff --git a/src/main/java/com/hbm/blocks/machine/BlockRotatable.java b/src/main/java/com/hbm/blocks/machine/BlockRotatable.java deleted file mode 100644 index d3e7d538e..000000000 --- a/src/main/java/com/hbm/blocks/machine/BlockRotatable.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.hbm.blocks.machine; - -import com.hbm.blocks.ModBlocks; -import com.hbm.lib.RefStrings; - -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.client.renderer.texture.IIconRegister; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; - -public class BlockRotatable extends Block { - - @SideOnly(Side.CLIENT) - private IIcon iconFront; - - public BlockRotatable(Material p_i45394_1_) { - super(p_i45394_1_); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister iconRegister) { - - if(this == ModBlocks.reactor_ejector) { - this.iconFront = iconRegister.registerIcon(RefStrings.MODID + ":reactor_ejector"); - this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":brick_concrete"); - } - if(this == ModBlocks.reactor_inserter) { - this.iconFront = iconRegister.registerIcon(RefStrings.MODID + ":reactor_inserter"); - this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":brick_concrete"); - } - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int side, int metadata) { - return metadata == 0 && side == 3 ? this.iconFront : (side == metadata ? this.iconFront : this.blockIcon); - } - - @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { - int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; - - if(i == 0) { - world.setBlockMetadataWithNotify(x, y, z, 2, 2); - } - if(i == 1) { - world.setBlockMetadataWithNotify(x, y, z, 5, 2); - } - if(i == 2) { - world.setBlockMetadataWithNotify(x, y, z, 3, 2); - } - if(i == 3) { - world.setBlockMetadataWithNotify(x, y, z, 4, 2); - } - } -} diff --git a/src/main/java/com/hbm/blocks/machine/ReactorCore.java b/src/main/java/com/hbm/blocks/machine/ReactorCore.java deleted file mode 100644 index 847ece06f..000000000 --- a/src/main/java/com/hbm/blocks/machine/ReactorCore.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.hbm.blocks.machine; - -import java.util.Random; - -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -public class ReactorCore extends BlockContainer { - - public boolean keepInventory = false; - public Random field_149933_a = new Random(); - - public ReactorCore(Material p_i45386_1_) { - super(p_i45386_1_); - } - - @Override - public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { - return null; - } -} diff --git a/src/main/java/com/hbm/blocks/machine/ReactorHatch.java b/src/main/java/com/hbm/blocks/machine/ReactorHatch.java deleted file mode 100644 index b83e57aa1..000000000 --- a/src/main/java/com/hbm/blocks/machine/ReactorHatch.java +++ /dev/null @@ -1,158 +0,0 @@ -package com.hbm.blocks.machine; - -import java.util.Random; - -import com.hbm.inventory.fluid.FluidType; -import com.hbm.inventory.fluid.Fluids; -import com.hbm.lib.RefStrings; -import com.hbm.main.MainRegistry; -import com.hbm.tileentity.machine.TileEntityMachineReactorLarge; - -import api.hbm.fluid.IFluidConnectorBlock; -import cpw.mods.fml.common.network.internal.FMLNetworkHandler; -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.client.renderer.texture.IIconRegister; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; - -public class ReactorHatch extends Block implements IFluidConnectorBlock { - - @SideOnly(Side.CLIENT) - private IIcon iconFront; - - public ReactorHatch(Material p_i45394_1_) { - super(p_i45394_1_); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister iconRegister) { - this.iconFront = iconRegister.registerIcon(RefStrings.MODID + ":reactor_hatch"); - this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":brick_concrete"); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int side, int metadata) { - return metadata == 0 && side == 3 ? this.iconFront : (side == metadata ? this.iconFront : this.blockIcon); - } - - @Override - public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) - { - return Item.getItemFromBlock(this); - } - - @Override - public void onBlockAdded(World world, int x, int y, int z) { - super.onBlockAdded(world, x, y, z); - //this.setDefaultDirection(world, x, y, z); - } - - @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { - int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; - - if(i == 0) - { - world.setBlockMetadataWithNotify(x, y, z, 2, 2); - } - if(i == 1) - { - world.setBlockMetadataWithNotify(x, y, z, 5, 2); - } - if(i == 2) - { - world.setBlockMetadataWithNotify(x, y, z, 3, 2); - } - if(i == 3) - { - world.setBlockMetadataWithNotify(x, y, z, 4, 2); - } - } - - @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()) - { - if(world.getBlockMetadata(x, y, z) == 2) - { - if(world.getTileEntity(x, y, z + 2) instanceof TileEntityMachineReactorLarge) - { - if(((TileEntityMachineReactorLarge)world.getTileEntity(x, y, z + 2)).checkBody()) - { - FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z + 2); - } else { - player.addChatMessage(new ChatComponentText("[Nuclear Reactor] Error: Reactor Structure not valid!")); - } - } else { - player.addChatMessage(new ChatComponentText("[Nuclear Reactor Error: Reactor Core not found!")); - } - } - if(world.getBlockMetadata(x, y, z) == 3) - { - if(world.getTileEntity(x, y, z - 2) instanceof TileEntityMachineReactorLarge) - { - if(((TileEntityMachineReactorLarge)world.getTileEntity(x, y, z - 2)).checkBody()) - { - FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z - 2); - } else { - player.addChatMessage(new ChatComponentText("[Nuclear Reactor] Error: Reactor Structure not valid!")); - } - } else { - player.addChatMessage(new ChatComponentText("[Nuclear Reactor Error: Reactor Core not found!")); - } - } - if(world.getBlockMetadata(x, y, z) == 4) - { - if(world.getTileEntity(x + 2, y, z) instanceof TileEntityMachineReactorLarge) - { - if(((TileEntityMachineReactorLarge)world.getTileEntity(x + 2, y, z)).checkBody()) - { - FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x + 2, y, z); - } else { - player.addChatMessage(new ChatComponentText("[Nuclear Reactor] Error: Reactor Structure not valid!")); - } - } else { - player.addChatMessage(new ChatComponentText("[Nuclear Reactor Error: Reactor Core not found!")); - } - } - if(world.getBlockMetadata(x, y, z) == 5) - { - if(world.getTileEntity(x - 2, y, z) instanceof TileEntityMachineReactorLarge) - { - if(((TileEntityMachineReactorLarge)world.getTileEntity(x - 2, y, z)).checkBody()) - { - FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x - 2, y, z); - } else { - player.addChatMessage(new ChatComponentText("[Nuclear Reactor] Error: Reactor Structure not valid!")); - } - } else { - player.addChatMessage(new ChatComponentText("[Nuclear Reactor Error: Reactor Core not found!")); - } - } - return true; - } else { - return false; - } - } - - @Override - public boolean canConnect(FluidType type, IBlockAccess world, int x, int y, int z, ForgeDirection dir) { - return type == Fluids.WATER || type == Fluids.COOLANT || type == Fluids.STEAM || type == Fluids.HOTSTEAM || type == Fluids.SUPERHOTSTEAM || type == Fluids.ULTRAHOTSTEAM; - } -} diff --git a/src/main/java/com/hbm/inventory/container/ContainerReactorMultiblock.java b/src/main/java/com/hbm/inventory/container/ContainerReactorMultiblock.java deleted file mode 100644 index e84e79fd9..000000000 --- a/src/main/java/com/hbm/inventory/container/ContainerReactorMultiblock.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.hbm.inventory.container; - -import com.hbm.inventory.SlotTakeOnly; -import com.hbm.tileentity.machine.TileEntityMachineReactorLarge; -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 ContainerReactorMultiblock extends Container { - - private TileEntityMachineReactorLarge diFurnace; - - public ContainerReactorMultiblock(InventoryPlayer invPlayer, TileEntityMachineReactorLarge tedf) { - - diFurnace = tedf; - - //Water in - this.addSlotToContainer(new Slot(tedf, 0, 8, 90)); - //Water out - this.addSlotToContainer(new SlotTakeOnly(tedf, 1, 8, 108)); - //Coolant in - this.addSlotToContainer(new Slot(tedf, 2, 26, 90)); - //Coolant out - this.addSlotToContainer(new SlotTakeOnly(tedf, 3, 26, 108)); - - //Fuel in - this.addSlotToContainer(new Slot(tedf, 4, 80, 36)); - //Fuel out - this.addSlotToContainer(new SlotTakeOnly(tedf, 5, 80, 72)); - //Waste in - this.addSlotToContainer(new Slot(tedf, 6, 152, 36)); - //Waste out - this.addSlotToContainer(new SlotTakeOnly(tedf, 7, 152, 72)); - - 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 + 56)); - } - } - - for(int i = 0; i < 9; i++) - { - this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142 + 56)); - } - } - - @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 <= 7) { - if (!this.mergeItemStack(var5, 8, this.inventorySlots.size(), true)) - { - return null; - } - } else { - 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); - } -} diff --git a/src/main/java/com/hbm/inventory/gui/GUIMachineRadarNTSlots.java b/src/main/java/com/hbm/inventory/gui/GUIMachineRadarNTSlots.java index 77f1f3a60..2c9338326 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIMachineRadarNTSlots.java +++ b/src/main/java/com/hbm/inventory/gui/GUIMachineRadarNTSlots.java @@ -52,6 +52,7 @@ public class GUIMachineRadarNTSlots extends GuiInfoContainer { @Override protected void drawGuiContainerForegroundLayer(int i, int j) { String name = this.radar.hasCustomInventoryName() ? this.radar.getInventoryName() : I18n.format(this.radar.getInventoryName()); + if(MainRegistry.polaroidID == 11) name = "Reda"; 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); } diff --git a/src/main/java/com/hbm/inventory/gui/GUIReactorMultiblock.java b/src/main/java/com/hbm/inventory/gui/GUIReactorMultiblock.java deleted file mode 100644 index 7cf44051e..000000000 --- a/src/main/java/com/hbm/inventory/gui/GUIReactorMultiblock.java +++ /dev/null @@ -1,189 +0,0 @@ -package com.hbm.inventory.gui; - -import org.lwjgl.opengl.GL11; - -import com.hbm.inventory.container.ContainerReactorMultiblock; -import com.hbm.inventory.fluid.FluidType; -import com.hbm.inventory.fluid.Fluids; -import com.hbm.lib.RefStrings; -import com.hbm.packet.AuxButtonPacket; -import com.hbm.packet.PacketDispatcher; -import com.hbm.tileentity.machine.TileEntityMachineReactorLarge; -import net.minecraft.client.Minecraft; -import net.minecraft.client.audio.PositionedSoundRecord; -import net.minecraft.client.resources.I18n; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; - -public class GUIReactorMultiblock extends GuiInfoContainer { - - private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_reactor_large_experimental.png"); - private TileEntityMachineReactorLarge diFurnace; - - public GUIReactorMultiblock(InventoryPlayer invPlayer, TileEntityMachineReactorLarge tedf) { - super(new ContainerReactorMultiblock(invPlayer, tedf)); - diFurnace = tedf; - - this.xSize = 176; - this.ySize = 222; - } - - @Override - public void drawScreen(int mouseX, int mouseY, float f) { - super.drawScreen(mouseX, mouseY, f); - - diFurnace.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 88 - 52, 16, 52); - diFurnace.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 26, guiTop + 88 - 52, 16, 52); - diFurnace.tanks[2].renderTankInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 108, 88, 4); - this.drawCustomInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 114, 88, 4, new String[] { "Hull Temperature:", " " + Math.round((diFurnace.hullHeat) * 0.00001 * 980 + 20) + "°C" }); - this.drawCustomInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 120, 88, 4, new String[] { "Core Temperature:", " " + Math.round((diFurnace.coreHeat) * 0.00002 * 980 + 20) + "°C" }); - - this.drawCustomInfo(this, mouseX, mouseY, guiLeft + 115, guiTop + 17, 18, 90, new String[] { "Operating Level: " + diFurnace.rods + "%" }); - - String fuel = ""; - - switch(diFurnace.type) { - case URANIUM: - fuel = "Uranium"; - break; - case MOX: - fuel = "MOX"; - break; - case PLUTONIUM: - fuel = "Plutonium"; - break; - case SCHRABIDIUM: - fuel = "Schrabidium"; - break; - case THORIUM: - fuel = "Thorium"; - break; - default: - fuel = "ERROR"; - break; - } - - this.drawCustomInfo(this, mouseX, mouseY, guiLeft + 98, guiTop + 18, 16, 88, new String[] { fuel + ": " + (diFurnace.fuel / diFurnace.fuelMult) + "/" + (diFurnace.maxFuel / diFurnace.fuelMult) + "ng" }); - this.drawCustomInfo(this, mouseX, mouseY, guiLeft + 134, guiTop + 18, 16, 88, new String[] { "Depleted " + fuel + ": " + (diFurnace.waste / diFurnace.fuelMult) + "/" + (diFurnace.maxWaste / diFurnace.fuelMult) + "ng" }); - - String[] text0 = new String[] { diFurnace.rods > 0 ? "Reactor is ON" : "Reactor is OFF"}; - this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 52, guiTop + 53, 18, 18, mouseX, mouseY, text0); - - String s = "0"; - - FluidType type = diFurnace.tanks[2].getTankType(); - if(type == Fluids.STEAM) s = "1x"; - if(type == Fluids.HOTSTEAM) s = "10x"; - if(type == Fluids.SUPERHOTSTEAM) s = "100x"; - - String[] text4 = new String[] { "Steam compression switch", - "Current compression level: " + s}; - this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 63, guiTop + 107, 14, 18, mouseX, mouseY, text4); - } - - protected void mouseClicked(int x, int y, int i) { - super.mouseClicked(x, y, i); - - if(guiLeft + 115 <= x && guiLeft + 115 + 18 > x && guiTop + 17 < y && guiTop + 17 + 90 >= y) { - - mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - - int rods = (y - (guiTop + 24)) * 100 / 76; - - if(rods < 0) - rods = 0; - - if(rods > 100) - rods = 100; - - rods = 100 - rods; - - PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(diFurnace.xCoord, diFurnace.yCoord, diFurnace.zCoord, rods, 0)); - } - - if(guiLeft + 63 <= x && guiLeft + 63 + 14 > x && guiTop + 107 < y && guiTop + 107 + 18 >= y) { - - mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - int c = 0; - - FluidType type = diFurnace.tanks[2].getTankType(); - if(type == Fluids.STEAM) c = 0; - if(type == Fluids.HOTSTEAM) c = 1; - if(type == Fluids.SUPERHOTSTEAM) c = 2; - - PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(diFurnace.xCoord, diFurnace.yCoord, diFurnace.zCoord, c, 1)); - } - } - - @Override - protected void drawGuiContainerForegroundLayer(int i, int j) { - String name = this.diFurnace.hasCustomInventoryName() ? this.diFurnace.getInventoryName() : I18n.format(this.diFurnace.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); - - int k = diFurnace.rods; - drawTexturedModalRect(guiLeft + 115, guiTop + 107 - 14 - (k * 76 / 100), 208, 36, 18, 14); - - if(diFurnace.rods > 0) - drawTexturedModalRect(guiLeft + 52, guiTop + 53, 212, 0, 18, 18); - - int q = diFurnace.getFuelScaled(88); - drawTexturedModalRect(guiLeft + 98, guiTop + 106 - q, 176, 124 - q, 16, q); - - int j = diFurnace.getWasteScaled(88); - drawTexturedModalRect(guiLeft + 134, guiTop + 106 - j, 192, 124 - j, 16, j); - - int s = diFurnace.size; - - if(s < 8) - drawTexturedModalRect(guiLeft + 50, guiTop + 17, 208, 50 + s * 18, 22, 18); - else - drawTexturedModalRect(guiLeft + 50, guiTop + 17, 230, 50 + (s - 8) * 18, 22, 18); - - - FluidType type = diFurnace.tanks[2].getTankType(); - if(type == Fluids.STEAM) drawTexturedModalRect(guiLeft + 63, guiTop + 107, 176, 18, 14, 18); - if(type == Fluids.HOTSTEAM) drawTexturedModalRect(guiLeft + 63, guiTop + 107, 190, 18, 14, 18); - if(type == Fluids.SUPERHOTSTEAM) drawTexturedModalRect(guiLeft + 63, guiTop + 107, 204, 18, 14, 18); - - if(diFurnace.hasHullHeat()) { - int i = diFurnace.getHullHeatScaled(88); - - i = (int) Math.min(i, 160); - - drawTexturedModalRect(guiLeft + 80, guiTop + 114, 0, 226, i, 4); - } - - if(diFurnace.hasCoreHeat()) { - int i = diFurnace.getCoreHeatScaled(88); - - i = (int) Math.min(i, 160); - - drawTexturedModalRect(guiLeft + 80, guiTop + 120, 0, 230, i, 4); - } - - if(diFurnace.tanks[2].getFill() > 0) { - int i = diFurnace.getSteamScaled(88); - - //i = (int) Math.min(i, 160); - - int offset = 234; - - if(type == Fluids.HOTSTEAM) offset += 4; - if(type == Fluids.SUPERHOTSTEAM) offset += 8; - - drawTexturedModalRect(guiLeft + 80, guiTop + 108, 0, offset, i, 4); - } - - diFurnace.tanks[0].renderTank(guiLeft + 8, guiTop + 88, this.zLevel, 16, 52); - diFurnace.tanks[1].renderTank(guiLeft + 26, guiTop + 88, this.zLevel, 16, 52); - } -} diff --git a/src/main/java/com/hbm/lib/Library.java b/src/main/java/com/hbm/lib/Library.java index 77c0bd6b1..f42d5a4c3 100644 --- a/src/main/java/com/hbm/lib/Library.java +++ b/src/main/java/com/hbm/lib/Library.java @@ -77,6 +77,7 @@ public class Library { public static String Ma118 = "1121cb7a-8773-491f-8e2b-221290c93d81"; public static String Adam29Adam29 = "bbae7bfa-0eba-40ac-a0dd-f3b715e73e61"; public static String Alcater = "0b399a4a-8545-45a1-be3d-ece70d7d48e9"; + public static String ege444 = "42ee978c-442a-4cd8-95b6-29e469b6df10"; public static Set contributors = Sets.newHashSet(new String[] { "06ab7c03-55ce-43f8-9d3c-2850e3c652de", //mustang_rudolf @@ -165,8 +166,6 @@ public class Library { return true; if((tileentity != null && (tileentity instanceof IFluidAcceptor || tileentity instanceof IFluidSource)) || - world.getBlock(x, y, z) == ModBlocks.reactor_hatch || - world.getBlock(x, y, z) == ModBlocks.reactor_conductor || world.getBlock(x, y, z) == ModBlocks.fusion_hatch || world.getBlock(x, y, z) == ModBlocks.fwatz_hatch || world.getBlock(x, y, z) == ModBlocks.dummy_port_ams_limiter || @@ -390,23 +389,6 @@ public class Library { Block block = worldObj.getBlock(x, y, z); TileEntity tileentity = worldObj.getTileEntity(x, y, z); - //Large Nuclear Reactor - if(block == ModBlocks.reactor_hatch && worldObj.getBlock(x, y, z + 2) == ModBlocks.reactor_computer) - { - tileentity = worldObj.getTileEntity(x, y, z + 2); - } - if(block == ModBlocks.reactor_hatch && worldObj.getBlock(x, y, z - 2) == ModBlocks.reactor_computer) - { - tileentity = worldObj.getTileEntity(x, y, z - 2); - } - if(block == ModBlocks.reactor_hatch && worldObj.getBlock(x + 2, y, z) == ModBlocks.reactor_computer) - { - tileentity = worldObj.getTileEntity(x + 2, y, z); - } - if(block == ModBlocks.reactor_hatch && worldObj.getBlock(x - 2, y, z) == ModBlocks.reactor_computer) - { - tileentity = worldObj.getTileEntity(x - 2, y, z); - } //FWatz Reactor if(block == ModBlocks.fwatz_hatch && worldObj.getBlock(x, y + 11, z + 9) == ModBlocks.fwatz_core) { diff --git a/src/main/java/com/hbm/main/CraftingManager.java b/src/main/java/com/hbm/main/CraftingManager.java index 4eb46ca3a..b4fb99e14 100644 --- a/src/main/java/com/hbm/main/CraftingManager.java +++ b/src/main/java/com/hbm/main/CraftingManager.java @@ -1079,6 +1079,8 @@ public class CraftingManager { addRecipeAuto(new ItemStack(ModBlocks.ore_nether_uranium, 8), new Object[] { "OOO", "OBO", "OOO", 'O', ModBlocks.ore_nether_uranium_scorched, 'B', Items.water_bucket }); addShapelessAuto(new ItemStack(ModBlocks.ore_gneiss_uranium, 1), new Object[] { ModBlocks.ore_gneiss_uranium_scorched, Items.water_bucket }); addRecipeAuto(new ItemStack(ModBlocks.ore_gneiss_uranium, 8), new Object[] { "OOO", "OBO", "OOO", 'O', ModBlocks.ore_gneiss_uranium_scorched, 'B', Items.water_bucket }); + addShapelessAuto(new ItemStack(ModBlocks.ore_uranium, 1), new Object[] { ModBlocks.ore_sellafield_uranium_scorched, Items.water_bucket }); + addRecipeAuto(new ItemStack(ModBlocks.ore_uranium, 8), new Object[] { "OOO", "OBO", "OOO", 'O', ModBlocks.ore_sellafield_uranium_scorched, 'B', Items.water_bucket }); addRecipeAuto(new ItemStack(ModItems.plate_iron, 4), new Object[] { "##", "##", '#', IRON.ingot() }); addRecipeAuto(new ItemStack(ModItems.plate_gold, 4), new Object[] { "##", "##", '#', GOLD.ingot() }); diff --git a/src/main/java/com/hbm/main/MainRegistry.java b/src/main/java/com/hbm/main/MainRegistry.java index 1456c584f..b02fb3722 100644 --- a/src/main/java/com/hbm/main/MainRegistry.java +++ b/src/main/java/com/hbm/main/MainRegistry.java @@ -43,7 +43,6 @@ import com.hbm.saveddata.satellites.Satellite; import com.hbm.tileentity.TileMappings; import com.hbm.tileentity.bomb.TileEntityLaunchPad; 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.*; @@ -864,7 +863,6 @@ public class MainRegistry { ArmorUtil.register(); HazmatRegistry.registerHazmats(); FluidContainerRegistry.register(); - TileEntityMachineReactorLarge.registerAll(); BlockToolConversion.registerRecipes(); AchievementHandler.register(); @@ -1204,6 +1202,14 @@ public class MainRegistry { ignoreMappings.add("hbm:tile.watz_core"); ignoreMappings.add("hbm:tile.watz_hatch"); ignoreMappings.add("hbm:tile.marker_structure"); + ignoreMappings.add("hbm:tile.reactor_element"); + ignoreMappings.add("hbm:tile.reactor_control"); + ignoreMappings.add("hbm:tile.reactor_hatch"); + ignoreMappings.add("hbm:tile.reactor_ejector"); + ignoreMappings.add("hbm:tile.reactor_inserter"); + ignoreMappings.add("hbm:tile.reactor_conductor"); + ignoreMappings.add("hbm:tile.reactor_computer"); + ignoreMappings.add("hbm:tile.ff"); /// REMAP /// remapItems.put("hbm:item.gadget_explosive8", ModItems.early_explosive_lenses); diff --git a/src/main/java/com/hbm/packet/AuxButtonPacket.java b/src/main/java/com/hbm/packet/AuxButtonPacket.java index 3cb163883..922b1704a 100644 --- a/src/main/java/com/hbm/packet/AuxButtonPacket.java +++ b/src/main/java/com/hbm/packet/AuxButtonPacket.java @@ -13,7 +13,6 @@ import com.hbm.tileentity.machine.TileEntityCoreStabilizer; import com.hbm.tileentity.machine.TileEntityForceField; import com.hbm.tileentity.machine.TileEntityMachineMiningLaser; import com.hbm.tileentity.machine.TileEntityMachineMissileAssembly; -import com.hbm.tileentity.machine.TileEntityMachineReactorLarge; import com.hbm.tileentity.machine.TileEntitySoyuzLauncher; import com.hbm.tileentity.machine.storage.TileEntityBarrel; import com.hbm.tileentity.machine.storage.TileEntityMachineBattery; @@ -85,30 +84,6 @@ public class AuxButtonPacket implements IMessage { field.isOn = !field.isOn; } - if (te instanceof TileEntityMachineReactorLarge) { - TileEntityMachineReactorLarge reactor = (TileEntityMachineReactorLarge)te; - - if(m.id == 0) - reactor.rods = m.value; - - if(m.id == 1) { - FluidType type = Fluids.STEAM; - int fill = reactor.tanks[2].getFill(); - - switch(m.value) { - case 0: type = Fluids.HOTSTEAM; fill = (int)Math.floor(fill / 10D); break; - case 1: type = Fluids.SUPERHOTSTEAM; fill = (int)Math.floor(fill / 10D); break; - case 2: type = Fluids.STEAM; fill = (int)Math.floor(fill * 100); break; - } - - if(fill > reactor.tanks[2].getMaxFill()) - fill = reactor.tanks[2].getMaxFill(); - - reactor.tanks[2].setTankType(type); - reactor.tanks[2].setFill(fill); - } - } - if (te instanceof TileEntityMachineMissileAssembly) { TileEntityMachineMissileAssembly assembly = (TileEntityMachineMissileAssembly)te; diff --git a/src/main/java/com/hbm/tileentity/TileMappings.java b/src/main/java/com/hbm/tileentity/TileMappings.java index f8060cbd2..0a9afce70 100644 --- a/src/main/java/com/hbm/tileentity/TileMappings.java +++ b/src/main/java/com/hbm/tileentity/TileMappings.java @@ -135,7 +135,6 @@ public class TileMappings { put(TileEntityMachineShredderLarge.class, "tileentity_machine_big_shredder"); put(TileEntityRFDuct.class, "tileentity_hbm_rfduct"); put(TileEntityReactorControl.class, "tileentity_reactor_remote_control"); - put(TileEntityMachineReactorLarge.class, "tileentity_large_reactor"); put(TileEntityWasteDrum.class, "tileentity_waste_drum"); put(TileEntityDecon.class, "tileentity_decon"); put(TileEntityMachineSatDock.class, "tileentity_miner_dock"); diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineReactorLarge.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineReactorLarge.java deleted file mode 100644 index 9cfafeb0d..000000000 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineReactorLarge.java +++ /dev/null @@ -1,1017 +0,0 @@ -package com.hbm.tileentity.machine; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.hbm.blocks.ModBlocks; -import com.hbm.config.MobConfig; -import com.hbm.explosion.ExplosionNukeGeneric; -import com.hbm.handler.radiation.ChunkRadiationManager; -import com.hbm.interfaces.IFluidAcceptor; -import com.hbm.interfaces.IFluidContainer; -import com.hbm.interfaces.IFluidSource; -import com.hbm.inventory.container.ContainerReactorMultiblock; -import com.hbm.inventory.fluid.FluidType; -import com.hbm.inventory.fluid.Fluids; -import com.hbm.inventory.fluid.tank.FluidTank; -import com.hbm.inventory.gui.GUIReactorMultiblock; -import com.hbm.items.ModItems; -import com.hbm.items.machine.ItemFuelRod; -import com.hbm.lib.Library; -import com.hbm.packet.AuxGaugePacket; -import com.hbm.packet.PacketDispatcher; -import com.hbm.tileentity.IGUIProvider; -import com.hbm.tileentity.TileEntityLoadedBase; - -import api.hbm.fluid.IFluidStandardTransceiver; -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.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.IInventory; -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.world.World; -import net.minecraftforge.common.util.ForgeDirection; - -public class TileEntityMachineReactorLarge extends TileEntityLoadedBase implements ISidedInventory, IFluidContainer, IFluidAcceptor, IFluidSource, IFluidStandardTransceiver, IGUIProvider { - - private ItemStack slots[]; - - public int hullHeat; - public final int maxHullHeat = 100000; - public int coreHeat; - public final int maxCoreHeat = 50000; - public int rods; - public final int rodsMax = 100; - public int age = 0; - public List list = new ArrayList(); - public FluidTank[] tanks; - public ReactorFuelType type; - public int fuel; - public int maxFuel = 240 * fuelMult; - public int waste; - public int maxWaste = 240 * fuelMult; - - public static int fuelMult = 1000; - public static int cycleDuration = 24000; - private static int fuelBase = 240 * fuelMult; - private static int waterBase = 128 * 1000; - private static int coolantBase = 64 * 1000; - private static int steamBase = 32 * 1000; - - private static final int[] slots_top = new int[] { 0 }; - private static final int[] slots_bottom = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 16 }; - private static final int[] slots_side = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 16 }; - - private String customName; - - public TileEntityMachineReactorLarge() { - slots = new ItemStack[8]; - tanks = new FluidTank[3]; - tanks[0] = new FluidTank(Fluids.WATER, 128000, 0); - tanks[1] = new FluidTank(Fluids.COOLANT, 64000, 1); - tanks[2] = new FluidTank(Fluids.STEAM, 32000, 2); - type = ReactorFuelType.URANIUM; - } - - @Override - public int getSizeInventory() { - return slots.length; - } - - @Override - public ItemStack getStackInSlot(int i) { - return slots[i]; - } - - @Override - public ItemStack getStackInSlotOnClosing(int i) { - if (slots[i] != null) { - ItemStack itemStack = slots[i]; - slots[i] = null; - return itemStack; - } else { - return null; - } - } - - @Override - public void setInventorySlotContents(int i, ItemStack itemStack) { - slots[i] = itemStack; - if (itemStack != null && itemStack.stackSize > getInventoryStackLimit()) { - itemStack.stackSize = getInventoryStackLimit(); - } - } - - @Override - public String getInventoryName() { - return this.hasCustomInventoryName() ? this.customName : "container.reactorLarge"; - } - - @Override - public boolean hasCustomInventoryName() { - return this.customName != null && this.customName.length() > 0; - } - - public void setCustomName(String name) { - this.customName = name; - } - - @Override - public int getInventoryStackLimit() { - return 64; - } - - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - if (worldObj.getTileEntity(xCoord, yCoord, zCoord) != this) { - return false; - } else { - return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <= 64; - } - } - - // You scrubs aren't needed for anything (right now) - @Override - public void openInventory() { - } - - @Override - public void closeInventory() { - } - - @Override - public boolean isItemValidForSlot(int i, ItemStack itemStack) { - return false; - } - - @Override - public ItemStack decrStackSize(int i, int j) { - if (slots[i] != null) { - if (slots[i].stackSize <= j) { - ItemStack itemStack = slots[i]; - slots[i] = null; - return itemStack; - } - ItemStack itemStack1 = slots[i].splitStack(j); - if (slots[i].stackSize == 0) { - slots[i] = null; - } - - return itemStack1; - } else { - return null; - } - } - - @Override - public void readFromNBT(NBTTagCompound nbt) { - super.readFromNBT(nbt); - NBTTagList list = nbt.getTagList("items", 10); - - coreHeat = nbt.getInteger("heat"); - hullHeat = nbt.getInteger("hullHeat"); - rods = nbt.getInteger("rods"); - fuel = nbt.getInteger("fuel"); - waste = nbt.getInteger("waste"); - slots = new ItemStack[getSizeInventory()]; - tanks[0].readFromNBT(nbt, "water"); - tanks[1].readFromNBT(nbt, "coolant"); - tanks[2].readFromNBT(nbt, "steam"); - type = ReactorFuelType.getEnum(nbt.getInteger("type")); - - for (int i = 0; i < list.tagCount(); i++) { - NBTTagCompound nbt1 = list.getCompoundTagAt(i); - byte b0 = nbt1.getByte("slot"); - if (b0 >= 0 && b0 < slots.length) { - slots[b0] = ItemStack.loadItemStackFromNBT(nbt1); - } - } - } - - @Override - public void writeToNBT(NBTTagCompound nbt) { - super.writeToNBT(nbt); - nbt.setInteger("heat", coreHeat); - nbt.setInteger("hullHeat", hullHeat); - nbt.setInteger("rods", rods); - nbt.setInteger("fuel", fuel); - nbt.setInteger("waste", waste); - NBTTagList list = new NBTTagList(); - tanks[0].writeToNBT(nbt, "water"); - tanks[1].writeToNBT(nbt, "coolant"); - tanks[2].writeToNBT(nbt, "steam"); - nbt.setInteger("type", type.getID()); - - for (int i = 0; i < slots.length; i++) { - if (slots[i] != null) { - NBTTagCompound nbt1 = new NBTTagCompound(); - nbt1.setByte("slot", (byte) i); - slots[i].writeToNBT(nbt1); - list.appendTag(nbt1); - } - } - nbt.setTag("items", list); - } - - @Override - public int[] getAccessibleSlotsFromSide(int p_94128_1_) { - return p_94128_1_ == 0 ? slots_bottom : (p_94128_1_ == 1 ? slots_top : slots_side); - } - - @Override - public boolean canInsertItem(int i, ItemStack itemStack, int j) { - return false; - } - - @Override - public boolean canExtractItem(int i, ItemStack itemStack, int j) { - return false; - - } - - public int getCoreHeatScaled(int i) { - return (coreHeat * i) / maxCoreHeat; - } - - public int getHullHeatScaled(int i) { - return (hullHeat * i) / maxHullHeat; - } - - public int getFuelScaled(int i) { - return (fuel * i) / maxFuel; - } - - public int getWasteScaled(int i) { - return (waste * i) / maxWaste; - } - - public int getSteamScaled(int i) { - return (tanks[2].getFill() * i) / tanks[2].getMaxFill(); - } - - public boolean hasCoreHeat() { - return coreHeat > 0; - } - - public boolean hasHullHeat() { - return hullHeat > 0; - } - - public boolean checkBody() { - - return worldObj.getBlock(xCoord + 1, yCoord, zCoord + 1) == ModBlocks.reactor_element && - worldObj.getBlock(xCoord - 1, yCoord, zCoord + 1) == ModBlocks.reactor_element && - worldObj.getBlock(xCoord - 1, yCoord, zCoord - 1) == ModBlocks.reactor_element && - worldObj.getBlock(xCoord + 1, yCoord, zCoord - 1) == ModBlocks.reactor_element && - worldObj.getBlock(xCoord + 1, yCoord, zCoord) == ModBlocks.reactor_control && - worldObj.getBlock(xCoord - 1, yCoord, zCoord) == ModBlocks.reactor_control && - worldObj.getBlock(xCoord, yCoord, zCoord + 1) == ModBlocks.reactor_control && - worldObj.getBlock(xCoord, yCoord, zCoord - 1) == ModBlocks.reactor_control; - } - - public boolean checkSegment(int offset) { - - return worldObj.getBlock(xCoord + 1, yCoord + offset, zCoord + 1) == ModBlocks.reactor_element && - worldObj.getBlock(xCoord - 1, yCoord + offset, zCoord + 1) == ModBlocks.reactor_element && - worldObj.getBlock(xCoord - 1, yCoord + offset, zCoord - 1) == ModBlocks.reactor_element && - worldObj.getBlock(xCoord + 1, yCoord + offset, zCoord - 1) == ModBlocks.reactor_element && - worldObj.getBlock(xCoord + 1, yCoord + offset, zCoord) == ModBlocks.reactor_control && - worldObj.getBlock(xCoord - 1, yCoord + offset, zCoord) == ModBlocks.reactor_control && - worldObj.getBlock(xCoord, yCoord + offset, zCoord + 1) == ModBlocks.reactor_control && - worldObj.getBlock(xCoord, yCoord + offset, zCoord - 1) == ModBlocks.reactor_control && - worldObj.getBlock(xCoord, yCoord + offset, zCoord) == ModBlocks.reactor_conductor; - } - - private float checkHull() { - - float max = getSize() * 12; - float count = 0; - - for(int y = yCoord - depth; y <= yCoord + height; y++) { - - if(blocksRad(xCoord - 1, y, zCoord + 2)) - count++; - if(blocksRad(xCoord, y, zCoord + 2)) - count++; - if(blocksRad(xCoord + 1, y, zCoord + 2)) - count++; - - if(blocksRad(xCoord - 1, y, zCoord - 2)) - count++; - if(blocksRad(xCoord, y, zCoord - 2)) - count++; - if(blocksRad(xCoord + 1, y, zCoord - 2)) - count++; - - if(blocksRad(xCoord + 2, y, zCoord - 1)) - count++; - if(blocksRad(xCoord + 2, y, zCoord)) - count++; - if(blocksRad(xCoord + 2, y, zCoord + 1)) - count++; - - if(blocksRad(xCoord - 2, y, zCoord - 1)) - count++; - if(blocksRad(xCoord - 2, y, zCoord)) - count++; - if(blocksRad(xCoord - 2, y, zCoord + 1)) - count++; - } - - if(count == 0) - return 1; - - //System.out.println(count + "/" + max); - - return 1 - (count / max); - } - - 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.brick_concrete) - return true; - - if(b.getExplosionResistance(null) >= 100) - return true; - - return false; - } - - int height; - int depth; - public int size; - - private void caluclateSize() { - - height = 0; - depth = 0; - - for(int i = 0; i < 7; i++) { - - if(checkSegment(i + 1)) - height++; - else - break; - } - - for(int i = 0; i < 7; i++) { - - if(checkSegment(-i - 1)) - depth++; - else - break; - } - - size = height + depth + 1; - } - - private int getSize() { - return size; - } - - private void generate() { - - int consumption = (int) (((double)maxFuel / cycleDuration) * rods / 100); - - if(consumption > fuel) - consumption = fuel; - - if(consumption + waste > maxWaste) - consumption = maxWaste - waste; - - fuel -= consumption; - waste += consumption; - - int heat = (int) (((double)consumption / size) * type.heat / fuelMult); - - this.coreHeat += heat; - - } - - @Override - public void updateEntity() { - - if (!worldObj.isRemote && checkBody()) { - - age++; - if (age >= 20) { - age = 0; - } - - fillFluidInit(tanks[2].getTankType()); - - caluclateSize(); - PacketDispatcher.wrapper.sendToAllAround(new AuxGaugePacket(xCoord, yCoord, zCoord, size, 3), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50)); - } - - tanks[0].changeTankSize(waterBase * getSize()); - tanks[1].changeTankSize(coolantBase * getSize()); - tanks[2].changeTankSize(steamBase * getSize()); - - maxWaste = maxFuel = fuelBase * getSize(); - - if(!worldObj.isRemote) { - - if(waste > maxWaste) - waste = maxWaste; - - if(fuel > maxFuel) - fuel = maxFuel; - - tanks[0].loadTank(0, 1, slots); - tanks[1].loadTank(2, 3, slots); - - //Change fuel type if empty - if(fuel == 0) { - - if(slots[4] != null && !getFuelType(slots[4].getItem()).toString().equals(ReactorFuelType.UNKNOWN.toString())) { - - this.type = getFuelType(slots[4].getItem()); - this.waste = 0; - - } - } - - //Meteorite sword - if(slots[4] != null && coreHeat > 0 && slots[4].getItem() == ModItems.meteorite_sword_bred) - slots[4] = new ItemStack(ModItems.meteorite_sword_irradiated); - - //Load fuel - if(slots[4] != null && getFuelContent(slots[4], type) > 0) { - - int cont = getFuelContent(slots[4], type) * fuelMult; - - if(fuel + cont <= maxFuel) { - - if(!slots[4].getItem().hasContainerItem()) { - - slots[4].stackSize--; - fuel += cont; - - } else if(slots[5] == null) { - - slots[5] = new ItemStack(slots[4].getItem().getContainerItem()); - slots[4].stackSize--; - fuel += cont; - - } else if(slots[4].getItem().getContainerItem() == slots[5].getItem() && slots[5].stackSize < slots[5].getMaxStackSize()) { - - slots[4].stackSize--; - slots[5].stackSize++; - fuel += cont; - - } - - if(slots[4].stackSize == 0) - slots[4] = null; - } - } - - //Unload waste - if(slots[6] != null && getWasteAbsorbed(slots[6].getItem(), type) > 0) { - - int absorbed = getWasteAbsorbed(slots[6].getItem(), type) * fuelMult; - - if(absorbed <= waste) { - - if(slots[7] == null) { - - waste -= absorbed; - slots[7] = new ItemStack(getWaste(slots[6].getItem(), type)); - slots[6].stackSize--; - - } else if(slots[7] != null && slots[7].getItem() == getWaste(slots[6].getItem(), type) && slots[7].stackSize < slots[7].getMaxStackSize()) { - - waste -= absorbed; - slots[7].stackSize++; - slots[6].stackSize--; - } - - if(slots[6].stackSize == 0) - slots[6] = null; - } - - } - - if(rods > 0) - generate(); - - if (this.coreHeat > 0 && this.tanks[1].getFill() > 0 && this.hullHeat < this.maxHullHeat) { - this.hullHeat += this.coreHeat * 0.175; - this.coreHeat -= this.coreHeat * 0.1; - - this.tanks[1].setFill(this.tanks[1].getFill() - 10); - - if (this.tanks[1].getFill() < 0) - this.tanks[1].setFill(0); - } - - if (this.hullHeat > maxHullHeat) { - this.hullHeat = maxHullHeat; - } - - if (this.hullHeat > 0 && this.tanks[0].getFill() > 0) { - generateSteam(); - this.hullHeat -= this.hullHeat * 0.085; - } - - if (this.coreHeat > maxCoreHeat) { - this.explode(); - } - - if (rods > 0 && coreHeat > 0 && age == 5) { - - float rad = (float)coreHeat / (float)maxCoreHeat * 50F; - rad *= checkHull(); - ChunkRadiationManager.proxy.incrementRad(worldObj, xCoord, yCoord, zCoord, rad); - } - - for (int i = 0; i < 3; i++) - tanks[i].updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId); - - if(worldObj.getBlock(xCoord, yCoord, zCoord - 2) == ModBlocks.reactor_ejector && worldObj.getBlockMetadata(xCoord, yCoord, zCoord - 2) == 2) - tryEjectInto(xCoord, yCoord, zCoord - 3); - if(worldObj.getBlock(xCoord, yCoord, zCoord + 2) == ModBlocks.reactor_ejector && worldObj.getBlockMetadata(xCoord, yCoord, zCoord + 2) == 3) - tryEjectInto(xCoord, yCoord, zCoord + 3); - if(worldObj.getBlock(xCoord - 2, yCoord, zCoord) == ModBlocks.reactor_ejector && worldObj.getBlockMetadata(xCoord - 2, yCoord, zCoord) == 4) - tryEjectInto(xCoord - 3, yCoord, zCoord); - if(worldObj.getBlock(xCoord + 2, yCoord, zCoord) == ModBlocks.reactor_ejector && worldObj.getBlockMetadata(xCoord + 2, yCoord, zCoord) == 5) - tryEjectInto(xCoord + 3, yCoord, zCoord); - - if(worldObj.getBlock(xCoord, yCoord, zCoord - 2) == ModBlocks.reactor_inserter && worldObj.getBlockMetadata(xCoord, yCoord, zCoord - 2) == 2) - tryInsertFrom(xCoord, yCoord, zCoord - 3); - if(worldObj.getBlock(xCoord, yCoord, zCoord + 2) == ModBlocks.reactor_inserter && worldObj.getBlockMetadata(xCoord, yCoord, zCoord + 2) == 3) - tryInsertFrom(xCoord, yCoord, zCoord + 3); - if(worldObj.getBlock(xCoord - 2, yCoord, zCoord) == ModBlocks.reactor_inserter && worldObj.getBlockMetadata(xCoord - 2, yCoord, zCoord) == 4) - tryInsertFrom(xCoord - 3, yCoord, zCoord); - if(worldObj.getBlock(xCoord + 2, yCoord, zCoord) == ModBlocks.reactor_inserter && worldObj.getBlockMetadata(xCoord + 2, yCoord, zCoord) == 5) - tryInsertFrom(xCoord + 3, yCoord, zCoord); - - PacketDispatcher.wrapper.sendToAllAround(new AuxGaugePacket(xCoord, yCoord, zCoord, rods, 0), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50)); - PacketDispatcher.wrapper.sendToAllAround(new AuxGaugePacket(xCoord, yCoord, zCoord, coreHeat, 1), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50)); - PacketDispatcher.wrapper.sendToAllAround(new AuxGaugePacket(xCoord, yCoord, zCoord, hullHeat, 2), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50)); - PacketDispatcher.wrapper.sendToAllAround(new AuxGaugePacket(xCoord, yCoord, zCoord, fuel, 4), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50)); - PacketDispatcher.wrapper.sendToAllAround(new AuxGaugePacket(xCoord, yCoord, zCoord, waste, 5), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50)); - PacketDispatcher.wrapper.sendToAllAround(new AuxGaugePacket(xCoord, yCoord, zCoord, type.getID(), 6), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50)); - } - } - - private void tryEjectInto(int x, int y, int z) { - - int wSize = type.toString().equals(ReactorFuelType.SCHRABIDIUM.toString()) ? 60 * fuelMult : 6 * fuelMult; - - if(waste < wSize) - return; - - TileEntity te = worldObj.getTileEntity(x, y, z); - - if(te instanceof IInventory) { - - IInventory chest = (IInventory)te; - - Item waste = ModItems.waste_uranium; - - switch(type) { - case PLUTONIUM: - waste = ModItems.waste_plutonium; - break; - case MOX: - waste = ModItems.waste_mox; - break; - case SCHRABIDIUM: - waste = ModItems.waste_schrabidium; - break; - case THORIUM: - waste = ModItems.waste_thorium; - break; - default: - waste = ModItems.waste_uranium; - break; - } - - for(int i = 0; i < chest.getSizeInventory(); i++) { - - if(chest.isItemValidForSlot(i, new ItemStack(waste, 1, 1)) && chest.getStackInSlot(i) != null && chest.getStackInSlot(i).getItem() == waste && chest.getStackInSlot(i).stackSize < chest.getStackInSlot(i).getMaxStackSize()) { - chest.setInventorySlotContents(i, new ItemStack(waste, chest.getStackInSlot(i).stackSize + 1, 1)); - this.waste -= wSize; - return; - } - } - - for(int i = 0; i < chest.getSizeInventory(); i++) { - - if(chest.isItemValidForSlot(i, new ItemStack(waste, 1, 1)) && chest.getStackInSlot(i) == null) { - chest.setInventorySlotContents(i, new ItemStack(waste, 1, 1)); - this.waste -= wSize; - return; - } - } - } - } - - private void tryInsertFrom(int x, int y, int z) { - - TileEntity te = worldObj.getTileEntity(x, y, z); - - if(te instanceof IInventory) { - - IInventory chest = (IInventory)te; - - if(fuel > 0) { - for(int i = 0; i < chest.getSizeInventory(); i++) { - - if(chest.getStackInSlot(i) != null) { - int cont = getFuelContent(chest.getStackInSlot(i), type) * fuelMult; - - if(cont > 0 && fuel + cont <= maxFuel) { - - Item container = chest.getStackInSlot(i).getItem().getContainerItem(); - - chest.decrStackSize(i, 1); - fuel += cont; - - if(chest.getStackInSlot(i) == null && container != null) - chest.setInventorySlotContents(i, new ItemStack(container)); - } - } - } - } else { - for(int i = 0; i < chest.getSizeInventory(); i++) { - - if(chest.getStackInSlot(i) != null) { - int cont = getFuelContent(chest.getStackInSlot(i), getFuelType(chest.getStackInSlot(i).getItem())) * fuelMult; - - if(cont > 0 && fuel + cont <= maxFuel) { - - Item container = chest.getStackInSlot(i).getItem().getContainerItem(); - - type = getFuelType(chest.getStackInSlot(i).getItem()); - chest.decrStackSize(i, 1); - fuel += cont; - - if(chest.getStackInSlot(i) == null && container != null) - chest.setInventorySlotContents(i, new ItemStack(container)); - } - } - } - } - } - } - - private void generateSteam() { - - //function of SHS produced per tick - //maxes out at heat% * tank capacity / 20 - - double statSteMaFiFiLe = 8000; - - double steam = (((double)hullHeat / (double)maxHullHeat) * (/*(double)tanks[2].getMaxFill()*/statSteMaFiFiLe / 50D)) * size; - - double water = steam; - - FluidType type = tanks[2].getTankType(); - if(type == Fluids.STEAM) water /= 100D; - if(type == Fluids.HOTSTEAM) water /= 10; - - tanks[0].setFill(tanks[0].getFill() - (int)Math.ceil(water)); - tanks[2].setFill(tanks[2].getFill() + (int)Math.floor(steam)); - - if(tanks[0].getFill() < 0) - tanks[0].setFill(0); - - if(tanks[2].getFill() > tanks[2].getMaxFill()) - tanks[2].setFill(tanks[2].getMaxFill()); - - } - - private void explode() { - for (int i = 0; i < slots.length; i++) { - this.slots[i] = null; - } - - int rad = (int)(((long)fuel) * 25000L / (fuelBase * 15L)); - - ChunkRadiationManager.proxy.incrementRad(worldObj, xCoord, yCoord, zCoord, rad); - - worldObj.createExplosion(null, this.xCoord, this.yCoord, this.zCoord, 7.5F, true); - ExplosionNukeGeneric.waste(worldObj, this.xCoord, this.yCoord, this.zCoord, 35); - - for(int i = yCoord - depth; i <= yCoord + height; i++) { - - if(worldObj.rand.nextInt(2) == 0) { - randomizeRadBlock(this.xCoord + 1, i, this.zCoord + 1); - } - if(worldObj.rand.nextInt(2) == 0) { - randomizeRadBlock(this.xCoord + 1, i, this.zCoord - 1); - } - if(worldObj.rand.nextInt(2) == 0) { - randomizeRadBlock(this.xCoord - 1, i, this.zCoord - 1); - } - if(worldObj.rand.nextInt(2) == 0) { - randomizeRadBlock(this.xCoord - 1, i, this.zCoord + 1); - } - - if(worldObj.rand.nextInt(5) == 0) { - worldObj.createExplosion(null, this.xCoord, this.yCoord, this.zCoord, 5.0F, true); - } - } - - worldObj.setBlock(this.xCoord, this.yCoord, this.zCoord, ModBlocks.sellafield, 5, 3); - - if(MobConfig.enableElementals) { - List 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); - } - } - } - - private void randomizeRadBlock(int x, int y, int z) { - - int rand = worldObj.rand.nextInt(20); - - if(rand < 7) - worldObj.setBlock(x, y, z, ModBlocks.toxic_block); - else if(rand < 10) - worldObj.setBlock(x, y, z, ModBlocks.sellafield, 0, 3); - else if(rand < 14) - worldObj.setBlock(x, y, z, ModBlocks.sellafield, 1, 3); - else if(rand < 17) - worldObj.setBlock(x, y, z, ModBlocks.sellafield, 2, 3); - else if(rand < 19) - worldObj.setBlock(x, y, z, ModBlocks.sellafield, 3, 3); - else - worldObj.setBlock(x, y, z, ModBlocks.sellafield, 4, 3); - } - - @Override - public void fillFluid(int x, int y, int z, boolean newTact, FluidType type) { - Library.transmitFluid(x, y, z, newTact, this, worldObj, type); - } - - @Override - public void fillFluidInit(FluidType type) { - - for(ForgeDirection dir : new ForgeDirection[] {Library.POS_X, Library.NEG_X, Library.POS_Z, Library.NEG_Z}) { - - if(worldObj.getBlock(xCoord + dir.offsetX * 2, yCoord, zCoord + dir.offsetZ * 2) == ModBlocks.reactor_hatch) { - fillFluid(this.xCoord + dir.offsetX * 3, this.yCoord, this.zCoord + dir.offsetZ * 3, getTact(), type); - for(int i = 0; i < 2; i++) this.trySubscribe(tanks[i].getTankType(), worldObj, this.xCoord + dir.offsetX * 3, this.yCoord, this.zCoord + dir.offsetZ * 3, Library.NEG_X); - this.sendFluid(tanks[2], worldObj, this.xCoord + dir.offsetX * 3, this.yCoord, this.zCoord + dir.offsetZ * 3, Library.NEG_X); - } else { - for(int i = 0; i < 2; i++) this.tryUnsubscribe(tanks[i].getTankType(), worldObj, this.xCoord + dir.offsetX * 3, this.yCoord, this.zCoord + dir.offsetZ * 3); - } - } - - fillFluid(this.xCoord, this.yCoord + height + 1, this.zCoord, getTact(), type); - fillFluid(this.xCoord, this.yCoord - depth - 1, this.zCoord, getTact(), type); - - this.sendFluid(tanks[2], worldObj, this.xCoord, this.yCoord + height + 1, this.zCoord, Library.POS_Y); - this.sendFluid(tanks[2], worldObj, this.xCoord, this.yCoord - depth - 1, this.zCoord, Library.NEG_Y); - } - - @Override - public boolean getTact() { - return this.worldObj.getTotalWorldTime() % 2 == 0; - } - - @Override - public int getMaxFluidFill(FluidType type) { - if (type.name().equals(tanks[0].getTankType().name())) - return tanks[0].getMaxFill(); - else if (type.name().equals(tanks[1].getTankType().name())) - return tanks[1].getMaxFill(); - else - return 0; - } - - @Override - public void setFluidFill(int i, FluidType type) { - if (type.name().equals(tanks[0].getTankType().name())) - tanks[0].setFill(i); - else if (type.name().equals(tanks[1].getTankType().name())) - tanks[1].setFill(i); - else if (type.name().equals(tanks[2].getTankType().name())) - tanks[2].setFill(i); - } - - @Override - public int getFluidFill(FluidType type) { - if (type.name().equals(tanks[0].getTankType().name())) - return tanks[0].getFill(); - else if (type.name().equals(tanks[1].getTankType().name())) - return tanks[1].getFill(); - else if (type.name().equals(tanks[2].getTankType().name())) - return tanks[2].getFill(); - else - return 0; - } - - @Override - public void setFillForSync(int fill, int index) { - if (index < 3 && tanks[index] != null) - tanks[index].setFill(fill); - } - - @Override - public void setTypeForSync(FluidType type, int index) { - if (index < 3 && tanks[index] != null) - tanks[index].setTankType(type); - } - - @Override - public List getFluidList(FluidType type) { - return list; - } - - @Override - public void clearFluidList(FluidType type) { - list.clear(); - } - - public enum ReactorFuelType { - - URANIUM(250000), - THORIUM(200000), - PLUTONIUM(312500), - MOX(250000), - SCHRABIDIUM(2085000), - UNKNOWN(1); - - private ReactorFuelType(int i) { - heat = i; - } - - //Heat per nugget burned - private int heat; - - public int getHeat() { - return heat; - } - - public int getID() { - return Arrays.asList(ReactorFuelType.values()).indexOf(this); - } - - public static ReactorFuelType getEnum(int i) { - if(i < ReactorFuelType.values().length) - return ReactorFuelType.values()[i]; - else - return ReactorFuelType.URANIUM; - } - } - - static class ReactorFuelEntry { - - int value; - ReactorFuelType type; - Item item; - - public ReactorFuelEntry(int value, ReactorFuelType type, Item item) { - this.value = value; - this.type = type; - this.item = item; - } - } - - static class ReactorWasteEntry { - - int value; - ReactorFuelType type; - Item in; - Item out; - - public ReactorWasteEntry(int value, ReactorFuelType type, Item in, Item out) { - this.value = value; - this.type = type; - this.in = in; - this.out = out; - } - } - - //TODO: turn this steaming hot garbage into hashmaps - static List fuels = new ArrayList(); - static List wastes = new ArrayList(); - - public static void registerAll() { - - TileEntityMachineReactorLarge.registerFuelEntry(1, ReactorFuelType.URANIUM, ModItems.nugget_uranium_fuel); - TileEntityMachineReactorLarge.registerFuelEntry(9, ReactorFuelType.URANIUM, ModItems.ingot_uranium_fuel); - - TileEntityMachineReactorLarge.registerFuelEntry(1, ReactorFuelType.PLUTONIUM, ModItems.nugget_plutonium_fuel); - TileEntityMachineReactorLarge.registerFuelEntry(9, ReactorFuelType.PLUTONIUM, ModItems.ingot_plutonium_fuel); - - TileEntityMachineReactorLarge.registerFuelEntry(1, ReactorFuelType.MOX, ModItems.nugget_mox_fuel); - TileEntityMachineReactorLarge.registerFuelEntry(9, ReactorFuelType.MOX, ModItems.ingot_mox_fuel); - - TileEntityMachineReactorLarge.registerFuelEntry(10, ReactorFuelType.SCHRABIDIUM, ModItems.nugget_schrabidium_fuel); - TileEntityMachineReactorLarge.registerFuelEntry(90, ReactorFuelType.SCHRABIDIUM, ModItems.ingot_schrabidium_fuel); - - TileEntityMachineReactorLarge.registerFuelEntry(1, ReactorFuelType.THORIUM, ModItems.nugget_thorium_fuel); - TileEntityMachineReactorLarge.registerFuelEntry(9, ReactorFuelType.THORIUM, ModItems.ingot_thorium_fuel); - } - - public static void registerFuelEntry(int nuggets, ReactorFuelType type, Item fuel) { - - fuels.add(new ReactorFuelEntry(nuggets, type, fuel)); - } - - public static void registerWasteEntry(int nuggets, ReactorFuelType type, Item in, Item out) { - - wastes.add(new ReactorWasteEntry(nuggets, type, in, out)); - } - - public static int getFuelContent(ItemStack item, ReactorFuelType type) { - - if(item == null) - return 0; - - for(ReactorFuelEntry ent : fuels) { - if(ent.item == item.getItem() && type.toString().equals(ent.type.toString())) { - - int value = ent.value; - - //if it's a fuel rod that has been used up, multiply by damage and floor it - if(item.getItem() instanceof ItemFuelRod) { - - double mult = 1D - ((double)ItemFuelRod.getLifeTime(item) / (double)((ItemFuelRod)item.getItem()).lifeTime); - return (int)Math.floor(mult * value); - } - - return value; - } - } - - return 0; - } - - public static ReactorFuelType getFuelType(Item item) { - - for(ReactorFuelEntry ent : fuels) { - if(ent.item == item) - return ent.type; - } - - return ReactorFuelType.UNKNOWN; - } - - public static Item getWaste(Item item, ReactorFuelType type) { - - for(ReactorWasteEntry ent : wastes) { - if(ent.in == item && type.toString().equals(ent.type.toString())) - return ent.out; - } - - return null; - } - - public static int getWasteAbsorbed(Item item, ReactorFuelType type) { - - for(ReactorWasteEntry ent : wastes) { - if(ent.in == item && type.toString().equals(ent.type.toString())) - return ent.value; - } - - return 0; - } - - @Override - public FluidTank[] getAllTanks() { - return tanks; - } - - @Override - public FluidTank[] getSendingTanks() { - return new FluidTank[] {tanks[2]}; - } - - @Override - public FluidTank[] getReceivingTanks() { - return new FluidTank[] {tanks[0], tanks[1]}; - } - - @Override - public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) { - return new ContainerReactorMultiblock(player.inventory, this); - } - - @Override - @SideOnly(Side.CLIENT) - public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) { - return new GUIReactorMultiblock(player.inventory, this); - } -} diff --git a/src/main/java/com/hbm/world/dungeon/Spaceship.java b/src/main/java/com/hbm/world/dungeon/Spaceship.java index c5f4cc5e2..ff8ca297b 100644 --- a/src/main/java/com/hbm/world/dungeon/Spaceship.java +++ b/src/main/java/com/hbm/world/dungeon/Spaceship.java @@ -22,7 +22,7 @@ public class Spaceship extends WorldGenerator Block Block3 = ModBlocks.deco_steel; Block Block4 = ModBlocks.fusion_heater; Block Block5 = ModBlocks.block_meteor; - Block Block6 = ModBlocks.reactor_element; + Block Block6 = ModBlocks.pwr_fuel; Block Block7 = ModBlocks.cable_switch; Block Block8 = ModBlocks.fusion_hatch; Block Block9 = ModBlocks.reinforced_light; diff --git a/src/main/java/com/hbm/world/dungeon/Spaceship2.java b/src/main/java/com/hbm/world/dungeon/Spaceship2.java index 165fd93d8..d94cb01ae 100644 --- a/src/main/java/com/hbm/world/dungeon/Spaceship2.java +++ b/src/main/java/com/hbm/world/dungeon/Spaceship2.java @@ -18,7 +18,7 @@ public class Spaceship2 Block Block3 = ModBlocks.deco_steel; Block Block4 = ModBlocks.fusion_heater; Block Block5 = ModBlocks.block_meteor; - Block Block6 = ModBlocks.reactor_element; + Block Block6 = ModBlocks.pwr_fuel; Block Block8 = ModBlocks.fusion_hatch; Block Block9 = ModBlocks.reinforced_light; Block Block10 = ModBlocks.reinforced_glass; diff --git a/src/main/resources/assets/hbm/textures/blocks/inserter_side.png b/src/main/resources/assets/hbm/textures/blocks/inserter_side.png deleted file mode 100644 index 528fcd142..000000000 Binary files a/src/main/resources/assets/hbm/textures/blocks/inserter_side.png and /dev/null differ diff --git a/src/main/resources/assets/hbm/textures/blocks/inserter_top.png b/src/main/resources/assets/hbm/textures/blocks/inserter_top.png deleted file mode 100644 index 703d13408..000000000 Binary files a/src/main/resources/assets/hbm/textures/blocks/inserter_top.png and /dev/null differ diff --git a/src/main/resources/assets/hbm/textures/blocks/machine_deuterium_front.png b/src/main/resources/assets/hbm/textures/blocks/machine_deuterium_front.png deleted file mode 100644 index 5811d823d..000000000 Binary files a/src/main/resources/assets/hbm/textures/blocks/machine_deuterium_front.png and /dev/null differ diff --git a/src/main/resources/assets/hbm/textures/blocks/machine_deuterium_side.png b/src/main/resources/assets/hbm/textures/blocks/machine_deuterium_side.png deleted file mode 100644 index bd8c49821..000000000 Binary files a/src/main/resources/assets/hbm/textures/blocks/machine_deuterium_side.png and /dev/null differ diff --git a/src/main/resources/assets/hbm/textures/blocks/machine_diesel_bottom.png b/src/main/resources/assets/hbm/textures/blocks/machine_diesel_bottom.png deleted file mode 100644 index 8c88d493c..000000000 Binary files a/src/main/resources/assets/hbm/textures/blocks/machine_diesel_bottom.png and /dev/null differ diff --git a/src/main/resources/assets/hbm/textures/blocks/machine_diesel_front.png b/src/main/resources/assets/hbm/textures/blocks/machine_diesel_front.png deleted file mode 100644 index 81a7fb19b..000000000 Binary files a/src/main/resources/assets/hbm/textures/blocks/machine_diesel_front.png and /dev/null differ diff --git a/src/main/resources/assets/hbm/textures/blocks/machine_diesel_side.png b/src/main/resources/assets/hbm/textures/blocks/machine_diesel_side.png deleted file mode 100644 index babe6929c..000000000 Binary files a/src/main/resources/assets/hbm/textures/blocks/machine_diesel_side.png and /dev/null differ diff --git a/src/main/resources/assets/hbm/textures/blocks/machine_diesel_top.png b/src/main/resources/assets/hbm/textures/blocks/machine_diesel_top.png deleted file mode 100644 index 2dc9eeb63..000000000 Binary files a/src/main/resources/assets/hbm/textures/blocks/machine_diesel_top.png and /dev/null differ diff --git a/src/main/resources/assets/hbm/textures/blocks/machine_drill.png b/src/main/resources/assets/hbm/textures/blocks/machine_drill.png deleted file mode 100644 index 379b7371a..000000000 Binary files a/src/main/resources/assets/hbm/textures/blocks/machine_drill.png and /dev/null differ diff --git a/src/main/resources/assets/hbm/textures/blocks/machine_refinery_side.png b/src/main/resources/assets/hbm/textures/blocks/machine_refinery_side.png deleted file mode 100644 index f16831e2f..000000000 Binary files a/src/main/resources/assets/hbm/textures/blocks/machine_refinery_side.png and /dev/null differ diff --git a/src/main/resources/assets/hbm/textures/blocks/machine_refinery_side_alt.png b/src/main/resources/assets/hbm/textures/blocks/machine_refinery_side_alt.png deleted file mode 100644 index 5d6cc6d84..000000000 Binary files a/src/main/resources/assets/hbm/textures/blocks/machine_refinery_side_alt.png and /dev/null differ diff --git a/src/main/resources/assets/hbm/textures/blocks/machine_refinery_top.png b/src/main/resources/assets/hbm/textures/blocks/machine_refinery_top.png deleted file mode 100644 index 6c8ca9a7c..000000000 Binary files a/src/main/resources/assets/hbm/textures/blocks/machine_refinery_top.png and /dev/null differ diff --git a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_side_blue.png b/src/main/resources/assets/hbm/textures/blocks/machine_rtg_side_blue.png deleted file mode 100644 index 5ddff42de..000000000 Binary files a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_side_blue.png and /dev/null differ diff --git a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_side_cyan.png b/src/main/resources/assets/hbm/textures/blocks/machine_rtg_side_cyan.png deleted file mode 100644 index fac216a59..000000000 Binary files a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_side_cyan.png and /dev/null differ diff --git a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_side_green.png b/src/main/resources/assets/hbm/textures/blocks/machine_rtg_side_green.png deleted file mode 100644 index 5b3f8f914..000000000 Binary files a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_side_green.png and /dev/null differ diff --git a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_side_grey.png b/src/main/resources/assets/hbm/textures/blocks/machine_rtg_side_grey.png deleted file mode 100644 index 7128c950c..000000000 Binary files a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_side_grey.png and /dev/null differ diff --git a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_side_orange.png b/src/main/resources/assets/hbm/textures/blocks/machine_rtg_side_orange.png deleted file mode 100644 index da4f8ad1f..000000000 Binary files a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_side_orange.png and /dev/null differ diff --git a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_side_purple.png b/src/main/resources/assets/hbm/textures/blocks/machine_rtg_side_purple.png deleted file mode 100644 index c0b633247..000000000 Binary files a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_side_purple.png and /dev/null differ diff --git a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_side_red.png b/src/main/resources/assets/hbm/textures/blocks/machine_rtg_side_red.png deleted file mode 100644 index 076167a90..000000000 Binary files a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_side_red.png and /dev/null differ diff --git a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_side_yellow.png b/src/main/resources/assets/hbm/textures/blocks/machine_rtg_side_yellow.png deleted file mode 100644 index 2f54bb11b..000000000 Binary files a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_side_yellow.png and /dev/null differ diff --git a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_top.png b/src/main/resources/assets/hbm/textures/blocks/machine_rtg_top.png deleted file mode 100644 index 8e3391409..000000000 Binary files a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_top.png and /dev/null differ diff --git a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_top_blue.png b/src/main/resources/assets/hbm/textures/blocks/machine_rtg_top_blue.png deleted file mode 100644 index 74c8aba72..000000000 Binary files a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_top_blue.png and /dev/null differ diff --git a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_top_cyan.png b/src/main/resources/assets/hbm/textures/blocks/machine_rtg_top_cyan.png deleted file mode 100644 index c62daaeb5..000000000 Binary files a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_top_cyan.png and /dev/null differ diff --git a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_top_green.png b/src/main/resources/assets/hbm/textures/blocks/machine_rtg_top_green.png deleted file mode 100644 index 2b436376c..000000000 Binary files a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_top_green.png and /dev/null differ diff --git a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_top_grey.png b/src/main/resources/assets/hbm/textures/blocks/machine_rtg_top_grey.png deleted file mode 100644 index aa04dc3c9..000000000 Binary files a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_top_grey.png and /dev/null differ diff --git a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_top_orange.png b/src/main/resources/assets/hbm/textures/blocks/machine_rtg_top_orange.png deleted file mode 100644 index b77a727ff..000000000 Binary files a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_top_orange.png and /dev/null differ diff --git a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_top_purple.png b/src/main/resources/assets/hbm/textures/blocks/machine_rtg_top_purple.png deleted file mode 100644 index d3853fe50..000000000 Binary files a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_top_purple.png and /dev/null differ diff --git a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_top_red.png b/src/main/resources/assets/hbm/textures/blocks/machine_rtg_top_red.png deleted file mode 100644 index 6065c582a..000000000 Binary files a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_top_red.png and /dev/null differ diff --git a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_top_yellow.png b/src/main/resources/assets/hbm/textures/blocks/machine_rtg_top_yellow.png deleted file mode 100644 index 00431d187..000000000 Binary files a/src/main/resources/assets/hbm/textures/blocks/machine_rtg_top_yellow.png and /dev/null differ diff --git a/src/main/resources/assets/hbm/textures/blocks/marker_structure.png b/src/main/resources/assets/hbm/textures/blocks/marker_structure.png deleted file mode 100755 index 9d7ad2cad..000000000 Binary files a/src/main/resources/assets/hbm/textures/blocks/marker_structure.png and /dev/null differ