mirror of
https://github.com/neoStudiosLCE/neoLegacy.git
synced 2026-08-20 09:57:09 +00:00
Roofed Forest
This commit is contained in:
parent
364c2039a5
commit
1822ffd3b0
|
|
@ -83,7 +83,7 @@ void Biome::staticCtor()
|
||||||
Biome::jungleHills = (new JungleBiome(22))->setColor(0x2c4205)->setName(L"JungleHills")->setLeafColor(0x537b09)->setTemperatureAndDownfall(1.2f, 0.9f)->setDepthAndScale(1.8f, 0.5f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_JungleHills, eMinecraftColour_Foliage_JungleHills, eMinecraftColour_Water_JungleHills,eMinecraftColour_Sky_JungleHills);
|
Biome::jungleHills = (new JungleBiome(22))->setColor(0x2c4205)->setName(L"JungleHills")->setLeafColor(0x537b09)->setTemperatureAndDownfall(1.2f, 0.9f)->setDepthAndScale(1.8f, 0.5f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_JungleHills, eMinecraftColour_Foliage_JungleHills, eMinecraftColour_Water_JungleHills,eMinecraftColour_Sky_JungleHills);
|
||||||
|
|
||||||
Biome::savanna = (new SavannaBiome(35))->setColor(0xbda235)->setName(L"Savanna")->setNoRain()->setTemperatureAndDownfall(1.2f, 0.0f) ->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_Savanna, eMinecraftColour_Foliage_Savanna, eMinecraftColour_Sky_Desert, eMinecraftColour_Sky_Desert);
|
Biome::savanna = (new SavannaBiome(35))->setColor(0xbda235)->setName(L"Savanna")->setNoRain()->setTemperatureAndDownfall(1.2f, 0.0f) ->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_Savanna, eMinecraftColour_Foliage_Savanna, eMinecraftColour_Sky_Desert, eMinecraftColour_Sky_Desert);
|
||||||
Biome::roofedForest = (new Biome(29))->setName(L"Roofed Forest")->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_RoofedForest, eMinecraftColour_Foliage_RoofedForest, eMinecraftColour_Water_Forest, eMinecraftColour_Sky_Forest);
|
Biome::roofedForest = (new RoofedForestBiome(29))->setName(L"RoofedForest")->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_RoofedForest, eMinecraftColour_Foliage_RoofedForest, eMinecraftColour_Water_Forest, eMinecraftColour_Sky_Forest);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ class BiomeDecorator
|
||||||
friend class BeachBiome;
|
friend class BeachBiome;
|
||||||
friend class SavannaBiome;
|
friend class SavannaBiome;
|
||||||
friend class JungleBiome;
|
friend class JungleBiome;
|
||||||
|
friend class RoofedForestBiome;
|
||||||
protected:
|
protected:
|
||||||
Level *level;
|
Level *level;
|
||||||
Random *random;
|
Random *random;
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ BiomeInitLayer::BiomeInitLayer(int64_t seed, shared_ptr<Layer>parent, LevelType
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
startBiomes = BiomeArray(8);
|
startBiomes = BiomeArray(9);
|
||||||
startBiomes[0] = Biome::desert;
|
startBiomes[0] = Biome::desert;
|
||||||
startBiomes[1] = Biome::forest;
|
startBiomes[1] = Biome::forest;
|
||||||
startBiomes[2] = Biome::extremeHills;
|
startBiomes[2] = Biome::extremeHills;
|
||||||
|
|
@ -30,6 +30,7 @@ BiomeInitLayer::BiomeInitLayer(int64_t seed, shared_ptr<Layer>parent, LevelType
|
||||||
startBiomes[5] = Biome::taiga;
|
startBiomes[5] = Biome::taiga;
|
||||||
startBiomes[6] = Biome::jungle;
|
startBiomes[6] = Biome::jungle;
|
||||||
startBiomes[7] = Biome::savanna;
|
startBiomes[7] = Biome::savanna;
|
||||||
|
startBiomes[8] = Biome::roofedForest;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ void BiomeSource::_init()
|
||||||
playerSpawnBiomes.push_back(Biome::jungle);
|
playerSpawnBiomes.push_back(Biome::jungle);
|
||||||
playerSpawnBiomes.push_back(Biome::jungleHills);
|
playerSpawnBiomes.push_back(Biome::jungleHills);
|
||||||
playerSpawnBiomes.push_back(Biome::savanna);
|
playerSpawnBiomes.push_back(Biome::savanna);
|
||||||
|
playerSpawnBiomes.push_back(Biome::roofedForest);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BiomeSource::_init(int64_t seed, LevelType *generator)
|
void BiomeSource::_init(int64_t seed, LevelType *generator)
|
||||||
|
|
|
||||||
|
|
@ -131,8 +131,12 @@ bool DarkOakFeature::checkSpace(Level *worldIn, int x, int y, int z, int height)
|
||||||
for (int k1 = -i1; k1 <= i1; ++k1) {
|
for (int k1 = -i1; k1 <= i1; ++k1) {
|
||||||
int tile = worldIn->getTile(x + j1, y + l, z + k1);
|
int tile = worldIn->getTile(x + j1, y + l, z + k1);
|
||||||
|
|
||||||
if (tile != 0 && tile != Tile::leaves_Id && tile != Tile::leaves2_Id &&
|
// ignores grass, dirt e trunks.
|
||||||
tile != Tile::tallgrass_Id && tile != Tile::sapling_Id) {
|
if (tile != 0 &&
|
||||||
|
tile != Tile::leaves_Id && tile != Tile::leaves2_Id &&
|
||||||
|
tile != Tile::tallgrass_Id && tile != Tile::sapling_Id &&
|
||||||
|
tile != Tile::grass_Id && tile != Tile::dirt_Id &&
|
||||||
|
tile != Tile::treeTrunk_Id && tile != Tile::tree2Trunk_Id) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,10 +34,8 @@ bool HugeMushroomFeature::place(Level *level, Random *random, int x, int y, int
|
||||||
if (yy >= 0 && yy < Level::maxBuildHeight)
|
if (yy >= 0 && yy < Level::maxBuildHeight)
|
||||||
{
|
{
|
||||||
int tt = level->getTile(xx, yy, zz);
|
int tt = level->getTile(xx, yy, zz);
|
||||||
if (tt != 0 && tt != Tile::leaves_Id)
|
if (tt != 0 && tt != Tile::leaves_Id && tt != Tile::leaves2_Id && tt != Tile::tallgrass_Id && tt != Tile::mushroom_brown_Id && tt != Tile::mushroom_red_Id &&tt != Tile::sapling_Id && tt != Tile::sapling2_Id)
|
||||||
{
|
|
||||||
free = false;
|
free = false;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,63 +1,63 @@
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "net.minecraft.world.level.biome.h"
|
#include "net.minecraft.world.level.biome.h"
|
||||||
#include "net.minecraft.world.level.levelgen.feature.h"
|
#include "net.minecraft.world.level.levelgen.feature.h"
|
||||||
#include "net.minecraft.world.level.tile.h"
|
#include "net.minecraft.world.level.tile.h"
|
||||||
#include "net.minecraft.world.level.h"
|
#include "net.minecraft.world.level.h"
|
||||||
#include "net.minecraft.world.entity.animal.h"
|
#include "net.minecraft.world.entity.animal.h"
|
||||||
#include "JungleBiome.h"
|
#include "JungleBiome.h"
|
||||||
|
|
||||||
JungleBiome::JungleBiome(int id) : Biome(id)
|
JungleBiome::JungleBiome(int id) : Biome(id)
|
||||||
{
|
|
||||||
decorator->treeCount = 50;
|
|
||||||
decorator->grassCount = 25;
|
|
||||||
decorator->flowerCount = 4;
|
|
||||||
|
|
||||||
enemies.push_back(new MobSpawnerData(eTYPE_OCELOT, 2, 1, 1));
|
|
||||||
|
|
||||||
// make chicken a lot more common in the jungle
|
|
||||||
friendlies.push_back(new MobSpawnerData(eTYPE_CHICKEN, 10, 4, 4));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Feature *JungleBiome::getTreeFeature(Random *random)
|
|
||||||
{
|
|
||||||
if (random->nextInt(10) == 0)
|
|
||||||
{
|
{
|
||||||
return new BasicTree(false); // 4J used to return member fancyTree, now returning newly created object so that caller can be consistently resposible for cleanup
|
decorator->treeCount = 50;
|
||||||
}
|
decorator->grassCount = 25;
|
||||||
if (random->nextInt(2) == 0)
|
decorator->flowerCount = 4;
|
||||||
{
|
|
||||||
return new GroundBushFeature(TreeTile::JUNGLE_TRUNK, LeafTile::NORMAL_LEAF);
|
|
||||||
}
|
|
||||||
if (random->nextInt(3) == 0)
|
|
||||||
{
|
|
||||||
return new MegaTreeFeature(false, 10 + random->nextInt(20), TreeTile::JUNGLE_TRUNK, LeafTile::JUNGLE_LEAF);
|
|
||||||
}
|
|
||||||
return new TreeFeature(false, 4 + random->nextInt(7), TreeTile::JUNGLE_TRUNK, LeafTile::JUNGLE_LEAF, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
Feature *JungleBiome::getGrassFeature(Random *random)
|
enemies.push_back(new MobSpawnerData(eTYPE_OCELOT, 2, 1, 1));
|
||||||
{
|
|
||||||
if (random->nextInt(4) == 0)
|
// make chicken a lot more common in the jungle
|
||||||
{
|
friendlies.push_back(new MobSpawnerData(eTYPE_CHICKEN, 10, 4, 4));
|
||||||
return new TallGrassFeature(Tile::tallgrass_Id, TallGrass::FERN);
|
|
||||||
}
|
}
|
||||||
return new TallGrassFeature(Tile::tallgrass_Id, TallGrass::TALL_GRASS);
|
|
||||||
}
|
|
||||||
|
|
||||||
void JungleBiome::decorate(Level *level, Random *random, int xo, int zo)
|
|
||||||
{
|
|
||||||
Biome::decorate(level, random, xo, zo);
|
|
||||||
|
|
||||||
PIXBeginNamedEvent(0, "Adding vines");
|
Feature *JungleBiome::getTreeFeature(Random *random)
|
||||||
VinesFeature *vines = new VinesFeature();
|
|
||||||
|
|
||||||
for (int i = 0; i < 50; i++)
|
|
||||||
{
|
{
|
||||||
int x = xo + random->nextInt(16) + 8;
|
if (random->nextInt(10) == 0)
|
||||||
int y = Level::genDepth / 2;
|
{
|
||||||
int z = zo + random->nextInt(16) + 8;
|
return new BasicTree(false); // 4J used to return member fancyTree, now returning newly created object so that caller can be consistently resposible for cleanup
|
||||||
vines->place(level, random, x, y, z);
|
}
|
||||||
|
if (random->nextInt(2) == 0)
|
||||||
|
{
|
||||||
|
return new GroundBushFeature(TreeTile::JUNGLE_TRUNK, LeafTile::NORMAL_LEAF);
|
||||||
|
}
|
||||||
|
if (random->nextInt(3) == 0)
|
||||||
|
{
|
||||||
|
return new MegaTreeFeature(false, 10 + random->nextInt(20), TreeTile::JUNGLE_TRUNK, LeafTile::JUNGLE_LEAF);
|
||||||
|
}
|
||||||
|
return new TreeFeature(false, 4 + random->nextInt(7), TreeTile::JUNGLE_TRUNK, LeafTile::JUNGLE_LEAF, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
Feature *JungleBiome::getGrassFeature(Random *random)
|
||||||
|
{
|
||||||
|
if (random->nextInt(4) == 0)
|
||||||
|
{
|
||||||
|
return new TallGrassFeature(Tile::tallgrass_Id, TallGrass::FERN);
|
||||||
|
}
|
||||||
|
return new TallGrassFeature(Tile::tallgrass_Id, TallGrass::TALL_GRASS);
|
||||||
|
}
|
||||||
|
|
||||||
|
void JungleBiome::decorate(Level *level, Random *random, int xo, int zo)
|
||||||
|
{
|
||||||
|
Biome::decorate(level, random, xo, zo);
|
||||||
|
|
||||||
|
PIXBeginNamedEvent(0, "Adding vines");
|
||||||
|
VinesFeature *vines = new VinesFeature();
|
||||||
|
|
||||||
|
for (int i = 0; i < 50; i++)
|
||||||
|
{
|
||||||
|
int x = xo + random->nextInt(16) + 8;
|
||||||
|
int y = Level::genDepth / 2;
|
||||||
|
int z = zo + random->nextInt(16) + 8;
|
||||||
|
vines->place(level, random, x, y, z);
|
||||||
|
}
|
||||||
|
PIXEndNamedEvent();
|
||||||
}
|
}
|
||||||
PIXEndNamedEvent();
|
|
||||||
}
|
|
||||||
|
|
@ -2715,6 +2715,7 @@
|
||||||
<ClInclude Include="RedSandStoneTile.h" />
|
<ClInclude Include="RedSandStoneTile.h" />
|
||||||
<ClInclude Include="Redstone.h" />
|
<ClInclude Include="Redstone.h" />
|
||||||
<ClInclude Include="RepeaterTile.h" />
|
<ClInclude Include="RepeaterTile.h" />
|
||||||
|
<ClInclude Include="RoofedForestBiome.h" />
|
||||||
<ClInclude Include="RotatedPillarTile.h" />
|
<ClInclude Include="RotatedPillarTile.h" />
|
||||||
<ClInclude Include="SandTile.h" />
|
<ClInclude Include="SandTile.h" />
|
||||||
<ClInclude Include="Sapling2.h" />
|
<ClInclude Include="Sapling2.h" />
|
||||||
|
|
@ -3654,6 +3655,7 @@
|
||||||
<ClCompile Include="RedSandStoneTile.cpp" />
|
<ClCompile Include="RedSandStoneTile.cpp" />
|
||||||
<ClCompile Include="Redstone.cpp" />
|
<ClCompile Include="Redstone.cpp" />
|
||||||
<ClCompile Include="RepeaterTile.cpp" />
|
<ClCompile Include="RepeaterTile.cpp" />
|
||||||
|
<ClCompile Include="RoofedForestBiome.cpp" />
|
||||||
<ClCompile Include="Rose.cpp" />
|
<ClCompile Include="Rose.cpp" />
|
||||||
<ClInclude Include="Rose.h" />
|
<ClInclude Include="Rose.h" />
|
||||||
<ClCompile Include="RotatedPillarTile.cpp" />
|
<ClCompile Include="RotatedPillarTile.cpp" />
|
||||||
|
|
|
||||||
|
|
@ -825,6 +825,7 @@
|
||||||
<ClCompile Include="SavannaTreeFeature.cpp" />
|
<ClCompile Include="SavannaTreeFeature.cpp" />
|
||||||
<ClCompile Include="DarkOakFeature.cpp" />
|
<ClCompile Include="DarkOakFeature.cpp" />
|
||||||
<ClCompile Include="SavannaBiome.cpp" />
|
<ClCompile Include="SavannaBiome.cpp" />
|
||||||
|
<ClCompile Include="RoofedForestBiome.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="AABB.h" />
|
<ClInclude Include="AABB.h" />
|
||||||
|
|
@ -1819,6 +1820,7 @@
|
||||||
<ClInclude Include="SavannaTreeFeature.h" />
|
<ClInclude Include="SavannaTreeFeature.h" />
|
||||||
<ClInclude Include="DarkOakFeature.h" />
|
<ClInclude Include="DarkOakFeature.h" />
|
||||||
<ClInclude Include="SavannaBiome.h" />
|
<ClInclude Include="SavannaBiome.h" />
|
||||||
|
<ClInclude Include="RoofedForestBiome.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="..\Minecraft.Client\Xbox\res\audio\Minecraft.xgs" />
|
<None Include="..\Minecraft.Client\Xbox\res\audio\Minecraft.xgs" />
|
||||||
|
|
|
||||||
54
Minecraft.World/RoofedForestBiome.cpp
Normal file
54
Minecraft.World/RoofedForestBiome.cpp
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "RoofedForestBiome.h"
|
||||||
|
#include "BiomeDecorator.h"
|
||||||
|
#include "DarkOakFeature.h"
|
||||||
|
#include "HugeMushroomFeature.h"
|
||||||
|
#include "net.minecraft.world.level.tile.h"
|
||||||
|
#include "..\Level.h"
|
||||||
|
|
||||||
|
RoofedForestBiome::RoofedForestBiome(int id) : Biome(id)
|
||||||
|
{
|
||||||
|
|
||||||
|
decorator->treeCount = 35;
|
||||||
|
decorator->grassCount = 2;
|
||||||
|
decorator->flowerCount = 1;
|
||||||
|
decorator->mushroomCount = 1;
|
||||||
|
decorator->hugeMushrooms = 1;
|
||||||
|
|
||||||
|
temperature = 0.7f;
|
||||||
|
downfall = 0.8f;
|
||||||
|
|
||||||
|
topMaterial = static_cast<byte>(Tile::grass_Id);
|
||||||
|
material = static_cast<byte>(Tile::dirt_Id);
|
||||||
|
|
||||||
|
|
||||||
|
setColor(0x28340A);
|
||||||
|
setLeafColor(0x2D5A27);
|
||||||
|
}
|
||||||
|
|
||||||
|
Feature* RoofedForestBiome::getTreeFeature(Random* random)
|
||||||
|
{
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
if (random->nextInt(5) == 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
return new HugeMushroomFeature();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return new DarkOakFeature(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int RoofedForestBiome::getGrassColor()
|
||||||
|
{
|
||||||
|
return 0x28340A;
|
||||||
|
}
|
||||||
|
|
||||||
|
int RoofedForestBiome::getFolageColor()
|
||||||
|
{
|
||||||
|
return 0x2D5A27;
|
||||||
|
}
|
||||||
12
Minecraft.World/RoofedForestBiome.h
Normal file
12
Minecraft.World/RoofedForestBiome.h
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
#pragma once
|
||||||
|
#include "Biome.h"
|
||||||
|
|
||||||
|
class RoofedForestBiome : public Biome
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
RoofedForestBiome(int id);
|
||||||
|
virtual Feature* getTreeFeature(Random* random) override;
|
||||||
|
// virtual void decorate(Level* level, Random* random, int xo, int zo) override;
|
||||||
|
virtual int getGrassColor() override;
|
||||||
|
virtual int getFolageColor() override;
|
||||||
|
};
|
||||||
|
|
@ -28,3 +28,13 @@ Feature *SavannaBiome::getTreeFeature(Random *random)
|
||||||
|
|
||||||
return new TreeFeature(false);
|
return new TreeFeature(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int SavannaBiome::getGrassColor()
|
||||||
|
{
|
||||||
|
return 0xBFB755;
|
||||||
|
}
|
||||||
|
|
||||||
|
int SavannaBiome::getFolageColor()
|
||||||
|
{
|
||||||
|
return 0xAEA42A;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,4 +7,7 @@ public:
|
||||||
SavannaBiome(int id);
|
SavannaBiome(int id);
|
||||||
|
|
||||||
virtual Feature *getTreeFeature(Random *random);
|
virtual Feature *getTreeFeature(Random *random);
|
||||||
|
virtual int getFolageColor() override;
|
||||||
|
virtual int getGrassColor() override;
|
||||||
|
//virtual int getWaterColor() override;
|
||||||
};
|
};
|
||||||
|
|
@ -43,7 +43,7 @@ void TreeTile::onRemove(Level *level, int x, int y, int z, int id, int data)
|
||||||
for (int zo = -r; zo <= r; zo++)
|
for (int zo = -r; zo <= r; zo++)
|
||||||
{
|
{
|
||||||
int t = level->getTile(x + xo, y + yo, z + zo);
|
int t = level->getTile(x + xo, y + yo, z + zo);
|
||||||
if (t == Tile::leaves_Id)
|
if (t == Tile::leaves_Id|| t == Tile::leaves2_Id)
|
||||||
{
|
{
|
||||||
int currentData = level->getData(x + xo, y + yo, z + zo);
|
int currentData = level->getData(x + xo, y + yo, z + zo);
|
||||||
if ((currentData & LeafTile::UPDATE_LEAF_BIT) == 0)
|
if ((currentData & LeafTile::UPDATE_LEAF_BIT) == 0)
|
||||||
|
|
|
||||||
|
|
@ -33,3 +33,4 @@
|
||||||
|
|
||||||
//TU31
|
//TU31
|
||||||
#include "SavannaBiome.h"
|
#include "SavannaBiome.h"
|
||||||
|
#include "RoofedForestBiome.h"
|
||||||
Loading…
Reference in a new issue