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:
@@ -1,6 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "net.minecraft.world.level.h"
|
||||
#include "net.minecraft.world.entity.item.h"
|
||||
#include "net.minecraft.world.entity.projectile.h"
|
||||
#include "net.minecraft.world.item.h"
|
||||
#include "net.minecraft.world.h"
|
||||
#include "net.minecraft.h"
|
||||
@@ -25,22 +26,19 @@ Icon *TntTile::getTexture(int face, int data)
|
||||
void TntTile::onPlace(Level *level, int x, int y, int z)
|
||||
{
|
||||
Tile::onPlace(level, x, y, z);
|
||||
if (level->hasNeighborSignal(x, y, z) && app.GetGameHostOption(eGameHostOption_TNT))
|
||||
if (level->hasNeighborSignal(x, y, z) && app.GetGameHostOption(eGameHostOption_TNT))
|
||||
{
|
||||
destroy(level, x, y, z, EXPLODE_BIT);
|
||||
level->setTile(x, y, z, 0);
|
||||
}
|
||||
destroy(level, x, y, z, EXPLODE_BIT);
|
||||
level->removeTile(x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
void TntTile::neighborChanged(Level *level, int x, int y, int z, int type)
|
||||
{
|
||||
if (type > 0 && Tile::tiles[type]->isSignalSource())
|
||||
if (level->hasNeighborSignal(x, y, z) && app.GetGameHostOption(eGameHostOption_TNT))
|
||||
{
|
||||
if (level->hasNeighborSignal(x, y, z) && app.GetGameHostOption(eGameHostOption_TNT))
|
||||
{
|
||||
destroy(level, x, y, z, EXPLODE_BIT);
|
||||
level->setTile(x, y, z, 0);
|
||||
}
|
||||
destroy(level, x, y, z, EXPLODE_BIT);
|
||||
level->removeTile(x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +47,7 @@ int TntTile::getResourceCount(Random *random)
|
||||
return 1;
|
||||
}
|
||||
|
||||
void TntTile::wasExploded(Level *level, int x, int y, int z)
|
||||
void TntTile::wasExploded(Level *level, int x, int y, int z, Explosion *explosion)
|
||||
{
|
||||
// 4J - added - don't every create on the client, I think this must be the cause of a bug reported in the java
|
||||
// version where white tnts are created in the network game
|
||||
@@ -59,13 +57,18 @@ void TntTile::wasExploded(Level *level, int x, int y, int z)
|
||||
// 4J-JEV: Fix for #90934 - Customer Encountered: TU11: Content: Gameplay: TNT blocks are triggered by explosions even though "TNT explodes" option is unchecked.
|
||||
if( level->newPrimedTntAllowed() && app.GetGameHostOption(eGameHostOption_TNT) )
|
||||
{
|
||||
shared_ptr<PrimedTnt> primed = shared_ptr<PrimedTnt>( new PrimedTnt(level, x + 0.5f, y + 0.5f, z + 0.5f) );
|
||||
shared_ptr<PrimedTnt> primed = shared_ptr<PrimedTnt>( new PrimedTnt(level, x + 0.5f, y + 0.5f, z + 0.5f, explosion->getSourceMob()) );
|
||||
primed->life = level->random->nextInt(primed->life / 4) + primed->life / 8;
|
||||
level->addEntity(primed);
|
||||
}
|
||||
}
|
||||
|
||||
void TntTile::destroy(Level *level, int x, int y, int z, int data)
|
||||
{
|
||||
destroy(level, x, y, z, data, nullptr);
|
||||
}
|
||||
|
||||
void TntTile::destroy(Level *level, int x, int y, int z, int data, shared_ptr<LivingEntity> source)
|
||||
{
|
||||
if (level->isClientSide) return;
|
||||
|
||||
@@ -74,9 +77,9 @@ void TntTile::destroy(Level *level, int x, int y, int z, int data)
|
||||
// 4J - added condition to have finite limit of these
|
||||
if( level->newPrimedTntAllowed() && app.GetGameHostOption(eGameHostOption_TNT) )
|
||||
{
|
||||
shared_ptr<PrimedTnt> tnt = shared_ptr<PrimedTnt>( new PrimedTnt(level, x + 0.5f, y + 0.5f, z + 0.5f) );
|
||||
shared_ptr<PrimedTnt> tnt = shared_ptr<PrimedTnt>( new PrimedTnt(level, x + 0.5f, y + 0.5f, z + 0.5f, source) );
|
||||
level->addEntity(tnt);
|
||||
level->playSound(tnt, eSoundType_RANDOM_FUSE, 1, 1.0f);
|
||||
level->playEntitySound(tnt, eSoundType_RANDOM_FUSE, 1, 1.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -86,8 +89,9 @@ bool TntTile::use(Level *level, int x, int y, int z, shared_ptr<Player> player,
|
||||
if (soundOnly) return false;
|
||||
if (player->getSelectedItem() != NULL && player->getSelectedItem()->id == Item::flintAndSteel_Id)
|
||||
{
|
||||
destroy(level, x, y, z, EXPLODE_BIT);
|
||||
level->setTile(x, y, z, 0);
|
||||
destroy(level, x, y, z, EXPLODE_BIT, player);
|
||||
level->removeTile(x, y, z);
|
||||
player->getSelectedItem()->hurtAndBreak(1, player);
|
||||
return true;
|
||||
}
|
||||
return Tile::use(level, x, y, z, player, clickedFace, clickX, clickY, clickZ);
|
||||
@@ -97,24 +101,23 @@ void TntTile::entityInside(Level *level, int x, int y, int z, shared_ptr<Entity>
|
||||
{
|
||||
if (entity->GetType() == eTYPE_ARROW && !level->isClientSide)
|
||||
{
|
||||
// 4J Stu - Don't need to cast this
|
||||
//shared_ptr<Arrow> arrow = dynamic_pointer_cast<Arrow>(entity);
|
||||
if (entity->isOnFire())
|
||||
{
|
||||
destroy(level, x, y, z, EXPLODE_BIT);
|
||||
level->setTile(x, y, z, 0);
|
||||
shared_ptr<Arrow> arrow = dynamic_pointer_cast<Arrow>(entity);
|
||||
destroy(level, x, y, z, EXPLODE_BIT, arrow->owner->instanceof(eTYPE_LIVINGENTITY) ? dynamic_pointer_cast<LivingEntity>(arrow->owner) : nullptr);
|
||||
level->removeTile(x, y, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
shared_ptr<ItemInstance> TntTile::getSilkTouchItemInstance(int data)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void TntTile::registerIcons(IconRegister *iconRegister)
|
||||
{
|
||||
icon = iconRegister->registerIcon(L"tnt_side");
|
||||
iconTop = iconRegister->registerIcon(L"tnt_top");
|
||||
iconBottom = iconRegister->registerIcon(L"tnt_bottom");
|
||||
}
|
||||
|
||||
bool TntTile::dropFromExplosion(Explosion *explosion)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
Reference in New Issue
Block a user