mirror of
https://github.com/GabsPuNs/Project-Zenith-Main.git
synced 2026-06-04 17:14:42 +00:00
TU24
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
#include "stdafx.h"
|
||||
#include "..\Minecraft.Client\Minecraft.h"
|
||||
#include "net.minecraft.h"
|
||||
#include "net.minecraft.world.entity.monster.h"
|
||||
#include "net.minecraft.world.item.h"
|
||||
@@ -57,20 +56,20 @@ ScatteredFeaturePieces::ScatteredFeaturePiece::ScatteredFeaturePiece(Random *ran
|
||||
}
|
||||
}
|
||||
|
||||
void ScatteredFeaturePieces::ScatteredFeaturePiece::addAdditionalSaveData(DataOutputStream *dos)
|
||||
void ScatteredFeaturePieces::ScatteredFeaturePiece::addAdditonalSaveData(CompoundTag *tag)
|
||||
{
|
||||
dos->writeInt(width);
|
||||
dos->writeInt(height);
|
||||
dos->writeInt(depth);
|
||||
dos->writeInt(heightPosition);
|
||||
tag->putInt(L"Width", width);
|
||||
tag->putInt(L"Height", height);
|
||||
tag->putInt(L"Depth", depth);
|
||||
tag->putInt(L"HPos", heightPosition);
|
||||
}
|
||||
|
||||
void ScatteredFeaturePieces::ScatteredFeaturePiece::readAdditonalSaveData(DataInputStream *dis)
|
||||
void ScatteredFeaturePieces::ScatteredFeaturePiece::readAdditonalSaveData(CompoundTag *tag)
|
||||
{
|
||||
width = dis->readInt();
|
||||
height = dis->readInt();
|
||||
depth = dis->readInt();
|
||||
heightPosition = dis->readInt();
|
||||
width = tag->getInt(L"Width");
|
||||
height = tag->getInt(L"Height");
|
||||
depth = tag->getInt(L"Depth");
|
||||
heightPosition = tag->getInt(L"HPos");
|
||||
}
|
||||
|
||||
bool ScatteredFeaturePieces::ScatteredFeaturePiece::updateAverageGroundHeight(Level *level, BoundingBox *chunkBB, int offset)
|
||||
@@ -103,41 +102,267 @@ bool ScatteredFeaturePieces::ScatteredFeaturePiece::updateAverageGroundHeight(Le
|
||||
return true;
|
||||
}
|
||||
|
||||
WeighedTreasure *ScatteredFeaturePieces::DesertPyramidPiece::treasureItems[ScatteredFeaturePieces::DesertPyramidPiece::TREASURE_ITEMS_COUNT] =
|
||||
{
|
||||
new WeighedTreasure(Item::diamond_Id, 0, 1, 3, 3),
|
||||
new WeighedTreasure(Item::ironIngot_Id, 0, 1, 5, 10),
|
||||
new WeighedTreasure(Item::goldIngot_Id, 0, 2, 7, 15),
|
||||
new WeighedTreasure(Item::emerald_Id, 0, 1, 3, 2),
|
||||
new WeighedTreasure(Item::bone_Id, 0, 4, 6, 20),
|
||||
new WeighedTreasure(Item::rotten_flesh_Id, 0, 3, 7, 16),
|
||||
// very rare for pyramids ...
|
||||
new WeighedTreasure(Item::saddle_Id, 0, 1, 1, 3),
|
||||
new WeighedTreasure(Item::horseArmorMetal_Id, 0, 1, 1, 1),
|
||||
new WeighedTreasure(Item::horseArmorGold_Id, 0, 1, 1, 1),
|
||||
new WeighedTreasure(Item::horseArmorDiamond_Id, 0, 1, 1, 1),
|
||||
// ...
|
||||
};
|
||||
|
||||
ScatteredFeaturePieces::DesertPyramidPiece::DesertPyramidPiece()
|
||||
{
|
||||
objectPlacedFlags.clear();
|
||||
tileOptionRemap.clear();
|
||||
tileOptionRemap.clear();
|
||||
entitySpawnCounts.clear();
|
||||
hasPlacedChest[0] = false;
|
||||
hasPlacedChest[1] = false;
|
||||
hasPlacedChest[2] = false;
|
||||
hasPlacedChest[3] = false;
|
||||
// for reflection
|
||||
}
|
||||
|
||||
ScatteredFeaturePieces::DesertPyramidPiece::DesertPyramidPiece(Random *random, int west, int north) : ScatteredFeaturePiece(random, west, 64, north,
|
||||
Minecraft::GetInstance()->getStructureTable()->getStructurePiece(eMinecraftStructurePiece_DesertPyramidPiece)->width,
|
||||
Minecraft::GetInstance()->getStructureTable()->getStructurePiece(eMinecraftStructurePiece_DesertPyramidPiece)->height,
|
||||
Minecraft::GetInstance()->getStructureTable()->getStructurePiece(eMinecraftStructurePiece_DesertPyramidPiece)->depth)
|
||||
ScatteredFeaturePieces::DesertPyramidPiece::DesertPyramidPiece(Random *random, int west, int north) : ScatteredFeaturePiece(random, west, 64, north, 21, 15, 21)
|
||||
{
|
||||
objectPlacedFlags.clear();
|
||||
tileOptionRemap.clear();
|
||||
tileOptionRemap.clear();
|
||||
entitySpawnCounts.clear();
|
||||
hasPlacedChest[0] = false;
|
||||
hasPlacedChest[1] = false;
|
||||
hasPlacedChest[2] = false;
|
||||
hasPlacedChest[3] = false;
|
||||
}
|
||||
|
||||
void ScatteredFeaturePieces::DesertPyramidPiece::addAdditionalSaveData(DataOutputStream *dos)
|
||||
void ScatteredFeaturePieces::DesertPyramidPiece::addAdditonalSaveData(CompoundTag *tag)
|
||||
{
|
||||
ScatteredFeaturePiece::addAdditionalSaveData(dos);
|
||||
ScatteredFeaturePiece::addAdditonalSaveData(tag);
|
||||
tag->putBoolean(L"hasPlacedChest0", hasPlacedChest[0]);
|
||||
tag->putBoolean(L"hasPlacedChest1", hasPlacedChest[1]);
|
||||
tag->putBoolean(L"hasPlacedChest2", hasPlacedChest[2]);
|
||||
tag->putBoolean(L"hasPlacedChest3", hasPlacedChest[3]);
|
||||
}
|
||||
|
||||
void ScatteredFeaturePieces::DesertPyramidPiece::readAdditonalSaveData(DataInputStream *dis)
|
||||
void ScatteredFeaturePieces::DesertPyramidPiece::readAdditonalSaveData(CompoundTag *tag)
|
||||
{
|
||||
ScatteredFeaturePiece::readAdditonalSaveData(dis);
|
||||
ScatteredFeaturePiece::readAdditonalSaveData(tag);
|
||||
hasPlacedChest[0] = tag->getBoolean(L"hasPlacedChest0");
|
||||
hasPlacedChest[1] = tag->getBoolean(L"hasPlacedChest1");
|
||||
hasPlacedChest[2] = tag->getBoolean(L"hasPlacedChest2");
|
||||
hasPlacedChest[3] = tag->getBoolean(L"hasPlacedChest3");
|
||||
}
|
||||
|
||||
bool ScatteredFeaturePieces::DesertPyramidPiece::postProcess(Level *level, Random *random, BoundingBox *chunkBB)
|
||||
{
|
||||
StructureTable *structureTable = Minecraft::GetInstance()->getStructureTable();
|
||||
StructureTable::StructurePiece *piece = structureTable->getStructurePiece(eMinecraftStructurePiece_DesertPyramidPiece);
|
||||
// pyramid
|
||||
generateBox(level, chunkBB, 0, -4, 0, width - 1, 0, depth - 1, Tile::sandStone_Id, Tile::sandStone_Id, false);
|
||||
for (int pos = 1; pos <= 9; pos++)
|
||||
{
|
||||
generateBox(level, chunkBB, pos, pos, pos, width - 1 - pos, pos, depth - 1 - pos, Tile::sandStone_Id, Tile::sandStone_Id, false);
|
||||
generateBox(level, chunkBB, pos + 1, pos, pos + 1, width - 2 - pos, pos, depth - 2 - pos, 0, 0, false);
|
||||
}
|
||||
for (int x = 0; x < width; x++)
|
||||
{
|
||||
for (int z = 0; z < depth; z++)
|
||||
{
|
||||
fillColumnDown(level, Tile::sandStone_Id, 0, x, -5, z, chunkBB);
|
||||
}
|
||||
}
|
||||
|
||||
generateStructureFromData(level, chunkBB, random, piece, objectPlacedFlags, featureConditions, tileOptionRemap, entitySpawnCounts);
|
||||
int stairsNorth = getOrientationData(Tile::stairs_sandstone_Id, 3);
|
||||
int stairsSouth = getOrientationData(Tile::stairs_sandstone_Id, 2);
|
||||
int stairsEast = getOrientationData(Tile::stairs_sandstone_Id, 0);
|
||||
int stairsWest = getOrientationData(Tile::stairs_sandstone_Id, 1);
|
||||
int baseDecoColor = ~DyePowderItem::ORANGE & 0xf;
|
||||
int blue = ~DyePowderItem::BLUE & 0xf;
|
||||
|
||||
// towers
|
||||
generateBox(level, chunkBB, 0, 0, 0, 4, 9, 4, Tile::sandStone_Id, 0, false);
|
||||
generateBox(level, chunkBB, 1, 10, 1, 3, 10, 3, Tile::sandStone_Id, Tile::sandStone_Id, false);
|
||||
placeBlock(level, Tile::stairs_sandstone_Id, stairsNorth, 2, 10, 0, chunkBB);
|
||||
placeBlock(level, Tile::stairs_sandstone_Id, stairsSouth, 2, 10, 4, chunkBB);
|
||||
placeBlock(level, Tile::stairs_sandstone_Id, stairsEast, 0, 10, 2, chunkBB);
|
||||
placeBlock(level, Tile::stairs_sandstone_Id, stairsWest, 4, 10, 2, chunkBB);
|
||||
generateBox(level, chunkBB, width - 5, 0, 0, width - 1, 9, 4, Tile::sandStone_Id, 0, false);
|
||||
generateBox(level, chunkBB, width - 4, 10, 1, width - 2, 10, 3, Tile::sandStone_Id, Tile::sandStone_Id, false);
|
||||
placeBlock(level, Tile::stairs_sandstone_Id, stairsNorth, width - 3, 10, 0, chunkBB);
|
||||
placeBlock(level, Tile::stairs_sandstone_Id, stairsSouth, width - 3, 10, 4, chunkBB);
|
||||
placeBlock(level, Tile::stairs_sandstone_Id, stairsEast, width - 5, 10, 2, chunkBB);
|
||||
placeBlock(level, Tile::stairs_sandstone_Id, stairsWest, width - 1, 10, 2, chunkBB);
|
||||
|
||||
// entrance
|
||||
generateBox(level, chunkBB, 8, 0, 0, 12, 4, 4, Tile::sandStone_Id, 0, false);
|
||||
generateBox(level, chunkBB, 9, 1, 0, 11, 3, 4, 0, 0, false);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, 9, 1, 1, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, 9, 2, 1, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, 9, 3, 1, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, 10, 3, 1, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, 11, 3, 1, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, 11, 2, 1, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, 11, 1, 1, chunkBB);
|
||||
|
||||
// tower pathways
|
||||
generateBox(level, chunkBB, 4, 1, 1, 8, 3, 3, Tile::sandStone_Id, 0, false);
|
||||
generateBox(level, chunkBB, 4, 1, 2, 8, 2, 2, 0, 0, false);
|
||||
generateBox(level, chunkBB, 12, 1, 1, 16, 3, 3, Tile::sandStone_Id, 0, false);
|
||||
generateBox(level, chunkBB, 12, 1, 2, 16, 2, 2, 0, 0, false);
|
||||
|
||||
// hall floor and pillars
|
||||
generateBox(level, chunkBB, 5, 4, 5, width - 6, 4, depth - 6, Tile::sandStone_Id, Tile::sandStone_Id, false);
|
||||
generateBox(level, chunkBB, 9, 4, 9, 11, 4, 11, 0, 0, false);
|
||||
generateBox(level, chunkBB, 8, 1, 8, 8, 3, 8, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, false);
|
||||
generateBox(level, chunkBB, 12, 1, 8, 12, 3, 8, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, false);
|
||||
generateBox(level, chunkBB, 8, 1, 12, 8, 3, 12, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, false);
|
||||
generateBox(level, chunkBB, 12, 1, 12, 12, 3, 12, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, false);
|
||||
|
||||
// catwalks
|
||||
generateBox(level, chunkBB, 1, 1, 5, 4, 4, 11, Tile::sandStone_Id, Tile::sandStone_Id, false);
|
||||
generateBox(level, chunkBB, width - 5, 1, 5, width - 2, 4, 11, Tile::sandStone_Id, Tile::sandStone_Id, false);
|
||||
generateBox(level, chunkBB, 6, 7, 9, 6, 7, 11, Tile::sandStone_Id, Tile::sandStone_Id, false);
|
||||
generateBox(level, chunkBB, width - 7, 7, 9, width - 7, 7, 11, Tile::sandStone_Id, Tile::sandStone_Id, false);
|
||||
generateBox(level, chunkBB, 5, 5, 9, 5, 7, 11, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, false);
|
||||
generateBox(level, chunkBB, width - 6, 5, 9, width - 6, 7, 11, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, false);
|
||||
placeBlock(level, 0, 0, 5, 5, 10, chunkBB);
|
||||
placeBlock(level, 0, 0, 5, 6, 10, chunkBB);
|
||||
placeBlock(level, 0, 0, 6, 6, 10, chunkBB);
|
||||
placeBlock(level, 0, 0, width - 6, 5, 10, chunkBB);
|
||||
placeBlock(level, 0, 0, width - 6, 6, 10, chunkBB);
|
||||
placeBlock(level, 0, 0, width - 7, 6, 10, chunkBB);
|
||||
|
||||
// tower stairs
|
||||
generateBox(level, chunkBB, 2, 4, 4, 2, 6, 4, 0, 0, false);
|
||||
generateBox(level, chunkBB, width - 3, 4, 4, width - 3, 6, 4, 0, 0, false);
|
||||
placeBlock(level, Tile::stairs_sandstone_Id, stairsNorth, 2, 4, 5, chunkBB);
|
||||
placeBlock(level, Tile::stairs_sandstone_Id, stairsNorth, 2, 3, 4, chunkBB);
|
||||
placeBlock(level, Tile::stairs_sandstone_Id, stairsNorth, width - 3, 4, 5, chunkBB);
|
||||
placeBlock(level, Tile::stairs_sandstone_Id, stairsNorth, width - 3, 3, 4, chunkBB);
|
||||
generateBox(level, chunkBB, 1, 1, 3, 2, 2, 3, Tile::sandStone_Id, Tile::sandStone_Id, false);
|
||||
generateBox(level, chunkBB, width - 3, 1, 3, width - 2, 2, 3, Tile::sandStone_Id, Tile::sandStone_Id, false);
|
||||
placeBlock(level, Tile::stairs_sandstone_Id, 0, 1, 1, 2, chunkBB);
|
||||
placeBlock(level, Tile::stairs_sandstone_Id, 0, width - 2, 1, 2, chunkBB);
|
||||
placeBlock(level, Tile::stoneSlabHalf_Id, StoneSlabTile::SAND_SLAB, 1, 2, 2, chunkBB);
|
||||
placeBlock(level, Tile::stoneSlabHalf_Id, StoneSlabTile::SAND_SLAB, width - 2, 2, 2, chunkBB);
|
||||
placeBlock(level, Tile::stairs_sandstone_Id, stairsWest, 2, 1, 2, chunkBB);
|
||||
placeBlock(level, Tile::stairs_sandstone_Id, stairsEast, width - 3, 1, 2, chunkBB);
|
||||
|
||||
// indoor decoration
|
||||
generateBox(level, chunkBB, 4, 3, 5, 4, 3, 18, Tile::sandStone_Id, Tile::sandStone_Id, false);
|
||||
generateBox(level, chunkBB, width - 5, 3, 5, width - 5, 3, 17, Tile::sandStone_Id, Tile::sandStone_Id, false);
|
||||
generateBox(level, chunkBB, 3, 1, 5, 4, 2, 16, 0, 0, false);
|
||||
generateBox(level, chunkBB, width - 6, 1, 5, width - 5, 2, 16, 0, 0, false);
|
||||
for (int z = 5; z <= 17; z += 2)
|
||||
{
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, 4, 1, z, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_HEIROGLYPHS, 4, 2, z, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, width - 5, 1, z, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_HEIROGLYPHS, width - 5, 2, z, chunkBB);
|
||||
}
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, 10, 0, 7, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, 10, 0, 8, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, 9, 0, 9, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, 11, 0, 9, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, 8, 0, 10, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, 12, 0, 10, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, 7, 0, 10, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, 13, 0, 10, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, 9, 0, 11, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, 11, 0, 11, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, 10, 0, 12, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, 10, 0, 13, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, blue, 10, 0, 10, chunkBB);
|
||||
|
||||
// outdoor decoration
|
||||
for (int x = 0; x <= width - 1; x += width - 1)
|
||||
{
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, x, 2, 1, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, x, 2, 2, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, x, 2, 3, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, x, 3, 1, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, x, 3, 2, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, x, 3, 3, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, x, 4, 1, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_HEIROGLYPHS, x, 4, 2, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, x, 4, 3, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, x, 5, 1, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, x, 5, 2, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, x, 5, 3, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, x, 6, 1, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_HEIROGLYPHS, x, 6, 2, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, x, 6, 3, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, x, 7, 1, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, x, 7, 2, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, x, 7, 3, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, x, 8, 1, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, x, 8, 2, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, x, 8, 3, chunkBB);
|
||||
}
|
||||
for (int x = 2; x <= width - 3; x += width - 3 - 2)
|
||||
{
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, x - 1, 2, 0, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, x, 2, 0, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, x + 1, 2, 0, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, x - 1, 3, 0, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, x, 3, 0, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, x + 1, 3, 0, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, x - 1, 4, 0, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_HEIROGLYPHS, x, 4, 0, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, x + 1, 4, 0, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, x - 1, 5, 0, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, x, 5, 0, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, x + 1, 5, 0, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, x - 1, 6, 0, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_HEIROGLYPHS, x, 6, 0, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, x + 1, 6, 00, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, x - 1, 7, 0, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, x, 7, 0, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, x + 1, 7, 0, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, x - 1, 8, 0, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, x, 8, 0, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, x + 1, 8, 0, chunkBB);
|
||||
}
|
||||
generateBox(level, chunkBB, 8, 4, 0, 12, 6, 0, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, false);
|
||||
placeBlock(level, 0, 0, 8, 6, 0, chunkBB);
|
||||
placeBlock(level, 0, 0, 12, 6, 0, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, 9, 5, 0, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_HEIROGLYPHS, 10, 5, 0, chunkBB);
|
||||
placeBlock(level, Tile::wool_Id, baseDecoColor, 11, 5, 0, chunkBB);
|
||||
|
||||
// tombs
|
||||
generateBox(level, chunkBB, 8, -14, 8, 12, -11, 12, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, false);
|
||||
generateBox(level, chunkBB, 8, -10, 8, 12, -10, 12, Tile::sandStone_Id, SandStoneTile::TYPE_HEIROGLYPHS, Tile::sandStone_Id, SandStoneTile::TYPE_HEIROGLYPHS, false);
|
||||
generateBox(level, chunkBB, 8, -9, 8, 12, -9, 12, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, false);
|
||||
generateBox(level, chunkBB, 8, -8, 8, 12, -1, 12, Tile::sandStone_Id, Tile::sandStone_Id, false);
|
||||
generateBox(level, chunkBB, 9, -11, 9, 11, -1, 11, 0, 0, false);
|
||||
placeBlock(level, Tile::pressurePlate_stone_Id, 0, 10, -11, 10, chunkBB);
|
||||
generateBox(level, chunkBB, 9, -13, 9, 11, -13, 11, Tile::tnt_Id, 0, false);
|
||||
placeBlock(level, 0, 0, 8, -11, 10, chunkBB);
|
||||
placeBlock(level, 0, 0, 8, -10, 10, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_HEIROGLYPHS, 7, -10, 10, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, 7, -11, 10, chunkBB);
|
||||
placeBlock(level, 0, 0, 12, -11, 10, chunkBB);
|
||||
placeBlock(level, 0, 0, 12, -10, 10, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_HEIROGLYPHS, 13, -10, 10, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, 13, -11, 10, chunkBB);
|
||||
placeBlock(level, 0, 0, 10, -11, 8, chunkBB);
|
||||
placeBlock(level, 0, 0, 10, -10, 8, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_HEIROGLYPHS, 10, -10, 7, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, 10, -11, 7, chunkBB);
|
||||
placeBlock(level, 0, 0, 10, -11, 12, chunkBB);
|
||||
placeBlock(level, 0, 0, 10, -10, 12, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_HEIROGLYPHS, 10, -10, 13, chunkBB);
|
||||
placeBlock(level, Tile::sandStone_Id, SandStoneTile::TYPE_SMOOTHSIDE, 10, -11, 13, chunkBB);
|
||||
|
||||
// chests!
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
if (!hasPlacedChest[i])
|
||||
{
|
||||
int xo = Direction::STEP_X[i] * 2;
|
||||
int zo = Direction::STEP_Z[i] * 2;
|
||||
hasPlacedChest[i] = createChest(level, chunkBB, random, 10 + xo, -11, 10 + zo, WeighedTreasure::addToTreasure(WeighedTreasureArray(treasureItems,TREASURE_ITEMS_COUNT), Item::enchantedBook->createForRandomTreasure(random)), 2 + random->nextInt(5));
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -178,22 +403,22 @@ ScatteredFeaturePieces::JunglePyramidPiece::JunglePyramidPiece(Random *random, i
|
||||
placedTrap2 = false;
|
||||
}
|
||||
|
||||
void ScatteredFeaturePieces::JunglePyramidPiece::addAdditionalSaveData(DataOutputStream *dos)
|
||||
void ScatteredFeaturePieces::JunglePyramidPiece::addAdditonalSaveData(CompoundTag *tag)
|
||||
{
|
||||
ScatteredFeaturePiece::addAdditionalSaveData(dos);
|
||||
dos->writeBoolean(placedMainChest);
|
||||
dos->writeBoolean(placedHiddenChest);
|
||||
dos->writeBoolean(placedTrap1);
|
||||
dos->writeBoolean(placedTrap2);
|
||||
ScatteredFeaturePiece::addAdditonalSaveData(tag);
|
||||
tag->putBoolean(L"placedMainChest", placedMainChest);
|
||||
tag->putBoolean(L"placedHiddenChest", placedHiddenChest);
|
||||
tag->putBoolean(L"placedTrap1", placedTrap1);
|
||||
tag->putBoolean(L"placedTrap2", placedTrap2);
|
||||
}
|
||||
|
||||
void ScatteredFeaturePieces::JunglePyramidPiece::readAdditonalSaveData(DataInputStream *dis)
|
||||
void ScatteredFeaturePieces::JunglePyramidPiece::readAdditonalSaveData(CompoundTag *tag)
|
||||
{
|
||||
ScatteredFeaturePiece::readAdditonalSaveData(dis);
|
||||
placedMainChest = dis->readBoolean();
|
||||
placedHiddenChest = dis->readBoolean();
|
||||
placedTrap1 = dis->readBoolean();
|
||||
placedTrap2 = dis->readBoolean();
|
||||
ScatteredFeaturePiece::readAdditonalSaveData(tag);
|
||||
placedMainChest = tag->getBoolean(L"placedMainChest");
|
||||
placedHiddenChest = tag->getBoolean(L"placedHiddenChest");
|
||||
placedTrap1 = tag->getBoolean(L"placedTrap1");
|
||||
placedTrap2 = tag->getBoolean(L"placedTrap2");
|
||||
}
|
||||
|
||||
bool ScatteredFeaturePieces::JunglePyramidPiece::postProcess(Level *level, Random *random, BoundingBox *chunkBB)
|
||||
@@ -341,7 +566,6 @@ bool ScatteredFeaturePieces::JunglePyramidPiece::postProcess(Level *level, Rando
|
||||
placeBlock(level, Tile::mossyCobblestone_Id, 0, 3, -3, 1, chunkBB);
|
||||
if (!placedTrap1)
|
||||
{
|
||||
setDirty();
|
||||
placedTrap1 = createDispenser(level, chunkBB, random, 3, -2, 1, Facing::NORTH, WeighedTreasureArray(dispenserItems,DISPENSER_ITEMS_COUNT), 2);
|
||||
}
|
||||
placeBlock(level, Tile::vine_Id, 0xf, 3, -2, 2, chunkBB);
|
||||
@@ -359,14 +583,12 @@ bool ScatteredFeaturePieces::JunglePyramidPiece::postProcess(Level *level, Rando
|
||||
placeBlock(level, Tile::redStoneDust_Id, 0, 9, -2, 4, chunkBB);
|
||||
if (!placedTrap2)
|
||||
{
|
||||
setDirty();
|
||||
placedTrap2 = createDispenser(level, chunkBB, random, 9, -2, 3, Facing::WEST, WeighedTreasureArray(dispenserItems,DISPENSER_ITEMS_COUNT), 2);
|
||||
}
|
||||
placeBlock(level, Tile::vine_Id, 0xf, 8, -1, 3, chunkBB);
|
||||
placeBlock(level, Tile::vine_Id, 0xf, 8, -2, 3, chunkBB);
|
||||
if (!placedMainChest)
|
||||
{
|
||||
setDirty();
|
||||
placedMainChest = createChest(level, chunkBB, random, 8, -3, 3, WeighedTreasure::addToTreasure(WeighedTreasureArray(treasureItems,TREASURE_ITEMS_COUNT), Item::enchantedBook->createForRandomTreasure(random)), 2 + random->nextInt(5));
|
||||
}
|
||||
placeBlock(level, Tile::mossyCobblestone_Id, 0, 9, -3, 2, chunkBB);
|
||||
@@ -400,7 +622,6 @@ bool ScatteredFeaturePieces::JunglePyramidPiece::postProcess(Level *level, Rando
|
||||
placeBlock(level, Tile::diode_off_Id, getOrientationData(Tile::diode_off_Id, Direction::NORTH), 10, -2, 10, chunkBB);
|
||||
if (!placedHiddenChest)
|
||||
{
|
||||
setDirty();
|
||||
placedHiddenChest = createChest(level, chunkBB, random, 9, -3, 10, WeighedTreasure::addToTreasure(WeighedTreasureArray(treasureItems,TREASURE_ITEMS_COUNT), Item::enchantedBook->createForRandomTreasure(random)), 2 + random->nextInt(5));
|
||||
}
|
||||
|
||||
@@ -432,16 +653,16 @@ ScatteredFeaturePieces::SwamplandHut::SwamplandHut(Random *random, int west, int
|
||||
spawnedWitch = false;
|
||||
}
|
||||
|
||||
void ScatteredFeaturePieces::SwamplandHut::addAdditionalSaveData(DataOutputStream *dos)
|
||||
void ScatteredFeaturePieces::SwamplandHut::addAdditonalSaveData(CompoundTag *tag)
|
||||
{
|
||||
ScatteredFeaturePiece::addAdditionalSaveData(dos);
|
||||
dos->writeBoolean(spawnedWitch);
|
||||
ScatteredFeaturePiece::addAdditonalSaveData(tag);
|
||||
tag->putBoolean(L"Witch", spawnedWitch);
|
||||
}
|
||||
|
||||
void ScatteredFeaturePieces::SwamplandHut::readAdditonalSaveData(DataInputStream *dis)
|
||||
void ScatteredFeaturePieces::SwamplandHut::readAdditonalSaveData(CompoundTag *tag)
|
||||
{
|
||||
ScatteredFeaturePiece::readAdditonalSaveData(dis);
|
||||
spawnedWitch = dis->readBoolean();
|
||||
ScatteredFeaturePiece::readAdditonalSaveData(tag);
|
||||
spawnedWitch = tag->getBoolean(L"Witch");
|
||||
}
|
||||
|
||||
bool ScatteredFeaturePieces::SwamplandHut::postProcess(Level *level, Random *random, BoundingBox *chunkBB)
|
||||
@@ -452,15 +673,15 @@ bool ScatteredFeaturePieces::SwamplandHut::postProcess(Level *level, Random *ran
|
||||
}
|
||||
|
||||
// floor and ceiling
|
||||
generateBox(level, chunkBB, 1, 1, 1, 5, 1, 7, Tile::wood_Id, LogTile::DARK_TRUNK, Tile::wood_Id, LogTile::DARK_TRUNK, false);
|
||||
generateBox(level, chunkBB, 1, 4, 2, 5, 4, 7, Tile::wood_Id, LogTile::DARK_TRUNK, Tile::wood_Id, LogTile::DARK_TRUNK, false);
|
||||
generateBox(level, chunkBB, 2, 1, 0, 4, 1, 0, Tile::wood_Id, LogTile::DARK_TRUNK, Tile::wood_Id, LogTile::DARK_TRUNK, false);
|
||||
generateBox(level, chunkBB, 1, 1, 1, 5, 1, 7, Tile::wood_Id, TreeTile::DARK_TRUNK, Tile::wood_Id, TreeTile::DARK_TRUNK, false);
|
||||
generateBox(level, chunkBB, 1, 4, 2, 5, 4, 7, Tile::wood_Id, TreeTile::DARK_TRUNK, Tile::wood_Id, TreeTile::DARK_TRUNK, false);
|
||||
generateBox(level, chunkBB, 2, 1, 0, 4, 1, 0, Tile::wood_Id, TreeTile::DARK_TRUNK, Tile::wood_Id, TreeTile::DARK_TRUNK, false);
|
||||
|
||||
// walls
|
||||
generateBox(level, chunkBB, 2, 2, 2, 3, 3, 2, Tile::wood_Id, LogTile::DARK_TRUNK, Tile::wood_Id, LogTile::DARK_TRUNK, false);
|
||||
generateBox(level, chunkBB, 1, 2, 3, 1, 3, 6, Tile::wood_Id, LogTile::DARK_TRUNK, Tile::wood_Id, LogTile::DARK_TRUNK, false);
|
||||
generateBox(level, chunkBB, 5, 2, 3, 5, 3, 6, Tile::wood_Id, LogTile::DARK_TRUNK, Tile::wood_Id, LogTile::DARK_TRUNK, false);
|
||||
generateBox(level, chunkBB, 2, 2, 7, 4, 3, 7, Tile::wood_Id, LogTile::DARK_TRUNK, Tile::wood_Id, LogTile::DARK_TRUNK, false);
|
||||
generateBox(level, chunkBB, 2, 2, 2, 3, 3, 2, Tile::wood_Id, TreeTile::DARK_TRUNK, Tile::wood_Id, TreeTile::DARK_TRUNK, false);
|
||||
generateBox(level, chunkBB, 1, 2, 3, 1, 3, 6, Tile::wood_Id, TreeTile::DARK_TRUNK, Tile::wood_Id, TreeTile::DARK_TRUNK, false);
|
||||
generateBox(level, chunkBB, 5, 2, 3, 5, 3, 6, Tile::wood_Id, TreeTile::DARK_TRUNK, Tile::wood_Id, TreeTile::DARK_TRUNK, false);
|
||||
generateBox(level, chunkBB, 2, 2, 7, 4, 3, 7, Tile::wood_Id, TreeTile::DARK_TRUNK, Tile::wood_Id, TreeTile::DARK_TRUNK, false);
|
||||
|
||||
// pillars
|
||||
generateBox(level, chunkBB, 1, 0, 2, 1, 3, 2, Tile::treeTrunk_Id, Tile::treeTrunk_Id, false);
|
||||
@@ -514,7 +735,6 @@ bool ScatteredFeaturePieces::SwamplandHut::postProcess(Level *level, Random *ran
|
||||
|
||||
if (chunkBB->isInside(wx, wy, wz))
|
||||
{
|
||||
setDirty();
|
||||
spawnedWitch = true;
|
||||
|
||||
shared_ptr<Witch> witch = std::make_shared<Witch>(level);
|
||||
|
||||
Reference in New Issue
Block a user