I'm trying to create a simple chunk loader to load just the chunk the block is located in. I read about Forge's ticket system, however I'm not sure I understand it. This is what I have so far:
public class TileLoader extends TileEntity {
private ForgeChunkManager.Ticket ticket;
@Override
public void validate() {
super.validate();
if (!worldObj.isRemote && ticket == null) {
ticket = ForgeChunkManager.requestTicket(LoaderTest.instance, this.worldObj, ForgeChunkManager.Type.NORMAL);
ForgeChunkManager.forceChunk(ticket, new ChunkCoordIntPair(this.xCoord / 16, this.yCoord / 16));
}
}
@Override
public void invalidate() {
super.invalidate();
ForgeChunkManager.releaseTicket(ticket);
}
}
With this code, many more tickets are created than needed and it doesn't seem to even load the chunk it is.
What have I done wrong?