Jump to content

Whov

Members
  • Posts

    59
  • Joined

  • Last visited

Everything posted by Whov

  1. when you place a block (from your mod ideally) override onBlockAdded and perform some checks for the near blocks. You must consider where that block might go. Example: railcraft has tanks. When you place any of the blocks it performs a check counting how many blocks there are in x, y and z. If one of them is 1 (1 layer) the other 2 are the height and width of the tank. After that, check if the structure is valid and, if it is, find the center block and set its tile entity (all of the blocks probably have a tile entity I would guess) to store all the data (size, pos, fluid, amount...). You might want to set the metadata of the blocks "part of a multiblock" to some value (maybe different values based on position) for rendering purposes. The trick to make it look cool is, of course, connected textures. Hope this helps!
  2. Check if the break is performed serverSide (because the server overwrites the client for tile entities). Use world.isRemote to see that. BTW, where is that method called? I can't find it..
  3. public class test extends TileEntity { public boolean[] connections = new int[]{0,0,0,0,0,0}; public void checkConnections() { ForgeDirection dir; TileEntity tile; for (int i=0;i<6;i++) { dir = ForgeDirection.getOrientation(i); tile = this.worldObj.getTileEntity(this.xCoord+dir.offsetX, this.yCoord+dir.offsetY, this.zCoord+dir.offsetZ); if (tile==null) { connections = 0; } else if (tile instanceof test) { connections = 1; ((test)tile).connections[ForgeDirection.OPPOSITES] = 1; } } } } Might work?
  4. Yea, I would really recommend using OpenGL (here's a tut by a great teacher: ). Moreover, if I recall correctly, Forge directions has arrays for every direction like {+1;0;0} for north or something, so you don't have to use that huge (compared to how long it could become) code to get the direction you want. Besides, it looks to me like your problem is indeed in check connections, so we'll need to improve it. I might write something for you later today (for reference: 12 am now)
  5. Could you show me how you render your pipes? Do you have a tile entity special renderer binded somewhere? Are the print in your check connections printing the right values? If they are not try considering make it look fancier using ForgeDirection(s can't remember if plural). Write and read nbt should be good, but check them too (they are used to sync with the client after all and you never know). While you are at it, put some print in that renderer and see if it receive the right stuff. If it does, you know where the problem lies then
  6. Thank you for the feedback! You probably have never seen it before because it's really new (I literally figured out everything I teach in every post while writing every new post). It should be pretty accurate now though. Thank you for linking me btw! Really appreciated!
  7. I saw your post on about ChickenBones' multipart API and I wanted to suggest you my tutorial too: http://whov.altervista.org/forge-modding-tutorials/ It's all from me and it might help you with some not-yet-covered aspects of multiparts. Enjoy both! Have a nice day/night (in Italy it's 17 right now )
  8. Hey, try mine! It' on my blog http://whov.altervista.org/forge-modding-tutorials/ And send feedback!
×
×
  • Create New...

Important Information

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