Fix Torch Placement
This commit is contained in:
parent
fd141cc8bb
commit
e04b12e94e
@ -64,6 +64,7 @@
|
||||
* `Implement RaspberryJuice API` (Enabled By Default)
|
||||
* `Fix HUD When Spectating Other Players` (Enabled By Default)
|
||||
* `Fix Crash When Spectated Entity Is Removed` (Enabled By Default)
|
||||
* `Fix Torch Placement` (Enabled)
|
||||
* Existing Functionality (All Enabled By Default)
|
||||
* `Fix Screen Rendering When Hiding HUD`
|
||||
* `Sanitize Usernames`
|
||||
|
@ -131,6 +131,7 @@ CATEGORY Bug Fixes
|
||||
TRUE Fix Fire Immunity
|
||||
TRUE Fix Sunlight Not Properly Setting Mobs On Fire
|
||||
TRUE Fix Transferring Durability When Using Items
|
||||
TRUE Fix Torch Placement
|
||||
CATEGORY Crashes
|
||||
TRUE Fix Crash When Generating Certain Seeds
|
||||
TRUE Close Editor When Sign Is Destroyed
|
||||
|
@ -497,6 +497,15 @@ static int Level_getTopTile_injection(Level_getTopTile_t original, Level *self,
|
||||
}
|
||||
}
|
||||
|
||||
// Fix Torch Placement
|
||||
static bool TileItem_useOn_Level_setTileAndData_injection(Level *self, const int x, const int y, const int z, const int tile, const int data) {
|
||||
const bool ret = self->setTileAndData(x, y, z, tile, data);
|
||||
if (tile == Tile::torch->id) {
|
||||
self->setData(x, y, z, data);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Init
|
||||
void init_misc() {
|
||||
// Sanitize Username
|
||||
@ -673,6 +682,11 @@ void init_misc() {
|
||||
overwrite_calls(Level_getTopTile, Level_getTopTile_injection);
|
||||
}
|
||||
|
||||
// Fix Torch Placement
|
||||
if (feature_has("Fix Torch Placement", server_enabled)) {
|
||||
overwrite_call((void *) 0xcb784, Level_setTileAndData, TileItem_useOn_Level_setTileAndData_injection);
|
||||
}
|
||||
|
||||
// Disable overwrite_calls() After Minecraft::init
|
||||
misc_run_on_init([](__attribute__((unused)) Minecraft *minecraft) {
|
||||
thunk_enabler = [](__attribute__((unused)) void *a, __attribute__((unused)) void *b) -> void * {
|
||||
|
@ -3,12 +3,12 @@ extends LevelSource;
|
||||
vtable 0x10fcf0;
|
||||
|
||||
method void saveLevelData() = 0xa2e94;
|
||||
method void setTile(int x, int y, int z, int id) = 0xa3904;
|
||||
method void setTileNoUpdate(int x, int y, int z, int id) = 0xa342c;
|
||||
method bool setTile(int x, int y, int z, int id) = 0xa3904;
|
||||
method bool setTileNoUpdate(int x, int y, int z, int id) = 0xa342c;
|
||||
method void setData(int x, int y, int z, int data) = 0xa394c;
|
||||
method void setDataNoUpdate(int x, int y, int z, int data) = 0xa3480;
|
||||
method void setTileAndData(int x, int y, int z, int id, int data) = 0xa38b4;
|
||||
method void setTileAndDataNoUpdate(int x, int y, int z, int id, int data) = 0xa33d0;
|
||||
method bool setDataNoUpdate(int x, int y, int z, int data) = 0xa3480;
|
||||
method bool setTileAndData(int x, int y, int z, int id, int data) = 0xa38b4;
|
||||
method bool setTileAndDataNoUpdate(int x, int y, int z, int id, int data) = 0xa33d0;
|
||||
// Calls setTileDirty and updateNearbyTiles
|
||||
method void tileUpdated(int x, int y, int z, int id) = 0xa387c;
|
||||
method void setTileDirty(int x, int y, int z) = 0xa3508;
|
||||
|
@ -98,6 +98,7 @@ static-property Tile *tallgrass = 0x181d0c;
|
||||
static-property Tile *stoneSlab = 0x181b44;
|
||||
static-property Tile *fire = 0x181de0;
|
||||
static-property Tile *sand = 0x181b20;
|
||||
static-property Tile *torch = 0x181d58;
|
||||
|
||||
// "Carried" Tiles
|
||||
static-property Tile *leaves_carried = 0x181dd8;
|
||||
|
Loading…
x
Reference in New Issue
Block a user