A few QoL changes and fixes from hodgepodge #113

Manually merged
TheBrokenRail merged 9 commits from bigjango13/minecraft-pi-reborn:master into master 2024-07-17 10:44:31 +00:00
Contributor

This PR has a few minor changes:

  • All items and blocks have names, and some duplicate names were updated
  • The camera legs render correctly, instead of being music discs
  • Zombie pigmen don't burn in the sunlight
  • Grass_carried's bottom texture is no longer the same as the top
  • Crosshairs are hidden in third person

I also changed an int to a bool, which was likely left over from the C to C++ switch.

This PR has a few minor changes: - All items and blocks have names, and some duplicate names were updated - The camera legs render correctly, instead of being music discs - Zombie pigmen don't burn in the sunlight - Grass_carried's bottom texture is no longer the same as the top - Crosshairs are hidden in third person I also changed an int to a bool, which was likely left over from the C to C++ switch.
152 KiB
bigjango13 added 6 commits 2024-06-30 02:21:15 +00:00
TheBrokenRail requested changes 2024-07-05 03:09:46 +00:00
TheBrokenRail left a comment
Owner

Overall, this looks pretty good. It just needs some minor changes.

Overall, this looks pretty good. It just needs some minor changes.
@ -88,1 +90,4 @@
// Hide crosshairs in 3rd person mode
static void Gui_renderProgressIndicator_GuiComponent_blit_injection(GuiComponent *self, int x1, int y1, int x2, int y2, int w1, int h1, int w2, int h2) {
if (!is_third_person) {

Couldn't you use ((Gui *) self)->minecraft->options.third_person? Also GuiComponent_blit(self should be self->blit(.

Couldn't you use `((Gui *) self)->minecraft->options.third_person`? Also `GuiComponent_blit(self` should be `self->blit(`.
bigjango13 marked this conversation as resolved
@ -747,0 +760,4 @@
}
Tile *Tile_init_invBedrock_injection(Tile *t) {
Tile *ret = Tile_init(t);

This should be t->init().

This should be `t->init()`.
bigjango13 marked this conversation as resolved
@ -747,0 +763,4 @@
Tile *ret = Tile_init(t);
// Fix invisible bedrock's name
std::string invBedrock = "invBedrock";
t->vtable->setDescriptionId(t, &invBedrock);

Remove the ->vtable->.

Remove the `->vtable->`.
bigjango13 marked this conversation as resolved
@ -747,0 +767,4 @@
return ret;
}
void copy_with_still(std::string *into, char *from) {

So, uh, what exactly are these functions? What do they do? What are the replacing? That should be a comment and/or in the function name.

So, uh, what exactly are these functions? What do they do? What are the replacing? That should be a comment and/or in the function name.
bigjango13 marked this conversation as resolved
@ -747,0 +780,4 @@
// Fix camera legs
void EntityRenderer_bindTexture_Camera_leg_injection(EntityRenderer *self, __attribute__((unused)) std::string *file) {
std::string camera = "item/camera.png";
EntityRenderer_bindTexture(self, &camera);

I know I'm being a bit of a broken record here, but this should be self->bindTexture.

I know I'm being a bit of a broken record here, but this should be `self->bindTexture`.
bigjango13 marked this conversation as resolved
@ -747,0 +783,4 @@
EntityRenderer_bindTexture(self, &camera);
}
void render_camera_legs() {

This should be in the dedicated camera mod folder and under a feature flag.

This should be in the dedicated camera mod folder and under a feature flag.
bigjango13 marked this conversation as resolved
@ -747,0 +787,4 @@
Tesselator *t = &Tesselator::instance;
constexpr float size = 0.45f;
Tesselator_vertexUV(t, -size, 0.5, -size, 0.75, 0.5);

This should be t->vertexUV.

This should be `t->vertexUV`.
bigjango13 marked this conversation as resolved
@ -747,0 +815,4 @@
}
// Fix grass_carried's bottom texture
static Tile_getTexture2_t CarriedTile_getTexture2 = NULL;

Use overwrite_calls, it bundles the original method for you.

Use `overwrite_calls`, it bundles the original method for you.
Author
Contributor

But I just want to overwrite CarriedTile_getTexture2, not all Tile_getTexture2?

But I just want to overwrite `CarriedTile_getTexture2`, not all `Tile_getTexture2`?

Then just overwrite_calls(CarriedTile_getTexture2. It seems to be a "real" method so it should be overwritable.

Then just `overwrite_calls(CarriedTile_getTexture2`. It seems to be a "real" method so it should be overwritable.
bigjango13 marked this conversation as resolved
@ -995,1 +1072,4 @@
}
// Fix/update lang strings
misc_run_on_language_setup(Language_injection);

The language fixes should be under a Add Missing Language Strings feature flag IMO (enabled by default).

The language fixes should be under a `Add Missing Language Strings` feature flag IMO (enabled by default).
bigjango13 marked this conversation as resolved
@ -996,0 +1087,4 @@
overwrite_call((void *) 0x65a08, (void *) render_camera_legs);
// Fix pigmen from burning in the sun
overwrite_call((void *) 0x89a1c, (void *) Zombie_aiStep_getBrightness_injection);

This should be under a feature flag.

This should be under a feature flag.
bigjango13 marked this conversation as resolved
@ -996,0 +1091,4 @@
// Fix grass_carried's bottom texture
CarriedTile_getTexture2 = *(__raw_Tile_getTexture2_t *) 0x1147c4;
patch_address((void *) 0x1147c4, (void *) CarriedTile_getTexture2_injection);

I'm not sure if this should be under a dedicated feature flag or not. I could be convinced either way.

I'm not sure if this should be under a dedicated feature flag or not. I could be convinced either way.
Author
Contributor

I figure why not, the more the merrier and it doesn't have any major disadvantages.

I figure why not, the more the merrier and it doesn't have any major disadvantages.
bigjango13 marked this conversation as resolved
bigjango13 added 1 commit 2024-07-06 23:53:58 +00:00
bigjango13 added 1 commit 2024-07-07 00:04:46 +00:00
bigjango13 added 1 commit 2024-07-07 00:17:55 +00:00
TheBrokenRail manually merged commit 5f2923b789 into master 2024-07-17 10:44:31 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: minecraft-pi-reborn/minecraft-pi-reborn#113
No description provided.