Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tputils: Home and Warps #335

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

pseudofractal
Copy link

All actions can be performed with CLI (like the waypoints app). Additionally, GUI for actions like displaying/teleporting to available warps. The GUI should only appear if the carpet version > 1.4.56 (I don't remember testing this, but I hope it works) so no need to bump up required version.

Provides CLI for making/deleteing homes and warps. Provides GUI to show all available homes and warps.
@altrisi altrisi added the new-app About adding a new app label Jul 30, 2022
global_hdata:uuid:name:'pitch' = player~'pitch';
global_hdata:uuid:name:'yaw' = player~'yaw';
global_hdata:uuid:name:'dimension' = player~'dimension';
_saveHData();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as with another pr u've done I think, I think you should do saveData in __on_close() and that's it to avoid re-writing to disk a bunch of times

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yh imma change this

Comment on lines 238 to 240
x= floor(loc:0);
y= floor(loc:1);
z= floor(loc:2);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a completely unrelated point, but this is the same as [x, y, z] = map(loc, floor(_)).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oman my whole scarpet life was a lie. I never knew this was possible xD. Imma change it everywhere asap

pseudofractal and others added 2 commits August 14, 2022 20:14
Co-authored-by: Ghoulboy <[email protected]>
Thanks @Ghoulboy78 for version checking changes and for telling me that `map()` exists
Copy link
Collaborator

@altrisi altrisi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found some bugs. Also I think it'd be nicer if there was a message (maybe to actionbar?) when teleporting, so you know something has happened, though it's not really needed.


info = global_hdata:str(player()~'uuid'):name;
if(info==null,
print(player,format('r \nThe specefied location does not exist. Please use home list to know your current list'));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print(player,format('r \nThe specefied location does not exist. Please use home list to know your current list'));
print(player(),format('r \nThe specefied location does not exist. Please use home list to know your current list'));


_hremove(name) -> (
if(global_hdata:str(player()~'uuid'):name==null,
print(player,format('r \nThe specefied location does not exist. Please use home list to know your current list'));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print(player,format('r \nThe specefied location does not exist. Please use home list to know your current list'));
print(player(),format('r \nThe specefied location does not exist. Please use home list to know your current list'));

Comment on lines +264 to +279
_screenCheck() -> (
sVersion= split('\\+',system_info('scarpet_version')):0; //fetches first part before the +, eg 1.4.57
vNumbers=split('\\.',sVersion);
[main, sub, x] = map(vNumbers,number(_));
if(main>1,
true,
main == 1,
if(sub>4,
true,
sub==4,
x >= 56,
false
),
false
)
);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion for if this is false just don't register the subcommand, else a command that does nothing is weird.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-app About adding a new app
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants