Simple Storage Network

Simple Storage Network

56M Downloads

TileConnectable.onChunkUnload can keep chunks loaded

mezz opened this issue ยท 3 comments

commented

I am helping out a server which says chunks are being loaded all the time even without chunk loaders.

It seems like TileConnectable.onChunkUnload is causing chunks to stay loaded because it is requesting a tile entity from a chunk that is unloading. I think this is contributing to their issue.

commented

Hmmm. yeah for some reason, this tile listens to chunk unload and then calls "refreshNetwork"

This seems counter intuitive i dont know why it would do this. Maybe its meant to remove itself from the network?

Ill look into removing this and then load and unload chunks and see if anything breaks

@Override
  public void onChunkUnload() {
    try {
      if (master != null && world.getTileEntity(master) instanceof TileMaster)
        ((TileMaster) world.getTileEntity(master)).refreshNetwork();
    }
    catch (Exception e) {
      System.out.println("Error on unload");
      e.printStackTrace();
    }
  }
commented

There is now a config option to disable this ๐Ÿ‘ https://minecraft.curseforge.com/projects/simple-storage-network/files/2524875

commented

Hm, if the master block is already unloaded does the network need to be updated when a part of it unloads? Maybe you can just add a check to see if the master block is loaded before trying to grab its tile entity to update the network.