Jump to content

Zeretul4

Members
  • Posts

    26
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Zeretul4's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Does anyone know how packet handlers can help update a Tile Entities GUI? Every example I find is just something like sending pointless numbers to the player chat. Vanilla code isn't helping either, the interface for that only deals with ints and i need to update other things like booleans and lists.
  2. Thanks for the reply, I tried to do what you said and looked up Packet250CustomPayload and IPacketHandler but all I found were basic tutorials that showed how to print random numbers to the chat. This doesn't really help because I have no idea how I can turn that into updating numbers for the gui, they look nothing like what I currently do for updating ints. http://www.minecraftforge.net/wiki/Packet_Handling this tutorial mentions that a good use for packets is for exactly what I need but doesn't get into how to do that. I've been searching and searching but can't figure this out. Any ideas? Thanks for the help so far!
  3. Hey everyone, some of you may know that if you want numbers that you use in tile entities to interact with the gui, you need to send packets which is done in the container class. In vanilla it's only possible to update ints because that's all vanilla minecraft needs. I want to see things like booleans, floats, and other information which i've been getting around by using ints. The problem now is that I want to use lists and the way I have it working isn't going to work for that. Right now the process is this and I don't know how it works, I sorta just pieced it together from random examples and tutorials. int lastVariable public void addCraftingToCrafters(ICrafting par1ICrafting) { super.addCraftingToCrafters(par1ICrafting); par1ICrafting.sendProgressBarUpdate(this, 0, (int)this.tileEntity.variable); } public void detectAndSendChanges() { super.detectAndSendChanges(); for (int var1 = 0; var1 < this.crafters.size(); ++var1) { ICrafting var2 = (ICrafting)this.crafters.get(var1); if (this.lastVariable = this.tileEntity.variable) { var2.sendProgressBarUpdate(this, 0, (int)this.tileEntity.variable); } } lastVariable= (int)tileEntity.variable; } @SideOnly(Side.CLIENT) public void updateProgressBar(int par1, int par2) { if (par1 == 0) { this.tileEntity.variable= par2; } } I have no idea what this is doing but I have to do it for each variable I want to work with in a gui. Whenever I try to change it from ints to anything else it stops working. I know it has something to do with packets but I have no idea where to begin with that.
  4. Hey everyone, I've been working on a block that basically shares its liquid level by averaging with adjacent blocks. This is done with a LiquidMetalMix object that keeps track of all this. This isn't the important part though, the problem is that forge is constantly crashing because of one line of code that is just like anything else and the error it's giving me says it is not recoverable. Heres the error 2013-05-14 18:32:42 [sEVERE] [ForgeModLoader] Fatal errors were detected during the transition from SERVER_STARTED to SERVER_STOPPED. Loading cannot continue 2013-05-14 18:32:42 [sEVERE] [ForgeModLoader] mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available Geology [Geology] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available 2013-05-14 18:32:42 [sEVERE] [ForgeModLoader] The ForgeModLoader state engine has become corrupted. Probably, a state was missed by and invalid modification to a base classForgeModLoader depends on. This is a critical error and not recoverable. Investigate any modifications to base classes outside ofForgeModLoader, especially Optifine, to see if there are fixes available. 2013-05-14 18:32:42 [iNFO] [sTDERR] Exception in thread "Server thread" java.lang.RuntimeException: The ForgeModLoader state engine is invalid 2013-05-14 18:32:42 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.transition(LoadController.java:134) 2013-05-14 18:32:42 [iNFO] [sTDERR] at cpw.mods.fml.common.Loader.serverStopped(Loader.java:799) 2013-05-14 18:32:42 [iNFO] [sTDERR] at cpw.mods.fml.common.FMLCommonHandler.handleServerStopped(FMLCommonHandler.java:470) 2013-05-14 18:32:42 [iNFO] [sTDERR] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:530) 2013-05-14 18:32:42 [iNFO] [sTDERR] at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16) I've been toying around with it for about half an hour now and can't come up with anything. If you guys have any idea what the issue even is then please tell me. Thanks! Heres the code that's causing problems, if you need anything else just tell me. // set this and all adjacent vats liquid level to the average public void balanceLiquids(){ int numOfAdjacentVats = 1; List<LiquidMetalMix> mixtures = new ArrayList<LiquidMetalMix>(); List<Integer> xCoords = new ArrayList<Integer>(); List<Integer> zCoords = new ArrayList<Integer>(); mixtures.add(mixture); // loop through surrounding blocks for (int xx = -1; xx < 2; xx++){ for (int zz = -1; zz < 2; zz++){ // if its checking itself or a corner if (Math.abs(xx) == Math.abs(zz)){ //continue; } else { // coordinates currently being checked int x = xCoord + xx; int y = yCoord; int z = zCoord + zz; // if a vat is adjacent if (worldObj.getBlockId(x, y, z) == Geology.blockMoltenVat.blockID || worldObj.getBlockId(x, y, z) == Geology.blockIngotMold.blockID){ // get the TE at that location TileEntityMoltenVat te = (TileEntityMoltenVat)worldObj.getBlockTileEntity(x, y, z); mixtures.add(te.mixture); numOfAdjacentVats++; xCoords.add(xx); zCoords.add(zz); } else if (worldObj.getBlockId(x, y, z) == Geology.blockMoltenValve.blockID){ // a valve instead // get the TE at that location TileEntityMoltenValve te = (TileEntityMoltenValve)worldObj.getBlockTileEntity(x, y, z); if (te.canFlow){ mixtures.add(te.mixture); numOfAdjacentVats++; xCoords.add(xx); zCoords.add(zz); } } } } } // average out the new mixtures // set this mixture to the new mix // the static method returns a new LiquidMetalMix object that averaged all the mixture together LiquidMetalMix newMix = LiquidMetalMix.combineMixtures(mixtures, numOfAdjacentVats); // I have no problems setting the new mixture to this objects mixture mixture = newMix; // distribute the new mix for (int xx = -1; xx < 2; xx++){ for (int zz = -1; zz < 2; zz++){ // if its checking itself or a corner if (Math.abs(xx) == Math.abs(zz)){ //continue; } else { // coordinates currently being checked int x = xCoord + xx; int y = yCoord; int z = zCoord + zz; // if a vat is adjacent if (worldObj.getBlockId(x, y, z) == Geology.blockMoltenVat.blockID || worldObj.getBlockId(x, y, z) == Geology.blockIngotMold.blockID){ // get the TE at that location TileEntityMoltenVat te = (TileEntityMoltenVat)worldObj.getBlockTileEntity(x, y, z); // but as soon as i try to set another molten vat to the new mixture, i get the wierd error te.mixture = newMix; // commenting this one line out makes minecraft run fine } else if (worldObj.getBlockId(x, y, z) == Geology.blockMoltenValve.blockID){ // a valve instead // get the TE at that location TileEntityMoltenValve te = (TileEntityMoltenValve)worldObj.getBlockTileEntity(x, y, z); if (te.canFlow){ //te.mixture = new LiquidMetalMix(8000); } } } } } }
  5. Hey everyone, I'm working on a TE and I've been having issues with calling methods in the onBlockPlaced() method in its block class. Right now the method is basic and sets the TEs xCoord, yCoord, and zCoord to variables that will be displayed in the gui. This works perfectly when called in onBlockActivated() for the block, but in the onBlockPlaced() method, they are always set to 0. I don't know if theres another method I should call but for what I'm trying to do I need these variables to be set when you place the block down right away. I'm thinking it ha something to do with the TE not having set up its coordinates yet, but it still doesn't work if I use the blocks coordinates so I'm not sure. Thanks guys!
  6. Hey everyone, I'm trying to make a simple custom render for a block I'm working on but need some help. I've looked up plenty of tutorials on how set up what you need like modelID, registering it, etc. In the class that implements ISimpleBlockRenderingHandler, they all say put my "rendering code" into the renderWorldBlock method which always confuses me. I haven't found a single tutorial that has told me what "rendering code" looks like. I assume there are simple methods that let me create basic shapes at coordinates in the block but I don't know. Anyway, if someone knows what to do can you please tell me? Thanks a lot!
  7. Hey everyone, I'm trying to make a simple custom render for a block I'm working on but need some help. I've looked up plenty of tutorials on how set up what you need like modelID, registering it, etc. In the class that implements ISimpleBlockRenderingHandler, they all say put my "rendering code" into the renderWorldBlock method which always confuses me. I haven't found a single tutorial that has told me what "rendering code" looks like. I assume there are simple methods that let me create basic shapes at coordinates in the block but I don't know. Anyway, if someone knows what to do can you please tell me? Thanks a lot!
  8. I looked into ISimpleBlockRenderingHandler and tried to find tutorials and I actually found plenty telling me how to set things up, but they all lead me to a dead end. They all say to just fill this method with my "rendering code" @Override public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { // TODO Auto-generated method stub return false; } That's great, but I have no idea where to go from there and nothing is telling me what I can write to make some simple square shapes render. Thanks a lot!
  9. I looked into ISimpleBlockRenderingHandler and tried to find tutorials and I actually found plenty telling me how to set things up, but they all lead me to a dead end. They all say to just fill this method with my "rendering code" @Override public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { // TODO Auto-generated method stub return false; } That's great, but I have no idea where to go from there and nothing is telling me what I can write to make some simple square shapes render. Thanks a lot!
  10. Hey everyone, I'm trying to make a multi-block that's like a huge cauldron and I only have a question about how I would render this. I want it to look simple, basically if theres a single block then it will render similar to a cauldron, but if there is another next to it then the walls in between that would normally separate them isn't rendered so it looks like a single large cauldron. I've never done anything with special rendering yet so I'm just asking how I would get started with this. The best example I could think of is how buildcraft pipes are small squares on their own but know to connect when they are next to each other. Thanks a lot guys!
  11. Hey everyone, I'm trying to make a multi-block that's like a huge cauldron and I only have a question about how I would render this. I want it to look simple, basically if theres a single block then it will render similar to a cauldron, but if there is another next to it then the walls in between that would normally separate them isn't rendered so it looks like a single large cauldron. I've never done anything with special rendering yet so I'm just asking how I would get started with this. The best example I could think of is how buildcraft pipes are small squares on their own but know to connect when they are next to each other. Thanks a lot guys!
  12. Thank for the replies everyone. My mod adds the basics like blocks, items tools, etc and a few tile entities. I don't have any plans to make it more complicated than this, but what should I look out for? Also, how do I know which methods/classes I have to put @sideonly or @clientside or whatever? Is there a tutorial for that? Thanks a lot guys!
  13. Thank for the replies everyone. My mod adds the basics like blocks, items tools, etc and a few tile entities. I don't have any plans to make it more complicated than this, but what should I look out for? Also, how do I know which methods/classes I have to put @sideonly or @clientside or whatever? Is there a tutorial for that? Thanks a lot guys!
  14. Hey everyone, just a quick question. I'm just about done with my mod but am wondering if it can be played on multiplayer as is. I've followed the basic tutorials on here so I'm not sure what else I would have to do to make it multiplayer. I have only joined a few of my friends servers so I have no idea how the process works with multiplayer mods. I would assume it's as simple as installing the mod and joining a server that also has it installed, but this probably isn't the case ha ha. Thanks guys!
×
×
  • Create New...

Important Information

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