diff options
| author | daoge <3523206925@qq.com> | 2026-03-03 03:04:10 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-03 03:04:10 +0800 |
| commit | b3feddfef372618c8a9d7a0abcaf18cfad866c18 (patch) | |
| tree | 267761c3bb39241ba5c347bfbe2254d06686e287 /Minecraft.World/LiquidTileStatic.cpp | |
| parent | 84c31a2331f7a0ec85b9d438992e244f60e5020f (diff) | |
feat: TU19 (Dec 2014) Features & Content (#155)
* try to resolve merge conflict
* feat: TU19 (Dec 2014) Features & Content (#32)
* December 2014 files
* Working release build
* Fix compilation issues
* Add sound to Windows64Media
* Add DLC content and force Tutorial DLC
* Revert "Add DLC content and force Tutorial DLC"
This reverts commit 97a43994725008e35fceb984d5549df9c8cea470.
* Disable broken light packing
* Disable breakpoint during DLC texture map load
Allows DLC loading but the DLC textures are still broken
* Fix post build not working
* ...
* fix vs2022 build
* fix cmake build
---------
Co-authored-by: Loki <lokirautio@gmail.com>
Diffstat (limited to 'Minecraft.World/LiquidTileStatic.cpp')
| -rw-r--r-- | Minecraft.World/LiquidTileStatic.cpp | 60 |
1 files changed, 29 insertions, 31 deletions
diff --git a/Minecraft.World/LiquidTileStatic.cpp b/Minecraft.World/LiquidTileStatic.cpp index 1d82d3dd..46018093 100644 --- a/Minecraft.World/LiquidTileStatic.cpp +++ b/Minecraft.World/LiquidTileStatic.cpp @@ -5,8 +5,8 @@ LiquidTileStatic::LiquidTileStatic(int id, Material *material) : LiquidTile(id, material) { - setTicking(false); - if (material == Material::lava) setTicking(true); + setTicking(false); + if (material == Material::lava) setTicking(true); } bool LiquidTileStatic::isPathfindable(LevelSource *level, int x, int y, int z) @@ -16,53 +16,50 @@ bool LiquidTileStatic::isPathfindable(LevelSource *level, int x, int y, int z) void LiquidTileStatic::neighborChanged(Level *level, int x, int y, int z, int type) { - LiquidTile::neighborChanged(level, x, y, z, type); - if (level->getTile(x, y, z) == id) + LiquidTile::neighborChanged(level, x, y, z, type); + if (level->getTile(x, y, z) == id) { - setDynamic(level, x, y, z); - } + setDynamic(level, x, y, z); + } } void LiquidTileStatic::setDynamic(Level *level, int x, int y, int z) { - int d = level->getData(x, y, z); - level->noNeighborUpdate = true; - level->setTileAndDataNoUpdate(x, y, z, id - 1, d); - level->setTilesDirty(x, y, z, x, y, z); - level->addToTickNextTick(x, y, z, id - 1, getTickDelay()); - level->noNeighborUpdate = false; + int d = level->getData(x, y, z); + level->setTileAndData(x, y, z, id - 1, d, Tile::UPDATE_CLIENTS); + level->addToTickNextTick(x, y, z, id - 1, getTickDelay(level)); } void LiquidTileStatic::tick(Level *level, int x, int y, int z, Random *random) { - if (material == Material::lava) + if (material == Material::lava) { - int h = random->nextInt(3); - for (int i = 0; i < h; i++) + int h = random->nextInt(3); + for (int i = 0; i < h; i++) { - x += random->nextInt(3) - 1; - y++; - z += random->nextInt(3) - 1; - int t = level->getTile(x, y, z); - if (t == 0) + x += random->nextInt(3) - 1; + y++; + z += random->nextInt(3) - 1; + int t = level->getTile(x, y, z); + if (t == 0) { - if (isFlammable(level, x - 1, y, z) || + if (isFlammable(level, x - 1, y, z) || isFlammable(level, x + 1, y, z) || isFlammable(level, x, y, z - 1) || isFlammable(level, x, y, z + 1) || isFlammable(level, x, y - 1, z) || isFlammable(level, x, y + 1, z)) { - level->setTile(x, y, z, Tile::fire_Id); - return; - } - } + level->setTileAndUpdate(x, y, z, Tile::fire_Id); + return; + } + } else if (Tile::tiles[t]->material->blocksMotion()) { - return; - } + return; + } - } + } if (h == 0) { int ox = x; @@ -71,12 +68,13 @@ void LiquidTileStatic::tick(Level *level, int x, int y, int z, Random *random) { x = ox + random->nextInt(3) - 1; z = oz + random->nextInt(3) - 1; - if (level->isEmptyTile(x, y + 1, z) && isFlammable(level, x, y, z)) { - level->setTile(x, y + 1, z, Tile::fire_Id); + if (level->isEmptyTile(x, y + 1, z) && isFlammable(level, x, y, z)) + { + level->setTileAndUpdate(x, y + 1, z, Tile::fire_Id); } } } - } + } } bool LiquidTileStatic::isFlammable(Level *level, int x, int y, int z) |
