
TheEpicTekkit
Members-
Posts
361 -
Joined
-
Last visited
Everything posted by TheEpicTekkit
-
How can I make the gag blocks search for the master block in a certain area? because I had an idea where instead of the gag blocks having a tileentity that references the master tileentity, I can make it search for the master when it is activated, and open the masters gui in my guiHandler. Is this the correct way to do this? or is there a better way?
-
Im really sorry to bother you again for like the fourth day in a row, but this has to be the strangest thing so far. Im still working on my distillation chamber multiblock structure, and in testing if I can return the master block of the whole structure, the one that contains all the inventoris contents, I put in the onBlockActivated method this: @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { TileEntityDistillationChamberGag tileEntity = (TileEntityDistillationChamberGag)world.getTileEntity(x, y, z); System.out.println("X: " + x + ", Y: " + y + ", Z: " + z + "."); //TileEntityDistillationChamberGag tileEntity1 = (TileEntityDistillationChamberGag)world.getTileEntity(x, y, z); if (!world.isRemote) { System.out.println("Master located at: X " + tileEntity.masterPosX + ", Y: " + tileEntity.masterPosY + ", Z: " + tileEntity.masterPosZ); return true; } return false; } Now the first system.out.println is the coordinates of the block you are clicking on, and the second one after the if (!world.isRemote) should return the coordinates of the master block. But instead it crashes, and in the crash report it says: java.lang.ClassCastException: net.theepictekkit.generator.common.tileentity.TileEntityDistillationChamberFrame cannot be cast to net.theepictekkit.generator.common.tileentity.TileEntityDistillationChamberGag at net.theepictekkit.generator.common.blocks.advanced.multiblock.BlockDistillationChamberWall.onBlockActivated(BlockDistillationChamberWall.java:26) And line 26 is: TileEntityDistillationChamberGag tileEntity = (TileEntityDistillationChamberGag)world.getTileEntity(x, y, z); now for some reason the x, y, z is returning the coords of the master block, but only in this line of code, as in the first system.out.println uses the same x, y, z coords and returns the coords of the block being clicked. And from what I understand, this is trying to cast the master: (TileEntityDistillationChamberFrame) to itself: (TileEntityDistillationChamberGag) and it shouldnt be doing that because the x, y, z coords shouldnt return the master block, and in no other place have I referenced the master block (yet). Am I doing something wrong in how I am trying to get the master block from the gag blocks? if so, what is the correct way to do this? Thanks for any help.
-
Nevermind. I got it working. I changed: TileEntityDistillationChamberFrame tileEntity = new TileEntityDistillationChamberFrame(); to: TileEntityDistillationChamberFrame tileEntity = (TileEntityDistillationChamberFrame)world.getTileEntity(x, y, z); So it was a problem with the way I was getting the tileentity.
-
Okay, I did read the error log, and I did go to line 53 in the tileentity, and that was the first if statement: if (worldObj.getBlock(x, y, z) == main) { This could not possibly be null because one: this is the main block in the structure that actually stores the data, and it is the actual blockDistillationChamber that has the onBlockActivated method that is causing the error. and two: if it were null, the structure would not be formed, and I know it is formed because when it is, it prints in the console that it is formed. And I have tested this, it only prints that if it is actually formed, it isn't a false reading. and I also looked at line 58 in BlockDistillationChamber and that was: if (!tileEntity.checkMultiBlockForm()) { I did say that I have spent about an hour trying to figure this out, and the first thing I did was read the crash report to see if I could locate the error.
-
Okay... I have been trying to figure this out for an hour now... my game crashes when I open the gui. This is the crash report: Now I know it is nothing to do with the actual container or gui because the gui was working perfectly fine before I made it check if the structure is properly formed, It opened, I could place items inside, it closed etc wothout a problem I have the feeling that it is something really obvious that I have missed.
-
Okay, thanks for that, I'll try this. Also, how would I make a for loop check a 5x5x10 space and what do you mean by a nested for loop?? I have never heard of that (probably should have....) And have you got any idea on how to make the inventory be able to store liquids? this whole multiblock is going to turn crude oil into petroleum, diesel, propane, tar, and butane (6 liquids I have already added)
-
I need help with creating A multiblock structure. I have the code that checks if all the blocks are in the correct formation, but that is about it, I dont know what to do from here. Also, another thing I have no idea how to even start is all the blocks in the structure open the same inventory, you dont have to click a specific block in the structure to open the gui, and the inventories are synchronised with eachother so that if you open the gui from one block and add items, the gui from a different block has the same items as long as it is in the same structure. This is the code I have that checks if the structure is correct (Warning, very long, the structure is large, 5x5x10) This code is in the tileentity I also want the container of this block to be able to store liquids, any ideas on how to make an inventory store liquids? Thanks for the help.
-
Custom fluid crash!?!? Help! [1.7.10] [UNSOLVED]
TheEpicTekkit replied to TheEpicTekkit's topic in Modder Support
How do I add a bucket for my custom fluid? -
Custom fluid crash!?!? Help! [1.7.10] [UNSOLVED]
TheEpicTekkit replied to TheEpicTekkit's topic in Modder Support
Okay, I figured it out, I rearranged the code a little, it is now: //Fluid public static Fluid fluidCreosoteOil; //Fluid Block public static Block blockCreosoteOil; public static void registerFluids(GameRegistry gameRegistry) { fluidCreosoteOil = new FluidCreosoteOil("fluidcreosoteoil").setUnlocalizedName("fluidCreosoteOil"); FluidRegistry.registerFluid(fluidCreosoteOil); blockCreosoteOil = new BlockCreosoteOil().setBlockName("creosoteOil"); GameRegistry.registerBlock(blockCreosoteOil, "blockCreosoteOil"); LanguageRegistry.addName(blockCreosoteOil, "Creosote Oil"); } And it works. -
Custom fluid crash!?!? Help! [1.7.10] [UNSOLVED]
TheEpicTekkit replied to TheEpicTekkit's topic in Modder Support
I have registered my fluid before the block... FluidRegistry.registerFluid(fluidCreosoteOil); GameRegistry.registerBlock(blockCreosoteOil, "blockCreosoteOil"); LanguageRegistry.addName(blockCreosoteOil, "Creosote Oil"); -
Custom fluid crash!?!? Help! [1.7.10] [UNSOLVED]
TheEpicTekkit replied to TheEpicTekkit's topic in Modder Support
Okay, now I have a problem. When I load the game, it crashes..... -
Custom fluid crash!?!? Help! [1.7.10] [UNSOLVED]
TheEpicTekkit replied to TheEpicTekkit's topic in Modder Support
Okay, thanks for your help. I'll post any problems I run into here. -
Custom fluid crash!?!? Help! [1.7.10] [UNSOLVED]
TheEpicTekkit replied to TheEpicTekkit's topic in Modder Support
Thanks, but I dont understand the way fluids work, Is there a place where you learnt how to do this? if so, please link. Also, does this fluid create an infinite source when flowing against itself? because I want my creosote oil not to have an infinite source. -
Custom fluid crash!?!? Help! [1.7.10] [UNSOLVED]
TheEpicTekkit replied to TheEpicTekkit's topic in Modder Support
Oh, and also, I need to know how to stop the liquid from having an infinite source (like water). I couldn't figure this bit out when I was modding 1.6