Java Reference
In-Depth Information
if (loc != null) {
} else { "You have not teleported yet." );
(I renamed the command to be “dback” so it would be different from the
existing BackCmd . You're welcome to rename it also, or just use it instead of
the old “back.”)
Now compile and install the whole mess with , and you're good to go.
Test It
Assuming everything worked, you should be able to test it:
Start the server.
Connect from your client.
Teleport to a new place, either by using the /tp command or by throwing
an Ender Pearl. Do this a few times.
Disconnect and shut down the server.
Restart and reconnect.
Now type the /back command in the client. Your history was saved and
reloaded from disk, and you should be able to go back to each teleport
Try This Yourself
You know what we need? A “clearback” command so that we can clear out
our teleport history (Canary already provides a “clear” command, so you need
to call it something other than that).
Go ahead and implement that. It's a new command, so you'll need a new
@Command section and function. In the code, all you need to do is to clear out
the stack for the player and save it back to the database.
Search WWH ::

Custom Search