Skip to content

Commit

Permalink
feat: adapt to 1.20.13
Browse files Browse the repository at this point in the history
  • Loading branch information
WillowSauceR authored and WillowSauceR committed Jul 28, 2023
1 parent 664c8d0 commit 9b59eb4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 14 deletions.
2 changes: 1 addition & 1 deletion include/mediaplayer/mc/actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ struct vec3 *actor_get_pos(struct actor *actor);
float calc_attack_damage(struct actor *attacker, struct actor *casualty);
const char *get_name_tag(struct actor *actor);
unsigned get_entity_type_id(struct actor *actor);
uintptr_t get_unique_id(struct actor *actor);
uintptr_t get_or_create_unique_id(struct actor *actor);
4 changes: 2 additions & 2 deletions src/mc/actor.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ unsigned get_entity_type_id(struct actor *actor)
actor);
}

uintptr_t get_unique_id(struct actor *actor)
uintptr_t get_or_create_unique_id(struct actor *actor)
{
return TLCALL("?getUniqueID@Actor@@QEBAAEBUActorUniqueID@@XZ",
return TLCALL("?getOrCreateUniqueID@Actor@@QEBAAEBUActorUniqueID@@XZ",
uintptr_t (*)(struct actor *actor),
actor);
}
2 changes: 1 addition & 1 deletion src/mc/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void send_boss_event_packet(struct player *player, const char *name,
float per, enum boss_bar_event_type type)
{
uintptr_t pkt = create_packet(74);
uintptr_t unique_id = DEREFERENCE(uintptr_t, get_unique_id((struct actor *)player), 0);
uintptr_t unique_id = DEREFERENCE(uintptr_t, get_or_create_unique_id((struct actor *)player), 0);
struct string *name_cpp_str = std_string_string(name);
DEREFERENCE(uintptr_t, pkt, 56) = unique_id;
DEREFERENCE(int, pkt, 72) = type;
Expand Down
11 changes: 1 addition & 10 deletions src/plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,7 @@ TLHOOK(on_initialize_logging, void,

// Constructor for Level
TLHOOK(level_construct, struct level *,
"??0Level@@QEAA@AEBV?$not_null@V?$NonOwnerPointer@VSoundPlayerInterface@@@Bedrock@@@"
"gsl@@V?$unique_ptr@VLevelStorage@@U?$default_delete@VLevelStorage@@@std@@@std@@"
"V?$unique_ptr@VLevelLooseFileStorage@@U?$default_delete@VLevelLooseFileStorage@@@"
"std@@@4@AEAVIMinecraftEventing@@_NW4SubClientId@@AEAVScheduler@@V?$not_null@"
"V?$NonOwnerPointer@VStructureManager@@@Bedrock@@@2@AEAVResourcePackManager@@"
"AEBV?$not_null@V?$NonOwnerPointer@VIEntityRegistryOwner@@@Bedrock@@@2@V?$WeakRefT@"
"UEntityRefTraits@@@@V?$unique_ptr@VBlockComponentFactory@@U?$default_delete@"
"VBlockComponentFactory@@@std@@@4@V?$unique_ptr@VBlockDefinitionGroup@@"
"U?$default_delete@VBlockDefinitionGroup@@@std@@@4@VItemRegistryRef@@V?$weak_ptr@"
"VBlockTypeRegistry@@@4@44AEBUNetworkPermissions@@V?$optional@VDimensionDefinitionGroup@@@4@@Z",
"??0Level@@QEAA@AEBV?$not_null@V?$NonOwnerPointer@VSoundPlayerInterface@@@Bedrock@@@gsl@@V?$OwnerPtrT@U?$SharePtrRefTraits@VLevelStorage@@@@@@AEAVIMinecraftEventing@@_NW4SubClientId@@AEAVScheduler@@V?$not_null@V?$NonOwnerPointer@VStructureManager@@@Bedrock@@@2@AEAVResourcePackManager@@AEBV?$not_null@V?$NonOwnerPointer@VIEntityRegistryOwner@@@Bedrock@@@2@V?$WeakRefT@UEntityRefTraits@@@@V?$unique_ptr@VBlockComponentFactory@@U?$default_delete@VBlockComponentFactory@@@std@@@std@@V?$unique_ptr@VBlockDefinitionGroup@@U?$default_delete@VBlockDefinitionGroup@@@std@@@std@@VItemRegistryRef@@V?$weak_ptr@VBlockTypeRegistry@@@std@@33AEBUNetworkPermissions@@V?$optional@VDimensionDefinitionGroup@@@std@@@Z",
struct level *level, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5,
uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9, uintptr_t a10, uintptr_t a11,
uintptr_t a12, uintptr_t a13, uintptr_t a14, uintptr_t a15, uintptr_t a16, uintptr_t a17,
Expand Down

0 comments on commit 9b59eb4

Please sign in to comment.