Get Back to Home

Get Back to Home

125k Downloads

The location setting created by /sethome gets reset and cleared each time a player logs out

SilventheThrid opened this issue ยท 4 comments

commented

(This is an admin from bluelightning32's server)
Running Dungeons, Dragons and Space shuttles 4.6 server with BackToHome-1.0.jar

After setting a home with /sethome and logging out users (myself included) receive the "no home created" error after logging back in and attempting to /back.

Note: This may potentially be not restricted to just our server as other members of the modpack discord have mentioned having the same problem on other servers.

commented

This isn't problem of my mod.
It uses standard forge capabilities system and it is tested many times in other modpacks.

I recommend you to contact author of Dungeons, Dragons and Space shuttles and try to find what mod can cause it.

commented

The data is getting persisted in the player.dat file:

$ cat /home/minecraft/.local/bin/nbtutil
#!/bin/bash
TERM=xterm mono $HOME/nbtexplorer/NBTUtil.exe "$@"
$ nbtutil --path 2e15e144-51b9-4f4b-a495-74dc0765a409.dat/ForgeCaps --json=/dev/stdout | grep home
	"get_back_to_home:home": [ 64, 84, 448, 0 ],

It seems it is not getting loaded on the next login, because it reports "Use /createhome command first" when I run /back after relogging in. Additionally, each time I run /back, debug.log has this log line:

[23:30:03] [Server thread/INFO] [STDOUT]: [com.example.examplemod.HomeController:moveBackHome:53]: 0 0
commented

Looking at the code, it's fairly clear this commit caused it:
e4b323f#diff-5857e52f7886cf96bbd0705144fb14c4

With that commit, the only way to set created=true is to call the /createhome:

    public void setHome(int x, int y, int z, int dim){
        this.x = x;
        this.y = y;
        this.z = z;
        this.dim = dim;
        created = true;
    }

Notably, every time the home location is loaded from disk, created is set to false:

    @Override
    public void readNBT(Capability<HomeInfo> capability, HomeInfo instance, EnumFacing side, NBTBase nbt) {
        instance.setHome(((NBTTagIntArray) nbt).getIntArray());
        instance.setCreated(false);
    }
commented

Okey, my fault.
Didn't check twice before uploading code, when worked about fixing your last problem