-
Notifications
You must be signed in to change notification settings - Fork 162
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
base: master
Are you sure you want to change the base?
Conversation
Provides CLI for making/deleteing homes and warps. Provides GUI to show all available homes and warps.
programs/survival/tputils.sc
Outdated
global_hdata:uuid:name:'pitch' = player~'pitch'; | ||
global_hdata:uuid:name:'yaw' = player~'yaw'; | ||
global_hdata:uuid:name:'dimension' = player~'dimension'; | ||
_saveHData(); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yh imma change this
programs/survival/tputils.sc
Outdated
x= floor(loc:0); | ||
y= floor(loc:1); | ||
z= floor(loc:2); |
There was a problem hiding this comment.
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(_))
.
There was a problem hiding this comment.
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
Co-authored-by: Ghoulboy <[email protected]>
Thanks @Ghoulboy78 for version checking changes and for telling me that `map()` exists
There was a problem hiding this 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')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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')); | |
_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 | ||
) | ||
); |
There was a problem hiding this comment.
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.
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.