More symbols! Mostly tile entity stuff

This commit is contained in:
Bigjango13 2024-02-12 02:29:35 -05:00 committed by TheBrokenRail
parent 5353bc188d
commit 6ac808919f
17 changed files with 91 additions and 11 deletions

View File

@ -468,7 +468,7 @@ static Entity *PathfinderMob_findAttackTarget_injection(PathfinderMob *mob) {
// Call Original Method // Call Original Method
Entity *target = mob->vtable->findAttackTarget(mob); Entity *target = mob->vtable->findAttackTarget(mob);
// Check if hostile // Only modify the AI of monsters
if (mob->vtable->getCreatureBaseType(mob) != 1) { if (mob->vtable->getCreatureBaseType(mob) != 1) {
return target; return target;
} }

View File

@ -31,7 +31,7 @@ static int32_t sdl_key_to_minecraft_key_injection(int32_t sdl_key) {
// Open Sign Screen // Open Sign Screen
static void LocalPlayer_openTextEdit_injection(LocalPlayer *local_player, TileEntity *sign) { static void LocalPlayer_openTextEdit_injection(LocalPlayer *local_player, TileEntity *sign) {
if (sign->id == 4) { if (sign->type == 4) {
Minecraft *minecraft = local_player->minecraft; Minecraft *minecraft = local_player->minecraft;
TextEditScreen *screen = alloc_TextEditScreen(); TextEditScreen *screen = alloc_TextEditScreen();
ALLOC_CHECK(screen); ALLOC_CHECK(screen);

View File

@ -133,15 +133,19 @@ set(SRC
src/tile/Tile.def src/tile/Tile.def
src/tile/LiquidTile.def src/tile/LiquidTile.def
src/tile/TallGrass.def src/tile/TallGrass.def
src/tile/entity/ChestTileEntity.def
src/tile/entity/TileEntity.def src/tile/entity/TileEntity.def
src/tile/entity/ChestTileEntity.def
src/tile/entity/FurnaceTileEntity.def src/tile/entity/FurnaceTileEntity.def
src/tile/entity/SignTileEntity.def src/tile/entity/SignTileEntity.def
src/tile/entity/TileEntityFactory.def
src/tile/entity/TileEntityRenderer.def
src/tile/entity/TileEntityRenderDispatcher.def
src/tile/StemTile.def src/tile/StemTile.def
src/tile/Tile_SoundType.def src/tile/Tile_SoundType.def
src/tile/TileRenderer.def src/tile/TileRenderer.def
src/tile/GrassTile.def src/tile/GrassTile.def
src/tile/HeavyTile.def src/tile/HeavyTile.def
src/tile/EntityTile.def
src/misc/Strings.def src/misc/Strings.def
src/misc/I18n.def src/misc/I18n.def
src/misc/SimpleFoodData.def src/misc/SimpleFoodData.def
@ -160,6 +164,8 @@ set(SRC
src/misc/Random.def src/misc/Random.def
src/misc/Mth.def src/misc/Mth.def
src/misc/Util.def src/misc/Util.def
src/misc/Tag.def
src/misc/CompoundTag.def
src/input/IMoveInput.def src/input/IMoveInput.def
src/input/IBuildInput.def src/input/IBuildInput.def
src/input/MouseBuildInput.def src/input/MouseBuildInput.def
@ -225,3 +231,5 @@ install(TARGETS symbols DESTINATION "${MCPI_LIB_DIR}")
# SDK # SDK
install(TARGETS symbols EXPORT sdk DESTINATION "${MCPI_SDK_LIB_DIR}") install(TARGETS symbols EXPORT sdk DESTINATION "${MCPI_SDK_LIB_DIR}")
install(DIRECTORY "${INCLUDE_OUTPUT_DIR}/" DESTINATION "${MCPI_SDK_INCLUDE_DIR}/symbols") install(DIRECTORY "${INCLUDE_OUTPUT_DIR}/" DESTINATION "${MCPI_SDK_INCLUDE_DIR}/symbols")
target_compile_options(symbols PUBLIC $<$<COMPILE_LANGUAGE:CXX>:-Wno-invalid-offsetof>)

View File

@ -1 +1,4 @@
virtual-method void render(Entity *entity, float param_2, float param_3, float param_4, float param_5, float param_6) = 0x8; virtual-method void render(Entity *entity, float param_2, float param_3, float param_4, float param_5, float param_6) = 0x8;
// Can be called without an EntityRenderer, just do EntityRenderer_bindTexture(NULL, &file);
method void bindTexture(std::string *file) = 0x62540;

View File

@ -1,3 +1,7 @@
extends AgableMob; extends AgableMob;
vtable 0x10b588; vtable 0x10b588;
// This int seems to be unused, and changing it doesn't effect anything
// I've called it love_timer because it matches where the love timer is on older java
property int love_timer = 0xc00;

View File

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

View File

@ -5,7 +5,11 @@ constructor tile(Tile *item) = 0x998e4;
constructor tile_extra(Tile *item, int count, int auxiliary) = 0x99918; constructor tile_extra(Tile *item, int count, int auxiliary) = 0x99918;
constructor item_extra(Item *item, int count, int auxiliary) = 0x99960; constructor item_extra(Item *item, int count, int auxiliary) = 0x99960;
static-method ItemInstance *fromTag(CompoundTag *tag) = 0x9a124;
method void save(CompoundTag *tag) = 0x9a31c;
method int getMaxStackSize() = 0x99ac8; method int getMaxStackSize() = 0x99ac8;
method bool isNull() = 0x999b0;
property int count = 0x0; property int count = 0x0;
property int id = 0x4; property int id = 0x4;

View File

@ -15,10 +15,13 @@ method void playSound(Entity *entity, std::string *name, float volume, float pit
method int getEntitiesOfType(int type_id, AABB *aabb, std::vector<Entity*> *buff) = 0xa612c; method int getEntitiesOfType(int type_id, AABB *aabb, std::vector<Entity*> *buff) = 0xa612c;
// Searches aabb for entities of base type base_type, adds then to buff, returns the number of entities added // Searches aabb for entities of base type base_type, adds then to buff, returns the number of entities added
method int getEntitiesOfClass(int base_type, AABB *aabb, std::vector<Entity*> *buff) = 0xa6240; method int getEntitiesOfClass(int base_type, AABB *aabb, std::vector<Entity*> *buff) = 0xa6240;
// This will implicitly make the tile entity if the tile at x, y, z doesn't have one and is an EntityTile
method TileEntity *getTileEntity(int x, int y, int z) = 0xa55d4;
virtual-method void tick() = 0x28; virtual-method void tick() = 0x28;
virtual-method void updateSleepingPlayerList() = 0x2c; virtual-method void updateSleepingPlayerList() = 0x2c;
virtual-method ChunkCache *createChunkSource() = 0x30; virtual-method ChunkCache *createChunkSource() = 0x30;
property std::vector<Entity *> entities = 0x20; property std::vector<Entity *> entities = 0x20;
property std::vector<TileEntity *> tileentities = 0x50;
property std::vector<Player *> players = 0x60; property std::vector<Player *> players = 0x60;

View File

@ -0,0 +1,10 @@
extends Tag;
vtable-size 0x34;
size 0x24;
constructor (std::string name) = 0x69740;
method bool getBoolean(std::string *name) = 0xd1b28;
method short getShort(std::string *name) = 0x459c0;
method bool contains(std::string *name, int type) = 0x7d130;
method void put(std::string *name, Tag *tag) = 0x6a040;

1
symbols/src/misc/Tag.def Normal file
View File

@ -0,0 +1 @@
constructor () = 0x684e0;

View File

@ -2,6 +2,7 @@ vtable 0x109ae8;
constructor () = 0x73b20; constructor () = 0x73b20;
virtual-method void sendTo(RakNet_RakNetGUID *guid, Packet *packet) = 0x3c;
virtual-method void send(Packet *packet) = 0x38; virtual-method void send(Packet *packet) = 0x38;
virtual-method uint isServer() = 0x48; virtual-method uint isServer() = 0x48;
virtual-method void pingForHosts(int base_port) = 0x14; virtual-method void pingForHosts(int base_port) = 0x14;

View File

@ -0,0 +1,7 @@
extends Tile;
vtable 0x111348;
vtable-size 0x108;
size 0x5c;
virtual-method TileEntity *newTileEntity() = 0x104;

View File

@ -26,6 +26,7 @@ virtual-method void onRemove(Level *level, int x, int y, int z) = 0x6c;
virtual-method int getRenderLayer() = 0x94; virtual-method int getRenderLayer() = 0x94;
virtual-method int use(Level *level, int x, int y, int z, Player *player) = 0x98; virtual-method int use(Level *level, int x, int y, int z, Player *player) = 0x98;
virtual-method void setPlacedBy(Level *level, int x, int y, int z, Mob *placer) = 0xa8; virtual-method void setPlacedBy(Level *level, int x, int y, int z, Mob *placer) = 0xa8;
virtual-method void handleEntityInside(Level *level, int x, int y, int z, Entity *entity, Vec3 *speed) = 0xb4;
virtual-method int getColor(LevelSource *level_source, int x, int y, int z) = 0xb8; virtual-method int getColor(LevelSource *level_source, int x, int y, int z) = 0xb8;
virtual-method void entityInside(Level *level, int x, int y, int z, Entity *entity) = 0xcc; virtual-method void entityInside(Level *level, int x, int y, int z, Entity *entity) = 0xcc;
virtual-method std::string getDescriptionId() = 0xdc; virtual-method std::string getDescriptionId() = 0xdc;
@ -40,8 +41,10 @@ property int id = 0x8;
property int category = 0x3c; property int category = 0x3c;
property AABB aabb = 0x40; property AABB aabb = 0x40;
// Globals // Globals, all of theses are 256 elements long
static-property-array Tile *tiles = 0x180e08; static-property-array Tile *tiles = 0x180e08;
static-property-array float lightEmission = 0x181214;
static-property-array bool isEntityTile = 0x181f20;
// Tiles // Tiles
static-property Tile *chest = 0x181d60; static-property Tile *chest = 0x181d60;
@ -70,6 +73,3 @@ static-property Tile *grass_carried = 0x181dd4;
// Sounds // Sounds
static-property Tile_SoundType SOUND_STONE = 0x181c80; static-property Tile_SoundType SOUND_STONE = 0x181c80;
// Light
static-property float *lightEmission = 0x181214;

View File

@ -1,5 +1,26 @@
property int id = 0x18; size 0x30;
property int renderer_id = 0x24; vtable-size 0x28;
vtable 0x115d78;
constructor (int type) = 0xd2308;
static-method void setId(int id, std::string *name) = 0xd26fc;
static-method void initTileEntities() = 0xd2834;
virtual-method bool shouldSave() = 0x8;
virtual-method void load(CompoundTag *tag) = 0xc;
virtual-method bool save(CompoundTag *tag) = 0x10;
virtual-method void tick() = 0x14;
property Level *level = 0x4;
property int x = 0x8;
property int y = 0xc;
property int z = 0x10;
property int tile_data = 0x14;
property int type = 0x18;
property int id = 0x1c;
property bool is_client = 0x20; property bool is_client = 0x20;
property int tile = 0xd0; property int renderer_id = 0x24;
property int lifetime = 0xd8; property Tile *tile = 0x28;
property bool pending_removal = 0x2c;
//property int tile = 0xd0;
//property int lifetime = 0xd8;

View File

@ -0,0 +1 @@
static-method TileEntity *createTileEntity(int type) = 0xd226c;

View File

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

View File

@ -0,0 +1,11 @@
size 0x8;
vtable 0x1081c0;
vtable-size 0x14;
constructor () = 0x67620;
virtual-method void render(TileEntity *tileentity, float x, float y, float z, float unknown) = 0x8;
virtual-method void onGraphicsReset() = 0xc;
virtual-method void onNewLevel(Level *level) = 0x10;
property TileEntityRenderDispatcher *tileEntityRenderDispatcher = 0x4;