mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-12 20:23:51 +00:00
add missing block.getData() (oops) and use string localization
This commit is contained in:
parent
0d1e0177e5
commit
54d4ad1ce0
6 changed files with 162 additions and 52 deletions
|
|
@ -112,7 +112,7 @@ typedef int(__stdcall *fn_fire_player_move)(int entityId,
|
|||
double toX, double toY, double toZ,
|
||||
double *outCoords);
|
||||
typedef void(__stdcall *fn_set_native_callbacks)(void *damage, void *setHealth, void *teleport, void *setGameMode, void *broadcastMessage, void *setFallDistance, void *getPlayerSnapshot, void *sendMessage, void *setWalkSpeed, void *teleportEntity);
|
||||
typedef void(__stdcall *fn_set_world_callbacks)(void *getTileId, void *setTile, void *setTileData, void *breakBlock, void *getHighestBlockY, void *getWorldInfo, void *setWorldTime, void *setWeather, void *createExplosion, void *strikeLightning, void *setSpawnLocation, void *dropItem);
|
||||
typedef void(__stdcall *fn_set_world_callbacks)(void *getTileId, void *getTileData, void *setTile, void *setTileData, void *breakBlock, void *getHighestBlockY, void *getWorldInfo, void *setWorldTime, void *setWeather, void *createExplosion, void *strikeLightning, void *setSpawnLocation, void *dropItem);
|
||||
typedef void(__stdcall *fn_update_entity_id)(int oldEntityId, int newEntityId);
|
||||
typedef int(__stdcall *fn_fire_player_chat)(int entityId, const char *msgUtf8, int msgByteLen, char *outBuf, int outBufSize, int *outLen);
|
||||
typedef int(__stdcall *fn_fire_block_place)(int entityId, int dimId,
|
||||
|
|
@ -448,6 +448,16 @@ static void __cdecl NativeSetTile(int dimId, int x, int y, int z, int tileId, in
|
|||
level->setTileAndData(x, y, z, tileId, data, Tile::UPDATE_ALL);
|
||||
}
|
||||
|
||||
static int __cdecl NativeGetTileData(int dimId, int x, int y, int z)
|
||||
{
|
||||
ServerLevel *level = GetLevel(dimId);
|
||||
if (!level)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return level->getData(x, y, z);
|
||||
}
|
||||
|
||||
static void __cdecl NativeSetTileData(int dimId, int x, int y, int z, int data)
|
||||
{
|
||||
ServerLevel *level = GetLevel(dimId);
|
||||
|
|
@ -1318,6 +1328,7 @@ void Initialize()
|
|||
|
||||
s_managedSetWorldCallbacks(
|
||||
(void *)&NativeGetTileId,
|
||||
(void *)&NativeGetTileData,
|
||||
(void *)&NativeSetTile,
|
||||
(void *)&NativeSetTileData,
|
||||
(void *)&NativeBreakBlock,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue