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 97a4399472.

* 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>
This commit is contained in:
daoge
2026-03-03 03:04:10 +08:00
committed by GitHub
parent 84c31a2331
commit b3feddfef3
2069 changed files with 264842 additions and 139522 deletions

View File

@@ -6,7 +6,7 @@
#include "Facing.h"
#include "AABB.h"
PistonMovingPiece::PistonMovingPiece(int id) : EntityTile(id, Material::piston, isSolidRender() )
PistonMovingPiece::PistonMovingPiece(int id) : BaseEntityTile(id, Material::piston, isSolidRender() )
{
setDestroyTime(INDESTRUCTIBLE_DESTROY_TIME);
}
@@ -22,15 +22,15 @@ void PistonMovingPiece::onPlace(Level *level, int x, int y, int z)
void PistonMovingPiece::onRemove(Level *level, int x, int y, int z, int id, int data)
{
shared_ptr<TileEntity> tileEntity = level->getTileEntity(x, y, z);
if (tileEntity != NULL && dynamic_pointer_cast<PistonPieceEntity>(tileEntity) != NULL)
shared_ptr<TileEntity> tileEntity = level->getTileEntity(x, y, z);
if (tileEntity != NULL && dynamic_pointer_cast<PistonPieceEntity>(tileEntity) != NULL)
{
dynamic_pointer_cast<PistonPieceEntity>(tileEntity)->finalTick();
}
dynamic_pointer_cast<PistonPieceEntity>(tileEntity)->finalTick();
}
else
{
EntityTile::onRemove(level, x, y, z, id, data);
}
BaseEntityTile::onRemove(level, x, y, z, id, data);
}
}
bool PistonMovingPiece::mayPlace(Level *level, int x, int y, int z)
@@ -61,14 +61,14 @@ bool PistonMovingPiece::isCubeShaped()
bool PistonMovingPiece::use(Level *level, int x, int y, int z, shared_ptr<Player> player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param
{
if( soundOnly) return false;
// this is a special case in order to help removing invisible, unbreakable, blocks in the world
if (!level->isClientSide && level->getTileEntity(x, y, z) == NULL)
// this is a special case in order to help removing invisible, unbreakable, blocks in the world
if (!level->isClientSide && level->getTileEntity(x, y, z) == NULL)
{
// this block is no longer valid
level->setTile(x, y, z, 0);
return true;
}
return false;
// this block is no longer valid
level->removeTile(x, y, z);
return true;
}
return false;
}
int PistonMovingPiece::getResource(int data, Random *random, int playerBonusLevel)
@@ -78,22 +78,23 @@ int PistonMovingPiece::getResource(int data, Random *random, int playerBonusLeve
void PistonMovingPiece::spawnResources(Level *level, int x, int y, int z, int data, float odds, int playerBonus)
{
if (level->isClientSide) return;
if (level->isClientSide) return;
shared_ptr<PistonPieceEntity> entity = getEntity(level, x, y, z);
if (entity == NULL)
shared_ptr<PistonPieceEntity> entity = getEntity(level, x, y, z);
if (entity == NULL)
{
return;
}
return;
}
Tile::tiles[entity->getId()]->spawnResources(level, x, y, z, entity->getData(), 0);
Tile::tiles[entity->getId()]->spawnResources(level, x, y, z, entity->getData(), 0);
}
void PistonMovingPiece::neighborChanged(Level *level, int x, int y, int z, int type)
{
if (!level->isClientSide && level->getTileEntity(x, y, z) == NULL)
if (!level->isClientSide)
{
}
level->getTileEntity(x, y, z) == NULL;
}
}
shared_ptr<TileEntity> PistonMovingPiece::newMovingPieceEntity(int block, int data, int facing, bool extending, bool isSourcePiston)
@@ -103,64 +104,64 @@ shared_ptr<TileEntity> PistonMovingPiece::newMovingPieceEntity(int block, int da
AABB *PistonMovingPiece::getAABB(Level *level, int x, int y, int z)
{
shared_ptr<PistonPieceEntity> entity = getEntity(level, x, y, z);
if (entity == NULL)
shared_ptr<PistonPieceEntity> entity = getEntity(level, x, y, z);
if (entity == NULL)
{
return NULL;
}
return NULL;
}
// move the aabb depending on the animation
float progress = entity->getProgress(0);
if (entity->isExtending())
// move the aabb depending on the animation
float progress = entity->getProgress(0);
if (entity->isExtending())
{
progress = 1.0f - progress;
}
return getAABB(level, x, y, z, entity->getId(), progress, entity->getFacing());
progress = 1.0f - progress;
}
return getAABB(level, x, y, z, entity->getId(), progress, entity->getFacing());
}
void PistonMovingPiece::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr<TileEntity> forceEntity) // 4J added forceData, forceEntity param
{
shared_ptr<PistonPieceEntity> entity = dynamic_pointer_cast<PistonPieceEntity>(forceEntity);
shared_ptr<PistonPieceEntity> entity = dynamic_pointer_cast<PistonPieceEntity>(forceEntity);
if( entity == NULL ) entity = getEntity(level, x, y, z);
if (entity != NULL)
if (entity != NULL)
{
Tile *tile = Tile::tiles[entity->getId()];
if (tile == NULL || tile == this)
Tile *tile = Tile::tiles[entity->getId()];
if (tile == NULL || tile == this)
{
return;
}
tile->updateShape(level, x, y, z);
return;
}
tile->updateShape(level, x, y, z);
float progress = entity->getProgress(0);
if (entity->isExtending())
float progress = entity->getProgress(0);
if (entity->isExtending())
{
progress = 1.0f - progress;
}
int facing = entity->getFacing();
progress = 1.0f - progress;
}
int facing = entity->getFacing();
ThreadStorage *tls = (ThreadStorage *)TlsGetValue(Tile::tlsIdxShape);
tls->xx0 = tile->getShapeX0() - Facing::STEP_X[facing] * progress;
tls->yy0 = tile->getShapeY0() - Facing::STEP_Y[facing] * progress;
tls->zz0 = tile->getShapeZ0() - Facing::STEP_Z[facing] * progress;
tls->xx1 = tile->getShapeX1() - Facing::STEP_X[facing] * progress;
tls->yy1 = tile->getShapeY1() - Facing::STEP_Y[facing] * progress;
tls->zz1 = tile->getShapeZ1() - Facing::STEP_Z[facing] * progress;
}
tls->xx0 = tile->getShapeX0() - Facing::STEP_X[facing] * progress;
tls->yy0 = tile->getShapeY0() - Facing::STEP_Y[facing] * progress;
tls->zz0 = tile->getShapeZ0() - Facing::STEP_Z[facing] * progress;
tls->xx1 = tile->getShapeX1() - Facing::STEP_X[facing] * progress;
tls->yy1 = tile->getShapeY1() - Facing::STEP_Y[facing] * progress;
tls->zz1 = tile->getShapeZ1() - Facing::STEP_Z[facing] * progress;
}
}
AABB *PistonMovingPiece::getAABB(Level *level, int x, int y, int z, int tile, float progress, int facing)
{
if (tile == 0 || tile == id)
if (tile == 0 || tile == id)
{
return NULL;
}
AABB *aabb = Tile::tiles[tile]->getAABB(level, x, y, z);
return NULL;
}
AABB *aabb = Tile::tiles[tile]->getAABB(level, x, y, z);
if (aabb == NULL)
if (aabb == NULL)
{
return NULL;
}
return NULL;
}
// move the aabb depending on the animation
// move the aabb depending on the animation
if (Facing::STEP_X[facing] < 0)
{
aabb->x0 -= Facing::STEP_X[facing] * progress;
@@ -185,17 +186,17 @@ AABB *PistonMovingPiece::getAABB(Level *level, int x, int y, int z, int tile, fl
{
aabb->z1 -= Facing::STEP_Z[facing] * progress;
}
return aabb;
return aabb;
}
shared_ptr<PistonPieceEntity> PistonMovingPiece::getEntity(LevelSource *level, int x, int y, int z)
{
shared_ptr<TileEntity> tileEntity = level->getTileEntity(x, y, z);
if (tileEntity != NULL && dynamic_pointer_cast<PistonPieceEntity>(tileEntity) != NULL)
shared_ptr<TileEntity> tileEntity = level->getTileEntity(x, y, z);
if (tileEntity != NULL && dynamic_pointer_cast<PistonPieceEntity>(tileEntity) != NULL)
{
return dynamic_pointer_cast<PistonPieceEntity>(tileEntity);
}
return nullptr;
return dynamic_pointer_cast<PistonPieceEntity>(tileEntity);
}
return nullptr;
}
void PistonMovingPiece::registerIcons(IconRegister *iconRegister)