#include "gamedef.h"
#include "modchannels.h"
#include "content/mods.h"
+#include "database/database-dummy.h"
#include "util/numeric.h"
#include "porting.h"
scene::ISceneManager *getSceneManager() { return m_scenemgr; }
IRollbackManager *getRollbackManager() { return m_rollbackmgr; }
EmergeManager *getEmergeManager() { return m_emergemgr; }
+ ModMetadataDatabase *getModStorageDatabase() { return m_mod_storage_database; }
scene::IAnimatedMesh *getMesh(const std::string &filename) { return NULL; }
bool checkLocalPrivilege(const std::string &priv) { return false; }
return testmodspec;
}
virtual const ModSpec* getModSpec(const std::string &modname) const { return NULL; }
- virtual std::string getModStoragePath() const { return "."; }
virtual bool registerModStorage(ModMetadata *meta) { return true; }
virtual void unregisterModStorage(const std::string &name) {}
bool joinModChannel(const std::string &channel);
scene::ISceneManager *m_scenemgr = nullptr;
IRollbackManager *m_rollbackmgr = nullptr;
EmergeManager *m_emergemgr = nullptr;
+ ModMetadataDatabase *m_mod_storage_database = nullptr;
std::unique_ptr<ModChannelMgr> m_modchannel_mgr;
};
TestGameDef::TestGameDef() :
+ m_mod_storage_database(new Database_Dummy()),
m_modchannel_mgr(new ModChannelMgr())
{
m_itemdef = createItemDefManager();
{
delete m_itemdef;
delete m_nodedef;
+ delete m_mod_storage_database;
}
"{default_water.png";
f = ContentFeatures();
f.name = itemdef.name;
- f.alpha = 128;
+ f.alpha = ALPHAMODE_BLEND;
f.liquid_type = LIQUID_SOURCE;
f.liquid_viscosity = 4;
f.is_ground_content = true;
"{default_lava.png";
f = ContentFeatures();
f.name = itemdef.name;
- f.alpha = 128;
+ f.alpha = ALPHAMODE_OPAQUE;
f.liquid_type = LIQUID_SOURCE;
f.liquid_viscosity = 7;
f.light_source = LIGHT_MAX-1;
MapNode node;
bool position_valid;
- core::list<v3s16> validity_exceptions;
+ std::list<v3s16> validity_exceptions;
TC()
{
{
//return position_valid ^ (p==position_valid_exception);
bool exception = false;
- for(core::list<v3s16>::Iterator i=validity_exceptions.begin();
+ for(std::list<v3s16>::iterator i=validity_exceptions.begin();
i != validity_exceptions.end(); i++)
{
if(p == *i)
parent.node.setContent(CONTENT_AIR);
parent.node.setLight(LIGHTBANK_DAY, LIGHT_SUN);
parent.node.setLight(LIGHTBANK_NIGHT, 0);
- core::map<v3s16, bool> light_sources;
+ std::map<v3s16, bool> light_sources;
// The bottom block is invalid, because we have a shadowing node
UASSERT(b.propagateSunlight(light_sources) == false);
UASSERT(b.getNode(v3s16(1,4,0)).getLight(LIGHTBANK_DAY) == LIGHT_SUN);
parent.position_valid = true;
b.setIsUnderground(true);
parent.node.setLight(LIGHTBANK_DAY, LIGHT_MAX/2);
- core::map<v3s16, bool> light_sources;
+ std::map<v3s16, bool> light_sources;
// The block below should be valid because there shouldn't be
// sunlight in there either
UASSERT(b.propagateSunlight(light_sources, true) == true);
}
// Lighting value for the valid nodes
parent.node.setLight(LIGHTBANK_DAY, LIGHT_MAX/2);
- core::map<v3s16, bool> light_sources;
+ std::map<v3s16, bool> light_sources;
// Bottom block is not valid
UASSERT(b.propagateSunlight(light_sources) == false);
}
// Create one with no heightmaps
ServerMapSector sector(&parent, v2s16(1,1));
- UASSERT(sector.getBlockNoCreateNoEx(0) == 0);
- UASSERT(sector.getBlockNoCreateNoEx(1) == 0);
+ UASSERT(sector.getBlockNoCreateNoEx(0) == nullptr);
+ UASSERT(sector.getBlockNoCreateNoEx(1) == nullptr);
MapBlock * bref = sector.createBlankBlock(-2);
- UASSERT(sector.getBlockNoCreateNoEx(0) == 0);
+ UASSERT(sector.getBlockNoCreateNoEx(0) == nullptr);
UASSERT(sector.getBlockNoCreateNoEx(-2) == bref);
//TODO: Check for AlreadyExistsException