TheBrokenRail
TheBrokenRail commented on pull request minecraft-pi-reborn/minecraft-pi-reborn#116 2024-10-30 08:10:54 +00:00
Port over most of the RaspberryJuice API

It should also be converted from UTF-8 to CP-437.

TheBrokenRail commented on pull request minecraft-pi-reborn/minecraft-pi-reborn#116 2024-10-30 08:10:54 +00:00
Port over most of the RaspberryJuice API

The if (type == 0 could probably be extracted into its own if statement rather than being duplicated. (If you can't tell duplicated code irks me, it's why some of Reborn is so weird and macro/template-filled.)

TheBrokenRail commented on pull request minecraft-pi-reborn/minecraft-pi-reborn#116 2024-10-30 08:10:54 +00:00
Port over most of the RaspberryJuice API

I still need to write an essay after this. (My priorities are messed up.)

TheBrokenRail commented on pull request minecraft-pi-reborn/minecraft-pi-reborn#116 2024-10-30 08:08:12 +00:00
Port over most of the RaspberryJuice API

It should also be converted from UTF-8 to CP-437.

TheBrokenRail commented on pull request minecraft-pi-reborn/minecraft-pi-reborn#116 2024-10-30 07:38:34 +00:00
Port over most of the RaspberryJuice API

Why not just also add entity.get/setAbsPos. It wouldn't break compatibility and could be useful.

TheBrokenRail pushed to master at minecraft-pi-reborn/minecraft-pi-reborn 2024-10-30 04:22:58 +00:00
419ad9c98c Minor Tweaks
TheBrokenRail commented on pull request minecraft-pi-reborn/minecraft-pi-reborn#116 2024-10-30 03:12:40 +00:00
Port over most of the RaspberryJuice API

If you're not converting to Unicode, this function is a bit redundant, just use player->username.

TheBrokenRail pushed to master at minecraft-pi-reborn/minecraft-pi-reborn 2024-10-30 03:10:56 +00:00
a0a566f594 F3 Tweak
TheBrokenRail commented on pull request minecraft-pi-reborn/minecraft-pi-reborn#116 2024-10-30 03:06:54 +00:00
Port over most of the RaspberryJuice API

Something like this (brace for pseudo-code):

if (minecraft->player) {
    std::string player_namespace = "player.";
    if (cmd.starts_with(player_namespace) && cmd != "player.setting")…
TheBrokenRail commented on pull request minecraft-pi-reborn/minecraft-pi-reborn#116 2024-10-30 03:02:14 +00:00
Port over most of the RaspberryJuice API

I mean, the original MCPI API also doesn't do any text. The outside (non-MCPI) world speaks Unicode, it might be easiest to convert outside text to CP-437 after decoding it and vice versa.…

TheBrokenRail commented on pull request minecraft-pi-reborn/minecraft-pi-reborn#116 2024-10-30 03:00:46 +00:00
Port over most of the RaspberryJuice API

In those cases, why not just check the vtable of the entity? Ie. If the type ID is 0, do something like ((void *) entity->vtable) == ((void *) TripodCamera_vtable_base, otherwise use the map.

TheBrokenRail commented on pull request minecraft-pi-reborn/minecraft-pi-reborn#116 2024-10-30 02:58:48 +00:00
Port over most of the RaspberryJuice API

Oh, I'm dumb. I didn't see that f3 directly used misc_get_entity_names(). Though the if (entity->isPlayer()) { type = "Player"; } else { ... } logic should probably be its own function IMO,…

TheBrokenRail commented on pull request minecraft-pi-reborn/minecraft-pi-reborn#116 2024-10-29 10:23:54 +00:00
Port over most of the RaspberryJuice API

If it cannot determine the entity type's name, it should just return an empty string, that way the caller can decide how to handle it. For instance, the F3 code would want to display <type ID> instead of <misc_get_entity_name> (<type ID>). And the API code would just want to show the type ID if it cannot determine the name.

TheBrokenRail commented on pull request minecraft-pi-reborn/minecraft-pi-reborn#116 2024-10-29 10:23:54 +00:00
Port over most of the RaspberryJuice API

I've tried to avoid using auto in Reborn (personal preference).

TheBrokenRail commented on pull request minecraft-pi-reborn/minecraft-pi-reborn#116 2024-10-29 10:23:54 +00:00
Port over most of the RaspberryJuice API

When this is called by the F3 screen, it should probably show Player instead of the username.

TheBrokenRail commented on pull request minecraft-pi-reborn/minecraft-pi-reborn#116 2024-10-29 10:23:54 +00:00
Port over most of the RaspberryJuice API

Aren't unknown entity types already covered by misc_get_entity_name?

TheBrokenRail commented on pull request minecraft-pi-reborn/minecraft-pi-reborn#116 2024-10-29 10:23:54 +00:00
Port over most of the RaspberryJuice API

This function converts the CP437 username to UTF-8. This works fine if the username is being output to the API, but make sure this isn't passed to Font::draw.

TheBrokenRail commented on pull request minecraft-pi-reborn/minecraft-pi-reborn#116 2024-10-29 10:23:54 +00:00
Port over most of the RaspberryJuice API

These new symbols should probably be in their own sub-directory. Maybe src/game/mode/creator? Keep CreatorMode where it is though

TheBrokenRail commented on pull request minecraft-pi-reborn/minecraft-pi-reborn#116 2024-10-29 10:23:54 +00:00
Port over most of the RaspberryJuice API

This (and others) are missing a null-check for the local player.