Move ServerLevel To minecraft.h
All checks were successful
minecraft-pi-reborn/pipeline/head This commit looks good

This commit is contained in:
TheBrokenRail 2021-08-24 17:21:38 -04:00
parent 4597e824bb
commit c60fb51fae
2 changed files with 5 additions and 3 deletions

View File

@ -150,6 +150,9 @@ static uint32_t CommandServer_minecraft_property_offset = 0x18; // Minecraft *
#define SERVER_LEVEL_SIZE 0xb80
typedef unsigned char *(*ServerLevel_t)(unsigned char *server_level, unsigned char *storage, unsigned char *name, struct LevelSettings *settings, int param_4, unsigned char *dimension);
static ServerLevel_t ServerLevel = (ServerLevel_t) 0x7692c;
// Packet
typedef void (*Packet_read_t)(unsigned char *packet, unsigned char *bit_stream);

View File

@ -43,12 +43,11 @@ void init_game_mode() {
overwrite_calls((void *) Minecraft_setIsCreativeMode, (void *) Minecraft_setIsCreativeMode_injection);
// Replace CreatorLevel With ServerLevel (This Fixes Beds And Mob Spawning)
unsigned char level_patch[4] = {0x68, 0x7e, 0x01, 0xeb}; // "bl 0x7692c"
patch((void *) 0x16f84, level_patch);
overwrite_call((void *) 0x16f84, (void *) ServerLevel);
// Allocate Correct Size For ServerLevel
uint32_t level_size = SERVER_LEVEL_SIZE;
patch((void *) 0x17004, (unsigned char *) &level_size);
patch_address((void *) 0x17004, (void *) level_size);
// Init C++
_init_game_mode_cpp();