|
@@ -15,9 +15,9 @@
|
|
|
#include "ItemEntity.h"
|
|
|
#include "Player.h"
|
|
|
// item skills
|
|
|
+#include "Axe.h"
|
|
|
#include "BasicItems.h"
|
|
|
#include "PlayerHand.h"
|
|
|
-#include "Axe.h"
|
|
|
// world updates
|
|
|
#include "AddEntityUpdate.h"
|
|
|
#include "EntityRemovedUpdate.h"
|
|
@@ -43,24 +43,28 @@ void initializeBlockTypes()
|
|
|
"blocks.ltdb/dirt.png",
|
|
|
"blocks.ltdb/lawn.png",
|
|
|
"blocks.ltdb/dirt.png"}),
|
|
|
- "Dirt"))
|
|
|
+ "Dirt",
|
|
|
+ 0xFF3C7C29))
|
|
|
->initializeDefault();
|
|
|
(new BasicBlockType(BlockTypeEnum::STONE,
|
|
|
ItemTypeEnum::STONE,
|
|
|
ModelInfo("cube", "blocks.ltdb/stone.png", 6),
|
|
|
- "Stone"))
|
|
|
+ "Stone",
|
|
|
+ 0xFF8E8E8D))
|
|
|
->setHardness(2.f)
|
|
|
->initializeDefault();
|
|
|
(new BasicBlockType(BlockTypeEnum::SAND,
|
|
|
ItemTypeEnum::SAND,
|
|
|
ModelInfo("cube", "blocks.ltdb/sand.png", 6),
|
|
|
- "Sand"))
|
|
|
+ "Sand",
|
|
|
+ 0xFFAE8558))
|
|
|
->setHardness(0.5f)
|
|
|
->initializeDefault();
|
|
|
(new BasicBlockType(BlockTypeEnum::WOOD_OAK,
|
|
|
ItemTypeEnum::WOOD_OAK,
|
|
|
ModelInfo("cube", "blocks.ltdb/oak.png", 6),
|
|
|
- "Oak Wood"))
|
|
|
+ "Oak Wood",
|
|
|
+ 0xFF7F7A70))
|
|
|
->setHardness(1.5f)
|
|
|
->initializeDefault();
|
|
|
(new BasicBlockType(
|
|
@@ -74,32 +78,37 @@ void initializeBlockTypes()
|
|
|
block->addSpawn({1, 1, 0.015, ItemTypeEnum::SEBLING_WOOD_OAK});
|
|
|
return (Block*)block;
|
|
|
},
|
|
|
- "Oak Wood Leaves"))
|
|
|
+ "Oak Wood Leaves",
|
|
|
+ 0xFF6A7C37))
|
|
|
->setHardness(0.1f)
|
|
|
->initializeDefault();
|
|
|
|
|
|
(new BasicBlockType(BlockTypeEnum::GRAVEL,
|
|
|
ItemTypeEnum::GRAVEL,
|
|
|
ModelInfo("cube", "blocks.ltdb/gravel.png", 6),
|
|
|
- "Gravel"))
|
|
|
+ "Gravel",
|
|
|
+ 0xFF928D8C))
|
|
|
->setHardness(0.75f)
|
|
|
->initializeDefault();
|
|
|
(new BasicBlockType(BlockTypeEnum::STONE_GRANITE,
|
|
|
ItemTypeEnum::STONE_GRANITE,
|
|
|
ModelInfo("cube", "blocks.ltdb/granite.png", 6),
|
|
|
- "Granite Stone"))
|
|
|
+ "Granite Stone",
|
|
|
+ 0xFF3B3A3E))
|
|
|
->setHardness(3.f)
|
|
|
->initializeDefault();
|
|
|
(new BasicBlockType(BlockTypeEnum::STONE_COBBLE,
|
|
|
ItemTypeEnum::STONE_COBBLE,
|
|
|
ModelInfo("cube", "blocks.ltdb/cobble.png", 6),
|
|
|
- "Cobble Stone"))
|
|
|
+ "Cobble Stone",
|
|
|
+ 0xFF7E7875))
|
|
|
->setHardness(1.f)
|
|
|
->initializeDefault();
|
|
|
(new BasicBlockType(BlockTypeEnum::WOOD_BIRCH,
|
|
|
ItemTypeEnum::WOOD_BIRCH,
|
|
|
ModelInfo("cube", "blocks.ltdb/birch.png", 6),
|
|
|
- "Birch Wood"))
|
|
|
+ "Birch Wood",
|
|
|
+ 0xFF99999D))
|
|
|
->setHardness(1.5f)
|
|
|
->initializeDefault();
|
|
|
(new BasicBlockType(
|
|
@@ -113,14 +122,16 @@ void initializeBlockTypes()
|
|
|
block->addSpawn({1, 1, 0.03, ItemTypeEnum::SEBLING_WOOD_BIRCH});
|
|
|
return (Block*)block;
|
|
|
},
|
|
|
- "Birch Wood Leaves"))
|
|
|
+ "Birch Wood Leaves",
|
|
|
+ 0xFF6A7C37))
|
|
|
->setHardness(0.1f)
|
|
|
->initializeDefault();
|
|
|
|
|
|
(new BasicBlockType(BlockTypeEnum::WOOD_BEECH,
|
|
|
ItemTypeEnum::WOOD_BEECH,
|
|
|
ModelInfo("cube", "blocks.ltdb/beech.png", 6),
|
|
|
- "Beech Wood"))
|
|
|
+ "Beech Wood",
|
|
|
+ 0xFF778172))
|
|
|
->setHardness(1.5f)
|
|
|
->initializeDefault();
|
|
|
(new BasicBlockType(
|
|
@@ -134,20 +145,23 @@ void initializeBlockTypes()
|
|
|
block->addSpawn({1, 1, 0.02, ItemTypeEnum::SEBLING_WOOD_BEECH});
|
|
|
return (Block*)block;
|
|
|
},
|
|
|
- "Beech Wood Leaves"))
|
|
|
+ "Beech Wood Leaves",
|
|
|
+ 0xFF6A7C37))
|
|
|
->setHardness(0.1f)
|
|
|
->initializeDefault();
|
|
|
|
|
|
(new BasicBlockType(BlockTypeEnum::STONE_BASALT,
|
|
|
ItemTypeEnum::STONE_BASALT,
|
|
|
ModelInfo("cube", "blocks.ltdb/basalt.png", 6),
|
|
|
- "Basalt Stone"))
|
|
|
+ "Basalt Stone",
|
|
|
+ 0xFF595552))
|
|
|
->setHardness(2.f)
|
|
|
->initializeDefault();
|
|
|
(new BasicBlockType(BlockTypeEnum::WOOD_PINE,
|
|
|
ItemTypeEnum::WOOD_PINE,
|
|
|
ModelInfo("cube", "blocks.ltdb/pine.png", 6),
|
|
|
- "Pine Wood"))
|
|
|
+ "Pine Wood",
|
|
|
+ 0xFF786C72))
|
|
|
->setHardness(1.4f)
|
|
|
->initializeDefault();
|
|
|
(new BasicBlockType(
|
|
@@ -161,7 +175,8 @@ void initializeBlockTypes()
|
|
|
block->addSpawn({1, 1, 0.025, ItemTypeEnum::SEBLING_WOOD_PINE});
|
|
|
return (Block*)block;
|
|
|
},
|
|
|
- "Pine Wood Leaves"))
|
|
|
+ "Pine Wood Leaves",
|
|
|
+ 0xFF6A7C37))
|
|
|
->setHardness(0.1f)
|
|
|
->initializeDefault();
|
|
|
|
|
@@ -178,7 +193,8 @@ void initializeBlockTypes()
|
|
|
ModelInfo("blocks.m3/sebling", "blocks.ltdb/sebling.png", 1),
|
|
|
BlockTypeEnum::WOOD_OAK,
|
|
|
BlockTypeEnum::LEAVES_WOOD_OAK,
|
|
|
- "Oak Wood Sebling"))
|
|
|
+ "Oak Wood Sebling",
|
|
|
+ 0xFD6A7B3A))
|
|
|
->setHardness(0.1f)
|
|
|
->initializeDefault();
|
|
|
(new TreeSeblingBlockType(BlockTypeEnum::SEBLING_WOOD_BIRCH,
|
|
@@ -186,7 +202,8 @@ void initializeBlockTypes()
|
|
|
ModelInfo("blocks.m3/sebling", "blocks.ltdb/sebling.png", 1),
|
|
|
BlockTypeEnum::WOOD_BIRCH,
|
|
|
BlockTypeEnum::LEAVES_WOOD_BIRCH,
|
|
|
- "Birch Wood Sebling"))
|
|
|
+ "Birch Wood Sebling",
|
|
|
+ 0xFD6A7B3A))
|
|
|
->setHardness(0.1f)
|
|
|
->initializeDefault();
|
|
|
(new TreeSeblingBlockType(BlockTypeEnum::SEBLING_WOOD_BEECH,
|
|
@@ -194,7 +211,8 @@ void initializeBlockTypes()
|
|
|
ModelInfo("blocks.m3/sebling", "blocks.ltdb/sebling.png", 1),
|
|
|
BlockTypeEnum::WOOD_BEECH,
|
|
|
BlockTypeEnum::LEAVES_WOOD_BEECH,
|
|
|
- "Beech Wood Sebling"))
|
|
|
+ "Beech Wood Sebling",
|
|
|
+ 0xFD6A7B3A))
|
|
|
->setHardness(0.1f)
|
|
|
->initializeDefault();
|
|
|
(new TreeSeblingBlockType(BlockTypeEnum::SEBLING_WOOD_PINE,
|
|
@@ -202,13 +220,15 @@ void initializeBlockTypes()
|
|
|
ModelInfo("blocks.m3/sebling", "blocks.ltdb/sebling.png", 1),
|
|
|
BlockTypeEnum::WOOD_PINE,
|
|
|
BlockTypeEnum::LEAVES_WOOD_PINE,
|
|
|
- "Pine Wood Sebling"))
|
|
|
+ "Pine Wood Sebling",
|
|
|
+ 0xFD6A7B3A))
|
|
|
->setHardness(0.1f)
|
|
|
->initializeDefault();
|
|
|
(new GrassBlockType(BlockTypeEnum::GRASS,
|
|
|
ItemTypeEnum::GRASS,
|
|
|
ModelInfo("grass", "blocks.ltdb/grass.png", 16).setTransparent(),
|
|
|
- "Grass"))
|
|
|
+ "Grass",
|
|
|
+ 0x5076C011))
|
|
|
->initializeDefault();
|
|
|
(new BasicBlockType(BlockTypeEnum::FARMLAND,
|
|
|
ItemTypeEnum::DIRT,
|
|
@@ -219,7 +239,8 @@ void initializeBlockTypes()
|
|
|
"blocks.ltdb/dirt.png",
|
|
|
"blocks.ltdb/farmland.png",
|
|
|
"blocks.ltdb/dirt.png"}),
|
|
|
- "Farmland"))
|
|
|
+ "Farmland",
|
|
|
+ 0xFF5E3819))
|
|
|
->setTransparent(1)
|
|
|
->setHardness(0.1f)
|
|
|
->initializeDefault();
|
|
@@ -228,7 +249,8 @@ void initializeBlockTypes()
|
|
|
"WheatSeeds",
|
|
|
BlockTypeEnum::WHEAT,
|
|
|
"Growing wheat",
|
|
|
- 18000))
|
|
|
+ 18000,
|
|
|
+ 0x5076C011))
|
|
|
->addGrowthState(0.2f,
|
|
|
ModelInfo("grass", "plants.ltdb/wheatseedsa.png", 16)
|
|
|
.setTransparent())
|
|
@@ -253,11 +275,13 @@ void initializeBlockTypes()
|
|
|
block->addSpawn({0, 4, 1.0, ItemTypeEnum::WHEAT});
|
|
|
return (Block*)block;
|
|
|
},
|
|
|
- "Wheat"))
|
|
|
+ "Wheat",
|
|
|
+ 0x90A8C011))
|
|
|
->initializeDefault();
|
|
|
(new FluidBlockType(BlockTypeEnum::WATER,
|
|
|
- ModelInfo("fluid", "fluids.ltdb/water.png", 6),
|
|
|
- "Water"))
|
|
|
+ ModelInfo("fluid", "fluids.ltdb/water.png", 6),
|
|
|
+ "Water",
|
|
|
+ 0xFF2323BF))
|
|
|
->initializeDefault();
|
|
|
(new BasicBlockType(BlockTypeEnum::CRAFTING_TABLE,
|
|
|
ItemTypeEnum::CRAFTING_TABLE,
|
|
@@ -268,7 +292,8 @@ void initializeBlockTypes()
|
|
|
"blocks.ltdb/woodplanks.png",
|
|
|
"blocks.ltdb/craftingtable.p",
|
|
|
"blocks.ltdb/woodplanks.png"}),
|
|
|
- "Crafting Table"))
|
|
|
+ "Crafting Table",
|
|
|
+ 0xFFC4A783))
|
|
|
->initializeDefault(); // TODO: implement crafting table block type
|
|
|
}
|
|
|
|
|
@@ -534,7 +559,7 @@ void initializeItemTypes()
|
|
|
&& below.getA()->zBlockType()->getId()
|
|
|
== BlockTypeEnum::FARMLAND)
|
|
|
|| (below.isB()
|
|
|
- && below.getB() == BlockTypeEnum::FARMLAND);
|
|
|
+ && below.getB() == BlockTypeEnum::FARMLAND);
|
|
|
}
|
|
|
return (bool)0;
|
|
|
},
|
|
@@ -545,7 +570,7 @@ void initializeItemTypes()
|
|
|
0,
|
|
|
ModelInfo("grass", "plants.ltdb/wheat.png", 16),
|
|
|
[]() {
|
|
|
- Item *item = ItemType::createBasicItem(ItemTypeEnum::WHEAT,
|
|
|
+ Item* item = ItemType::createBasicItem(ItemTypeEnum::WHEAT,
|
|
|
"Wheat",
|
|
|
1.f,
|
|
|
1.f,
|
|
@@ -559,11 +584,13 @@ void initializeItemTypes()
|
|
|
50);
|
|
|
item->setFoodEffect([](Entity* zEntity) {
|
|
|
zEntity->setHunger(zEntity->getHunger() + 0.5f);
|
|
|
- zEntity->setThirst(zEntity->getThirst() + 1.f); // TODO: remove thirst addition when drinkable water exists
|
|
|
+ zEntity->setThirst(
|
|
|
+ zEntity->getThirst() + 1.f); // TODO: remove thirst addition
|
|
|
+ // when drinkable water exists
|
|
|
});
|
|
|
return item;
|
|
|
}));
|
|
|
-
|
|
|
+
|
|
|
(new BasicBlockItemType(ItemTypeEnum::CRAFTING_TABLE,
|
|
|
"Crafting Table",
|
|
|
0,
|