Minor Tweaks

This commit is contained in:
TheBrokenRail 2024-02-15 23:02:44 -05:00
parent f8bd6d380b
commit 9556d13791
12 changed files with 20 additions and 12 deletions

@ -1 +1 @@
Subproject commit 8bca4b7ec6aa28ef6fbc894d1f358468bcc4b321
Subproject commit 225eb259fe00348044b7b9008a810204004701df

View File

@ -60,3 +60,4 @@ FALSE Food Overlay
TRUE Add Splashes
TRUE Display Date In Select World Screen
TRUE Optimized Chunk Sorting
TRUE Disable Buggy Held Item Caching

View File

@ -834,10 +834,14 @@ void init_misc() {
overwrite_calls((void *) Player_stopUsingItem, (void *) Player_stopUsingItem_injection);
// Fix invalid ItemInHandRenderer texture cache
uchar cmp_r7_patch[] = {0x07, 0x00, 0x57, 0xe1}; // "cmp r7,r7"
patch((void *) 0x4b938, cmp_r7_patch);
uchar moveq_r3_true_patch[] = {0x01, 0x30, 0xa0, 0x03}; // "moveq r3,#0x1"
patch((void *) 0x4b93c, moveq_r3_true_patch);
if (feature_has("Disable Buggy Held Item Caching", server_disabled)) {
// This works by forcing MCPI to always use the branch that enables using the
// cache, but then patches that as well to do the opposite
uchar ensure_equal_patch[] = {0x07, 0x00, 0x57, 0xe1}; // "cmp r7, r7"
patch((void *) 0x4b938, ensure_equal_patch);
uchar set_true_patch[] = {0x01, 0x30, 0xa0, 0x03}; // "moveq r3, #0x1"
patch((void *) 0x4b93c, set_true_patch);
}
// Init C++ And Logging
_init_misc_cpp();

View File

@ -232,5 +232,3 @@ install(TARGETS symbols DESTINATION "${MCPI_LIB_DIR}")
# SDK
install(TARGETS symbols EXPORT sdk DESTINATION "${MCPI_SDK_LIB_DIR}")
install(DIRECTORY "${INCLUDE_OUTPUT_DIR}/" DESTINATION "${MCPI_SDK_INCLUDE_DIR}/symbols")
target_compile_options(symbols PUBLIC $<$<COMPILE_LANGUAGE:CXX>:-Wno-invalid-offsetof>)

View File

@ -32,6 +32,7 @@ property float pitch = 0x44;
property float old_yaw = 0x48;
property float old_pitch = 0x4c;
property AABB hitbox = 0x50;
property float height_offset = 0x68;
property int fire_timer = 0xa0;
property int renderer_id = 0xa8;
property bool on_ground = 0xb2;

View File

@ -1,3 +1,5 @@
constructor () = 0x6096c;
method void assign(uchar entity_id, EntityRenderer *renderer) = 0x6094c;
method void render(Entity *entity, float x, float y, float z, float rot, float unknown) = 0x60674;
static-method EntityRenderDispatcher *getInstance() = 0x60e90;

View File

@ -2,3 +2,6 @@ virtual-method void render(Entity *entity, float param_2, float param_3, float p
// Can be called without an EntityRenderer, just do EntityRenderer_bindTexture(NULL, &file);
method void bindTexture(std::string *file) = 0x62540;
// Globals
static-property EntityRenderDispatcher *entityRenderDispatcher = 0x137bc0;

View File

@ -5,5 +5,3 @@ property Minecraft *mc = 0x18;
method void renderItem(Mob *mob, ItemInstance *item) = 0x4b824;
method void render(float param_1) = 0x4bfcc;
static-property ItemInHandRenderer **instance = 0x137bc0;

View File

@ -2,3 +2,5 @@ virtual-method void startOpen() = 0x24;
virtual-method void stopOpen() = 0x28;
virtual-method ItemInstance *getItem(int slot) = 0x8;
virtual-method void setItem(int slot, ItemInstance *item_instance) = 0xc;
virtual-method int getContainerSize() = 0x18;
virtual-method std::vector<ItemInstance> getSlotCopies() = 0x2c;

View File

@ -5,5 +5,6 @@ method void selectSlot(int slot) = 0x8d13c;
method ItemInstance *getSelected() = 0x8d134;
// It's just FillingContainer_linkSlot with selectedSlot as linked_slot
method bool moveToSelectedSlot(int unlinked_slot, bool push_aside) = 0x8d148;
method void setupDefault() = 0x8d164;
property int selectedSlot = 0x28;

View File

@ -22,5 +22,3 @@ property bool is_client = 0x20;
property int renderer_id = 0x24;
property Tile *tile = 0x28;
property bool pending_removal = 0x2c;
//property int tile = 0xd0;
//property int lifetime = 0xd8;

View File

@ -1,4 +1,4 @@
constructor () = 0x66f18;
property Level *level = 0x4;
property std::map<int, TileEntityRenderer*> renderer_map = 0x24;
property std::map<int, TileEntityRenderer *> renderer_map = 0x24;