December 2014 files

This commit is contained in:
Loki Rautio
2026-03-01 11:00:23 -06:00
parent b691c43c44
commit 8fd3ac6e37
2049 changed files with 260190 additions and 134787 deletions

View File

@@ -27,31 +27,28 @@ LightningBolt::LightningBolt(Level *level, double x, double y, double z) :
flashes = 1;
// 4J - added clientside check
if( !level->isClientSide )
if( !level->isClientSide && level->getGameRules()->getBoolean(GameRules::RULE_DOFIRETICK)&&level->difficulty >= 2 && level->hasChunksAt( Mth::floor(x), Mth::floor(y), Mth::floor(z), 10))
{
if (level->difficulty >= 2 && level->hasChunksAt( Mth::floor(x), Mth::floor(y), Mth::floor(z), 10))
{
int xt = Mth::floor(x);
int yt = Mth::floor(y);
int zt = Mth::floor(z);
// 4J added - don't go setting tiles if we aren't tracking them for network synchronisation
if( MinecraftServer::getInstance()->getPlayers()->isTrackingTile(xt, yt, zt, level->dimension->id) )
{
int xt = Mth::floor(x);
int yt = Mth::floor(y);
int zt = Mth::floor(z);
// 4J added - don't go setting tiles if we aren't tracking them for network synchronisation
if( MinecraftServer::getInstance()->getPlayers()->isTrackingTile(xt, yt, zt, level->dimension->id) )
{
if (level->getTile(xt, yt, zt) == 0 && Tile::fire->mayPlace(level, xt, yt, zt)) level->setTile(xt, yt, zt, Tile::fire_Id);
}
if (level->getTile(xt, yt, zt) == 0 && Tile::fire->mayPlace(level, xt, yt, zt)) level->setTileAndUpdate(xt, yt, zt, Tile::fire_Id);
}
}
for (int i = 0; i < 4; i++)
for (int i = 0; i < 4; i++)
{
int xt = Mth::floor(x) + random->nextInt(3) - 1;
int yt = Mth::floor(y) + random->nextInt(3) - 1;
int zt = Mth::floor(z) + random->nextInt(3) - 1;
// 4J added - don't go setting tiles if we aren't tracking them for network synchronisation
if( MinecraftServer::getInstance()->getPlayers()->isTrackingTile(xt, yt, zt, level->dimension->id) )
{
int xt = Mth::floor(x) + random->nextInt(3) - 1;
int yt = Mth::floor(y) + random->nextInt(3) - 1;
int zt = Mth::floor(z) + random->nextInt(3) - 1;
// 4J added - don't go setting tiles if we aren't tracking them for network synchronisation
if( MinecraftServer::getInstance()->getPlayers()->isTrackingTile(xt, yt, zt, level->dimension->id) )
{
if (level->getTile(xt, yt, zt) == 0 && Tile::fire->mayPlace(level, xt, yt, zt)) level->setTile(xt, yt, zt, Tile::fire_Id);
}
if (level->getTile(xt, yt, zt) == 0 && Tile::fire->mayPlace(level, xt, yt, zt)) level->setTileAndUpdate(xt, yt, zt, Tile::fire_Id);
}
}
}
@@ -79,21 +76,18 @@ void LightningBolt::tick()
{
flashes--;
life = 1;
// 4J - added clientside check
if( !level->isClientSide )
{
seed = random->nextLong();
if (level->hasChunksAt( (int) floor(x), (int) floor(y), (int) floor(z), 10))
{
int xt = (int) floor(x);
int yt = (int) floor(y);
int zt = (int) floor(z);
// 4J added - don't go setting tiles if we aren't tracking them for network synchronisation
if( MinecraftServer::getInstance()->getPlayers()->isTrackingTile(xt, yt, zt, level->dimension->id) )
{
if (level->getTile(xt, yt, zt) == 0 && Tile::fire->mayPlace(level, xt, yt, zt)) level->setTile(xt, yt, zt, Tile::fire_Id);
}
seed = random->nextLong();
if (!level->isClientSide && level->getGameRules()->getBoolean(GameRules::RULE_DOFIRETICK) && level->hasChunksAt( (int) floor(x), (int) floor(y), (int) floor(z), 10))
{
int xt = (int) floor(x);
int yt = (int) floor(y);
int zt = (int) floor(z);
// 4J added - don't go setting tiles if we aren't tracking them for network synchronisation
if( MinecraftServer::getInstance()->getPlayers()->isTrackingTile(xt, yt, zt, level->dimension->id) )
{
if (level->getTile(xt, yt, zt) == 0 && Tile::fire->mayPlace(level, xt, yt, zt)) level->setTileAndUpdate(xt, yt, zt, Tile::fire_Id);
}
}
}
@@ -101,10 +95,13 @@ void LightningBolt::tick()
if (life >= 0)
{
double r = 3;
// 4J - added clientside check
if( !level->isClientSide )
if (level->isClientSide)
{
level->skyFlashTime = 2;
}
else
{
double r = 3;
vector<shared_ptr<Entity> > *entities = level->getEntities(shared_from_this(), AABB::newTemp(x - r, y - r, z - r, x + r, y + 6 + r, z + r));
AUTO_VAR(itEnd, entities->end());
for (AUTO_VAR(it, entities->begin()); it != itEnd; it++)
@@ -113,8 +110,6 @@ void LightningBolt::tick()
e->thunderHit(this);
}
}
level->lightningBoltTime = 2;
}
}