Railcraft

Railcraft

34M Downloads

Personal Anchor keeping chunks loaded when owner is offline [1.7.10]

draknyte1 opened this issue ยท 7 comments

commented
    public void updateEntity() {
        if (Game.isHost(worldObj) && hasActiveTicket()) {
            if (PlayerPlugin.isPlayerConnected(getOwner()))
                ticksSincePlayerLogged = 0;
            else
                ticksSincePlayerLogged++;
            if (ticksSincePlayerLogged > RailcraftConstants.TICKS_PER_MIN * MINUTES_BEFORE_DISABLE)
                releaseTicket();
        }
        super.updateEntity();
    }

I see no reason why after the initial 5-15 minute period after the owner logs off, that this should keep chunks loaded. However during play on a server the past few days, we have noticed whole areas stay loaded several hours after the owner has left. Personal Anchors were chosen to prevent this, but.. they haven't worked.

Any suggestions or ideas?

Thanks.

commented

You probably have a poorly coded mod that interacts with unloaded chunks. This can cause what is called chunk thrashing, also known as a Hopper Chunkloader. This behavior is very costly because it is constantly unloading and reloading chunks.

The Anchor does nothing to forcefully remove the chunks it was loading, it just removes the marker that said to keep them loaded.

commented

It's a large base consisting of tile entities from quite a few mods, as We're playing the Beyond Reality mod pack.

Any known culprits which exhibit this behaviour?

commented

Sadly I can't help much there. It would probably be good if the personal anchor tried to unload the chunks forcefully, but I know other mods who tried to do that caused all kinds of problems.

commented

I've never messed with chunk (un)loading but I assume there's a way to see what mods or possibly tile entities are doing it?

Might look into writing up a quick debug mod if so~

commented

Well if you are fine with core mods you could probably hook the code that loads chunks and print the stack traces.

commented

No, but it's always a good refresher for the little I did learn.
Is it worth hooking the forge methods or just go with those from vanilla?

Going to be a heap of garbage logging to sift through and re-tune the logger for.

commented

You'd want to hook whatever method results in a chunk being loaded from the disk probably. I'm not really sure where that is. Possibly in ChunkProvider.