From f11f2ebc76a5a80851da94b03cbafb0608fc2a7d Mon Sep 17 00:00:00 2001 From: draknyte1 Date: Sun, 12 Mar 2017 13:53:59 +1000 Subject: + Re-added the Helium Generator. + Added a handful of new textures. + Added a new GUI texture for the Helium generator, made by 4000DC. --- src/Java/gtPlusPlus/core/block/ModBlocks.java | 1 + .../machine/heliumgen/block/HeliumGenerator.java | 173 ------ .../container/ContainerHeliumGenerator.java | 74 --- .../machine/heliumgen/gui/GUIHeliumGenerator.java | 71 --- .../machine/heliumgen/slots/InvSlotRadiation.java | 78 --- .../tileentity/TileEntityHeliumGenerator.java | 647 --------------------- src/Java/gtPlusPlus/core/handler/GuiHandler.java | 8 +- .../core/tileentities/ModTileEntities.java | 5 +- .../textures/blocks/chrono/CyberPanel.png | Bin 0 -> 328 bytes .../textures/blocks/chrono/CyberPanel2.png | Bin 0 -> 350 bytes .../textures/blocks/chrono/MetalFunnel.png | Bin 0 -> 378 bytes .../textures/blocks/chrono/MetalGrate.png | Bin 0 -> 333 bytes .../textures/blocks/chrono/MetalGrate2.png | Bin 0 -> 269 bytes .../textures/blocks/chrono/MetalGrate3.png | Bin 0 -> 292 bytes .../textures/blocks/chrono/MetalPanel.png | Bin 0 -> 318 bytes .../textures/blocks/chrono/MetalSheet.png | Bin 0 -> 298 bytes .../textures/blocks/chrono/MetalSheet2.png | Bin 0 -> 318 bytes .../textures/blocks/chrono/Overlay_Cyber.png | Bin 0 -> 295 bytes .../textures/gui/helium_collector_gui.png | Bin 199683 -> 265229 bytes 19 files changed, 8 insertions(+), 1049 deletions(-) delete mode 100644 src/Java/gtPlusPlus/core/block/machine/heliumgen/block/HeliumGenerator.java delete mode 100644 src/Java/gtPlusPlus/core/block/machine/heliumgen/container/ContainerHeliumGenerator.java delete mode 100644 src/Java/gtPlusPlus/core/block/machine/heliumgen/gui/GUIHeliumGenerator.java delete mode 100644 src/Java/gtPlusPlus/core/block/machine/heliumgen/slots/InvSlotRadiation.java delete mode 100644 src/Java/gtPlusPlus/core/block/machine/heliumgen/tileentity/TileEntityHeliumGenerator.java create mode 100644 src/resources/assets/miscutils/textures/blocks/chrono/CyberPanel.png create mode 100644 src/resources/assets/miscutils/textures/blocks/chrono/CyberPanel2.png create mode 100644 src/resources/assets/miscutils/textures/blocks/chrono/MetalFunnel.png create mode 100644 src/resources/assets/miscutils/textures/blocks/chrono/MetalGrate.png create mode 100644 src/resources/assets/miscutils/textures/blocks/chrono/MetalGrate2.png create mode 100644 src/resources/assets/miscutils/textures/blocks/chrono/MetalGrate3.png create mode 100644 src/resources/assets/miscutils/textures/blocks/chrono/MetalPanel.png create mode 100644 src/resources/assets/miscutils/textures/blocks/chrono/MetalSheet.png create mode 100644 src/resources/assets/miscutils/textures/blocks/chrono/MetalSheet2.png create mode 100644 src/resources/assets/miscutils/textures/blocks/chrono/Overlay_Cyber.png (limited to 'src') diff --git a/src/Java/gtPlusPlus/core/block/ModBlocks.java b/src/Java/gtPlusPlus/core/block/ModBlocks.java index 8acb757063..5063dfae96 100644 --- a/src/Java/gtPlusPlus/core/block/ModBlocks.java +++ b/src/Java/gtPlusPlus/core/block/ModBlocks.java @@ -59,6 +59,7 @@ public final class ModBlocks { //Workbench blockWorkbench = new Machine_Workbench().setHardness(1.5F); blockWorkbenchAdvanced = new Machine_WorkbenchAdvanced().setHardness(2.5F); + blockHeliumGenerator = new HeliumGenerator(); blockFirePit = new FirePit(); blockFishTrap = new FishTrap(); blockOreFluorite = new BlockBaseOre("oreFluorite", "Fluorite", Material.rock, BlockTypes.ORE, Utils.rgbtoHexValue(120, 120, 30), 3); diff --git a/src/Java/gtPlusPlus/core/block/machine/heliumgen/block/HeliumGenerator.java b/src/Java/gtPlusPlus/core/block/machine/heliumgen/block/HeliumGenerator.java deleted file mode 100644 index ddfcf62306..0000000000 --- a/src/Java/gtPlusPlus/core/block/machine/heliumgen/block/HeliumGenerator.java +++ /dev/null @@ -1,173 +0,0 @@ -package gtPlusPlus.core.block.machine.heliumgen.block; - -import java.util.Random; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.GTplusplus; -import gtPlusPlus.core.block.machine.heliumgen.tileentity.TileEntityHeliumGenerator; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.lib.CORE; -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; - -public class HeliumGenerator extends BlockContainer { - - private IIcon top, sides, front; - private final Random randy = new Random(); - - public HeliumGenerator(){ - super(Material.iron); - this.setStepSound(Block.soundTypeMetal); - this.setHardness(20.0F); - this.setBlockName("helium_collector"); - this.setHarvestLevel("pickaxe", 3); - this.setCreativeTab(AddToCreativeTab.tabMachines); - } - - @SideOnly(Side.CLIENT) - @Override - public void registerBlockIcons (final IIconRegister iconRegister) - { - this.top = iconRegister.registerIcon(CORE.MODID+":blockHeliumCollector_SIDE"); - this.sides = iconRegister.registerIcon(CORE.MODID+":blockHeliumCollector_SIDE"); - this.front = iconRegister.registerIcon(CORE.MODID+":blockHeliumCollector_FRONT"); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(final IBlockAccess world, final int x, final int y, final int z, final int side){ - if(side == 1) { - return this.top; - } - int facing = 2; - final TileEntityHeliumGenerator machine = (TileEntityHeliumGenerator)world.getTileEntity(x, y, z); - if(machine != null) { - facing = machine.getFacing(); - } - if(side == facing) { - return this.front; - } else { - return this.sides; - } - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon (final int side, final int metadata) - { - if(side == 1) { - return this.top; - } - if(side == 3) { - return this.front; - } - return this.sides; - } - - @Override - public boolean onBlockActivated (final World world, final int x, final int y, final int z, final EntityPlayer player, final int par6, final float par7, final float par8, final float par9) - { - if (world.isRemote) - { - return true; - } - player.openGui(GTplusplus.instance, 2, world, x, y, z); - return true; - } - - @Override - public TileEntity createNewTileEntity(final World world, final int meta) - { - return new TileEntityHeliumGenerator(); - } - - @Override - public void onBlockPlacedBy(final World world, final int x, final int y, final int z, final EntityLivingBase player, final ItemStack item) - { - final TileEntity tile = world.getTileEntity(x, y, z); - if(tile instanceof TileEntityHeliumGenerator) { - final TileEntityHeliumGenerator machine = (TileEntityHeliumGenerator)tile; - final int l = MathHelper.floor_double((player.rotationYaw * 4.0F) / 360.0F + 0.5D) & 3; - - if (l == 0) { - machine.setFacing((short) 2); - } - - if (l == 1) { - machine.setFacing((short) 5); - } - - if (l == 2) { - machine.setFacing((short) 3); - } - - if (l == 3) { - machine.setFacing((short) 4); - } - } - - } - - @Override - public void breakBlock(final World world, final int x, final int y, final int z, final Block block, final int wut) - { - final TileEntityHeliumGenerator collector = (TileEntityHeliumGenerator)world.getTileEntity(x, y, z); - - if (collector != null) - { - int i = 0; - for (i = 0; i < collector.getSizeInventory(); i++){ - - final ItemStack itemstack = collector.getStackInSlot(i); - - if (itemstack != null) - { - final float f = (this.randy.nextFloat() * 0.8F) + 0.1F; - final float f1 = (this.randy.nextFloat() * 0.8F) + 0.1F; - final float f2 = (this.randy.nextFloat() * 0.8F) + 0.1F; - - while (itemstack.stackSize > 0) - { - int j1 = this.randy.nextInt(21) + 10; - - if (j1 > itemstack.stackSize) - { - j1 = itemstack.stackSize; - } - - itemstack.stackSize -= j1; - final EntityItem entityitem = new EntityItem(world, x + f, y + f1, z + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); - - if (itemstack.hasTagCompound()) - { - entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy()); - } - - final float f3 = 0.05F; - entityitem.motionX = (float)this.randy.nextGaussian() * f3; - entityitem.motionY = ((float)this.randy.nextGaussian() * f3) + 0.2F; - entityitem.motionZ = (float)this.randy.nextGaussian() * f3; - world.spawnEntityInWorld(entityitem); - } - } - - world.func_147453_f(x, y, z, block); - } - } - - super.breakBlock(world, x, y, z, block, wut); - } -} diff --git a/src/Java/gtPlusPlus/core/block/machine/heliumgen/container/ContainerHeliumGenerator.java b/src/Java/gtPlusPlus/core/block/machine/heliumgen/container/ContainerHeliumGenerator.java deleted file mode 100644 index 4ce1238bde..0000000000 --- a/src/Java/gtPlusPlus/core/block/machine/heliumgen/container/ContainerHeliumGenerator.java +++ /dev/null @@ -1,74 +0,0 @@ -package gtPlusPlus.core.block.machine.heliumgen.container; - -import java.util.List; - -import gtPlusPlus.core.block.machine.heliumgen.tileentity.TileEntityHeliumGenerator; -import ic2.core.ContainerBase; -import ic2.core.slot.SlotInvSlot; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Slot; -import net.minecraft.inventory.SlotFurnace; - -public class ContainerHeliumGenerator -extends ContainerBase -{ - public short size; - - public ContainerHeliumGenerator(final InventoryPlayer player, final TileEntityHeliumGenerator machine) - { - super(machine); - //Utils.LOG_WARNING("containerHeliumGenerator"); - final short sr = machine.getReactorSize(); - this.addSlotToContainer(new SlotFurnace(player.player, machine, 2, 80, 35)); - this.size = sr; - int startX = 16; - int startY = 16; - int i = 0; - for (i = 0; i < 9; i++) - { - final int x = i % this.size; - final int y = i / this.size; - - this.addSlotToContainer(new SlotInvSlot(machine.reactorSlot, i, startX + (18 * x), startY + (18 * y))); - } - startX = 108; - startY = 16; - for (i = 9; i < 18; i++) - { - final int x = i % this.size; - final int y = (i-9) / this.size; - - this.addSlotToContainer(new SlotInvSlot(machine.reactorSlot, i, startX + (18 * x), startY + (18 * y))); - } - for (i = 0; i < 3; ++i) - { - for (int j = 0; j < 9; ++j) - { - this.addSlotToContainer(new Slot(player, j + (i * 9) + 9, 8 + (j * 18), 84 + (i * 18))); - } - } - - for (i = 0; i < 9; ++i) - { - this.addSlotToContainer(new Slot(player, i, 8 + (i * 18), 142)); - } - // addSlotToContainer(new SlotInvSlot(machine.coolantinputSlot, 0, 8, 25)); - //addSlotToContainer(new SlotInvSlot(machine.hotcoolinputSlot, 0, 188, 25)); - //addSlotToContainer(new SlotInvSlot(machine.coolantoutputSlot, 0, 8, 115)); - //addSlotToContainer(new SlotInvSlot(machine.hotcoolantoutputSlot, 0, 188, 115)); - } - - @Override - public List getNetworkedFields() - { - final List ret = super.getNetworkedFields(); - - ret.add("heat"); - ret.add("maxHeat"); - ret.add("EmitHeat"); - /*ret.add("inputTank"); - ret.add("outputTank"); - ret.add("fluidcoolreactor");*/ - return ret; - } -} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/block/machine/heliumgen/gui/GUIHeliumGenerator.java b/src/Java/gtPlusPlus/core/block/machine/heliumgen/gui/GUIHeliumGenerator.java deleted file mode 100644 index 70e13d57e1..0000000000 --- a/src/Java/gtPlusPlus/core/block/machine/heliumgen/gui/GUIHeliumGenerator.java +++ /dev/null @@ -1,71 +0,0 @@ -package gtPlusPlus.core.block.machine.heliumgen.gui; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.core.block.machine.heliumgen.container.ContainerHeliumGenerator; -import gtPlusPlus.core.block.machine.heliumgen.tileentity.TileEntityHeliumGenerator; -import gtPlusPlus.core.lib.CORE; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; - -@SideOnly(Side.CLIENT) -public class GUIHeliumGenerator extends GuiContainer -{ - private static final ResourceLocation collectorGuiTexture = new ResourceLocation(CORE.MODID, "textures/gui/helium_collector_gui.png"); - - public GUIHeliumGenerator(final InventoryPlayer player, final TileEntityHeliumGenerator machine) - { - super(new ContainerHeliumGenerator(player, machine)); - } - - /** - * Draw the foreground layer for the GuiContainer (everything in front of the items) - */ - @Override - protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) - { - final String s = StatCollector.translateToLocal("Helium Collector"); - this.fontRendererObj.drawString(s, (this.xSize / 2) - (this.fontRendererObj.getStringWidth(s) / 2), 6, 4210752); - this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, (this.ySize - 96) + 2, 4210752); - - this.fontRendererObj.drawString(StatCollector.translateToLocal("|"+-1), 80, 35, 2); - - final short sr = 3; - final int size = sr; - int startX = 16; - int startY = 16; - int i = 0; - for (i = 0; i < 9; i++) - { - final int x = i % size; - final int y = i / size; - this.fontRendererObj.drawString(StatCollector.translateToLocal("|"+i), startX + (18 * x), startY + (18 * y), 4210752); - //addSlotToContainer(new SlotInvSlot(machine.reactorSlot, i, startX + 18 * x, startY + 18 * y)); - } - startX = 108; - startY = 16; - for (i = 9; i < 18; i++) - { - final int x = i % size; - final int y = (i-9) / size; - this.fontRendererObj.drawString(StatCollector.translateToLocal("|"+i), startX + (18 * x), startY + (18 * y), 4210752); - // addSlotToContainer(new SlotInvSlot(machine.reactorSlot, i, startX + 18 * x, startY + 18 * y)); - } - - } - - @Override - protected void drawGuiContainerBackgroundLayer(final float p_146976_1_, final int p_146976_2_, final int p_146976_3_) - { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(collectorGuiTexture); - final int k = (this.width - this.xSize) / 2; - final int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - - } -} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/block/machine/heliumgen/slots/InvSlotRadiation.java b/src/Java/gtPlusPlus/core/block/machine/heliumgen/slots/InvSlotRadiation.java deleted file mode 100644 index d5c6ed5a96..0000000000 --- a/src/Java/gtPlusPlus/core/block/machine/heliumgen/slots/InvSlotRadiation.java +++ /dev/null @@ -1,78 +0,0 @@ -package gtPlusPlus.core.block.machine.heliumgen.slots; - -import gtPlusPlus.core.block.machine.heliumgen.tileentity.TileEntityHeliumGenerator; -import ic2.core.block.invslot.InvSlot; -import net.minecraft.item.ItemStack; - -public class InvSlotRadiation extends InvSlot -{ - public InvSlotRadiation(final TileEntityHeliumGenerator base, final String name1, final int oldStartIndex1, final int count) - { - super(base, name1, oldStartIndex1, InvSlot.Access.IO, count); - - this.setStackSizeLimit(1); - } - - @Override - public boolean accepts(final ItemStack itemStack) - { - return ((TileEntityHeliumGenerator)this.base).isUsefulItem(itemStack, true); - } - - @Override - public int size() - { - //Utils.LOG_INFO("InvSlotRadiation/Size"); - return 3 * 6; - } - - public int rawSize() - { - return super.size(); - } - - @Override - public ItemStack get(final int index) - { - return super.get(this.mapIndex(index)); - } - - public ItemStack get(final int x, final int y) - { - return super.get((y * 9) + x); - } - - @Override - public void put(final int index, final ItemStack content) - { - super.put(this.mapIndex(index), content); - } - - public void put(final int x, final int y, final ItemStack content) - { - super.put((y * 9) + x, content); - } - - private int mapIndex(int index) - { - final int size = this.size(); - final int cols = size / 6; - if (index < size) - { - final int row = index / cols; - final int col = index % cols; - - return (row * 9) + col; - } - index -= size; - final int remCols = 9 - cols; - - final int row = index / remCols; - final int col = cols + (index % remCols); - - return (row * 9) + col; - } - - private final int rows = 6; - private final int maxCols = 9; -} diff --git a/src/Java/gtPlusPlus/core/block/machine/heliumgen/tileentity/TileEntityHeliumGenerator.java b/src/Java/gtPlusPlus/core/block/machine/heliumgen/tileentity/TileEntityHeliumGenerator.java deleted file mode 100644 index 53d6f1d68f..0000000000 --- a/src/Java/gtPlusPlus/core/block/machine/heliumgen/tileentity/TileEntityHeliumGenerator.java +++ /dev/null @@ -1,647 +0,0 @@ -package gtPlusPlus.core.block.machine.heliumgen.tileentity; - -import java.util.List; - -import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.block.machine.heliumgen.slots.InvSlotRadiation; -import gtPlusPlus.core.item.ModItems; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.item.ItemUtils; -import ic2.api.Direction; -import ic2.api.reactor.IReactor; -import ic2.api.reactor.IReactorComponent; -import ic2.api.tile.IWrenchable; -import ic2.core.*; -import ic2.core.block.TileEntityInventory; -import ic2.core.init.MainConfig; -import ic2.core.item.reactor.ItemReactorHeatStorage; -import ic2.core.util.ConfigUtil; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; - -public class TileEntityHeliumGenerator extends TileEntityInventory implements IInventory ,IReactor, IWrenchable { - - private ItemStack heliumStack; - private int facing = 2; - private int progress; - - - public void update2Entity(){ - Utils.LOG_WARNING("updateEntity"); - if(++this.progress >= 40){ - //if(++progress >= 300){ - if(this.heliumStack == null) { - this.heliumStack = ItemUtils.getSimpleStack(ModItems.itemHeliumBlob); - } else if((this.heliumStack.getItem() == ModItems.itemHeliumBlob) && (this.heliumStack.stackSize < 64)) { - this.heliumStack.stackSize++; - } - this.progress = 0; - this.markDirty(); - } - } - - @Override - public short getFacing(){ - return (short) this.facing; - } - - @Override - public void setFacing(final short dir){ - this.facing = dir; - } - - /*@Override - public void readCustomNBT(NBTTagCompound tag) - { - this.heliumStack = ItemStack.loadItemStackFromNBT(tag.getCompoundTag("Helium")); - this.progress = tag.getInteger("Progress"); - this.facing = tag.getShort("Facing"); - this.heat = tag.getInteger("heat"); - this.prevActive = (this.active = tag.getBoolean("active")); - } - - @Override - public void writeCustomNBT(NBTTagCompound tag) - { - tag.setInteger("Progress", this.progress); - tag.setShort("Facing", (short) this.facing); - tag.setInteger("heat", this.heat); - tag.setBoolean("active", this.active); - if(heliumStack != null) { - NBTTagCompound produce = new NBTTagCompound(); - heliumStack.writeToNBT(produce); - tag.setTag("Helium", produce); - } - else - tag.removeTag("Helium"); - }*/ - - - @Override - public void readFromNBT(final NBTTagCompound nbttagcompound) - { - super.readFromNBT(nbttagcompound); - - //this.heliumStack = ItemStack.loadItemStackFromNBT(nbttagcompound.getCompoundTag("Helium")); - final NBTTagList list = nbttagcompound.getTagList("Items", 10); - for (int i = 0; i < list.tagCount(); ++i) { - final NBTTagCompound stackTag = list.getCompoundTagAt(i); - final int slot = stackTag.getByte("Slot") & 255; - this.setInventorySlotContents(slot, ItemStack.loadItemStackFromNBT(stackTag)); - } - this.progress = nbttagcompound.getInteger("Progress"); - this.facing = nbttagcompound.getShort("Facing"); - this.heat = nbttagcompound.getInteger("heat"); - this.output = nbttagcompound.getShort("output"); - this.prevActive = (this.active = nbttagcompound.getBoolean("active")); - } - - @Override - public void writeToNBT(final NBTTagCompound nbttagcompound) - { - super.writeToNBT(nbttagcompound); - - nbttagcompound.setInteger("Progress", this.progress); - nbttagcompound.setShort("Facing", (short) this.facing); - nbttagcompound.setInteger("heat", this.heat); - nbttagcompound.setShort("output", (short)(int)this.getReactorEnergyOutput()); - nbttagcompound.setBoolean("active", this.active); - /*if(heliumStack != null) { - NBTTagCompound produce = new NBTTagCompound(); - heliumStack.writeToNBT(produce); - nbttagcompound.setTag("Helium", produce); - } - else - nbttagcompound.removeTag("Helium");*/ - final NBTTagList list = new NBTTagList(); - for (int i = 0; i < this.getSizeInventory(); ++i) { - if (this.getStackInSlot(i) != null) { - final NBTTagCompound stackTag = new NBTTagCompound(); - stackTag.setByte("Slot", (byte) i); - this.getStackInSlot(i).writeToNBT(stackTag); - list.appendTag(stackTag); - } - } - nbttagcompound.setTag("Items", list); - } - - - @Override - public Packet getDescriptionPacket() { - final NBTTagCompound tag = new NBTTagCompound(); - this.writeToNBT(tag); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, -999, tag); - } - - @Override - public void onDataPacket(final net.minecraft.network.NetworkManager net, final S35PacketUpdateTileEntity packet) { - super.onDataPacket(net, packet); - this.readFromNBT(packet.func_148857_g()); - } - - - @Override - public int getSizeInventory() - { - return 19; - } - - @Override - public ItemStack getStackInSlot(final int slot){ - return this.heliumStack; - } - - @Override - public ItemStack decrStackSize(final int slot, final int decrement){ - Utils.LOG_WARNING("decrStackSize"); - if(this.heliumStack == null) { - return null; - } - if(decrement < this.heliumStack.stackSize){ - final ItemStack take = this.heliumStack.splitStack(decrement); - if(this.heliumStack.stackSize <= 0) { - this.heliumStack = null; - } - return take; - } - final ItemStack take = this.heliumStack; - this.heliumStack = null; - return take; - } - - @Override - public void openInventory() {} - @Override - public void closeInventory() {} - - @Override - public boolean isUseableByPlayer(final EntityPlayer player) - { - return (this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) == this) && (player.getDistanceSq(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D) <= 64.0D); - } - - @Override - public boolean isItemValidForSlot(final int slot, final ItemStack stack){ - return false; - } - - @Override - public int getInventoryStackLimit(){ - return 64; - } - - @Override - public void setInventorySlotContents(final int slot, final ItemStack stack){ - this.heliumStack = stack; - } - - @Override - public ItemStack getStackInSlotOnClosing(final int slot){ - return null; - } - - /** - * Returns the name of the inventory - */ - @Override - public String getInventoryName() - { - //return "container.helium_collector"; - return "container.helium_collector"; - } - - /** - * Returns if the inventory is named - */ - @Override - public boolean hasCustomInventoryName() - { - return false; - } - - //IC2 Nuclear Code - - - public Block[][][] surroundings = new Block[5][5][5]; - public final InvSlotRadiation reactorSlot; - public float output = 0.0F; - public int updateTicker; - public int heat = 5000; - public int maxHeat = 100000; - public float hem = 1.0F; - private int EmitHeatbuffer = 0; - public int EmitHeat = 0; - private boolean redstone = false; - private final boolean fluidcoolreactor = false; - private boolean active = true; - - - public short getReactorSize() - { - //Utils.LOG_WARNING("getReactorSize"); - if (this.worldObj == null) { - Utils.LOG_WARNING("getReactorSize == 9"); - return 9; - } - short cols = 3; - //Utils.LOG_WARNING("getReactorSize == "+cols); - for (final Direction direction : Direction.directions) - { - final TileEntity target = direction.applyToTileEntity(this); - if ((target instanceof TileEntityHeliumGenerator)) { - cols = (short)(cols + 1); - Utils.LOG_WARNING("getReactorSize =1= "+cols); - } - } - //Utils.LOG_WARNING("getReactorSize == "+cols); - return cols; - } - - @Override - protected void updateEntityServer() - { - Utils.LOG_WARNING("updateEntityServer"); - super.updateEntity(); - - if ((this.updateTicker++ % this.getTickRate()) != 0) { - return; - } - if (!this.worldObj.doChunksNearChunkExist(this.xCoord, this.yCoord, this.zCoord, 2)) - { - this.output = 0.0F; - } - else - { - - this.dropAllUnfittingStuff(); - - this.output = 0.0F; - this.maxHeat = 10000; - this.hem = 1.0F; - - this.processChambers(); - this.EmitHeatbuffer = 0; - if (this.calculateHeatEffects()) { - return; - } - this.setActive((this.heat >= 1000) || (this.output > 0.0F)); - - this.markDirty(); - } - IC2.network.get().updateTileEntityField(this, "output"); - } - - @Override - public void setActive(final boolean active1) - { - Utils.LOG_WARNING("setActive"); - this.active = active1; - if (this.prevActive != active1) { - IC2.network.get().updateTileEntityField(this, "active"); - } - this.prevActive = active1; - } - - public void dropAllUnfittingStuff() - { - Utils.LOG_WARNING("dropAllUnfittingStuff"); - for (int i = 0; i < this.reactorSlot.size(); i++) - { - final ItemStack stack = this.reactorSlot.get(i); - if ((stack != null) && (!this.isUsefulItem(stack, false))) - { - this.reactorSlot.put(i, null); - this.eject(stack); - } - } - for (int i = this.reactorSlot.size(); i < this.reactorSlot.rawSize(); i++) - { - final ItemStack stack = this.reactorSlot.get(i); - - this.reactorSlot.put(i, null); - this.eject(stack); - } - } - - public void eject(final ItemStack drop) - { - Utils.LOG_WARNING("eject"); - if ((!IC2.platform.isSimulating()) || (drop == null)) { - return; - } - final float f = 0.7F; - final double d = (this.worldObj.rand.nextFloat() * f) + ((1.0F - f) * 0.5D); - final double d1 = (this.worldObj.rand.nextFloat() * f) + ((1.0F - f) * 0.5D); - final double d2 = (this.worldObj.rand.nextFloat() * f) + ((1.0F - f) * 0.5D); - final EntityItem entityitem = new EntityItem(this.worldObj, this.xCoord + d, this.yCoord + d1, this.zCoord + d2, drop); - entityitem.delayBeforeCanPickup = 10; - this.worldObj.spawnEntityInWorld(entityitem); - } - - public boolean isUsefulItem(final ItemStack stack, final boolean forInsertion) - { - //Utils.LOG_WARNING("isUsefulItem"); - final Item item = stack.getItem(); - if ((forInsertion) && (this.fluidcoolreactor) && - ((item instanceof ItemReactorHeatStorage)) && - (((ItemReactorHeatStorage)item).getCustomDamage(stack) > 0)) { - return false; - } - if ((item instanceof IReactorComponent)) { - return true; - } - return (item == Ic2Items.TritiumCell.getItem()) || (item == Ic2Items.reactorDepletedUraniumSimple.getItem()) || (item == Ic2Items.reactorDepletedUraniumDual.getItem()) || (item == Ic2Items.reactorDepletedUraniumQuad.getItem()) || (item == Ic2Items.reactorDepletedMOXSimple.getItem()) || (item == Ic2Items.reactorDepletedMOXDual.getItem()) || (item == Ic2Items.reactorDepletedMOXQuad.getItem()); - } - - public boolean calculateHeatEffects() - { - Utils.LOG_WARNING("calculateHeatEffects"); - if ((this.heat < 8000) || (!IC2.platform.isSimulating()) || (ConfigUtil.getFloat(MainConfig.get(), "protection/reactorExplosionPowerLimit") <= 0.0F)) { - return false; - } - final float power = this.heat / this.maxHeat; - if (power >= 1.0F) - { - this.explode(); - return true; - } - if ((power >= 0.85F) && (this.worldObj.rand.nextFloat() <= (0.2F * this.hem))) - { - final int[] coord = this.getRandCoord(2); - if (coord != null) - { - final Block block = this.worldObj.getBlock(coord[0], coord[1], coord[2]); - if (block.isAir(this.worldObj, coord[0], coord[1], coord[2])) - { - this.worldObj.setBlock(coord[0], coord[1], coord[2], Blocks.fire, 0, 7); - } - else if ((block.getBlockHardness(this.worldObj, coord[0], coord[1], coord[2]) >= 0.0F) && (this.worldObj.getTileEntity(coord[0], coord[1], coord[2]) == null)) - { - final Material mat = block.getMaterial(); - if ((mat == Material.rock) || (mat == Material.iron) || (mat == Material.lava) || (mat == Material.ground) || (mat == Material.clay)) { - this.worldObj.setBlock(coord[0], coord[1], coord[2], Blocks.flowing_lava, 15, 7); - } else { - this.worldObj.setBlock(coord[0], coord[1], coord[2], Blocks.fire, 0, 7); - } - } - } - } - if (power >= 0.7F) - { - final List list1 = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(this.xCoord - 3, this.yCoord - 3, this.zCoord - 3, this.xCoord + 4, this.yCoord + 4, this.zCoord + 4)); - for (int l = 0; l < list1.size(); l++) - { - final Entity ent = (Entity)list1.get(l); - ent.attackEntityFrom(IC2DamageSource.radiation, (int)(this.worldObj.rand.nextInt(4) * this.hem)); - } - } - if ((power >= 0.5F) && (this.worldObj.rand.nextFloat() <= this.hem)) - { - final int[] coord = this.getRandCoord(2); - if (coord != null) - { - final Block block = this.worldObj.getBlock(coord[0], coord[1], coord[2]); - if (block.getMaterial() == Material.water) { - this.worldObj.setBlockToAir(coord[0], coord[1], coord[2]); - } - } - } - if ((power >= 0.4F) && (this.worldObj.rand.nextFloat() <= this.hem)) - { - final int[] coord = this.getRandCoord(2); - if ((coord != null) && - (this.worldObj.getTileEntity(coord[0], coord[1], coord[2]) == null)) - { - final Block block = this.worldObj.getBlock(coord[0], coord[1], coord[2]); - final Material mat = block.getMaterial(); - if ((mat == Material.wood) || (mat == Material.leaves) || (mat == Material.cloth)) { - this.worldObj.setBlock(coord[0], coord[1], coord[2], Blocks.fire, 0, 7); - } - } - } - return false; - } - - public int[] getRandCoord(final int radius) - { - if (radius <= 0) { - return null; - } - final int[] c = new int[3]; - c[0] = ((this.xCoord + this.worldObj.rand.nextInt((2 * radius) + 1)) - radius); - c[1] = ((this.yCoord + this.worldObj.rand.nextInt((2 * radius) + 1)) - radius); - c[2] = ((this.zCoord + this.worldObj.rand.nextInt((2 * radius) + 1)) - radius); - if ((c[0] == this.xCoord) && (c[1] == this.yCoord) && (c[2] == this.zCoord)) { - return null; - } - return c; - } - - public void processChambers() - { - Utils.LOG_WARNING("processChambers"); - final int size = this.getReactorSize(); - for (int pass = 0; pass < 6; pass++) { - for (int y = 0; y < 3; y++) { - for (int x = 0; x < size; x++) - { - final ItemStack stack = this.reactorSlot.get(x, y); - if ((stack != null) && ((stack.getItem() instanceof IReactorComponent))) - { - final IReactorComponent comp = (IReactorComponent)stack.getItem(); - comp.processChamber(this, stack, x, y, pass == 0); - } - } - } - } - } - - @Override - public ChunkCoordinates getPosition() - { - return new ChunkCoordinates(this.xCoord, this.yCoord, this.zCoord); - } - - @Override - public World getWorld() { - return this.worldObj; - } - - @Override - public int getHeat() { - return this.heat; - } - - @Override - public void setHeat(final int heat1) - { - this.heat = heat1; - } - - @Override - public int addHeat(final int amount) - { - this.heat += amount; - return this.heat; - } - - @Override - public int getMaxHeat() - { - return this.maxHeat; - } - - @Override - public void setMaxHeat(final int newMaxHeat) - { - this.maxHeat = newMaxHeat; - } - - @Override - public void addEmitHeat(final int heat) - { - this.EmitHeatbuffer += heat; - } - - @Override - public float getHeatEffectModifier() - { - return this.hem; - } - - @Override - public void setHeatEffectModifier(final float newHEM) - { - this.hem = newHEM; - } - - @Override - public float getReactorEnergyOutput() - { - return this.output; - } - - @Override - public double getReactorEUEnergyOutput() - { - return this.getOfferedEnergy(); - } - - public double getOfferedEnergy() - { - return this.getReactorEnergyOutput() * 5.0F * 1.0F; - } - - @Override - public float addOutput(final float energy) - { - return this.output += energy; - } - - @Override - public ItemStack getItemAt(final int x, final int y) - { - Utils.LOG_WARNING("getItemAt"); - if ((x < 0) || (x >= this.getReactorSize()) || (y < 0) || (y >= 6)) { - return null; - } - return this.reactorSlot.get(x, y); - } - - @Override - public void setItemAt(final int x, final int y, final ItemStack item) - { - Utils.LOG_WARNING("setItemAt"); - if ((x < 0) || (x >= this.getReactorSize()) || (y < 0) || (y >= 6)) { - return; - } - this.reactorSlot.put(x, y, item); - } - - public TileEntityHeliumGenerator() { - this.updateTicker = IC2.random.nextInt(this.getTickRate()); - this.reactorSlot = new InvSlotRadiation(this, "helium_collector", 0, 54); //TODO - } - - @Override - public void explode() { - Utils.LOG_WARNING("Explosion"); - //TODO - } - - @Override - public int getTickRate() - { - return 20; - } - - public boolean receiveredstone() - { - Utils.LOG_WARNING("receiveRedstone"); - if ((this.worldObj.isBlockIndirectlyGettingPowered(this.xCoord, this.yCoord, this.zCoord)) || (this.redstone)) { - this.decrStackSize(-1, 1); - return true; - } - return false; - } - - @Override - public boolean produceEnergy() - { - Utils.LOG_WARNING("produceEnergy"); - return (this.receiveredstone()) && (ConfigUtil.getFloat(MainConfig.get(), "balance/energy/generator/generator") > 0.0F); - } - - @Override - public void setRedstoneSignal(final boolean redstone) - { - this.redstone = redstone; - } - - @Override - public boolean isFluidCooled() { - Utils.LOG_WARNING("isFluidCooled"); - return false; - } - - @Override - public boolean wrenchCanSetFacing(final EntityPlayer entityPlayer, final int side) - { - return true; - } - - @Override - public boolean wrenchCanRemove(final EntityPlayer entityPlayer) - { - return true; - } - - @Override - public float getWrenchDropRate() - { - return 1F; - } - - @Override - public ItemStack getWrenchDrop(final EntityPlayer entityPlayer) - { - return new ItemStack(ModBlocks.blockHeliumGenerator, 1); - } - -} diff --git a/src/Java/gtPlusPlus/core/handler/GuiHandler.java b/src/Java/gtPlusPlus/core/handler/GuiHandler.java index 998547d17d..c4be591ab4 100644 --- a/src/Java/gtPlusPlus/core/handler/GuiHandler.java +++ b/src/Java/gtPlusPlus/core/handler/GuiHandler.java @@ -12,6 +12,7 @@ import gtPlusPlus.core.interfaces.IGuiManager; import gtPlusPlus.core.inventories.BaseInventoryBackpack; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.tileentities.general.TileEntityFishTrap; +import gtPlusPlus.core.tileentities.general.TileEntityHeliumGenerator; import gtPlusPlus.core.tileentities.machines.TileEntityWorkbench; import gtPlusPlus.core.tileentities.machines.TileEntityWorkbenchAdvanced; import gtPlusPlus.core.util.Utils; @@ -26,7 +27,7 @@ import net.minecraft.world.World; public class GuiHandler implements IGuiHandler { public static final int GUI1 = 0; //Frame Alveary - public static final int GUI2 = 1; //RTG + public static final int GUI2 = 1; //Helium Generator public static final int GUI3 = 2; //BackpackHandler public static final int GUI4 = 3; //Workbench public static final int GUI5 = 4; //Workbench Adv @@ -56,7 +57,8 @@ public class GuiHandler implements IGuiHandler { } } else if (ID == GUI2){ - //return new CONTAINER_RTG(player, (TileEntityRTG)te); + //HeliumGenerator + return new Container_HeliumGenerator(player.inventory, (TileEntityHeliumGenerator)te); } @@ -106,7 +108,7 @@ public class GuiHandler implements IGuiHandler { } else if (ID == GUI2){ Utils.LOG_WARNING("Opening Gui with Id: "+ID+" RTG"); - //return new GUI_RTG((TileEntityRTG) te.); + return new GUI_HeliumGenerator(player.inventory, (TileEntityHeliumGenerator) te); } } diff --git a/src/Java/gtPlusPlus/core/tileentities/ModTileEntities.java b/src/Java/gtPlusPlus/core/tileentities/ModTileEntities.java index 46f2416ee1..02b562c3ec 100644 --- a/src/Java/gtPlusPlus/core/tileentities/ModTileEntities.java +++ b/src/Java/gtPlusPlus/core/tileentities/ModTileEntities.java @@ -1,8 +1,7 @@ package gtPlusPlus.core.tileentities; import cpw.mods.fml.common.registry.GameRegistry; -import gtPlusPlus.core.tileentities.general.TileEntityFirepit; -import gtPlusPlus.core.tileentities.general.TileEntityFishTrap; +import gtPlusPlus.core.tileentities.general.*; import gtPlusPlus.core.tileentities.machines.TileEntityWorkbench; import gtPlusPlus.core.tileentities.machines.TileEntityWorkbenchAdvanced; import gtPlusPlus.core.util.Utils; @@ -16,7 +15,7 @@ public class ModTileEntities { //GameRegistry.registerTileEntity(TileEntityReverter.class, "Tower Reverter"); //GameRegistry.registerTileEntity(TileEntityNHG.class, "NuclearFueledHeliumGenerator"); //GameRegistry.registerTileEntity(TileEntityCharger.class, "TE_Charger"); - // GameRegistry.registerTileEntity(TileEntityHeliumGenerator.class, "Helium"); + GameRegistry.registerTileEntity(TileEntityHeliumGenerator.class, "HeliumGenerator"); GameRegistry.registerTileEntity(TileEntityWorkbench.class, "TileWorkbench"); GameRegistry.registerTileEntity(TileEntityWorkbenchAdvanced.class, "TileWorkbenchAdvanced"); GameRegistry.registerTileEntity(TileEntityFishTrap.class, "TileFishTrap"); diff --git a/src/resources/assets/miscutils/textures/blocks/chrono/CyberPanel.png b/src/resources/assets/miscutils/textures/blocks/chrono/CyberPanel.png new file mode 100644 index 0000000000..6761aa4773 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/chrono/CyberPanel.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/chrono/CyberPanel2.png b/src/resources/assets/miscutils/textures/blocks/chrono/CyberPanel2.png new file mode 100644 index 0000000000..befbe80c9f Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/chrono/CyberPanel2.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/chrono/MetalFunnel.png b/src/resources/assets/miscutils/textures/blocks/chrono/MetalFunnel.png new file mode 100644 index 0000000000..e52a1b11dc Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/chrono/MetalFunnel.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/chrono/MetalGrate.png b/src/resources/assets/miscutils/textures/blocks/chrono/MetalGrate.png new file mode 100644 index 0000000000..b24e8657f8 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/chrono/MetalGrate.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/chrono/MetalGrate2.png b/src/resources/assets/miscutils/textures/blocks/chrono/MetalGrate2.png new file mode 100644 index 0000000000..4f84e52ab1 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/chrono/MetalGrate2.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/chrono/MetalGrate3.png b/src/resources/assets/miscutils/textures/blocks/chrono/MetalGrate3.png new file mode 100644 index 0000000000..ba4f079ba9 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/chrono/MetalGrate3.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/chrono/MetalPanel.png b/src/resources/assets/miscutils/textures/blocks/chrono/MetalPanel.png new file mode 100644 index 0000000000..2c56924c8b Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/chrono/MetalPanel.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/chrono/MetalSheet.png b/src/resources/assets/miscutils/textures/blocks/chrono/MetalSheet.png new file mode 100644 index 0000000000..223ae1cad3 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/chrono/MetalSheet.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/chrono/MetalSheet2.png b/src/resources/assets/miscutils/textures/blocks/chrono/MetalSheet2.png new file mode 100644 index 0000000000..951871ce12 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/chrono/MetalSheet2.png differ diff --git a/src/resources/assets/miscutils/textures/blocks/chrono/Overlay_Cyber.png b/src/resources/assets/miscutils/textures/blocks/chrono/Overlay_Cyber.png new file mode 100644 index 0000000000..0d32fdeec8 Binary files /dev/null and b/src/resources/assets/miscutils/textures/blocks/chrono/Overlay_Cyber.png differ diff --git a/src/resources/assets/miscutils/textures/gui/helium_collector_gui.png b/src/resources/assets/miscutils/textures/gui/helium_collector_gui.png index 4fe6ad461c..114891e80a 100644 Binary files a/src/resources/assets/miscutils/textures/gui/helium_collector_gui.png and b/src/resources/assets/miscutils/textures/gui/helium_collector_gui.png differ -- cgit