Jump to content

TheEpicTekkit

Members
  • Posts

    361
  • Joined

  • Last visited

Everything posted by TheEpicTekkit

  1. Actually, I am trying halfing the x any y size in the code, this way, it will act like it is a 256x texture. The same way a texturepack can increase the resolution of blocks.
  2. I havn't got any gl11 code in my gui class... Here it is: though come to think of it, would I be able to use gl11 to double the size if the gui?
  3. Also... (again...) I dont understand why this is happening.... The gui is half the size it needs to be.... The gui texture file is 512x512 (twice the size if the default 256x256 gui) but I dont see why that would be a problem, because I am telling it to draw from the top left (X: 0, Y:0) to x: 276, Y: 183 the size of the actual gui texture. Am I not able to have gui's larger than 256x256? Also... Sory but I need a response fast because I need to go very soon....
  4. Also, I want one tank to be the input, and 5 tanks to be the output. How would I make a recipe with liquids so that if the right liquid is in the input tank, it will fill the 5 other tanks with a certain amount of a different liquid? Also... (sorry for all the questions ) How do I make it so that when I mouse over a tank it displays the fluid name, and how much is stored out of how much can be stored. I know there is the onMouseOver method for slots, but the tanks aren't slots, so that method wont work for them.
  5. Ad this will draw any fluid with a texture reguardless of what mod it is from? Also... I dont understand, how would I do this? what do you mean by direction? do you mean what side of the block the fluid comes from? if so, this is a multiblock structure storing the fluids.... how would this work?
  6. Also, how do I get it to draw the fluid in the tank in the gui class? Im sure that it isnt like the furnace for example where you have things you want to draw on the gui in the texture file, like the progress bar, or the burn tile bar. Would there be a way to get the liquids texture file and draw from that?
  7. So would I have return tankInput.fill(...); return tankOutput1.fill(...); return tankOutput2.fill(...); //etc like that, with multiple return statements?
  8. Okay, how do I add multiple tanks to my tileeinity? I am stuck on: @Override public int fill(ForgeDirection from, FluidStack resource, boolean doFill) { return tankInput.fill(resource, doFill); } How can I make this do this for all 6 tanks in the inventory? These are my 6 tanks: public FluidTank tankInput; public FluidTank tankOutput1; public FluidTank tankOutput2; public FluidTank tankOutput3; public FluidTank tankOutput4; public FluidTank tankBiproduct; public TileEntityDistillationChamberFrame() { tankInput = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME * 48); tankOutput1 = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME * 12); tankOutput2 = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME * 12); tankOutput3 = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME * 12); tankOutput4 = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME * 12); tankBiproduct = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME * 16); }
  9. Do I need to implement IFluidTank and or IFluidContainerItem?
  10. Okay, thanks for the help, I'll pose back here if I come across any issues.
  11. So I can just extend TileFluidHandler in my tileentity class?
  12. Thanks. But this only really explains what the methods do, which in most of them is pretty self explanatory, I need to know how to properly fill out all the methods. for example: with a gui that stores items, the decrStackSize is pretty self explanatory as to what it does, but not to how to fill it out. After watching tutorials on inventories and guis, I have learnt how to fill it out: public ItemStack decrStackSize(int i, int j) { if (this.slots[i] != null) { ItemStack itemStack; if (this.slots[i].stackSize <= j) { itemStack = this.slots[i]; this.slots[i] = null; return itemStack; } else { itemStack = this.slots[i].splitStack(j); if (this.slots [i].stackSize == 0) { this.slots[i] = null; } } return itemStack; } return null; } Also, I am kind of new to java and modding... I know that I shouldnt, but I have jumped right to the advanced stuff, like multiblock structures (done successfully), custom wind turbine that can make power but only if there is an item inside the inventory, and the item takes damage over time, and more damage depending on how high the turbine is in the world. (done successfully) and custom machines that can run on the power the turbine makes (almoast done). But these are things that I can find tutorials for, I cant find any tutorials on inventories that can store liquids, and even use liquids in a recipe.
  13. Okay, so I would like to add a liquid tank to an inventory, and after doing some research, I have discovered the IFluidTank, IFluidHandler, and IFluidContainerItem. Now, I have no idea how to use them, I only know that they are used in inventory tanks, and couldnt find any tutorials on them, so, anyone here know how to use these interfaces? or can anyone direct me to a tutorial that explains the methods these add? Thanks in advance.
  14. I got it working finally I havn't found any crash bugs (yet) and the inventory is accessable from any block in the structure, and the inventory is the same, it has the same contents no matter what block you click, and is only accessible when the structure is formed. For anyone that wants to see how I have done it, here is my code:
  15. I do need something there though, because otherwise it gives an error saying 'add arguments to match TileEntityDistillationChamberGag(TileEntityDistillationChamberFrame)' because there is a constructor in the tileentity to reference the master.
  16. Update: This code has fixed all the crash problems when the block is activated, but it now only returns 0, 0, 0 for the coords of the master... what am I doing wrong? because if this were to open a gui, I would get a nullPointerException because the block at 0, 0, 0 doesnt have a gui.
  17. Im also looking on github for the way forestry has done their multifarms. I cant actually find where they have done this though. I have their page on github up, and I have looked through all their packages, but cant find the multifarm code. This will also be useful for me to see how the inventory can store liquids, because I want to have a gui that can store liquids (I have an idea on how to do this, but I dont think that it would be compatible with things like fluiducts, or waterproof pipes, I want to see how they make it compatible)
  18. Thanks! now alot more things make sense. When you say I could pass the reference in the constructor, do you mean like this? private TileEntityDistillationChamberFrame tileEntityMain; public int masterPosX; public int masterPosY; public int masterPosZ; public TileEntityDistillationChamberGag(TileEntityDistillationChamberFrame main) { this.tileEntityMain = main; if (tileEntityMain != null) { this.masterPosX = tileEntityMain.masterPosX; this.masterPosY = tileEntityMain.masterPosY; this.masterPosZ = tileEntityMain.masterPosZ; } else { this.masterPosX = 1; this.masterPosY = 1; this.masterPosZ = 1; //So that it isn't null and causes a crash when right clicked this.hasMaster = false; } } And then change the createNewTileEntity method in the block class from: @Override public TileEntity createNewTileEntity(World world, int par2) { return new TileEntityDistillationChamberGag(); } to: @Override public TileEntity createNewTileEntity(World world, int par2) { return new TileEntityDistillationChamberGag(new TileEntityDistillationChamberFrame()); } But how would this work if there was multiple of these structures in the world? I feel like I am missing something to make sure that it is part of 'this' multiblock structure.
  19. But it is actually referencing the class that is the problem, I dont know how to properly do this. Before when I have tried to reference other classes, I have had crashes saying things like classCastException, class1 can not be cast to class2, or nullPointerException etc. I knew that the variable needed to be public for other classes to access it, I pretty much make everything public, unless I know that it needs to be protected or private.
  20. but how do I set a non static variable from another class? (I am kind of new to java, and for the record, I have attempted this before in this mod, and havnt had much luck, so it would be great if I could get a detailed explanation on how to do this).
  21. That wont work because tileEntity.xCoord, yCoord etc is the coordinates of the gag tileentity, but in the gag tileentity there are 3 integers, masterPosX, masterPosY, and masterPosZ. These should return the location of the master block. Now im not sure if I am referencing the master correctly in the tileentitygag here is what I did: Im pretty sure it is wrong because when it is part of the multiblock it returns x: 0, y: 0, z: 0. And when it is not part of the multiblock, it crashes the game with a nullPointerException. Is the way I am getting the master block correct? I have a strong feeling that it is not, but I cant figure out how to properly do so. Also sorry for the late reply, I was out of the house for a bit.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.