|
@@ -27,22 +27,18 @@ BasicBlockType::BasicBlockType(int typeId, int itemTypeId, ModelInfo model)
|
|
|
|
|
|
void BasicBlockType::createSuperBlock(Block* zBlock, Item* zItem) const
|
|
|
{
|
|
|
- if (zItem)
|
|
|
- BlockType::createSuperBlock(zBlock, zItem);
|
|
|
- else
|
|
|
- {
|
|
|
- BasicBlock* block = dynamic_cast<BasicBlock*>(zBlock);
|
|
|
- if (!block)
|
|
|
- throw "DirtBlockType::createSuperBlock was called with a block witch is not an instance of BasicBlock";
|
|
|
- block->transparent = transparent;
|
|
|
- block->passable = passable;
|
|
|
- block->hp = (float)getInitialMaxHP();
|
|
|
- block->maxHP = (float)getInitialMaxHP();
|
|
|
- block->hardness = hardness;
|
|
|
- block->zTool = zTool;
|
|
|
- block->speedModifier = speedModifier;
|
|
|
- block->interactable = interactable;
|
|
|
- }
|
|
|
+ BasicBlock* block = dynamic_cast<BasicBlock*>(zBlock);
|
|
|
+ if (!block)
|
|
|
+ throw "DirtBlockType::createSuperBlock was called with a block witch is not an instance of BasicBlock";
|
|
|
+ block->transparent = transparent;
|
|
|
+ block->passable = passable;
|
|
|
+ block->hp = (float)getInitialMaxHP();
|
|
|
+ block->maxHP = (float)getInitialMaxHP();
|
|
|
+ block->hardness = hardness;
|
|
|
+ block->zTool = zTool;
|
|
|
+ block->speedModifier = speedModifier;
|
|
|
+ block->interactable = interactable;
|
|
|
+ BlockType::createSuperBlock(zBlock, zItem);
|
|
|
}
|
|
|
|
|
|
Block* BasicBlockType::createBlock(Framework::Vec3<int> position) const
|
|
@@ -70,7 +66,7 @@ DirtBlockItemType::DirtBlockItemType()
|
|
|
Item* DirtBlockItemType::createItem() const
|
|
|
{
|
|
|
BasicBlockItem* item = new BasicBlockItem(this, DirtBlockType::INSTANCE, "Dirt");
|
|
|
- initializeItem(item, 0, 0, 100, 100, 1, 0, 1);
|
|
|
+ initializeItem(item, 0, 0, 1, 0, 1);
|
|
|
return item;
|
|
|
}
|
|
|
|
|
@@ -90,7 +86,7 @@ StoneBlockItemType::StoneBlockItemType()
|
|
|
Item* StoneBlockItemType::createItem() const
|
|
|
{
|
|
|
BasicBlockItem* item = new BasicBlockItem(this, StoneBlockType::INSTANCE, "Stone");
|
|
|
- initializeItem(item, 0, 0, 100, 100, 2, 0, 1);
|
|
|
+ initializeItem(item, 0, 0, 2, 0, 1);
|
|
|
return item;
|
|
|
}
|
|
|
|
|
@@ -110,7 +106,7 @@ SandBlockItemType::SandBlockItemType()
|
|
|
Item* SandBlockItemType::createItem() const
|
|
|
{
|
|
|
BasicBlockItem* item = new BasicBlockItem(this, SandBlockType::INSTANCE, "Sand");
|
|
|
- initializeItem(item, 0, 0, 100, 100, 0.5f, 0, 1);
|
|
|
+ initializeItem(item, 0, 0, 0.5f, 0, 1);
|
|
|
return item;
|
|
|
}
|
|
|
|
|
@@ -130,7 +126,7 @@ OakBlockItemType::OakBlockItemType()
|
|
|
Item* OakBlockItemType::createItem() const
|
|
|
{
|
|
|
BasicBlockItem* item = new BasicBlockItem(this, OakBlockType::INSTANCE, "Oak");
|
|
|
- initializeItem(item, 0, 0, 100, 100, 1.5f, 0, 1);
|
|
|
+ initializeItem(item, 0, 0, 1.5f, 0, 1);
|
|
|
return item;
|
|
|
}
|
|
|
|
|
@@ -150,7 +146,7 @@ LeavesBlockItemType::LeavesBlockItemType()
|
|
|
Item* LeavesBlockItemType::createItem() const
|
|
|
{
|
|
|
BasicBlockItem* item = new BasicBlockItem(this, LeavesBlockType::INSTANCE, "Leaves");
|
|
|
- initializeItem(item, 0, 0, 100, 100, 0.1f, 0, 1);
|
|
|
+ initializeItem(item, 0, 0, 0.1f, 0, 1);
|
|
|
return item;
|
|
|
}
|
|
|
|
|
@@ -170,7 +166,7 @@ GravelBlockItemType::GravelBlockItemType()
|
|
|
Item* GravelBlockItemType::createItem() const
|
|
|
{
|
|
|
BasicBlockItem* item = new BasicBlockItem(this, GravelBlockType::INSTANCE, "Gravel");
|
|
|
- initializeItem(item, 0, 0, 100, 100, 0.75f, 0, 1);
|
|
|
+ initializeItem(item, 0, 0, 0.75f, 0, 1);
|
|
|
return item;
|
|
|
}
|
|
|
|
|
@@ -190,7 +186,7 @@ GraniteBlockItemType::GraniteBlockItemType()
|
|
|
Item* GraniteBlockItemType::createItem() const
|
|
|
{
|
|
|
BasicBlockItem* item = new BasicBlockItem(this, GraniteBlockType::INSTANCE, "Granite");
|
|
|
- initializeItem(item, 0, 0, 100, 100, 3.f, 0, 1);
|
|
|
+ initializeItem(item, 0, 0, 3.f, 0, 1);
|
|
|
return item;
|
|
|
}
|
|
|
|
|
@@ -210,7 +206,7 @@ CobbleBlockItemType::CobbleBlockItemType()
|
|
|
Item* CobbleBlockItemType::createItem() const
|
|
|
{
|
|
|
BasicBlockItem* item = new BasicBlockItem(this, CobbleBlockType::INSTANCE, "Cobble");
|
|
|
- initializeItem(item, 0, 0, 100, 100, 1.f, 0, 1);
|
|
|
+ initializeItem(item, 0, 0, 1.f, 0, 1);
|
|
|
return item;
|
|
|
}
|
|
|
|
|
@@ -230,7 +226,7 @@ BirchBlockItemType::BirchBlockItemType()
|
|
|
Item* BirchBlockItemType::createItem() const
|
|
|
{
|
|
|
BasicBlockItem* item = new BasicBlockItem(this, BirchBlockType::INSTANCE, "Birch");
|
|
|
- initializeItem(item, 0, 0, 100, 100, 1.5f, 0, 1);
|
|
|
+ initializeItem(item, 0, 0, 1.5f, 0, 1);
|
|
|
return item;
|
|
|
}
|
|
|
|
|
@@ -250,7 +246,7 @@ BeechBlockItemType::BeechBlockItemType()
|
|
|
Item* BeechBlockItemType::createItem() const
|
|
|
{
|
|
|
BasicBlockItem* item = new BasicBlockItem(this, BeechBlockType::INSTANCE, "Beech");
|
|
|
- initializeItem(item, 0, 0, 100, 100, 1.5f, 0, 1);
|
|
|
+ initializeItem(item, 0, 0, 1.5f, 0, 1);
|
|
|
return item;
|
|
|
}
|
|
|
|
|
@@ -270,7 +266,7 @@ BasaltBlockItemType::BasaltBlockItemType()
|
|
|
Item* BasaltBlockItemType::createItem() const
|
|
|
{
|
|
|
BasicBlockItem* item = new BasicBlockItem(this, BasaltBlockType::INSTANCE, "Basalt");
|
|
|
- initializeItem(item, 0, 0, 100, 100, 2.f, 0, 1);
|
|
|
+ initializeItem(item, 0, 0, 2.f, 0, 1);
|
|
|
return item;
|
|
|
}
|
|
|
|
|
@@ -290,6 +286,6 @@ PineBlockItemType::PineBlockItemType()
|
|
|
Item* PineBlockItemType::createItem() const
|
|
|
{
|
|
|
BasicBlockItem* item = new BasicBlockItem(this, PineBlockType::INSTANCE, "Pine");
|
|
|
- initializeItem(item, 0, 0, 100, 100, 1.4f, 0, 1);
|
|
|
+ initializeItem(item, 0, 0, 1.4f, 0, 1);
|
|
|
return item;
|
|
|
}
|