Posted June 24, 201510 yr New APIs, so fun. I'm attempting to get my ribbon cable multipart to function as a cable, but my method requires being able to access the next block, see if it's a cable, if it is, look at it's values. But thing is, neither world.getBlock or world.getTileEntity work. So how would I go about interacting with nearby multiparts and their tile entities, I have yet to find something equivalent to worlds functions [shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]
June 25, 201510 yr int side = 0 t = getMultipartTile(world, pos) t.partMap(side) Put this in some sort of Library. You will need it quite a few times... def getMultipartTile(w:IBlockAccess, bc:BlockCoord):TileMultipart = getMultipartTile(w, bc.x, bc.y, bc.z) def getMultipartTile(w:IBlockAccess, x:Int, y:Int, z:Int) = w.getTileEntity(x, y, z) match { case t:TileMultipart => t case _ => null } PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.
June 25, 201510 yr Author Thanks, I'll try and translate that into Java [shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]
June 25, 201510 yr Author Okay, according to Whov's tut, the tile entity is remade in the part class, but your function returns a TileMultipart. Did Whov do it wrong? [shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]
June 25, 201510 yr The part "block" actually is just a block with a tileentity. This TileEntity contains an array in which the parts are stored. Certain parts like cables should occupy up specific spaces. 1-6 for each side. t.partMap() will return an instance of your part (wire) which you can access directly by type checking followed by type casting. PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.