Posted 17 June 2014 - 10:02 PM
I'm the developer of CRMod, that adds chunkloader modules for turtles. To load the chunks when the world loads I have to make a callback that from the forge's tickets loads the needed chunks: I get the ticket, the tickets has some coordinates and from those I get the location to load. I have to check for the existence of a turtle with the chunky module before loading the chunks and I also should store the ticket in the peripheral's object. The problem is that since CC1.6 getting to this object isn't easy, when I get the tile entity with world.getBlockTileEntity i get an object of class TileTurtleExpanded that isn't in the apis so I use reflection to get the method getAccess and obtain an ITurtleAccess. after doing so I should call getPeripheral, but it always return null (not only for my peripheral, also, for example, for the wireless modem). It only does this here in the callback, inside the update method of the peripheral it works fine. In CC1.58 it worked also in the callback. There are workarounds: using getUpgrade to verify there is the chunky module, loading the chunks and releasing the ticket, at the first update the turtle sees it hasn't a ticket and creates a new one. It works but it shouldn't, the doc of ForgeChunkManager.releaseTicket says releaseTicket should unload the chunks, if it really does it the update method wouldn't be called, so that's not a great solution.
Is there any way to get to the peripheral? and maybe getting to the ITurtleAccess in a better way?
Is there any way to get to the peripheral? and maybe getting to the ITurtleAccess in a better way?