From 338fc44ae5f008367de2d3a179c717e49dcb7fcc Mon Sep 17 00:00:00 2001 From: Boblet Date: Fri, 24 Apr 2026 12:03:31 +0200 Subject: [PATCH] hough --- .../com/hbm/blocks/test/TestEventTester.java | 639 +++++------------- .../hbm/tileentity/TileEntityLoadedBase.java | 3 - .../java/com/hbm/tileentity/TileMappings.java | 2 + .../assets/hbm/textures/gui/gui_planner.png | Bin 1759 -> 0 bytes .../hbm/textures/gui/gui_planner_journal.png | Bin 1776 -> 0 bytes .../hbm/textures/gui/gui_test_storage.png | Bin 0 -> 1399 bytes 6 files changed, 168 insertions(+), 476 deletions(-) delete mode 100644 src/main/resources/assets/hbm/textures/gui/gui_planner.png delete mode 100644 src/main/resources/assets/hbm/textures/gui/gui_planner_journal.png create mode 100644 src/main/resources/assets/hbm/textures/gui/gui_test_storage.png diff --git a/src/main/java/com/hbm/blocks/test/TestEventTester.java b/src/main/java/com/hbm/blocks/test/TestEventTester.java index f81fa49ff..99bf52681 100644 --- a/src/main/java/com/hbm/blocks/test/TestEventTester.java +++ b/src/main/java/com/hbm/blocks/test/TestEventTester.java @@ -1,503 +1,196 @@ package com.hbm.blocks.test; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Random; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; +import com.hbm.lib.RefStrings; import com.hbm.main.MainRegistry; +import com.hbm.tileentity.IGUIProvider; +import com.hbm.tileentity.TileEntityMachineBase; import cpw.mods.fml.common.network.internal.FMLNetworkHandler; -import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; -import net.minecraft.enchantment.EnchantmentProtection; -import net.minecraft.entity.Entity; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.util.AxisAlignedBB; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; +import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; -public class TestEventTester extends Block { +public class TestEventTester extends BlockContainer { - public float explosionSize = 1000F; - private Map field_77288_k = new HashMap(); - protected static Random itemRand = new Random(); - public World worldObj; + public static final int SLOT_CLICK_ID_REFRESH = -666; + + public TestEventTester(Material mat) { + super(mat); + } - public TestEventTester(Material p_i45394_1_) { - super(p_i45394_1_); + @Override + public TileEntity createNewTileEntity(World worlb, int mettaton) { + return new TileEntityTestStorage(); + } + + @Override + public boolean onBlockActivated(World worlb, int x, int y, int z, EntityPlayer playor, int side, float hitX, float hitY, float hitZ) { + if(!worlb.isRemote) FMLNetworkHandler.openGui(playor, MainRegistry.instance, 0, worlb, x, y, z); + return true; } - @Override - public void onNeighborBlockChange(World p_149695_1_, int x1, int y1, int z1, Block p_149695_5_) - { - this.worldObj = p_149695_1_; - //Levers and buttons for some reason set meta and notify, and *then* notify again, meaning they will always fire this twice. - //Pressure plates, torches, redstone, etc. do not have this issue. - if (p_149695_1_.isBlockIndirectlyGettingPowered(x1, y1, z1)) - { - /*Component comp = new SiloComponent(this.worldObj.rand, x1, z1); - StructureBoundingBox box = comp.getBoundingBox(); - box.minY = 0; - box.maxY = 512; - comp.addComponentParts(p_149695_1_, this.worldObj.rand, box);*/ - - //The laser thread is too dangerous to use right now - //ThreadLaser laser = new ThreadLaser(p_149695_1_, x, y, z, "north"); - //laser.start(); - //ExplosionChaos.frag(p_149695_1_, x, y + 2, z, 10, false, null); - //EntitySmokeFX smoke = new EntitySmokeFX(p_149695_1_, x + 0.5, y + 1, z + 0.5, 0.0, 0.0, 0.0); - //p_149695_1_.spawnEntityInWorld(smoke); - //ExplosionParticle.spawnMush(p_149695_1_, x, y, z); - //mirv(this.worldObj, x, y + 20, z); - //killEvent(p_149695_1_, x, y, z); - /*EntityNuclearCreeper e = new EntityNuclearCreeper(p_149695_1_); - e.posX = x; - e.posY = y + 1; - e.posZ = z; - if(!p_149695_1_.isRemote) - { - p_149695_1_.spawnEntityInWorld(e); - } - /*if(p_149695_1_.isRemote) - { - ExplosionNukeAdvanced.mush(p_149695_1_, x, y, z); - }*/ - /*EntityFalloutRain fallout = new EntityFalloutRain(p_149695_1_, 1000); - fallout.posX = x; - fallout.posY = y + 3; - fallout.posZ = z; - fallout.setScale(50); - - p_149695_1_.spawnEntityInWorld(fallout);*/ - - //worldObj.setBlock(x, y, z, Blocks.air); - //ExplosionLarge.explode(worldObj, x + 0.5, y + 0.5, z + 0.5, MainRegistry.x, true, true, true); - - /*EntityBlackHole bl = new EntityBlackHole(worldObj, MainRegistry.x * 0.1F); - bl.posX = x + 0.5F; - bl.posY = y + 0.5F; - bl.posZ = z + 0.5F; - worldObj.spawnEntityInWorld(bl);*/ - - - - - - /*if(!worldObj.isRemote) - { - try { - Chunk oldChunk = worldObj.getChunkFromBlockCoords(x1, z1); + public static class TileEntityTestStorage extends TileEntityMachineBase implements IGUIProvider { - if(worldObj instanceof WorldServer) - { - WorldServer worldServer = (WorldServer) worldObj; - ChunkProviderServer chunkProviderServer = worldServer.theChunkProviderServer; - IChunkProvider chunkProviderGenerate = chunkProviderServer.currentChunkProvider; - - Chunk newChunk = chunkProviderGenerate.provideChunk(oldChunk.xPosition, oldChunk.zPosition); - - for (int x = 0; x < 16; x++) - { - for (int z = 0; z < 16; z++) - { - for (int y = 0; y < worldObj.getHeight(); y++) - { - Block block = newChunk.getBlock(x, y, z); - int metadata = newChunk.getBlockMetadata(x, y, z); - - worldServer.setBlock(x + oldChunk.xPosition * 16, y, z + oldChunk.zPosition * 16, block, metadata, 2); - - TileEntity tileEntity = newChunk.getTileEntityUnsafe(x, y, z); - - if(tileEntity != null) - { - worldServer.setTileEntity(x + oldChunk.xPosition * 16, y, z + oldChunk.zPosition * 16, tileEntity); - } - } - } - } - - oldChunk.isTerrainPopulated = false; - chunkProviderGenerate.populate(chunkProviderGenerate, oldChunk.xPosition, oldChunk.zPosition); - } - } catch(Exception e) { - System.out.println("Rejuvenation Failed!"); - e.printStackTrace(); - } - }*/ - - - /*if(!worldObj.isRemote) { - switch(itemRand.nextInt(3)) { - case 0: - (new Meteorite()).generateLarge(worldObj, itemRand, x1, y1, z1); - break; - case 1: - (new Meteorite()).generateMedium(worldObj, itemRand, x1, y1, z1); - break; - case 2: - (new Meteorite()).generateSmall(worldObj, itemRand, x1, y1, z1); - break; - } - }*/ - - - /*if(!worldObj.isRemote) { - EntityMeteor met = new EntityMeteor(worldObj); - met.posX = x1; - met.posY = 300; - met.posZ = z1; - worldObj.spawnEntityInWorld(met); - worldObj.setBlockToAir(x1, y1, z1); - }*/ - - - /*if(!worldObj.isRemote) { - ModEventHandler.meteorShower = 6000; - }*/ - - /*EntityCloudFleija rainbow = new EntityCloudFleija(worldObj); - rainbow.posX = x1; - rainbow.posY = y1; - rainbow.posZ = z1; - rainbow.maxAge = 100; - if(!worldObj.isRemote) - worldObj.spawnEntityInWorld(rainbow);*/ - - /*RadiationSavedData data = RadiationSavedData.getData(worldObj); - - //ALU SETS RAD TO 1000 - //BER PRINTS RAD LEVEL - //COP INITIATES CYCLE - //RED FLUSHES ALL RAD - //STE PRINTS RAD CHUNKS - //URA PRINTS TOTAL RAD - //THO SETS RAD TO 1000000 - - if(worldObj.getBlock(x1, y1 - 1, z1) == ModBlocks.block_aluminium) { - - Chunk chunk = worldObj.getChunkFromBlockCoords(x1, z1); - - data.setRadForCoord(chunk.xPosition, chunk.zPosition, 1000); - - System.out.println(data.getRadNumFromCoord(chunk.xPosition, chunk.zPosition)); - } - - if(worldObj.getBlock(x1, y1 - 1, z1) == ModBlocks.block_beryllium) { - - Chunk chunk = worldObj.getChunkFromBlockCoords(x1, z1); - - System.out.println(data.getRadNumFromCoord(chunk.xPosition, chunk.zPosition)); - } - - if(worldObj.getBlock(x1, y1 - 1, z1) == ModBlocks.block_copper) { - data.updateSystem(); - } - - if(worldObj.getBlock(x1, y1 - 1, z1) == ModBlocks.block_red_copper) { - - data.jettisonData(); - } - - if(worldObj.getBlock(x1, y1 - 1, z1) == ModBlocks.block_steel) { - - System.out.println(data.contamination.size()); - } - - if(worldObj.getBlock(x1, y1 - 1, z1) == ModBlocks.block_uranium) { - - float r = 0; - - for(Entry struct : data.contamination.entrySet()) { - r += struct.getValue(); - } - - System.out.println(r); - } - - if(worldObj.getBlock(x1, y1 - 1, z1) == ModBlocks.block_thorium) { - - Chunk chunk = worldObj.getChunkFromBlockCoords(x1, z1); - - data.setRadForCoord(chunk.xPosition, chunk.zPosition, 1000000); - - System.out.println(data.getRadNumFromCoord(chunk.xPosition, chunk.zPosition)); - } - - if(!worldObj.isRemote) { - - worldObj.spawnEntityInWorld(EntityNukeCloudSmall.statFac(worldObj, x1, y1 + 5, z1, 100)); - worldObj.setBlockToAir(x1, y1, z1); - }*/ - - } - } - - /*public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - this.worldObj = world; - if(world.isRemote) - { - return true; - } else if(!player.isSneaking()) - { - //killEvent(world, x, y, z); - world.spawnParticle("smoke", (double)x, (double)y + 1, (double)z, 0.0D, 1.0D, 0.0D); - - return true; - } else { - return false; + public TileEntityTestStorage() { + super(8 * 50); // just eat fucking shit at this point } - }*/ - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) - { - this.worldObj = par1World; - - /*double d = (float)par2 + 0.5F; - double d1 = (float)par3 + 0.7F; - double d2 = (float)par4 + 0.5F; - double d3 = 0.2199999988079071D; - double d4 = 0.27000001072883606D; - par1World.spawnParticle("smoke", d - d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D); - par1World.spawnParticle("flame", d - d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D); - //Minecraft.getMinecraft().effectRenderer.addEffect(new NukeSmokeFX(par1World, d - d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D, 100, 100)); - //NukeCloudFX part = new NukeCloudFX(par1World, d - d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D, 100); - //part. - //Minecraft.getMinecraft().effectRenderer.addEffect(part); - { - return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - if(par1World.isRemote) - { - ExplosionNukeAdvanced.mush(par1World, par2, par3, par4); - } - }*/ - - //ExplosionThutmose splosion = new ExplosionThutmose(par1World, null, (double) par2 + 0.5D, (double) par3 + 0.5D, (double) par4 + 0.5D, 10); - //splosion.doExplosion(); - - //par1World.setBlock(par2, par3, par4, Blocks.air); - //ExplosionChaos.anvil(par1World, par2, par3 + 2, par4, 1); - - //return true; - //System.out.println(par5EntityPlayer.getCommandSenderName()); - //System.out.println(par5EntityPlayer.getUniqueID()); - /*List list = new ArrayList(); - PotionEffect effect = new PotionEffect(PotionEffectTaint.instance.id, 300, 0); - effect.setCurativeItems(list); - par5EntityPlayer.addPotionEffect(effect); - return true;*/ - - - /*if(!worldObj.isRemote) { - SatelliteSavedData data = (SatelliteSavedData)worldObj.perWorldStorage.loadData(SatelliteSavedData.class, "satellites"); - if(data == null) { - worldObj.perWorldStorage.setData("satellites", new SatelliteSavedData(worldObj)); - return true; - } - - for(SatelliteSaveStructure sat : data.satellites) { - par5EntityPlayer.addChatComponentMessage(new ChatComponentText(sat.satelliteID + ": " + sat.satelliteType.name())); - } - data.markDirty(); - }*/ - - - /*if(!worldObj.isRemote) - buildEvent(worldObj, par2, par3, par4, 30);*/ - - /*((EntityLivingBase)par5EntityPlayer).addPotionEffect(new PotionEffect(HbmPotion.radiation.id, 100, 0));*/ - - /*worldObj.setBlockToAir(par2, par3, par4); - (new Sellafield()).generate(worldObj, par2, par4, 50D, 15D);*/ - - /*switch(itemRand.nextInt(3)) { - case 0: - worldObj.playSoundEffect(par2, par3, par4, "hbm:fm.clap", 1.0F, 1.0F); break; - case 1: - worldObj.playSoundEffect(par2, par3, par4, "hbm:fm.mug", 1.0F, 1.0F); break; - case 2: - worldObj.playSoundEffect(par2, par3, par4, "hbm:fm.sample", 1.0F, 1.0F); break; - }*/ - - /*worldObj.setBlockToAir(par2, par3, par4); - - new Barrel().generate(worldObj, worldObj.rand, par2, par3, par4);*/ + @Override public String getName() { return "Balls"; } + @Override public void updateEntity() { } - - /*worldObj.setBlock(par2, par3, par4, ModBlocks.crate_steel, 0, 3); - - if(worldObj.getBlock(par2, par3, par4) == ModBlocks.crate_steel) - { - WeightedRandomChestContent.generateChestContents(worldObj.rand, HbmChestContents.getLoot(3), (TileEntityCrateSteel)worldObj.getTileEntity(par2, par3, par4), 32); - }*/ - - /*EntityBurningFOEQ foeq = new EntityBurningFOEQ(worldObj); - foeq.posX = par2; - foeq.posY = 400; - foeq.posZ = par4; - foeq.motionX = worldObj.rand.nextGaussian() * 1D; - foeq.motionZ = worldObj.rand.nextGaussian() * 1D; - foeq.motionY = -4D; - - if(!worldObj.isRemote) - worldObj.spawnEntityInWorld(foeq);*/ - - /*if(!worldObj.isRemote) { - worldObj.setBlockToAir(par2, par3, par4); - ExplosionLarge.jolt(worldObj, par2 - 0.5, par3 - 0.5, par4 - 0.5, 5, 200, 0.25); - ExplosionLarge.explode(worldObj, par2 + 0.5, par3 + 0.5, par4 + 0.5, 5, false, false, false); - }*/ - - /*if(!worldObj.isRemote) { - EntityMinerRocket rocket = new EntityMinerRocket(worldObj); - rocket.posX = par2 + 0.5; - rocket.posY = 100; - rocket.posZ = par4 + 0.5; - - worldObj.spawnEntityInWorld(rocket); - }*/ - - /*if(!worldObj.isRemote) { - EntityEMP emp = new EntityEMP(worldObj); - emp.posX = par2 + 0.5; - emp.posY = par3 + 0.5; - emp.posZ = par4 + 0.5; - - worldObj.spawnEntityInWorld(emp); - }*/ - - /*if(!worldObj.isRemote) { - - new GeyserLarge().generate(worldObj, itemRand, par2, par3, par4); - }*/ - - /*if(!worldObj.isRemote) - PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacket(par2, par3 + 2, par4, 2), - new TargetPoint(worldObj.provider.dimensionId,par2, par3, par4, 50));*/ - - /*if(!worldObj.isRemote) { - - EntityFallingBlock entityfallingblock = new EntityFallingBlock(worldObj, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this, worldObj.getBlockMetadata(par2, par3, par4)); - worldObj.spawnEntityInWorld(entityfallingblock); - }*/ - - /*if(!worldObj.isRemote) { - EntityCloudTom tom = new EntityCloudTom(worldObj, 100); - tom.setPosition(par2 + 0.5, par3 + 2, par4 + 0.5); - worldObj.spawnEntityInWorld(tom); - }*/ - - /*if(!worldObj.isRemote) { - - worldObj.setBlockToAir(par2, par3, par4); - ExplosionNT ex = new ExplosionNT(worldObj, null, par2 + 0.5, par3 + 2, par4 + 0.5, 5); - ex.addAttrib(ExAttrib.ALLDROP); - ex.doExplosionA(); - ex.doExplosionB(false); - }*/ - - - FMLNetworkHandler.openGui(par5EntityPlayer, MainRegistry.instance, -1, par1World, par2, par3, par4); - - return true; - } - - public void buildEvent(World world, int x, int y, int z, int r) { - - Random rand = new Random(); - - for(double h = r; h >= -r; h -= (0.2D + ((r - Math.abs(h)) / r * 0.6D))) { - - double sectionRad = Math.sqrt(Math.pow(r, 2) - Math.pow(h, 2)); - double circumference = 4 * Math.PI * sectionRad + rand.nextGaussian() * 0.5 + 0.25D; - - System.out.println(h + " " + circumference); - - for(int c = 0; c < circumference; c++) { - - Vec3 vec = Vec3.createVectorHelper(sectionRad, h, 0); - vec = vec.normalize(); - //vec.rotateAroundZ((float) (h / sectionRad) * -2); - vec.rotateAroundY((float) (360 / circumference * c)); - - int dX = (int) Math.round(vec.xCoord * r + x); - int dY = (int) Math.round(vec.yCoord * r + y); - int dZ = (int) Math.round(vec.zCoord * r + z); - - world.setBlock(dX, dY, dZ, Blocks.gold_block); - } - } - } + @Override public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) { return new ContainerTestStorage(player.inventory, this); } + @Override public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) { return new GUITestStorage(player.inventory, this); } + } - public void killEvent(World world, int x, int y, int z) { + public static class ContainerTestStorage extends Container { - world.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "random.break", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); - float f = this.explosionSize; - int i; - int j; - int k; - double d5; - double d6; - double d7; - double wat = 20.0D; - + protected TileEntityTestStorage tile; + + public ContainerTestStorage(InventoryPlayer invPlayer, TileEntityTestStorage tile) { + this.tile = tile; + setupWithScroll(tile, invPlayer, 0); + } + + @Override + public ItemStack slotClick(int slotIndex, int button, int mode, EntityPlayer player) { + + if(slotIndex == SLOT_CLICK_ID_REFRESH) { + this.setupWithScroll(tile, player.inventory, mode); + return null; + } + + return super.slotClick(slotIndex, button, mode, player); + } + + public void setupWithScroll(TileEntityTestStorage tile, InventoryPlayer invPlayer, int rowOffset) { + this.inventorySlots.clear(); + this.inventoryItemStacks.clear(); - this.explosionSize *= 2.0F; - i = MathHelper.floor_double(x - wat - 1.0D); - j = MathHelper.floor_double(x + wat + 1.0D); - k = MathHelper.floor_double(y - wat - 1.0D); - int i2 = MathHelper.floor_double(y + wat + 1.0D); - int l = MathHelper.floor_double(z - wat - 1.0D); - int j2 = MathHelper.floor_double(z + wat + 1.0D); - List list = world.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(i, k, l, j, i2, j2)); - Vec3 vec4 = Vec3.createVectorHelper(x, y + 1, z); + for(int row = 0; row < 6; row++) { + for(int col = 0; col < 8; col++) { + int index = col + (row + rowOffset) * 8; + if(index >= tile.slots.length) continue; + this.addSlotToContainer(new Slot(tile, index, 8 + col * 18, 18 + row * 18)); + } + } - for (int i1 = 0; i1 < list.size(); ++i1) - { - Entity entity = (Entity)list.get(i1); - double d4 = entity.getDistance(x, y, z) / this.explosionSize; + 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, 140 + i * 18)); + } + } - if (d4 <= 1.0D) - { - d5 = entity.posX - x; - d6 = entity.posY + entity.getEyeHeight() - y; - d7 = entity.posZ - z; - double d9 = MathHelper.sqrt_double(d5 * d5 + d6 * d6 + d7 * d7); + for(int i = 0; i < 9; i++) { + this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 198)); + } + } - if (d9 < wat) - { - d5 /= d9; - d6 /= d9; - d7 /= d9; - double d10 = world.getBlockDensity(vec4, entity.boundingBox); - double d11 = (1.0D - d4) * d10; - //entity.attackEntityFrom(DamageSource.generic, (float)(100 - d9/wat*100/d10)); - - if(!entity.worldObj.isRemote && !entity.isDead) - { - entity.setFire(50); - //entity.setDead(); - } + @Override + public ItemStack transferStackInSlot(EntityPlayer player, int index) { + return null; + } - //entity.attackEntityFrom(DamageSource.generic, (float)((int)((d11 * d11 + d11) / 2.0D * 8.0D * (double)this.explosionSize + 1.0D))); - double d8 = EnchantmentProtection.func_92092_a(entity, d11); - entity.motionX += d5 * d8; - entity.motionY += d6 * d8; - entity.motionZ += d7 * d8; + @Override + public boolean canInteractWith(EntityPlayer player) { + return tile.isUseableByPlayer(player); + } + } + + public static class GUITestStorage extends GuiContainer { - if (entity instanceof EntityPlayer) - { - this.field_77288_k.put(entity, Vec3.createVectorHelper(d5 * d11, d6 * d11, d7 * d11)); - } - } - } - } + public static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_test_storage.png"); + protected int scrollIndex = 0; + protected static final int scrollBounds = (50 - 7); // 50 rows total, minus 6 visible rows, minus 1 because we start at index 0 + protected boolean wasClicking = false; + protected boolean draggingScroll = false; - this.explosionSize = f; + public GUITestStorage(InventoryPlayer invPlayer, TileEntityTestStorage tile) { + super(new ContainerTestStorage(invPlayer, tile)); + + this.xSize = 176; + this.ySize = 222; + } + + @Override + public void drawScreen(int x, int y, float interp) { + boolean isClicking = Mouse.isButtonDown(0); + if(!isClicking) this.draggingScroll = false; + + if(!wasClicking && isClicking && guiLeft + 153 <= x && guiLeft + 153 + 14 > x && guiTop + 17 < y && guiTop + 17 + 108 >= y) { + draggingScroll = true; + } + + if(draggingScroll) { + int range = 92; // 106 scroll bar size, -7 pixels on top and bottom + int sY = MathHelper.clamp_int(y - guiTop - 25, 0, 92); + double scrollFrac = (double) sY / (double) range; + int row = (int) (scrollBounds * scrollFrac); + this.setScroll(row); + } + + this.wasClicking = isClicking; + super.drawScreen(x, y, interp); + } + + @Override + protected void drawGuiContainerBackgroundLayer(float interp, int x, int y) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + Minecraft.getMinecraft().getTextureManager().bindTexture(texture); + drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); + + drawTexturedModalRect(guiLeft + getScrollBarXPos(), guiTop + getScrollBarYPos(), draggingScroll ? 188 : 176, 0, 12, 15); + } + + @Override + public void handleMouseInput() { + super.handleMouseInput(); + + int scrollDir = Mouse.getEventDWheel(); + + if(scrollDir != 0) { + + if(scrollDir > 0) scrollDir = 1; + if(scrollDir < 0) scrollDir = -1; + this.setScroll(this.getScroll() - scrollDir); + } + } + + public int getScrollBarXPos() { + return 154; + } + + public int getScrollBarYPos() { + int scrollArea = 106 - 15; // bar height minus the scroll knob's height + double scrollProgress = (double) scrollIndex / (double) scrollBounds; + int scrollYPos = 18 + (int) (scrollProgress * scrollArea); + return scrollYPos; + } + + public int getScroll() { + return MathHelper.clamp_int(scrollIndex, 0, scrollBounds); + } + + public void setScroll(int scroll) { + int prevScroll = getScroll(); + this.scrollIndex = MathHelper.clamp_int(scroll, 0, scrollBounds); + if(prevScroll != this.scrollIndex) refreshContainer(); + } + + public void refreshContainer() { + this.mc.playerController.windowClick(this.inventorySlots.windowId, SLOT_CLICK_ID_REFRESH, 0, this.scrollIndex, this.mc.thePlayer); + } } } diff --git a/src/main/java/com/hbm/tileentity/TileEntityLoadedBase.java b/src/main/java/com/hbm/tileentity/TileEntityLoadedBase.java index 9ba41c097..bd65a5e2d 100644 --- a/src/main/java/com/hbm/tileentity/TileEntityLoadedBase.java +++ b/src/main/java/com/hbm/tileentity/TileEntityLoadedBase.java @@ -52,9 +52,6 @@ public class TileEntityLoadedBase extends TileEntity implements ILoadedTile, IBu super.readFromNBT(nbt); this.muffled = nbt.getBoolean("muffled"); this.tilted = nbt.getBoolean("tilted"); - - // one more for good measure - if(this instanceof IFluidUserMK2) markChanged(); } @Override diff --git a/src/main/java/com/hbm/tileentity/TileMappings.java b/src/main/java/com/hbm/tileentity/TileMappings.java index a67e399ac..68be764bc 100644 --- a/src/main/java/com/hbm/tileentity/TileMappings.java +++ b/src/main/java/com/hbm/tileentity/TileMappings.java @@ -44,6 +44,7 @@ import com.hbm.blocks.network.FluidDuctPaintableBlockExhaust.TileEntityPipeExhau import com.hbm.blocks.network.FluidPump.TileEntityFluidPump; import com.hbm.blocks.network.PneumoTubePaintableBlock.TileEntityPneumoTubePaintable; import com.hbm.blocks.rail.RailStandardSwitch.TileEntityRailSwitch; +import com.hbm.blocks.test.TestEventTester.TileEntityTestStorage; import com.hbm.blocks.network.BlockOpenComputersCablePaintable.TileEntityOpenComputersCablePaintable; import com.hbm.tileentity.bomb.*; import com.hbm.tileentity.deco.*; @@ -68,6 +69,7 @@ public class TileMappings { public static void writeMappings() { put(TileEntityDiFurnace.class, "tilentity_diFurnace"); + put(TileEntityTestStorage.class, "tilentity_test_storage"); put(TileEntityObjTester.class, "tilentity_objtester"); put(TileEntityMachineCentrifuge.class, "tileentity_centrifuge"); put(TileEntityNukeMan.class, "tileentity_nukeman"); diff --git a/src/main/resources/assets/hbm/textures/gui/gui_planner.png b/src/main/resources/assets/hbm/textures/gui/gui_planner.png deleted file mode 100644 index dabf8d89906a3e181e584c22a437cf3f172ecfd4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1759 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 diff --git a/src/main/resources/assets/hbm/textures/gui/gui_test_storage.png b/src/main/resources/assets/hbm/textures/gui/gui_test_storage.png new file mode 100644 index 0000000000000000000000000000000000000000..599f6398c4b36d87614305a1b9ec17635d8b17f7 GIT binary patch literal 1399 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K5893O0R7}x|G$6%N?Bp530R%N1DIE+9ta_d< zjv*Cu-rf!LQ;HU8yLh%Y`4i)^MrOr>fewcp5~PwIEqP`4{9o5kozW+I z9&2?5p{IxBK_U zkA;7P_bBr(um8B+v~~Wb+izdJe7W-5@4v_Y$1KMfvl~& zelbovohr-6Ud;4-&;05AKW%^2)ZhB~O(bDwOx#z7*I#$>wKrQf7TfLL{pC{S^6$%e zmoo_XFeuDma4=wONMK?($imRX$-pAaz@dg!!g@D9(5P!wd-wfvJacl6^Z&F^Q=Y@? z`y=gR4MCP#|jW=peQU(TE2G8emr5RG5X zyD1dUI=fMDMZFo*%*#1_y$*kidGWgw-8`^HzQ3CVPs~Xx&S7~qzt`cJ$?Rn1fd4Vf z#P}Ow9$2IE{~Q*hkTj%V1lVx7YH!Y5K;97~A&$y9Pxt%6YCibYc-oTeA#~qq|(#X&t;ucLK6V*-|-3n literal 0 HcmV?d00001