Posted October 29, 201410 yr Hi, I was making a tile entity that would need to detect nearby tile entities. I check all sides of the block on each updateEntity() method call, but it is unable to detect any nearby tile entities. I added a debug line to print the name of the blocks it detected, and they all returned as "tile.air" despite the blocks clearly not being air blocks. Code: https://github.com/austinv11/PeripheralsPlusPlus/blob/master/src%2Fmain%2Fjava%2Fcom%2Faustinv11%2Fperipheralsplusplus%2Ftiles%2FTileEntityRFCharger.java Thanks!
October 29, 201410 yr Maybe stop using forge directions and just use addition? See if that works. Check out my mod, Realms of Chaos, here. If I helped you, be sure to press the "Thank You" button!
October 29, 201410 yr Author Wow, can't believe I missed that! Still getting the same problem after fixing it though.
November 1, 201410 yr Hi I'd suggest adding a few more diagnostics, eg for (int i = 0; i < 6; i++) { int x = this.xCoord + dirs[i].offsetX; int y = this.yCoord + dirs[i].offsetY; int z = this.zCoord + dirs[i].offsetZ; System.out.println("Test " + i + " at [" + x + ", " + y + ", " + z + "]"); if (!getWorldObj().blockExists(x, y, z)) continue; Block t = getWorldObj().getBlock(x, y, z); System.out.println("Block found:" + block); TileEntity te = getWorldObj().getTileEntity(x, y, z); System.out.println("Tile Entity found:" + te); if (te instanceof ITurtleAccess) { turtles.add((ITurtleAccess) te); Logger.info(""); } } -TGG
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.