TheBrokenRail
TheBrokenRail pushed to master at minecraft-pi-reborn/minecraft-pi-reborn 2024-11-04 01:06:13 +00:00
a6dad72778 Fix Sugar Position In Hand
TheBrokenRail commented on pull request minecraft-pi-reborn/minecraft-pi-reborn#116 2024-11-03 10:22:25 +00:00
Port over most of the RaspberryJuice API

There could even be a helper method for mobs where the API name is just an upper-cased friendly name:

static std::pair<std::string, std::string> format_entity_name(const std::string
TheBrokenRail commented on pull request minecraft-pi-reborn/minecraft-pi-reborn#116 2024-11-03 07:34:13 +00:00
Port over most of the RaspberryJuice API

I mentioned this already in the Discord, but this should be changed to std::map<int, std::pair<std::string, std::string>> to accommodate for RJ's entity type names.

TheBrokenRail commented on pull request minecraft-pi-reborn/minecraft-pi-reborn#116 2024-11-03 07:16:08 +00:00
Port over most of the RaspberryJuice API

Also, the fallback for this should just be UNKNOWN since entity type ID has already been sent.

TheBrokenRail commented on pull request minecraft-pi-reborn/minecraft-pi-reborn#116 2024-11-03 06:05:39 +00:00
Port over most of the RaspberryJuice API

It might be easier to do std::vector, for polling just do:

for (const type &event : list) {
    if (id == -1 
TheBrokenRail commented on pull request minecraft-pi-reborn/minecraft-pi-reborn#116 2024-11-03 05:42:57 +00:00
Port over most of the RaspberryJuice API

When compatibility mode is disabled, `

TheBrokenRail pushed to master at minecraft-pi-reborn/minecraft-pi-reborn 2024-11-03 05:41:39 +00:00
9ae6cd17cf Convert API Chat Posts To CP-437
TheBrokenRail commented on pull request minecraft-pi-reborn/minecraft-pi-reborn#116 2024-11-03 05:21:50 +00:00
Port over most of the RaspberryJuice API

When in compat-mode, this should be put though the type ID map.

TheBrokenRail pushed to master at minecraft-pi-reborn/minecraft-pi-reborn 2024-11-03 04:02:23 +00:00
644e9e421b Finally Fix Dumb Method Names
TheBrokenRail commented on pull request minecraft-pi-reborn/minecraft-pi-reborn#116 2024-11-03 03:37:56 +00:00
Port over most of the RaspberryJuice API

Same here, in compat mode it should only return types in the mapping table.

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

This should be char instead of auto.

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

Same as to_cp437, this needs to be freed.

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

Why not just use the float version of from @ 0x27c64?

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

to_cp437 has to be freed, so maybe:

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

cleared or removed would probably be a better name IMO. invalid makes me think the event has bad values.

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

Why not do char lines[4][100] rather than char l1[100], l2[100], l3[100], l4[100]; char *lines[4] = {l1, l2, l3, l4}?

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

If the mapping table doesn't contain the ID, it should probably just fail. Otherwise the behavior is pretty unpredictable.

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

On one hand, all entity names are plain/safe ASCII. But on the other hand, it would be more consistent to Base64-encode them. You decide.

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

Maybe iterating through the tile events should be a helper method like iterate_tile_events(const std::function<void(EventList_TileEvent &)> &callback)?

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

Base64-ing the XYZ data probably isn't necessary, why not move to get_output to ChatEvent::toString and ProjectileEvent::toString. That way they're consistent with other API calls where only text is Base64-ed.