homchom / recode

a utility-focused fabric mod to make DiamondFire development more fun
GNU Lesser General Public License v3.0
27 stars 28 forks source link

minor command fixes (/name, /uuid, /node and /dfgive) #14

Closed TRMMax closed 2 years ago

TRMMax commented 2 years ago

fixed uuid command displaying an error message when the player isn't in creative.

Might want to consider not making the isCreative method send an error message when the player is not in creative.

homchom commented 2 years ago

I'm looking at the Command.isCreative() code right now and I don't see why it would cause an error.

What error are you getting with this command?

TRMMax commented 2 years ago

"You must be in creative mode to use this command!" is sent to the players chat with this line of code inside the Command.isCreative() method ChatUtil.sendTranslateMessage("recode.command.require_creative_mode", ChatType.FAIL)

I also either made an oopsie or Command.sendCommand was already broken, because DF just tells me the command is invalid whenever I am in creative.

homchom commented 2 years ago

Oh, I see. You meant a chat error, not an exception.

I think the point of that method is to require creative mode, and print an error otherwise, but return a boolean so commands can use the result. I agree the name should be better; I can change that later.

The real question then, I think, is: why do /uuid and /name even send both a copyable text and a text item? That seems redundant. I will get around to changing this when I add recode macros. But in the meantime can you apply this fix to /name too?

TRMMax commented 2 years ago

Will do, I also found out Command.sendCommand is not supposed to take a "/" in front of the command to execute, so I will also fix that for all usages of it.

TRMMax commented 2 years ago

Hmm, on a side note, /name seems to not work altogether anyway

TRMMax commented 2 years ago

It seems to be an issue with the mojang API, when I go to it it gives this error {"error":"ResourceException","errorMessage":"Gone (410) - The requested resource is no longer available at the server and no forwarding address is known"} Unlike an unknown API request which just says it's not recognised

TRMMax commented 2 years ago

Ah, https://wiki.vg/Mojang_API#UUID_to_Name_History_.28Removed.29 explains it all. Guess the /name command can't function anymore via the mojang API

homchom commented 2 years ago

Can you remove it? I have to go to class.

homchom commented 2 years ago

Actually, sorry, you should be able to revert that and fix it. Use https://wiki.vg/Mojang_API#UUID_to_Profile_and_Skin.2FCape