mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
make mycelium and vines fire BlockSpreadEvent
This commit is contained in:
parent
e91e5be732
commit
590e38b803
|
|
@ -524,6 +524,7 @@ set(_MINECRAFT_SERVER_COMMON_ROOT
|
|||
"${CMAKE_CURRENT_SOURCE_DIR}/../Minecraft.World/RedstoneOreTile.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../Minecraft.World/PistonBaseTile.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../Minecraft.World/ReedTile.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../Minecraft.World/VineTile.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../Minecraft.World/SnowTile.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../Minecraft.World/IceTile.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../Minecraft.World/StemTile.cpp"
|
||||
|
|
|
|||
|
|
@ -62,6 +62,9 @@ void MycelTile::tick(Level *level, int x, int y, int z, Random *random)
|
|||
int above = level->getTile(xt, yt + 1, zt);
|
||||
if (level->getTile(xt, yt, zt) == Tile::dirt_Id && level->getRawBrightness(xt, yt + 1, zt) >= MIN_BRIGHTNESS && Tile::lightBlock[above] <= 2)
|
||||
{
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
if (!FourKitBridge::FireBlockSpread(level->dimension->id, xt, yt, zt, x, y, z, id, 0))
|
||||
#endif
|
||||
level->setTileAndUpdate(xt, yt, zt, id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,10 @@
|
|||
#include "net.minecraft.world.item.h"
|
||||
#include "net.minecraft.stats.h"
|
||||
#include "net.minecraft.world.level.biome.h"
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
#include "../Minecraft.Server/FourKitBridge.h"
|
||||
#include "Dimension.h"
|
||||
#endif
|
||||
|
||||
VineTile::VineTile(int id) : Tile(id, Material::replaceable_plant, isSolidRender() )
|
||||
{
|
||||
|
|
@ -246,12 +250,15 @@ testLoop: if(noSideSpread) break;
|
|||
spawnFacings &= ~(1 << d);
|
||||
}
|
||||
}
|
||||
if (spawnFacings > 0)
|
||||
{
|
||||
level->setTileAndData(x, y + 1, z, id, spawnFacings, Tile::UPDATE_CLIENTS);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (spawnFacings > 0)
|
||||
{
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
if (!FourKitBridge::FireBlockSpread(level->dimension->id, x, y + 1, z, x, y, z, id, spawnFacings))
|
||||
#endif
|
||||
level->setTileAndData(x, y + 1, z, id, spawnFacings, Tile::UPDATE_CLIENTS);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (testFacing >= Facing::NORTH && testFacing <= Facing::EAST && (currentFacings & (1 << testDirection)) == 0)
|
||||
{
|
||||
// 4J - Brought side spread check forward from 1.2.3
|
||||
|
|
@ -270,11 +277,17 @@ testLoop: if(noSideSpread) break;
|
|||
if ((currentFacings & (1 << left)) != 0
|
||||
&& isAcceptableNeighbor(level->getTile(x + Direction::STEP_X[testDirection] + Direction::STEP_X[left], y, z + Direction::STEP_Z[testDirection] + Direction::STEP_Z[left])))
|
||||
{
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
if (!FourKitBridge::FireBlockSpread(level->dimension->id, x + Direction::STEP_X[testDirection], y, z + Direction::STEP_Z[testDirection], x, y, z, id, 1 << left))
|
||||
#endif
|
||||
level->setTileAndData(x + Direction::STEP_X[testDirection], y, z + Direction::STEP_Z[testDirection], id, 1 << left, Tile::UPDATE_CLIENTS);
|
||||
}
|
||||
else if ((currentFacings & (1 << right)) != 0
|
||||
&& isAcceptableNeighbor(level->getTile(x + Direction::STEP_X[testDirection] + Direction::STEP_X[right], y, z + Direction::STEP_Z[testDirection] + Direction::STEP_Z[right])))
|
||||
{
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
if (!FourKitBridge::FireBlockSpread(level->dimension->id, x + Direction::STEP_X[testDirection], y, z + Direction::STEP_Z[testDirection], x, y, z, id, 1 << right))
|
||||
#endif
|
||||
level->setTileAndData(x + Direction::STEP_X[testDirection], y, z + Direction::STEP_Z[testDirection], id, 1 << right, Tile::UPDATE_CLIENTS);
|
||||
}
|
||||
// attempt to grow around corners, but only if the
|
||||
|
|
@ -283,6 +296,9 @@ testLoop: if(noSideSpread) break;
|
|||
&& level->isEmptyTile(x + Direction::STEP_X[testDirection] + Direction::STEP_X[left], y, z + Direction::STEP_Z[testDirection] + Direction::STEP_Z[left])
|
||||
&& isAcceptableNeighbor(level->getTile(x + Direction::STEP_X[left], y, z + Direction::STEP_Z[left])))
|
||||
{
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
if (!FourKitBridge::FireBlockSpread(level->dimension->id, x + Direction::STEP_X[testDirection] + Direction::STEP_X[left], y, z + Direction::STEP_Z[testDirection] + Direction::STEP_Z[left], x, y, z, id, 1 << ((testDirection + 2) & 3)))
|
||||
#endif
|
||||
level->setTileAndData(x + Direction::STEP_X[testDirection] + Direction::STEP_X[left], y, z + Direction::STEP_Z[testDirection] + Direction::STEP_Z[left], id,
|
||||
1 << ((testDirection + 2) & 3), Tile::UPDATE_CLIENTS);
|
||||
}
|
||||
|
|
@ -290,12 +306,18 @@ testLoop: if(noSideSpread) break;
|
|||
&& level->isEmptyTile(x + Direction::STEP_X[testDirection] + Direction::STEP_X[right], y, z + Direction::STEP_Z[testDirection] + Direction::STEP_Z[right])
|
||||
&& isAcceptableNeighbor(level->getTile(x + Direction::STEP_X[right], y, z + Direction::STEP_Z[right])))
|
||||
{
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
if (!FourKitBridge::FireBlockSpread(level->dimension->id, x + Direction::STEP_X[testDirection] + Direction::STEP_X[right], y, z + Direction::STEP_Z[testDirection] + Direction::STEP_Z[right], x, y, z, id, 1 << ((testDirection + 2) & 3)))
|
||||
#endif
|
||||
level->setTileAndData(x + Direction::STEP_X[testDirection] + Direction::STEP_X[right], y, z + Direction::STEP_Z[testDirection] + Direction::STEP_Z[right], id,
|
||||
1 << ((testDirection + 2) & 3), Tile::UPDATE_CLIENTS);
|
||||
}
|
||||
// attempt to grow onto the ceiling
|
||||
else if (isAcceptableNeighbor(level->getTile(x + Direction::STEP_X[testDirection], y + 1, z + Direction::STEP_Z[testDirection])))
|
||||
{
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
if (!FourKitBridge::FireBlockSpread(level->dimension->id, x + Direction::STEP_X[testDirection], y, z + Direction::STEP_Z[testDirection], x, y, z, id, 0))
|
||||
#endif
|
||||
level->setTileAndData(x + Direction::STEP_X[testDirection], y, z + Direction::STEP_Z[testDirection], id, 0, Tile::UPDATE_CLIENTS);
|
||||
}
|
||||
|
||||
|
|
@ -317,6 +339,9 @@ testLoop: if(noSideSpread) break;
|
|||
int spawnFacings = level->random->nextInt(16) & currentFacings;
|
||||
if (spawnFacings > 0)
|
||||
{
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
if (!FourKitBridge::FireBlockSpread(level->dimension->id, x, y - 1, z, x, y, z, id, spawnFacings))
|
||||
#endif
|
||||
level->setTileAndData(x, y - 1, z, id, spawnFacings, Tile::UPDATE_CLIENTS);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue