Skip to content

Commit

Permalink
feat: adapt to 1.19.80
Browse files Browse the repository at this point in the history
  • Loading branch information
WillowSauceR authored and WillowSauceR committed Apr 27, 2023
1 parent 7d89319 commit 4e4d976
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,47 @@

TLHOOK(on_initialize_logging, void,
"?initializeLogging@DedicatedServer@@AEAAXXZ",
uintptr_t _this)
uintptr_t this)
{
on_initialize_logging.original(_this);
on_initialize_logging.original(this);
server_logger("MediaPlayer Loaded!", INFO);
}

// 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@4V?$optional@VDimensionDefinitionGroup@@@4@@Z",
struct level* _this, 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)
"??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@44V?$optional@VDimensionDefinitionGroup@@@4@@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, uintptr_t a18)
{
return g_level = level_construct.original(_this, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17);
return g_level = level_construct.original(level, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18);
}

TLHOOK(change_setting_command_setup, void,
"?setup@ChangeSettingCommand@@SAXAEAVCommandRegistry@@@Z",
uintptr_t _this)
uintptr_t this)
{
struct string *cmd_music = std_string_string("mpm");
struct string *cmd_video = std_string_string("mpv");
TLCALL("?registerCommand@CommandRegistry@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEBDW4CommandPermissionLevel@@UCommandFlag@@3@Z",
void (*)(uintptr_t, struct string *, const char *, char, short, short),
_this, cmd_music, "mediaplayer music", 0, 0, 0x80);
this, cmd_music, "mediaplayer music", 0, 0, 0x80);
TLCALL("?registerCommand@CommandRegistry@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEBDW4CommandPermissionLevel@@UCommandFlag@@3@Z",
void (*)(uintptr_t, struct string *, const char *, char, short, short),
_this, cmd_video, "mediaplayer video", 0, 0, 0x80);
this, cmd_video, "mediaplayer video", 0, 0, 0x80);
free(cmd_music);
free(cmd_video);
change_setting_command_setup.original(_this);
change_setting_command_setup.original(this);
}

TLHOOK(on_player_cmd, void,
"?handle@ServerNetworkHandler@@UEAAXAEBVNetworkIdentifier@@AEBVCommandRequestPacket@@@Z",
struct server_network_handler* _this, uintptr_t id, uintptr_t pkt)
struct server_network_handler *this, uintptr_t id, uintptr_t pkt)
{
struct player* player = get_server_player(_this, id, pkt);
struct player *player = get_server_player(this, id, pkt);
const char *cmd = std_string_c_str(REFERENCE(struct string, pkt, 48));
if (player && !process_cmd(player, cmd))
return;

on_player_cmd.original(_this, id, pkt);
on_player_cmd.original(this, id, pkt);
}

TLHOOK(map_item_update, void,
Expand Down

0 comments on commit 4e4d976

Please sign in to comment.