18 Commits

Author SHA1 Message Date
Lord Cambion ce764a072c Biome Update pt2 2026-03-26 22:52:52 +01:00
Lord Cambion 10b7fc36d3 Biome Update! 2026-03-26 20:37:51 +01:00
piebot 74c197cc15 apparently the commits i did for glass pane didnt apply so 2026-03-26 20:41:29 +03:00
piebot 42af4ed545 Fix fence connect logic 2026-03-26 20:21:36 +03:00
piebot 87348a7e16 Fix Github Actions compile error 2026-03-26 19:09:04 +03:00
piebot fc0927065a ACTUALLY fix it 2026-03-26 18:11:27 +03:00
piebot 1df2fd42dd Bug fixes 2026-03-26 18:04:55 +03:00
piebot d73ae8fd5c Fix Commit "Implement LCERenewed Changes"
This fixes commit cf0472117c.
2026-03-26 17:57:03 +03:00
piebot cf0472117c Implement LCERenewed Changes 2026-03-26 14:14:42 +03:00
piebot 0e56730255 Update logo 2026-03-26 11:36:31 +03:00
piebot f76896d7e8 Merge branch 'main' of https://github.com/piebotc/LegacyEvolved 2026-03-26 09:46:09 +03:00
piebot ce15163a81 Update Logo 2026-03-25 22:03:15 +03:00
piebot db500edc3a Update README.md 2026-03-25 13:46:11 +03:00
piebot 86366b5b20 Update README.md 2026-03-25 13:45:57 +03:00
piebot 91ddc735c3 Update README.md 2026-03-25 13:45:40 +03:00
piebot 75187488e8 Update README.md 2026-03-25 13:45:17 +03:00
piebot ec7d784c18 Update README.md 2026-03-25 13:44:31 +03:00
piebot e310f1e6f1 Add Acknowledgments Section 2026-03-25 13:22:32 +03:00
49 changed files with 1115 additions and 173 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.
@@ -82,7 +82,7 @@ void IUIScene_CreativeMenu::staticCtor()
ITEM(Tile::obsidian_Id)
ITEM(Tile::clay)
ITEM(Tile::ice_Id)
ITEM(Tile::packed_ice_Id)
ITEM(Tile::packedIce_Id)
ITEM(Tile::snow_Id)
ITEM(Tile::netherRack_Id)
ITEM(Tile::soulsand_Id)
+4 -1
View File
@@ -243,8 +243,11 @@ void ItemInHandRenderer::renderItem(shared_ptr<LivingEntity> mob, shared_ptr<Ite
MemSect(31);
minecraft->textures->bindTexture(minecraft->textures->getTextureLocation(Icon::TYPE_TERRAIN));
MemSect(0);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
tileRenderer->renderTile(Tile::tiles[item->id], item->getAuxValue(), SharedConstants::TEXTURE_LIGHTING ? 1.0f : mob->getBrightness(1)); // 4J - change brought forward from 1.8.2
}
glDisable(GL_BLEND);
}
else
{
MemSect(31);
+40
View File
@@ -8505,6 +8505,44 @@ void TileRenderer::renderTile( Tile* tile, int data, float brightness, float fAl
tesselateHopperInWorld(tile, 0, 0, 0, 0, true);
glTranslatef(0.5f, 0.5f, 0.5f);
}
else if (shape == Tile::SHAPE_THIN_PANE)
{
setShape(7.0f / 16.0f, 0, 0, 9.0f / 16.0f, 1.0f, 1.0f);
glTranslatef(-0.5f, -0.5f, -0.5f);
t->begin();
t->normal(0, -1, 0);
renderFaceDown(tile, 0, 0, 0, getTexture(tile, 0, data));
t->end();
t->begin();
t->normal(0, 1, 0);
renderFaceUp(tile, 0, 0, 0, getTexture(tile, 1, data));
t->end();
t->begin();
t->normal(0, 0, -1);
renderNorth(tile, 0, 0, 0, getTexture(tile, 2, data));
t->end();
t->begin();
t->normal(0, 0, 1);
renderSouth(tile, 0, 0, 0, getTexture(tile, 3, data));
t->end();
t->begin();
t->normal(-1, 0, 0);
renderWest(tile, 0, 0, 0, getTexture(tile, 4, data));
t->end();
t->begin();
t->normal(1, 0, 0);
renderEast(tile, 0, 0, 0, getTexture(tile, 5, data));
t->end();
glTranslatef(0.5f, 0.5f, 0.5f);
setShape(0, 0, 0, 1, 1, 1);
}
t->setMipmapEnable( true ); // 4J added
}
@@ -8525,6 +8563,8 @@ bool TileRenderer::canRender( int renderShape )
if ( renderShape == Tile::SHAPE_WALL) return true;
if ( renderShape == Tile::SHAPE_BEACON) return true;
if ( renderShape == Tile::SHAPE_ANVIL) return true;
if (renderShape == Tile::SHAPE_THIN_PANE) return true;
if (renderShape == Tile::SHAPE_WATER) return true;
return false;
}
+71 -34
View File
@@ -13,8 +13,6 @@
Biome *Biome::biomes[256];
Biome *Biome::ocean = nullptr;
Biome *Biome::plains = nullptr;
Biome *Biome::desert = nullptr;
@@ -38,58 +36,95 @@ Biome *Biome::taigaHills = nullptr;
Biome *Biome::smallerExtremeHills = nullptr;
Biome *Biome::jungle = nullptr;
Biome *Biome::jungleHills = nullptr;
Biome *Biome::savanna = nullptr;
Biome *Biome::roofedForest = nullptr;
Biome *Biome::flowerForest = nullptr;
Biome *Biome::jungleEdge = nullptr;
Biome *Biome::deepOcean = nullptr;
Biome *Biome::stoneBeach = nullptr;
Biome *Biome::coldBeach = nullptr;
Biome *Biome::birchForest = nullptr;
Biome *Biome::birchForestHills = nullptr;
Biome *Biome::birchForestHillsM = nullptr;
Biome *Biome::roofedForest = nullptr;
Biome *Biome::coldTaiga = nullptr;
Biome *Biome::coldTaigaHills = nullptr;
Biome *Biome::megaTaiga = nullptr;
Biome *Biome::megaTaigaHills = nullptr;
Biome *Biome::extremeHills_plus = nullptr;
Biome *Biome::savanna = nullptr;
Biome *Biome::savannaPlateau = nullptr;
Biome *Biome::mesa = nullptr;
Biome *Biome::mesaPlateauF = nullptr;
Biome *Biome::mesaPlateau = nullptr;
Biome *Biome::theVoid = nullptr;
Biome *Biome::sunflowersPlains = nullptr;
Biome *Biome::desertM = nullptr;
Biome *Biome::extremeHillsM = nullptr;
Biome *Biome::flowerForest = nullptr;
Biome *Biome::taigaM = nullptr;
Biome *Biome::swamplandM = nullptr;
Biome *Biome::iceSpikes = nullptr;
Biome *Biome::jungleM = nullptr;
Biome *Biome::jungleEdgeM = nullptr;
Biome *Biome::birchForestM = nullptr;
Biome *Biome::deepOcean = nullptr;
Biome *Biome::birchForestHillsM = nullptr;
Biome *Biome::roofedForestM = nullptr;
Biome *Biome::coldTaigaM = nullptr;
Biome *Biome::redwoodTaiga = nullptr;
Biome *Biome::redwoodTaigaHills = nullptr;
Biome *Biome::extremeHills_plusM = nullptr;
Biome *Biome::savannaM = nullptr;
Biome *Biome::savannaPlateauM = nullptr;
Biome *Biome::mesaBryce = nullptr;
Biome *Biome::mesaPlateauFM = nullptr;
Biome *Biome::mesaPlateauM = nullptr;//167
void Biome::staticCtor()
{
Biome::ocean = (new OceanBiome(0))->setColor(0x000070)->setName(L"Ocean")->setDepthAndScale(-1, 0.4f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_Ocean, eMinecraftColour_Foliage_Ocean, eMinecraftColour_Water_Ocean,eMinecraftColour_Sky_Ocean);
Biome::plains = (new PlainsBiome(1))->setColor(0x8db360)->setName(L"Plains")->setTemperatureAndDownfall(0.8f, 0.4f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_Plains, eMinecraftColour_Foliage_Plains, eMinecraftColour_Water_Plains,eMinecraftColour_Sky_Plains);
Biome::ocean = (new OceanBiome(0))->setColor(0x000070)->setName(L"Ocean")->setDepthAndScale(-1, 0.4f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_Ocean, eMinecraftColour_Foliage_Ocean, eMinecraftColour_Water_Ocean,eMinecraftColour_Sky_Ocean);
Biome::plains = (new PlainsBiome(1,false))->setColor(0x8db360)->setName(L"Plains")->setTemperatureAndDownfall(0.8f, 0.4f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_Plains, eMinecraftColour_Foliage_Plains, eMinecraftColour_Water_Plains,eMinecraftColour_Sky_Plains);
Biome::desert = (new DesertBiome(2))->setColor(0xFA9418)->setName(L"Desert")->setNoRain()->setTemperatureAndDownfall(2, 0)->setDepthAndScale(0.1f, 0.2f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_Desert, eMinecraftColour_Foliage_Desert, eMinecraftColour_Water_Desert,eMinecraftColour_Sky_Desert);
Biome::extremeHills = (new ExtremeHillsBiome(3))->setColor(0x606060)->setName(L"Extreme Hills")->setDepthAndScale(0.3f, 1.5f)->setTemperatureAndDownfall(0.2f, 0.3f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_ExtremeHills, eMinecraftColour_Foliage_ExtremeHills, eMinecraftColour_Water_ExtremeHills,eMinecraftColour_Sky_ExtremeHills);
// Foreste Base
Biome::forest = (new ForestBiome(4,0))->setColor(0x056621)->setName(L"Forest")->setLeafColor(0x4EBA31)->setTemperatureAndDownfall(0.7f, 0.8f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_Forest, eMinecraftColour_Foliage_Forest, eMinecraftColour_Water_Forest,eMinecraftColour_Sky_Forest);
Biome::forestHills = (new ForestBiome(18,0))->setColor(0x22551c)->setName(L"ForestHills")->setLeafColor(0x4EBA31)->setTemperatureAndDownfall(0.7f, 0.8f)->setDepthAndScale(0.3f, 0.7f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_ForestHills, eMinecraftColour_Foliage_ForestHills, eMinecraftColour_Water_ForestHills,eMinecraftColour_Sky_ForestHills);
Biome::taiga = (new TaigaBiome(5))->setColor(0x0b6659)->setName(L"Taiga")->setLeafColor(0x4EBA31)->setSnowCovered()->setTemperatureAndDownfall(0.05f, 0.8f)->setDepthAndScale(0.1f, 0.4f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_Taiga, eMinecraftColour_Foliage_Taiga, eMinecraftColour_Water_Taiga,eMinecraftColour_Sky_Taiga);
Biome::taiga = (new TaigaBiome(5))->setColor(0x0b6659)->setName(L"Taiga")->setLeafColor(0x4EBA31)->setTemperatureAndDownfall(0.25f, 0.8f)->setDepthAndScale(0.1f, 0.4f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_Taiga, eMinecraftColour_Foliage_Taiga, eMinecraftColour_Water_Taiga,eMinecraftColour_Sky_Taiga);
Biome::coldTaiga = (new TaigaBiome(30))->setColor(0x0b6659)->setName(L"Cold Taiga")->setLeafColor(0x4EBA31)->setSnowCovered()->setTemperatureAndDownfall(-0.5f, 0.4f)->setDepthAndScale(0.1f, 0.4f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_Taiga, eMinecraftColour_Foliage_Taiga, eMinecraftColour_Water_Taiga,eMinecraftColour_Sky_Taiga);
Biome::swampland = (new SwampBiome(6))->setColor(0x07F9B2)->setName(L"Swampland")->setLeafColor(0x8BAF48)->setDepthAndScale(-0.2f, 0.1f)->setTemperatureAndDownfall(0.8f, 0.9f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_Swampland, eMinecraftColour_Foliage_Swampland, eMinecraftColour_Water_Swampland,eMinecraftColour_Sky_Swampland);
Biome::river = (new RiverBiome(7))->setColor(0x0000ff)->setName(L"River")->setDepthAndScale(-0.5f, 0)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_River, eMinecraftColour_Foliage_River, eMinecraftColour_Water_River,eMinecraftColour_Sky_River);
Biome::hell = (new HellBiome(8))->setColor(0xff0000)->setName(L"Hell")->setNoRain()->setTemperatureAndDownfall(2, 0)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_Hell, eMinecraftColour_Foliage_Hell, eMinecraftColour_Water_Hell,eMinecraftColour_Sky_Hell);
Biome::sky = (new TheEndBiome(9))->setColor(0x8080ff)->setName(L"Sky")->setNoRain()->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_Sky, eMinecraftColour_Foliage_Sky, eMinecraftColour_Water_Sky,eMinecraftColour_Sky_Sky);
Biome::frozenOcean = (new OceanBiome(10))->setColor(0x9090a0)->setName(L"FrozenOcean")->setSnowCovered()->setDepthAndScale(-1, 0.5f)->setTemperatureAndDownfall(0, 0.5f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_FrozenOcean, eMinecraftColour_Foliage_FrozenOcean, eMinecraftColour_Water_FrozenOcean,eMinecraftColour_Sky_FrozenOcean);
Biome::frozenRiver = (new RiverBiome(11))->setColor(0xa0a0ff)->setName(L"FrozenRiver")->setSnowCovered()->setDepthAndScale(-0.5f, 0)->setTemperatureAndDownfall(0, 0.5f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_FrozenRiver, eMinecraftColour_Foliage_FrozenRiver, eMinecraftColour_Water_FrozenRiver,eMinecraftColour_Sky_FrozenRiver);
Biome::frozenOcean = (new OceanBiome(10))->setColor(0x9090a0)->setName(L"Frozen Ocean")->setSnowCovered()->setDepthAndScale(-1, 0.5f)->setTemperatureAndDownfall(0, 0.5f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_FrozenOcean, eMinecraftColour_Foliage_FrozenOcean, eMinecraftColour_Water_FrozenOcean,eMinecraftColour_Sky_FrozenOcean);
Biome::frozenRiver = (new RiverBiome(11))->setColor(0xa0a0ff)->setName(L"Frozen River")->setSnowCovered()->setDepthAndScale(-0.5f, 0)->setTemperatureAndDownfall(0, 0.5f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_FrozenRiver, eMinecraftColour_Foliage_FrozenRiver, eMinecraftColour_Water_FrozenRiver,eMinecraftColour_Sky_FrozenRiver);
Biome::iceFlats = (new IceBiome(12))->setColor(0xffffff)->setName(L"Ice Plains")->setSnowCovered()->setTemperatureAndDownfall(0, 0.5f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_IcePlains, eMinecraftColour_Foliage_IcePlains, eMinecraftColour_Water_IcePlains,eMinecraftColour_Sky_IcePlains);
Biome::iceMountains = (new IceBiome(13))->setColor(0xa0a0a0)->setName(L"Ice Mountains")->setSnowCovered()->setDepthAndScale(0.3f, 1.3f)->setTemperatureAndDownfall(0, 0.5f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_IceMountains, eMinecraftColour_Foliage_IceMountains, eMinecraftColour_Water_IceMountains,eMinecraftColour_Sky_IceMountains);
Biome::mushroomIsland = (new MushroomIslandBiome(14))->setColor(0xff00ff)->setName(L"MushroomIsland")->setTemperatureAndDownfall(0.9f, 1.0f)->setDepthAndScale(0.2f, 1.0f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_MushroomIsland, eMinecraftColour_Foliage_MushroomIsland, eMinecraftColour_Water_MushroomIsland,eMinecraftColour_Sky_MushroomIsland);
Biome::mushroomIslandShore = (new MushroomIslandBiome(15))->setColor(0xa000ff)->setName(L"MushroomIslandShore")->setTemperatureAndDownfall(0.9f, 1.0f)->setDepthAndScale(-1, 0.1f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_MushroomIslandShore, eMinecraftColour_Foliage_MushroomIslandShore, eMinecraftColour_Water_MushroomIslandShore,eMinecraftColour_Sky_MushroomIslandShore);
Biome::mushroomIsland = (new MushroomIslandBiome(14))->setColor(0xff00ff)->setName(L"Mushroom Island")->setTemperatureAndDownfall(0.9f, 1.0f)->setDepthAndScale(0.2f, 1.0f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_MushroomIsland, eMinecraftColour_Foliage_MushroomIsland, eMinecraftColour_Water_MushroomIsland,eMinecraftColour_Sky_MushroomIsland);
Biome::mushroomIslandShore = (new MushroomIslandBiome(15))->setColor(0xa000ff)->setName(L"Mushroom Island Shore")->setTemperatureAndDownfall(0.9f, 1.0f)->setDepthAndScale(-1, 0.1f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_MushroomIslandShore, eMinecraftColour_Foliage_MushroomIslandShore, eMinecraftColour_Water_MushroomIslandShore,eMinecraftColour_Sky_MushroomIslandShore);
Biome::beaches = (new BeachBiome(16))->setColor(0xfade55)->setName(L"Beach")->setTemperatureAndDownfall(0.8f, 0.4f)->setDepthAndScale(0.0f, 0.1f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_Beach, eMinecraftColour_Foliage_Beach, eMinecraftColour_Water_Beach,eMinecraftColour_Sky_Beach);
Biome::desertHills = (new DesertBiome(17))->setColor(0xd25f12)->setName(L"DesertHills")->setNoRain()->setTemperatureAndDownfall(2, 0)->setDepthAndScale(0.3f, 0.8f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_DesertHills, eMinecraftColour_Foliage_DesertHills, eMinecraftColour_Water_DesertHills,eMinecraftColour_Sky_DesertHills);
Biome::taigaHills = (new TaigaBiome(19))->setColor(0x163933)->setName(L"TaigaHills")->setSnowCovered()->setLeafColor(0x4EBA31)->setTemperatureAndDownfall(0.05f, 0.8f)->setDepthAndScale(0.3f, 0.8f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_TaigaHills, eMinecraftColour_Foliage_TaigaHills, eMinecraftColour_Water_TaigaHills,eMinecraftColour_Sky_TaigaHills);
Biome::desertHills = (new DesertBiome(17))->setColor(0xd25f12)->setName(L"Desert Hills")->setNoRain()->setTemperatureAndDownfall(2, 0)->setDepthAndScale(0.3f, 0.8f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_DesertHills, eMinecraftColour_Foliage_DesertHills, eMinecraftColour_Water_DesertHills,eMinecraftColour_Sky_DesertHills);
Biome::forestHills = (new ForestBiome(18,0))->setColor(0x22551c)->setName(L"Forest Hills")->setLeafColor(0x4EBA31)->setTemperatureAndDownfall(0.7f, 0.8f)->setDepthAndScale(0.3f, 0.7f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_ForestHills, eMinecraftColour_Foliage_ForestHills, eMinecraftColour_Water_ForestHills,eMinecraftColour_Sky_ForestHills);
Biome::taigaHills = (new TaigaBiome(19))->setColor(0x163933)->setName(L"Taiga Hills")->setLeafColor(0x4EBA31)->setTemperatureAndDownfall(0.25f, 0.8f)->setDepthAndScale(0.3f, 0.8f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_TaigaHills, eMinecraftColour_Foliage_TaigaHills, eMinecraftColour_Water_TaigaHills,eMinecraftColour_Sky_TaigaHills);
Biome::smallerExtremeHills = (new ExtremeHillsBiome(20))->setColor(0x72789a)->setName(L"Extreme Hills Edge")->setDepthAndScale(0.2f, 0.8f)->setTemperatureAndDownfall(0.2f, 0.3f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_ExtremeHillsEdge, eMinecraftColour_Foliage_ExtremeHillsEdge, eMinecraftColour_Water_ExtremeHillsEdge,eMinecraftColour_Sky_ExtremeHillsEdge);
Biome::jungle = (new JungleBiome(21))->setColor(0x537b09)->setName(L"Jungle")->setLeafColor(0x537b09)->setTemperatureAndDownfall(1.2f, 0.9f)->setDepthAndScale(0.2f, 0.4f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_Jungle, eMinecraftColour_Foliage_Jungle, eMinecraftColour_Water_Jungle,eMinecraftColour_Sky_Jungle);
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::deepOcean= (new OceanBiome(24))->setName(L"Deep Ocean")->setDepthAndScale(-1.8,0.1f)->setColor(0x000070)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_Ocean, eMinecraftColour_Foliage_Ocean, eMinecraftColour_Water_Ocean,eMinecraftColour_Sky_Ocean);;
// Foreste Avanzate e Speciali
Biome::roofedForest = (new ForestBiome(29, 3))->setColor(0x056621)->setName(L"Roofed Forest")->setTemperatureAndDownfall(0.7f, 0.8f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_RoofedForest, eMinecraftColour_Foliage_RoofedForest, eMinecraftColour_Water_Forest, eMinecraftColour_Sky_Forest);
Biome::flowerForest = (new ForestBiome(132, 1))->setColor(0x056621)->setName(L"Flower Forest")->setTemperatureAndDownfall(0.7f, 0.8f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_Forest, eMinecraftColour_Foliage_Forest, eMinecraftColour_Water_Forest, eMinecraftColour_Sky_Forest);
// Nuovi Biomi Betulla
Biome::jungle = (new JungleBiome(21, false))->setColor(0x537b09)->setName(L"Jungle")->setLeafColor(0x537b09)->setTemperatureAndDownfall(1.2f, 0.9f)->setDepthAndScale(0.2f, 0.4f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_Jungle, eMinecraftColour_Foliage_Jungle, eMinecraftColour_Water_Jungle,eMinecraftColour_Sky_Jungle);
Biome::jungleHills = (new JungleBiome(22, false))->setColor(0x2c4205)->setName(L"Jungle Hills")->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);
//23
Biome::deepOcean= (new OceanBiome(24))->setName(L"Deep Ocean")->setDepthAndScale(-1.8,0.1f)->setColor(0x000070)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_Ocean, eMinecraftColour_Foliage_Ocean, eMinecraftColour_Water_Ocean,eMinecraftColour_Sky_Ocean);;
//25
//26
Biome::birchForest=(new ForestBiome(27, 2))->setColor(0x307444)->setName(L"Birch Forest")->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_Forest, eMinecraftColour_Foliage_Birch, eMinecraftColour_Water_Forest, eMinecraftColour_Sky_Forest);
Biome::birchForestHills=(new ForestBiome(28, 2))->setColor(0x1f5f32)->setName(L"Birch Forest Hills")->setDepthAndScale(0.45f, 0.3f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_ForestHills, eMinecraftColour_Foliage_Birch, eMinecraftColour_Water_Forest, eMinecraftColour_Sky_ForestHills);
// Varianti Mutate (M)
Biome::birchForestM=(new ForestBiome::MutatedBirchForestBiome(155, biomes[27]))->setColor(0x47875a)->setName(L"Birch Forest M")->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_Forest, eMinecraftColour_Foliage_Birch, eMinecraftColour_Water_Forest, eMinecraftColour_Sky_Forest);
Biome::birchForestHills=(new ForestBiome(28, 2))->setColor(0x1f5f32)->setName(L"Birch Forest Hills")->setDepthAndScale(0.45f, 0.3f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_ForestHills, eMinecraftColour_Foliage_Birch, eMinecraftColour_Water_Forest, eMinecraftColour_Sky_ForestHills);
Biome::roofedForest = (new ForestBiome(29, 3))->setColor(0x056621)->setName(L"Roofed Forest")->setTemperatureAndDownfall(0.7f, 0.8f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_RoofedForest, eMinecraftColour_Foliage_RoofedForest, eMinecraftColour_Water_Forest, eMinecraftColour_Sky_Forest);
//30
//31
Biome::coldTaigaHills = (new TaigaBiome(31))->setColor(0x163933)->setName(L"Cold Taiga Hills")->setLeafColor(0x4EBA31)->setSnowCovered()->setTemperatureAndDownfall(-0.5f, 0.4f)->setDepthAndScale(0.3f, 0.8f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_TaigaHills, eMinecraftColour_Foliage_TaigaHills, eMinecraftColour_Water_TaigaHills,eMinecraftColour_Sky_TaigaHills);
Biome::megaTaiga = (new TaigaBiome(32,1))->setColor(0x0b6659)->setName(L"Mega Taiga")->setLeafColor(0x4EBA31)->setTemperatureAndDownfall(0.3f, 0.8f)->setDepthAndScale(0.1f, 0.4f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_Taiga, eMinecraftColour_Foliage_Taiga, eMinecraftColour_Water_Taiga,eMinecraftColour_Sky_Taiga);
Biome::megaTaigaHills = (new TaigaBiome(33,2))->setColor(0x0b6659)->setName(L"Mega Taiga Hills")->setLeafColor(0x4EBA31)->setTemperatureAndDownfall(0.3f, 0.8f)->setDepthAndScale(0.3f, 0.8f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_TaigaHills, eMinecraftColour_Foliage_TaigaHills, eMinecraftColour_Water_TaigaHills,eMinecraftColour_Sky_TaigaHills);
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::sunflowersPlains = (new PlainsBiome(129,true))->setColor(0x8db360)->setName(L"Sunflowers Plains")->setTemperatureAndDownfall(0.8f, 0.4f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_Plains, eMinecraftColour_Foliage_Plains, eMinecraftColour_Water_Plains,eMinecraftColour_Sky_Plains);
Biome::flowerForest = (new ForestBiome(132, 1))->setColor(0x056621)->setName(L"Flower Forest")->setTemperatureAndDownfall(0.7f, 0.8f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_Forest, eMinecraftColour_Foliage_Forest, eMinecraftColour_Water_Forest, eMinecraftColour_Sky_Forest);
Biome::iceSpikes = (new IceBiome(140,true))->setColor(0xffffff)->setName(L"Ice Spikes")->setSnowCovered()->setTemperatureAndDownfall(0, 0.5f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_IcePlains, eMinecraftColour_Foliage_IcePlains, eMinecraftColour_Water_IcePlains,eMinecraftColour_Sky_IcePlains);
Biome::birchForestM=(new ForestBiome::MutatedBirchForestBiome(155, biomes[27]))->setColor(0x47875a)->setName(L"Birch Forest M")->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_Forest, eMinecraftColour_Foliage_Birch, eMinecraftColour_Water_Forest, eMinecraftColour_Sky_Forest);
Biome::birchForestHillsM=(new ForestBiome::MutatedBirchForestBiome(156, biomes[28]))->setColor(0x47875a)->setName(L"Birch Forest Hills M")->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_ForestHills, eMinecraftColour_Foliage_Birch, eMinecraftColour_Water_Forest, eMinecraftColour_Sky_ForestHills);
Biome::roofedForestM=(new ForestBiome::MutatedForestBiome(157, biomes[29]))->setColor(0x177a35)->setName(L"Roofed Forest M")->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_RoofedForest, eMinecraftColour_Foliage_RoofedForest, eMinecraftColour_Water_Forest, eMinecraftColour_Sky_Forest);
}
Biome::Biome(int id) : id(id)
{
@@ -104,7 +139,8 @@ Biome::Biome(int id) : id(id)
downfall = 0.5f;
decorator = nullptr;
m_temperatureNoise = nullptr;
GRASS_COLOR_NOISE = new PerlinNoise(new Random(2345L), 1);
DOUBLE_PLANT_GENERATOR = new DoublePlantFeature(false);
m_grassColor = eMinecraftColour_NOT_SET;
m_foliageColor = eMinecraftColour_NOT_SET;
m_waterColor = eMinecraftColour_NOT_SET;
@@ -136,6 +172,7 @@ Biome::Biome(int id) : id(id)
Biome::~Biome()
{
if(decorator != nullptr) delete decorator;
if(DOUBLE_PLANT_GENERATOR != nullptr) delete DOUBLE_PLANT_GENERATOR;
}
BiomeDecorator *Biome::createDecorator()
+44 -12
View File
@@ -6,6 +6,7 @@ using namespace std;
#include "WeighedRandom.h"
#include "BlockPos.h"
#include "ChunkPrimer.h"
#include "DoublePlantFeature.h"
class Feature;
@@ -51,20 +52,48 @@ public:
static Biome *smallerExtremeHills;
static Biome *jungle;
static Biome *jungleHills;
static Biome *savanna;
static Biome *jungleEdge;
static Biome *deepOcean;
static Biome *stoneBeach;
static Biome *coldBeach;
static Biome *birchForest;
static Biome *birchForestHills ;
static Biome *roofedForest;
static Biome *coldTaiga;
static Biome *coldTaigaHills;
static Biome *megaTaiga;
static Biome *megaTaigaHills;
static Biome *extremeHills_plus;
static Biome *savanna;
static Biome *savannaPlateau;
static Biome *mesa;
static Biome *mesaPlateauF;
static Biome *mesaPlateau;
static Biome *theVoid;
static Biome *sunflowersPlains;
static Biome *desertM;
static Biome *extremeHillsM;
static Biome *flowerForest;
static Biome *Biome::birchForest;
static Biome *Biome::birchForestHills ;
static Biome *Biome::birchForestM ;
static Biome *Biome::birchForestHillsM;
static Biome *Biome::roofedForestM;
static Biome *Biome::deepOcean;
static Biome *taigaM;
static Biome *swamplandM;
static Biome *iceSpikes;
static Biome *jungleM;
static Biome *jungleEdgeM;
static Biome *birchForestM ;
static Biome *birchForestHillsM;
static Biome *roofedForestM;
static Biome *coldTaigaM;
static Biome *redwoodTaiga;
static Biome *redwoodTaigaHills;
static Biome *extremeHills_plusM;
static Biome *savannaM;
static Biome *savannaPlateauM;
static Biome *mesaBryce;
static Biome *mesaPlateauFM;
static Biome *mesaPlateauM;
static const int BIOME_COUNT = 256 ;
@@ -79,8 +108,11 @@ public:
float temperature;
float downfall;
BiomeDecorator *decorator;
PerlinNoise *m_temperatureNoise;
PerlinNoise *GRASS_COLOR_NOISE;
DoublePlantFeature *DOUBLE_PLANT_GENERATOR;
const int id;
+19 -18
View File
@@ -76,6 +76,7 @@ void BiomeDecorator::_init()
doublePlantFeature = new DoublePlantFeature(false);
doublePlantCount = 0;
waterlilyCount = 0;
treeCount = 0;
flowerCount = 2;
@@ -213,24 +214,24 @@ void BiomeDecorator::decorate()
}
}
// 2blockstall
int doublePlantsToGen = (grassCount + flowerCount) / 2;
if (doublePlantsToGen > 0 && random->nextInt(3) == 0)
{
for (int i = 0; i < doublePlantsToGen; i++)
{
int x = xo + random->nextInt(16) + 8;
int y = random->nextInt(Level::genDepth);
int z = zo + random->nextInt(16) + 8;
int plantType = biome->getRandomDoublePlantType(random);
DoublePlantFeature* dpf = static_cast<DoublePlantFeature*>(doublePlantFeature);
dpf->setPlantType(plantType);
dpf->place(level, random, x, y, z);
}
}
//int doublePlantsToGen = doublePlantCount; // <-- Usa una variabile specifica per bioma!
//for (int i = 0; i < doublePlantsToGen; i++)
//{
// // Genera il punto centrale del cluster
// int x = xo + random->nextInt(16) + 8;
// int z = zo + random->nextInt(16) + 8;
// int y = random->nextInt(Level::genDepth);
//
// int plantType = biome->getRandomDoublePlantType(random);
//
// DoublePlantFeature* dpf = static_cast<DoublePlantFeature*>(doublePlantFeature);
// dpf->setPlantType(plantType);
//
// // La chiamata place() ora genererà il grappolo grazie al ciclo da 64 inserito nel Passo 1
// dpf->place(level, random, x, y, z);
//}
PIXEndNamedEvent();
PIXBeginNamedEvent(0,"Decorate bush/waterlily/mushroom/reeds/pumpkins/cactuses");
+1
View File
@@ -59,6 +59,7 @@ public:
Feature *tulipPinkFeature;
Feature *doublePlantFeature;
int doublePlantCount;
int waterlilyCount;
int treeCount;
int flowerCount;
+32 -30
View File
@@ -8,7 +8,6 @@ BiomeInitLayer::BiomeInitLayer(int64_t seed, shared_ptr<Layer>parent, LevelType
{
this->parent = parent;
if(levelType == LevelType::lvl_normal_1_1)
{
startBiomes = BiomeArray(6);
@@ -21,23 +20,24 @@ BiomeInitLayer::BiomeInitLayer(int64_t seed, shared_ptr<Layer>parent, LevelType
}
else
{
startBiomes = BiomeArray(16);
startBiomes[0] = Biome::desert;
startBiomes[1] = Biome::forest;
startBiomes[2] = Biome::extremeHills;
startBiomes[3] = Biome::swampland;
startBiomes[4] = Biome::plains;
startBiomes[5] = Biome::taiga;
startBiomes[6] = Biome::jungle;
startBiomes[7] = Biome::savanna;
startBiomes[8] = Biome::roofedForest;
startBiomes[9] = Biome::flowerForest;
// Only use biomes that are actually initialized in Biome::staticCtor()
// to avoid null pointer crashes during world generation.
startBiomes = BiomeArray(15);
startBiomes[0] = Biome::desert;
startBiomes[1] = Biome::forest;
startBiomes[2] = Biome::extremeHills;
startBiomes[3] = Biome::swampland;
startBiomes[4] = Biome::plains;
startBiomes[5] = Biome::taiga;
startBiomes[6] = Biome::jungle;
startBiomes[7] = Biome::savanna;
startBiomes[8] = Biome::roofedForest;
startBiomes[9] = Biome::flowerForest;
startBiomes[10] = Biome::birchForest;
startBiomes[11] = Biome::birchForestHills;
startBiomes[12] = Biome::birchForestM;
startBiomes[13] = Biome::birchForestHillsM;
startBiomes[14] = Biome::roofedForestM;
startBiomes[15] = Biome::deepOcean;
startBiomes[11] = Biome::sunflowersPlains;
startBiomes[12] = Biome::coldTaiga;
startBiomes[13] = Biome::megaTaiga;
startBiomes[14] = Biome::iceSpikes;
}
}
@@ -56,25 +56,27 @@ intArray BiomeInitLayer::getArea(int xo, int yo, int w, int h)
for (int x = 0; x < w; x++)
{
initRandom(x + xo, y + yo);
int old = b[x + y * w];
if (old == 0)
int old = b[x + y * w];
if (old == 0)
{
result[x + y * w] = 0;
}
result[x + y * w] = 0;
}
else if (old == Biome::mushroomIsland->id)
{
result[x + y * w] = old;
}
else if (old == 1)
result[x + y * w] = old;
}
else if (old == 1) // Normal land
{
result[x + y * w] = startBiomes[nextRandom(startBiomes.length)]->id;
}
else
result[x + y * w] = startBiomes[nextRandom(startBiomes.length)]->id;
}
else // Snowy/Cold areas
{
int isTaiga = startBiomes[nextRandom(startBiomes.length)]->id;
if (isTaiga == Biome::taiga->id)
int picked = startBiomes[nextRandom(startBiomes.length)]->id;
// Only let cold biomes remain in snowy areas, everything else becomes ice plains
if (picked == Biome::taiga->id || picked == Biome::coldTaiga->id ||
picked == Biome::megaTaiga->id || picked == Biome::iceSpikes->id)
{
result[x + y * w] = isTaiga;
result[x + y * w] = picked;
}
else
{
+2
View File
@@ -27,6 +27,8 @@ void BiomeSource::_init()
playerSpawnBiomes.push_back(Biome::savanna);
playerSpawnBiomes.push_back(Biome::roofedForest);
playerSpawnBiomes.push_back(Biome::flowerForest);
playerSpawnBiomes.push_back(Biome::sunflowersPlains);
playerSpawnBiomes.push_back(Biome::iceSpikes);
}
void BiomeSource::_init(int64_t seed, LevelType *generator)
+1 -1
View File
@@ -11,7 +11,7 @@ set(MINECRAFT_WORLD_SOURCES
${SOURCES_COMMON}
)
add_library(Minecraft.World STATIC ${MINECRAFT_WORLD_SOURCES})
add_library(Minecraft.World STATIC ${MINECRAFT_WORLD_SOURCES} "IceSpikeFeature.cpp" "IceSpikeFeature.h")
target_include_directories(Minecraft.World
PRIVATE
+22
View File
@@ -7,6 +7,7 @@
#include "net.minecraft.world.entity.player.h"
#include "net.minecraft.world.h"
#include "..\Minecraft.Client\ServerPlayer.h"
#include "net.minecraft.world.phys.h"
const wstring CauldronTile::TEXTURE_INSIDE = L"cauldron_inner";
const wstring CauldronTile::TEXTURE_BOTTOM = L"cauldron_bottom";
@@ -31,6 +32,27 @@ Icon *CauldronTile::getTexture(int face, int data)
return icon;
}
void CauldronTile::entityInside(Level* level, int x, int y, int z, shared_ptr<Entity> entity)
{
if (level->isClientSide) return;
int data = level->getData(x, y, z);
int fillLevel = getFillLevel(data);
double waterSurfaceY = ((3 * fillLevel + 6) * 0.0625) + y;
if (level->isClientSide) return;
if (!entity->isOnFire()) return;
if (fillLevel <= 0) return;
if (entity->bb->y0 <= waterSurfaceY)
{
entity->clearFire();
level->setData(x, y, z, fillLevel - 1, Tile::UPDATE_CLIENTS);
}
}
void CauldronTile::registerIcons(IconRegister *iconRegister)
{
iconInner = iconRegister->registerIcon(L"cauldron_inner");
+1
View File
@@ -20,6 +20,7 @@ public:
virtual Icon *getTexture(int face, int data);
//@Override
void registerIcons(IconRegister *iconRegister);
void entityInside(Level* level, int x, int y, int z, shared_ptr<Entity> entity);
static Icon *getTexture(const wstring &name);
virtual void addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr<Entity> source);
virtual void updateDefaultShape();
+6 -6
View File
@@ -5,13 +5,13 @@
#include "TallGrass2.h"
DoublePlantFeature::DoublePlantFeature(bool doUpdate)
: Feature(doUpdate), m_plantType(0)
: Feature(doUpdate), m_plantType(1)
{
}
void DoublePlantFeature::setPlantType(int plantType)
{
m_plantType = (plantType < 1) ? 1 : plantType;
m_plantType = plantType;
}
bool DoublePlantFeature::place(Level* level, Random* rand, int x, int y, int z)
@@ -24,8 +24,7 @@ bool DoublePlantFeature::place(Level* level, Random* rand, int x, int y, int z)
int by = y + rand->nextInt(4) - rand->nextInt(4);
int bz = z + rand->nextInt(8) - rand->nextInt(8);
if (by >= Level::maxBuildHeight - 1) continue;
if (by < 1) continue;
if (by >= Level::maxBuildHeight - 1 || by < 1) continue;
if (level->getTile(bx, by, bz) != 0) continue;
if (level->getTile(bx, by + 1, bz) != 0) continue;
@@ -33,8 +32,9 @@ bool DoublePlantFeature::place(Level* level, Random* rand, int x, int y, int z)
if (!static_cast<TallGrass2*>(Tile::tiles[Tile::tallgrass2_Id])->mayPlace(level, bx, by, bz)) continue;
level->setTileAndData(bx, by, bz, Tile::tallgrass2_Id, m_plantType, Tile::UPDATE_ALL);
level->setTileAndData(bx, by + 1, bz, Tile::tallgrass2_Id, m_plantType | TallGrass2::UPPER_BIT, Tile::UPDATE_ALL);
level->setTileAndData(bx, by, bz, Tile::tallgrass2_Id, m_plantType, 0);
level->setTileAndData(bx, by + 1, bz, Tile::tallgrass2_Id, TallGrass2::UPPER_BIT | m_plantType, 0);
placed = true;
}
+52 -2
View File
@@ -3,16 +3,37 @@
#include "net.minecraft.world.level.tile.h"
#include "net.minecraft.world.level.levelgen.feature.h"
#include "ExtremeHillsBiome.h"
#include "BiomeDecorator.h"
ExtremeHillsBiome::ExtremeHillsBiome(int id) : Biome(id)
#include "SpruceFeature.h"
#include "TreeFeature.h"
ExtremeHillsBiome::ExtremeHillsBiome(int id, bool extraTrees) : Biome(id)
{
silverfishFeature = new OreFeature(Tile::monsterStoneEgg_Id, 8);
taigaFeature = new SpruceFeature(false);
friendlies.clear();
type = 0;
if (extraTrees)
{
decorator->treeCount = 3;
type = 1;
}
}
ExtremeHillsBiome::~ExtremeHillsBiome()
{
delete silverfishFeature;
delete taigaFeature;
}
Feature *ExtremeHillsBiome::getTreeFeature(Random *random)
{
if (random->nextInt(3) > 0)
{
return new SpruceFeature(false);
}
return Biome::getTreeFeature(random);
}
void ExtremeHillsBiome::decorate(Level *level, Random *random, int xo, int zo) {
@@ -37,8 +58,37 @@ void ExtremeHillsBiome::decorate(Level *level, Random *random, int xo, int zo) {
for (int i = 0; i < 7; i++)
{
int x = xo + random->nextInt(16);
int y = random->nextInt(Level::genDepth / 2);
int y = random->nextInt(64);
int z = zo + random->nextInt(16);
silverfishFeature->place(level, random, x, y, z);
}
}
void ExtremeHillsBiome::buildSurfaceAtDefault(Level *level, Random *random, byte* chunkBlocks, int x, int z, double noiseVal)
{
topMaterial = static_cast<byte>(Tile::grass_Id);
material = static_cast<byte>(Tile::dirt_Id);
if ((noiseVal < -1.0 || noiseVal > 2.0) && type == 2)
{
topMaterial = static_cast<byte>(Tile::gravel_Id);
material = static_cast<byte>(Tile::gravel_Id);
}
else if (noiseVal > 1.0 && type != 1)
{
topMaterial = static_cast<byte>(Tile::stone_Id);
material = static_cast<byte>(Tile::stone_Id);
}
Biome::buildSurfaceAtDefault(level, random, chunkBlocks, x, z, noiseVal);
}
Biome* ExtremeHillsBiome::mutateHills(Biome* baseBiome)
{
this->type = 2; // Mutated type
this->setColor(baseBiome->color, true);
this->setName(baseBiome->m_name + L" M");
this->setDepthAndScale(baseBiome->depth, baseBiome->scale);
this->setTemperatureAndDownfall(baseBiome->temperature, baseBiome->downfall);
return this;
}
+7 -2
View File
@@ -8,11 +8,16 @@ class ExtremeHillsBiome : public Biome
private:
static const bool GENERATE_EMERALD_ORE = true;
Feature *silverfishFeature;
int type;
Feature *taigaFeature;
protected:
ExtremeHillsBiome(int id);
ExtremeHillsBiome(int id, bool extraTrees = false);
~ExtremeHillsBiome();
public:
void decorate(Level *level, Random *random, int xo, int zo);
virtual void decorate(Level *level, Random *random, int xo, int zo) override;
virtual void buildSurfaceAtDefault(Level *level, Random *random, byte* chunkBlocks, int x, int z, double noiseVal) override;
virtual Feature *getTreeFeature(Random *random) override;
Biome* mutateHills(Biome* baseBiome);
};
+18 -11
View File
@@ -2,6 +2,7 @@
#include "net.minecraft.world.item.h"
#include "net.minecraft.world.level.h"
#include "net.minecraft.world.h"
#include "net.minecraft.world.level.tile.h"
#include "FenceTile.h"
FenceTile::FenceTile(int id, const wstring &texture, Material *material) : Tile( id, material, isSolidRender())
@@ -122,18 +123,24 @@ int FenceTile::getRenderShape()
bool FenceTile::connectsTo(LevelSource *level, int x, int y, int z)
{
int tile = level->getTile(x, y, z);
if (isFence(tile) || tile == Tile::fenceGate_Id)
{
Tile* tileInstance = Tile::tiles[tile];
if (tileInstance == nullptr)
return false;
FenceTile* asFence = dynamic_cast<FenceTile*>(tileInstance);
// more reliable fence check
if (asFence && asFence->material == this->material)
return true;
}
Tile *tileInstance = Tile::tiles[tile];
if (tileInstance != nullptr)
{
if (tileInstance->material->isSolidBlocking() && tileInstance->isCubeShaped())
{
return tileInstance->material != Material::vegetable;
}
}
// check if its a fencegate
if (dynamic_cast<FenceGateTile*>(tileInstance))
return true;
if (tileInstance->material->isSolidBlocking() && tileInstance->isCubeShaped())
return tileInstance->material != Material::vegetable;
return false;
}
+20 -4
View File
@@ -45,7 +45,11 @@ floatArray FixedBiomeSource::getTemperatureBlock(int x, int z, int w, int h) con
// 4J - note that caller is responsible for deleting returned array. temperatures array is for output only.
void FixedBiomeSource::getTemperatureBlock(doubleArray& temperatures, int x, int z, int w, int h) const
{
temperatures = doubleArray(w * h);
if (temperatures.data == nullptr || temperatures.length < w * h)
{
if(temperatures.data != nullptr) delete [] temperatures.data;
temperatures = doubleArray(w * h);
}
Arrays::fill(temperatures, 0, w * h, (double)temperature);
}
@@ -86,7 +90,11 @@ void FixedBiomeSource::getDownfallBlock(doubleArray downfalls, int x, int z, int
void FixedBiomeSource::getBiomeBlock(BiomeArray& biomes, int x, int z, int w, int h, bool useCache) const
{
MemSect(36);
biomes = BiomeArray(w * h);
if (biomes.data == nullptr || biomes.length < w * h)
{
if(biomes.data != nullptr) delete [] biomes.data;
biomes = BiomeArray(w * h);
}
MemSect(0);
Arrays::fill(biomes, 0, w * h, biome);
@@ -96,7 +104,11 @@ void FixedBiomeSource::getBiomeBlock(BiomeArray& biomes, int x, int z, int w, in
void FixedBiomeSource::getBiomeIndexBlock(byteArray& biomeIndices, int x, int z, int w, int h, bool useCache) const
{
MemSect(36);
biomeIndices = byteArray(w * h);
if (biomeIndices.data == nullptr || biomeIndices.length < w * h)
{
if(biomeIndices.data != nullptr) delete [] biomeIndices.data;
biomeIndices = byteArray(w * h);
}
MemSect(0);
int biomeIndex = biome->id;
Arrays::fill(biomeIndices, 0, w * h, biomeIndex);
@@ -107,7 +119,11 @@ void FixedBiomeSource::getBiomeIndexBlock(byteArray& biomeIndices, int x, int z,
void FixedBiomeSource::getRawBiomeBlock(BiomeArray& biomes,int x, int z, int w, int h) const
{
MemSect(36);
biomes = BiomeArray(w * h);
if (biomes.data == nullptr || biomes.length < w * h)
{
if(biomes.data != nullptr) delete [] biomes.data;
biomes = BiomeArray(w * h);
}
MemSect(0);
Arrays::fill(biomes, 0, w * h, biome);
+6 -2
View File
@@ -9,6 +9,7 @@
#include "Rose.h"
#include "HugeMushroomFeature.h"
#include "DoublePlantFeature.h"
#include "TallGrass2.h"
#include "../Minecraft.Client/Minecraft.h"
#include "../Minecraft.Client/Common/Colours/ColourTable.h"
#include "Level.h"
@@ -175,10 +176,13 @@ void ForestBiome::decorate(Level* level, Random* rand, int xo, int zo)
{
do
{
int plantType = rand->nextInt(3);
int l1 = rand->nextInt(3);
DoublePlantFeature plantFeature;
if (l1 == 0) plantFeature.setPlantType(TallGrass2::LILAC);
else if (l1 == 1) plantFeature.setPlantType(TallGrass2::ROSE_BUSH);
else if (l1 == 2) plantFeature.setPlantType(TallGrass2::PEONY);
for (int attempts = 2; attempts >= 0; --attempts)
for (int attempts = 0; attempts < 5; ++attempts)
{
int dx = rand->nextInt(16) + 8;
int dz = rand->nextInt(16) + 8;
+1
View File
@@ -47,6 +47,7 @@ FurnaceRecipes::FurnaceRecipes()
addFurnaceRecipy(Tile::lapisOre_Id, new ItemInstance(Item::dye_powder, 1, DyePowderItem::BLUE), .2f);
addFurnaceRecipy(Tile::netherQuartz_Id, new ItemInstance(Item::netherQuartz), .2f);
addFurnaceRecipy(Tile::tree2Trunk_Id, new ItemInstance(Item::coal, 1, CoalItem::CHAR_COAL), .15f);
}
void FurnaceRecipes::addFurnaceRecipy(int itemId, ItemInstance *result, float value)
+12
View File
@@ -17,6 +17,18 @@ bool HalfTransparentTile::isSolidRender(bool isServerLevel)
bool HalfTransparentTile::shouldRenderFace(LevelSource *level, int x, int y, int z, int face)
{
int id = level->getTile(x, y, z);
if (this->id == 95) // Tile::stained_glass
{
bool isBlocking = level->isTopSolidBlocking(x, y, z);
if (face == 0 && level->isSolidBlockingTile(x, y + 1, z) != isBlocking) return true; // Facing::DOWN
else if (face == 1 && level->isTopSolidBlocking(x, y - 1, z) != isBlocking) return true; // Facing::UP
else if (face == 2 && level->isSolidBlockingTile(x, y, z + 1) != isBlocking) return true; // Facing::NORTH
else if (face == 3 && level->isSolidBlockingTile(x, y, z - 1) != isBlocking) return true; // Facing::SOUTH
else if (face == 4 && level->isSolidBlockingTile(x + 1, y, z) != isBlocking) return true; // Facing::WEST
else if (face == 5 && level->isSolidBlockingTile(x - 1, y, z) != isBlocking) return true; // Facing::EAST
else if (face == 6 && level->isSolidBlockingTile(x, y, z) != isBlocking) return true; // not really a direction? is this supposed to be here?
}
if (!allowSame && id == this->id) return false;
return Tile::shouldRenderFace(level, x, y, z, face);
}
+35 -2
View File
@@ -1,6 +1,39 @@
#include "stdafx.h"
#include "IceBiome.h"
#include "net.minecraft.world.level.tile.h"
#include "IceSpikeFeature.h"
#include "SpruceFeature.h"
#include "Level.h"
#include "Random.h"
IceBiome::IceBiome(int id) : Biome(id)
IceBiome::IceBiome(int id, bool isSpikes) : Biome(id)
{
};
this->isSpikes = isSpikes;
if (isSpikes)
{
topMaterial = static_cast<byte>(Tile::snow_Id);
}
friendlies.clear();
}
void IceBiome::decorate(Level *level, Random *random, int xo, int zo)
{
if (this->isSpikes)
{
IceSpikeFeature iceSpikeFeature;
for (int i = 0; i < 3; ++i)
{
int j = random->nextInt(16) + 8;
int k = random->nextInt(16) + 8;
int y = level->getHeightmap(xo + j, zo + k);
iceSpikeFeature.place(level, random, xo + j, y, zo + k);
}
}
Biome::decorate(level, random, xo, zo);
}
Feature* IceBiome::getTreeFeature(Random* random)
{
return new SpruceFeature(false);
}
+5 -1
View File
@@ -3,6 +3,10 @@
class IceBiome : public Biome
{
private:
bool isSpikes;
public:
IceBiome(int id);
IceBiome(int id, bool isSpikes = false);
virtual void decorate(Level *level, Random *random, int xo, int zo) override;
virtual Feature* getTreeFeature(Random* random) override;
};
+111
View File
@@ -0,0 +1,111 @@
#include "IceSpikeFeature.h"
#include <cmath>
#include "Level.h"
#include "Tile.h"
#include <algorithm>
IceSpikeFeature::IceSpikeFeature() {}
bool IceSpikeFeature::place(Level *level, Random *random, int x, int y, int z)
{
while (level->isEmptyTile(x, y, z) && y > 2)
{
y--;
}
if (level->getTile(x, y, z) != Tile::snow_Id)
{
return false;
}
y += random->nextInt(4);
int height = random->nextInt(4) + 7;
int baseRadius = height / 4 + random->nextInt(2);
if (baseRadius > 1 && random->nextInt(60) == 0)
{
y += 10 + random->nextInt(30);
}
for (int k = 0; k < height; ++k)
{
float f = (1.0F - (float)k / (float)height) * (float)baseRadius;
int l = ceil(f);
for (int ix = -l; ix <= l; ++ix)
{
float f1 = (float)abs(ix) - 0.25F;
for (int iz = -l; iz <= l; ++iz)
{
float f2 = (float)abs(iz) - 0.25F;
if ((ix == 0 && iz == 0 || f1 * f1 + f2 * f2 <= f * f) &&
(ix != -l && ix != l && iz != -l && iz != l || random->nextFloat() <= 0.75F))
{
int currentTile = level->getTile(x + ix, y + k, z + iz);
if (level->isEmptyTile(x + ix, y + k, z + iz) || currentTile == Tile::dirt_Id ||
currentTile == Tile::snow_Id || currentTile == Tile::ice_Id)
{
level->setTileAndData(x + ix, y + k, z + iz, Tile::packedIce_Id, 0, 3);
}
if (k != 0 && l > 1)
{
currentTile = level->getTile(x + ix, y - k, z + iz);
if (level->isEmptyTile(x + ix, y - k, z + iz) || currentTile == Tile::dirt_Id ||
currentTile == Tile::snow_Id || currentTile == Tile::ice_Id)
{
level->setTileAndData(x + ix, y - k, z + iz, Tile::packedIce_Id, 0, 3);
}
}
}
}
}
}
int rootRadius = baseRadius - 1;
if (rootRadius < 0) rootRadius = 0;
else if (rootRadius > 1) rootRadius = 1;
for (int rx = -rootRadius; rx <= rootRadius; ++rx)
{
for (int rz = -rootRadius; rz <= rootRadius; ++rz)
{
int curY = y - 1;
int depthCounter = 50;
if (abs(rx) == 1 && abs(rz) == 1) depthCounter = random->nextInt(5);
while (curY > 50)
{
int t = level->getTile(x + rx, curY, z + rz);
if (!level->isEmptyTile(x + rx, curY, z + rz) && t != Tile::dirt_Id &&
t != Tile::snow_Id && t != Tile::ice_Id && t != Tile::packedIce_Id)
{
break;
}
level->setTileAndData(x + rx, curY, z + rz, Tile::packedIce_Id, 0, 3);
curY--;
depthCounter--;
if (depthCounter <= 0)
{
curY -= (random->nextInt(5) + 1);
depthCounter = random->nextInt(5);
}
}
}
}
return true;
}
+10
View File
@@ -0,0 +1,10 @@
#pragma once
#include "Feature.h"
class IceSpikeFeature : public Feature
{
public:
IceSpikeFeature();
virtual bool place(Level *level, Random *random, int x, int y, int z) override;
};
+20 -10
View File
@@ -6,14 +6,23 @@
#include "net.minecraft.world.entity.animal.h"
#include "JungleBiome.h"
JungleBiome::JungleBiome(int id) : Biome(id)
JungleBiome::JungleBiome(int id, bool isEdge) : Biome(id)
{
decorator->treeCount = 50;
this->isEdge = isEdge;
if (isEdge)
{
decorator->treeCount = 2;
}
else
{
decorator->treeCount = 50;
enemies.push_back(new MobSpawnerData(eTYPE_OCELOT, 2, 1, 1));
}
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));
}
@@ -23,13 +32,13 @@
{
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
return new BasicTree(false);
}
if (random->nextInt(2) == 0)
{
return new GroundBushFeature(TreeTile::JUNGLE_TRUNK, LeafTile::NORMAL_LEAF);
return new GroundBushFeature(TreeTile::JUNGLE_TRUNK, LeafTile::NORMAL_LEAF); // Shrub
}
if (random->nextInt(3) == 0)
if (!this->isEdge && random->nextInt(3) == 0)
{
return new MegaTreeFeature(false, 10 + random->nextInt(20), TreeTile::JUNGLE_TRUNK, LeafTile::JUNGLE_LEAF);
}
@@ -52,12 +61,13 @@
PIXBeginNamedEvent(0, "Adding vines");
VinesFeature *vines = new VinesFeature();
for (int i = 0; i < 50; i++)
for (int j = 0; j < 50; j++)
{
int x = xo + random->nextInt(16) + 8;
int y = Level::genDepth / 2;
int y2 = 128;
int z = zo + random->nextInt(16) + 8;
vines->place(level, random, x, y, z);
vines->place(level, random, x, y2, z);
}
delete vines;
PIXEndNamedEvent();
}
+7 -5
View File
@@ -4,11 +4,13 @@
class JungleBiome : public Biome
{
private:
bool isEdge;
public:
JungleBiome(int id);
JungleBiome(int id, bool isEdge);
Feature *getTreeFeature(Random *random);
Feature *getGrassFeature(Random *random);
void decorate(Level *level, Random *random, int xo, int zo);
virtual Feature *getTreeFeature(Random *random) override;
virtual Feature *getGrassFeature(Random *random) override;
virtual void decorate(Level *level, Random *random, int xo, int zo) override;
};
+1 -1
View File
@@ -64,7 +64,7 @@ public:
public:
static const int MAX_XBOX_BOATS = 60; // Max number of boats
static const int MAX_CONSOLE_MINECARTS = 60;
static const int MAX_CONSOLE_MINECARTS = 250;
static const int MAX_DISPENSABLE_FIREBALLS = 300;
static const int MAX_DISPENSABLE_PROJECTILES = 400;
+217
View File
@@ -0,0 +1,217 @@
#include "stdafx.h"
#include "MegaPineTreeFeature.h"
#include "net.minecraft.world.level.h"
#include "net.minecraft.world.level.tile.h"
#include "Random.h"
#include "Level.h"
MegaPineTreeFeature::MegaPineTreeFeature(bool doUpdate, bool useBaseHeight) : Feature(doUpdate), useBaseHeight(useBaseHeight)
{
}
// Port of WorldGenHugeTrees.func_175925_a
// Places a layer of leaves centered on the 2x2 trunk at (x,z),(x+1,z),(x,z+1),(x+1,z+1)
// Equivalent to: keep block if it's within `radius` of at least one of the 4 trunk corners.
void MegaPineTreeFeature::placeLeavesLayer(Level *level, int x, int z, int y, int radius, Random *random)
{
int rSq = radius * radius;
// Loop from x-radius to x+radius+1 (extra +1 for 2x2 trunk width)
for (int xx = x - radius; xx <= x + radius + 1; xx++)
{
for (int zz = z - radius; zz <= z + radius + 1; zz++)
{
// Distance from each of the 4 trunk corner columns
int j0 = xx - x, k0 = zz - z;
int j1 = xx - (x+1), k1 = zz - z;
int j2 = xx - x, k2 = zz - (z+1);
int j3 = xx - (x+1), k3 = zz - (z+1);
// Place leaf if within radius of ANY trunk corner
if (j0*j0 + k0*k0 > rSq &&
j1*j1 + k1*k1 > rSq &&
j2*j2 + k2*k2 > rSq &&
j3*j3 + k3*k3 > rSq)
{
continue;
}
// Java: only place on air or leaf blocks (isAirLeaves equivalent)
int t = level->getTile(xx, y, zz);
if (t == 0 || t == Tile::leaves_Id || t == Tile::leaves2_Id)
{
placeBlock(level, xx, y, zz, Tile::leaves_Id, LeafTile::EVERGREEN_LEAF);
}
}
}
}
// Port of WorldGenMegaPineTree.func_150541_c
// Generates conical leaf crown from the top of the tree downward.
// p_150541_5_ is always 0 in the original call (base radius offset)
void MegaPineTreeFeature::placeCrown(Level *level, int x, int z, int treeTop, Random *random)
{
// Crown span = rand.nextInt(5) + (useBaseHeight ? baseHeight=13 : 3)
int crownHeight = random->nextInt(5) + (this->useBaseHeight ? 13 : 3);
int prevRadius = 0;
// k goes from (treeTop - crownHeight) to treeTop
for (int k = treeTop - crownHeight; k <= treeTop; k++)
{
int l = treeTop - k; // l = distance from top: goes from crownHeight down to 0
int i1 = (int)floorf((float)l / (float)crownHeight * 3.5f); // base radius at layer
// Stagger: if same radius as layer below and even Y, expand by 1
int layerRadius = i1 + (l > 0 && i1 == prevRadius && (k & 1) == 0 ? 1 : 0);
placeLeavesLayer(level, x, z, k, layerRadius, random);
prevRadius = i1;
}
}
// Port of WorldGenMegaPineTree.func_175934_c
// Searches downward from y+2 to y-3 and replaces first grass/dirt with Podzol
void MegaPineTreeFeature::func_175934_c(Level *level, int x, int z, int y)
{
for (int i = 2; i >= -3; --i)
{
int targetY = y + i;
int tile = level->getTile(x, targetY, z);
// canSustainPlant equivalent: grass or dirt
if (tile == Tile::grass_Id || tile == Tile::dirt_Id)
{
placeBlock(level, x, targetY, z, Tile::dirt_Id, DirtTile::PODZOL);
break;
}
if (tile != 0 && i < 0) break;
}
}
// Port of WorldGenMegaPineTree.func_175933_b
// Spreads Podzol in a 5x5 (minus corners) pattern centered at (x,z)
void MegaPineTreeFeature::func_175933_b(Level *level, int x, int z, int y)
{
for (int i = -2; i <= 2; ++i)
{
for (int j = -2; j <= 2; ++j)
{
if (abs(i) != 2 || abs(j) != 2) // skip the 4 far corners
{
func_175934_c(level, x + i, z + j, y);
}
}
}
}
// Port of WorldGenMegaPineTree.func_180711_a
// Places Podzol patches at the 4 corners + 5 random border positions
void MegaPineTreeFeature::placeBase(Level *level, Random *random, int x, int z, int y)
{
// 4 fixed corners (relative to 2x2 trunk)
func_175933_b(level, x - 1, z - 1, y); // west().north()
func_175933_b(level, x + 2, z - 1, y); // east(2).north()
func_175933_b(level, x - 1, z + 2, y); // west().south(2)
func_175933_b(level, x + 2, z + 2, y); // east(2).south(2)
// 5 random border positions (8x8 grid, only border cells)
for (int i = 0; i < 5; ++i)
{
int j = random->nextInt(64);
int k = j % 8;
int l = j / 8;
if (k == 0 || k == 7 || l == 0 || l == 7)
{
func_175933_b(level, x - 3 + k, z - 3 + l, y);
}
}
}
// Port of WorldGenHugeTrees.func_175929_a (space check)
// Returns true if the tree can grow: checks all blocks from y to y+height+1
bool MegaPineTreeFeature::canPlace(Level *level, Random *random, int x, int y, int z, int height)
{
if (y < 1 || y + height + 1 > Level::maxBuildHeight) return false;
for (int l = 0; l <= height + 1; l++)
{
int r = (l == 0) ? 1 : 2; // bottom layer: radius 1; rest: radius 2
int yy = y + l;
for (int xx = x - r; xx <= x + r + 1; xx++)
{
for (int zz = z - r; zz <= z + r + 1; zz++)
{
if (yy < 0 || yy >= Level::maxBuildHeight) return false;
int t = level->getTile(xx, yy, zz);
if (!isReplaceable(t)) return false;
}
}
}
// Ground check: all 4 blocks below the 2x2 trunk must be grass or dirt
auto isGround = [&](int bx, int bz) {
int t = level->getTile(bx, y - 1, bz);
return t == Tile::grass_Id || t == Tile::dirt_Id;
};
return isGround(x, z) && isGround(x+1, z) && isGround(x, z+1) && isGround(x+1, z+1);
}
bool MegaPineTreeFeature::isAirLeaves(Level *level, int x, int y, int z)
{
int t = level->getTile(x, y, z);
return t == 0 || t == Tile::leaves_Id || t == Tile::leaves2_Id;
}
// Equivalent to Java's canGrowInto: blocks the tree can grow through
bool MegaPineTreeFeature::isReplaceable(int tileId)
{
return tileId == 0
|| tileId == Tile::leaves_Id
|| tileId == Tile::leaves2_Id
|| tileId == Tile::grass_Id
|| tileId == Tile::dirt_Id
|| tileId == Tile::treeTrunk_Id
|| tileId == Tile::sapling_Id
|| tileId == Tile::deadBush_Id
|| tileId == Tile::tallgrass_Id
|| tileId == Tile::snow_Id;
}
bool MegaPineTreeFeature::place(Level *level, Random *random, int x, int y, int z)
{
// func_150533_a: rand.nextInt(maxVariation - baseHeight) + baseHeight
// = rand.nextInt(15 - 13) + 13 = rand.nextInt(2) + 13
int height = random->nextInt(2) + 13;
// func_175929_a: space check
if (!canPlace(level, random, x, y, z, height))
{
return false;
}
// func_150541_c: generate conical leaf crown first
placeCrown(level, x, z, y + height, random);
// Trunk: 2x2 column of spruce logs
for (int j = 0; j < height; j++)
{
if (isAirLeaves(level, x, y + j, z))
{
placeBlock(level, x, y + j, z, Tile::treeTrunk_Id, TreeTile::SPRUCE_TRUNK);
}
if (j < height - 1) // 3 extra columns stop 1 short of the top
{
if (isAirLeaves(level, x + 1, y + j, z))
{
placeBlock(level, x + 1, y + j, z, Tile::treeTrunk_Id, TreeTile::SPRUCE_TRUNK);
}
if (isAirLeaves(level, x + 1, y + j, z + 1))
{
placeBlock(level, x + 1, y + j, z + 1, Tile::treeTrunk_Id, TreeTile::SPRUCE_TRUNK);
}
if (isAirLeaves(level, x, y + j, z + 1))
{
placeBlock(level, x, y + j, z + 1, Tile::treeTrunk_Id, TreeTile::SPRUCE_TRUNK);
}
}
}
// func_180711_a: generate Podzol base patches
placeBase(level, random, x, z, y);
return true;
}
+22
View File
@@ -0,0 +1,22 @@
#pragma once
#include "Feature.h"
class MegaPineTreeFeature : public Feature
{
private:
bool useBaseHeight;
public:
MegaPineTreeFeature(bool doUpdate, bool useBaseHeight);
virtual bool place(Level *level, Random *random, int x, int y, int z) override;
private:
void placeLeavesLayer(Level *level, int x, int z, int y, int radius, Random *random);
void placeCrown(Level *level, int x, int z, int treeTop, Random *random);
void placeBase(Level *level, Random *random, int x, int z, int y);
void func_175933_b(Level *level, int x, int z, int y);
void func_175934_c(Level *level, int x, int z, int y);
bool canPlace(Level *level, Random *random, int x, int y, int z, int height);
bool isAirLeaves(Level *level, int x, int y, int z);
bool isReplaceable(int tileId);
};
+8
View File
@@ -76,6 +76,14 @@ int MutatedBiome::getTemperatureCategory() const {
return m_baseBiome ? m_baseBiome->getTemperatureCategory() : Biome::getTemperatureCategory();
}
Feature* MutatedBiome::getFlowerFeature(Random* random, int x, int y, int z) {
return m_baseBiome ? m_baseBiome->getFlowerFeature(random, x, y, z) : Biome::getFlowerFeature(random, x, y, z);
}
int MutatedBiome::getRandomDoublePlantType(Random* random) {
return m_baseBiome ? m_baseBiome->getRandomDoublePlantType(random) : Biome::getRandomDoublePlantType(random);
}
void MutatedBiome::buildSurfaceAt(Level* level, Random* random, ChunkPrimer* primer, int x, int z, double noiseVal) {
if (m_baseBiome)
m_baseBiome->buildSurfaceAt(level, random, primer, x, z, noiseVal);
+2
View File
@@ -15,6 +15,8 @@ public:
virtual float getCreatureProbability() const override;
virtual bool isSame(const Biome* other) const override;
virtual int getTemperatureCategory() const override;
virtual Feature* getFlowerFeature(Random* random, int x, int y, int z) override;
virtual int getRandomDoublePlantType(Random* random) override;
virtual void buildSurfaceAt(Level* level, Random* random, ChunkPrimer* primer, int x, int z, double noiseVal) override;
Biome* getBaseBiome() const { return m_baseBiome; } // Rimosso const
+1 -1
View File
@@ -79,7 +79,7 @@ bool NoteBlockTile::triggerEvent(Level *level, int x, int y, int z, int i, int n
break;
}
app.DebugPrintf("NoteBlockTile::triggerEvent - playSound - pitch = %f\n",pitch);
level->playSound(x + 0.5, y + 0.5, z + 0.5, iSound, 3, pitch);
level->playSound(x + 0.5, y + 0.5, z + 0.5, iSound, 3, pitch, 64.0f);
level->addParticle(eParticleType_note, x + 0.5, y + 1.2, z + 0.5, note / 24.0, 0, 0);
return true;
+72 -13
View File
@@ -1,8 +1,12 @@
#include "stdafx.h"
#include "net.minecraft.world.level.biome.h"
#include "DoublePlantFeature.h"
#include "TallGrass2.h"
#include "Level.h"
PlainsBiome::PlainsBiome(int id) : Biome(id)
PlainsBiome::PlainsBiome(int id,bool plains) : Biome(id)
{
_plains = plains;
friendlies.push_back(new MobSpawnerData(eTYPE_HORSE, 5, 2, 6));
friendlies.push_back(new MobSpawnerData(eTYPE_RABBIT, 4, 2, 3));
@@ -13,18 +17,73 @@ PlainsBiome::PlainsBiome(int id) : Biome(id)
Feature* PlainsBiome::getFlowerFeature(Random* random, int x, int y, int z)
{
int fType = random->nextInt(3);
if (fType == 0) return new FlowerFeature(Tile::rose_Id, Rose::OXEYE_DAISY);
if (fType == 1) return new FlowerFeature(Tile::rose_Id, Rose::AZURE_BLUET);
// Tulipani (qualsiasi colore)
int tulipColor = random->nextInt(4);
switch (tulipColor) {
case 0: return new FlowerFeature(Tile::rose_Id, Rose::RED_TULIP);
case 1: return new FlowerFeature(Tile::rose_Id, Rose::ORANGE_TULIP);
case 2: return new FlowerFeature(Tile::rose_Id, Rose::WHITE_TULIP);
case 3: return new FlowerFeature(Tile::rose_Id, Rose::PINK_TULIP);
}
double d0 = GRASS_COLOR_NOISE->getValue((double)(x + 8) / 200.0,(double)(z + 8) / 200.0);
if (d0 < -0.8)
{
int j = random->nextInt(4);
switch (j) {
case 0: return new FlowerFeature(Tile::rose_Id, Rose::ORANGE_TULIP);
case 1: return new FlowerFeature(Tile::rose_Id, Rose::RED_TULIP);
case 2: return new FlowerFeature(Tile::rose_Id, Rose::PINK_TULIP);
case 3: return new FlowerFeature(Tile::rose_Id, Rose::WHITE_TULIP);
}
}else if (random->nextInt(3) > 0)
{
int i = random->nextInt(3);
if (i == 1) {
return new FlowerFeature(Tile::rose_Id,Rose::AZURE_BLUET);
} else
return new FlowerFeature(Tile::rose_Id,Rose::OXEYE_DAISY);
}
else
{
return new FlowerFeature(Tile::flower_Id);
}
return Biome::getFlowerFeature(random, x, y, z);
}
void PlainsBiome::decorate(Level* level, Random* rand, int xo, int zo)
{
double d0 = GRASS_COLOR_NOISE->getValue((double)(xo + 8) / 200.0,(double)(zo + 8) / 200.0);
if (d0 < -0.8)
{
decorator->flowerCount = 15;
decorator->grassCount = 5;
}
else
{
decorator->flowerCount = 4;
decorator->grassCount = 10;
DOUBLE_PLANT_GENERATOR->setPlantType(TallGrass2::TALL_GRASS);
for (int i = 0; i < 7; ++i)
{
int x = xo + rand->nextInt(16) + 8;
int z = zo + rand->nextInt(16) + 8;
int y = rand->nextInt(level->getHeightmap(x, z) + 32);
DOUBLE_PLANT_GENERATOR->place(level, rand, x, y, z);
}
}
if (_plains)
{
DOUBLE_PLANT_GENERATOR->setPlantType(TallGrass2::SUNFLOWER);
for (int i1 = 0; i1 < 10; ++i1)
{
int j1 = rand->nextInt(16) + 8;
int k1 = rand->nextInt(16) + 8;
int l1 = rand->nextInt(level->getHeightmap(j1, k1) + 32);
DOUBLE_PLANT_GENERATOR->place(level, rand, j1, l1, k1);
}
}
Biome::decorate(level, rand, xo, zo);
}
+6 -1
View File
@@ -6,6 +6,11 @@ class PlainsBiome : public Biome
{
friend class Biome;
protected:
PlainsBiome(int id);
bool _plains;
protected:
PlainsBiome(int id,bool plains);
virtual Feature* getFlowerFeature(Random* random, int x, int y, int z) override;
void decorate(Level* level, Random* rand, int xo, int zo)override;
bool isPlains() { return _plains; };
};
+16
View File
@@ -34,6 +34,14 @@ intArray RegionHillsLayer::getArea(int xo, int yo, int w, int h)
{
next = Biome::taigaHills->id;
}
else if (old == Biome::coldTaiga->id)
{
next = Biome::coldTaigaHills->id;
}
else if (old == Biome::megaTaiga->id)
{
next = Biome::megaTaigaHills->id;
}
else if (old == Biome::plains->id)
{
next = Biome::forest->id;
@@ -42,11 +50,19 @@ intArray RegionHillsLayer::getArea(int xo, int yo, int w, int h)
{
next = Biome::iceMountains->id;
}
else if (old == Biome::iceFlats->id)
{
next = Biome::iceSpikes->id;
}
else if (old == Biome::jungle->id)
{
next = Biome::jungleHills->id;
}
/*else if (old == Biome::savanna->id)
{
next = Biome::savannaPlateau->id;
}*/
if (next == old)
{
result[x + y * w] = old;
+22 -1
View File
@@ -7,6 +7,7 @@
#include "Sapling.h"
#include "SavannaTreeFeature.h"
#include "RoofTreeFeature.h"
#include "MegaPineTreeFeature.h"
int Sapling::SAPLING_NAMES[SAPLING_NAMES_SIZE] = {
IDS_TILE_SAPLING_OAK,
@@ -85,7 +86,27 @@ void Sapling::growTree(Level *level, int x, int y, int z, Random *random)
if (data == TYPE_EVERGREEN)
{
f = new SpruceFeature(true);
for (ox = 0; ox >= -1; ox--)
{
for (oz = 0; oz >= -1; oz--)
{
if (isSapling(level, x + ox, y, z + oz, TYPE_EVERGREEN) &&
isSapling(level, x + ox + 1, y, z + oz, TYPE_EVERGREEN) &&
isSapling(level, x + ox, y, z + oz + 1, TYPE_EVERGREEN) &&
isSapling(level, x + ox + 1, y, z + oz + 1, TYPE_EVERGREEN))
{
f = new MegaPineTreeFeature(true, random->nextBoolean());
multiblock = true;
break;
}
}
if (f != nullptr) break;
}
if (f == nullptr)
{
ox = oz = 0;
f = new SpruceFeature(true);
}
}
else if (data == TYPE_BIRCH)
{
+50 -1
View File
@@ -5,6 +5,10 @@
#include "net.minecraft.world.entity.h"
#include "SavannaBiome.h"
#include "SavannaTreeFeature.h"
#include "DoublePlantFeature.h"
#include "TallGrass2.h"
#include "Level.h"
#include "Random.h"
SavannaBiome::SavannaBiome(int id) : Biome(id)
{
@@ -48,6 +52,51 @@ Feature *SavannaBiome::getFlowerFeature(Random *random, int x, int y, int z)
int SavannaBiome::getRandomDoublePlantType(Random *random)
{
return 0;
}
void SavannaBiome::decorate(Level *level, Random *random, int xo, int zo)
{
DOUBLE_PLANT_GENERATOR->setPlantType(TallGrass2::TALL_GRASS);
for (int i = 0; i < 7; ++i)
{
int x = xo + random->nextInt(16) + 8;
int z = zo + random->nextInt(16) + 8;
int y = random->nextInt(level->getHeightmap(x, z) + 32);
DOUBLE_PLANT_GENERATOR->place(level, random, x, y, z);
}
Biome::decorate(level, random, xo, zo);
}
MutatedSavannaBiome::MutatedSavannaBiome(int id, Biome* baseBiome) : MutatedBiome(id, baseBiome)
{
decorator->treeCount = 2;
decorator->flowerCount = 2;
decorator->grassCount = 5;
}
void MutatedSavannaBiome::buildSurfaceAtDefault(Level *level, Random *random, byte* chunkBlocks, int x, int z, double noiseVal)
{
topMaterial = static_cast<byte>(Tile::grass_Id);
material = static_cast<byte>(Tile::dirt_Id);
if (noiseVal > 1.75)
{
topMaterial = static_cast<byte>(Tile::stone_Id);
material = static_cast<byte>(Tile::stone_Id);
}
else if (noiseVal > -0.5)
{
topMaterial = static_cast<byte>(Tile::dirt_Id);
material = static_cast<byte>(Tile::dirt_Id);
}
Biome::buildSurfaceAtDefault(level, random, chunkBlocks, x, z, noiseVal);
}
void MutatedSavannaBiome::decorate(Level *level, Random *random, int xo, int zo)
{
MutatedBiome::decorate(level, random, xo, zo);
}
+11
View File
@@ -1,5 +1,6 @@
#pragma once
#include "Biome.h"
#include "MutatedBiome.h"
class SavannaBiome : public Biome
{
@@ -12,4 +13,14 @@ public:
//virtual int getWaterColor() override;
virtual Feature *getFlowerFeature(Random *random, int x, int y, int z) override;
virtual int getRandomDoublePlantType(Random *random) override;
virtual void decorate(Level *level, Random *random, int xo, int zo) override;
};
class MutatedSavannaBiome : public MutatedBiome
{
public:
MutatedSavannaBiome(int id, Biome* baseBiome);
virtual void buildSurfaceAtDefault(Level *level, Random *random, byte* chunkBlocks, int x, int z, double noiseVal) override;
virtual void decorate(Level *level, Random *random, int xo, int zo) override;
};
+36 -4
View File
@@ -2,26 +2,58 @@
#include "net.minecraft.world.level.h"
#include "net.minecraft.world.level.biome.h"
#include "SwampTreeFeature.h"
#include "net.minecraft.world.level.tile.h"
#include "PerlinNoise.h"
SwampBiome::SwampBiome(int id) : Biome(id)
{
decorator->treeCount = 2;
decorator->flowerCount = -999;
decorator->flowerCount = 1;
decorator->deadBushCount = 1;
decorator->mushroomCount = 8;
decorator->reedsCount = 10;
decorator->clayCount = 1;
decorator->waterlilyCount = 4;
decorator->sandCount = 0;
decorator->grassCount = 5;
// waterColor = 0xe0ffae;
enemies.push_back(new MobSpawnerData(eTYPE_SLIME, 1, 1, 1));
}
Feature *SwampBiome::getTreeFeature(Random *random)
{
return new SwampTreeFeature(); // 4J used to return member swampTree, now returning newly created object so that caller can be consistently resposible for cleanup
return new SwampTreeFeature();
}
void SwampBiome::buildSurfaceAtDefault(Level *level, Random *random, byte* chunkBlocks, int x, int z, double noiseVal)
{
double d0 = GRASS_COLOR_NOISE->getValue(x * 0.25, z * 0.25);
if (d0 > 0.0)
{
int localX = x & 15;
int localZ = z & 15;
for (int y = 255; y >= 0; --y)
{
int index = (localX * 16 + localZ) * 256 + y;
if (chunkBlocks[index] != 0)
{
if (y == 62 && chunkBlocks[index] != static_cast<byte>(Tile::water_Id))
{
chunkBlocks[index] = static_cast<byte>(Tile::water_Id);
if (d0 < 0.12)
{
chunkBlocks[index + 1] = static_cast<byte>(Tile::waterLily_Id);
}
}
break;
}
}
}
Biome::buildSurfaceAtDefault(level, random, chunkBlocks, x, z, noiseVal);
}
// 4J Stu - Not using these any more
+1
View File
@@ -14,6 +14,7 @@ public:
public:
virtual Feature *getTreeFeature(Random *random);
virtual void buildSurfaceAtDefault(Level *level, Random *random, byte* chunkBlocks, int x, int z, double noiseVal) override;
virtual Feature* getFlowerFeature(Random* random, int x, int y, int z) override{return new FlowerFeature(Tile::rose_Id, Rose::BLUE_ORCHID);}
// 4J Stu - Not using these any more
//virtual int getGrassColor();
+82 -2
View File
@@ -4,20 +4,100 @@
#include "net.minecraft.world.level.levelgen.feature.h"
#include "net.minecraft.world.level.biome.h"
TaigaBiome::TaigaBiome(int id) : Biome(id)
#include "net.minecraft.world.level.tile.h"
#include "DoublePlantFeature.h"
#include "TallGrass2.h"
#include "Level.h"
#include "Random.h"
#include "MegaPineTreeFeature.h"
TaigaBiome::TaigaBiome(int id, int type) : Biome(id)
{
this->type = type;
friendlies_wolf.push_back(new MobSpawnerData(eTYPE_WOLF, 8, 4, 4)); // 4J - moved to their own category
friendlies.push_back(new MobSpawnerData(eTYPE_RABBIT, 4, 2, 3));
decorator->treeCount = 10;
decorator->grassCount = 1;
if (type != 1 && type != 2)
{
decorator->grassCount = 1;
decorator->mushroomCount = 1;
}
else
{
decorator->grassCount = 7;
decorator->deadBushCount = 1;
decorator->mushroomCount = 3;
}
}
Feature *TaigaBiome::getTreeFeature(Random *random)
{
if (type == 1 || type == 2)
{
if (random->nextInt(3) == 0)
{
return new MegaPineTreeFeature(false, random->nextBoolean());
}
}
if (random->nextInt(3) == 0)
{
return new PineFeature();
}
return new SpruceFeature(false);
}
void TaigaBiome::decorate(Level *level, Random *random, int xo, int zo)
{
if (type == 1 || type == 2)
{
int count = random->nextInt(3);
for (int i = 0; i < count; ++i)
{
int x = xo + random->nextInt(16) + 8;
int z = zo + random->nextInt(16) + 8;
int y = level->getHeightmap(x, z);
for (int dx = -1; dx <= 1; ++dx) {
for (int dy = -1; dy <= 1; ++dy) {
for (int dz = -1; dz <= 1; ++dz) {
int tileAt = level->getTile(x + dx, y + dy, z + dz);
if (random->nextInt(4) != 0 && (tileAt == 0 || tileAt == Tile::grass_Id)) {
level->setTileAndData(x + dx, y + dy, z + dz, Tile::mossyCobblestone_Id, 0, Tile::UPDATE_CLIENTS);
}
}
}
}
}
}
DOUBLE_PLANT_GENERATOR->setPlantType(TallGrass2::LARGE_FERN);
for (int i = 0; i < 7; ++i)
{
int x = xo + random->nextInt(16) + 8;
int z = zo + random->nextInt(16) + 8;
int y = random->nextInt(level->getHeightmap(x, z) + 32);
DOUBLE_PLANT_GENERATOR->place(level, random, x, y, z);
}
Biome::decorate(level, random, xo, zo);
}
void TaigaBiome::buildSurfaceAtDefault(Level *level, Random *random, byte* chunkBlocks, int x, int z, double noiseVal)
{
if (type == 1 || type == 2)
{
topMaterial = static_cast<byte>(Tile::grass_Id);
material = static_cast<byte>(Tile::dirt_Id);
if (noiseVal > 1.75)
{
topMaterial = static_cast<byte>(Tile::dirt_Id);
}
else if (noiseVal > -0.95)
{
topMaterial = static_cast<byte>(Tile::dirt_Id);
}
}
Biome::buildSurfaceAtDefault(level, random, chunkBlocks, x, z, noiseVal);
}
+6 -2
View File
@@ -3,8 +3,12 @@
class TaigaBiome : public Biome
{
private:
int type;
public:
TaigaBiome(int id);
TaigaBiome(int id, int type = 0);
virtual Feature *getTreeFeature(Random *random);
virtual Feature *getTreeFeature(Random *random) override;
virtual void decorate(Level *level, Random *random, int xo, int zo) override;
virtual void buildSurfaceAtDefault(Level *level, Random *random, byte* chunkBlocks, int x, int z, double noiseVal) override;
};
+2 -2
View File
@@ -259,7 +259,7 @@ Tile* Tile::prismarine = nullptr;
Tile* Tile::tree2Trunk = nullptr;
Tile* Tile::packed_ice = nullptr;
Tile* Tile::packedIce = nullptr;
TallGrass2* Tile::tallgrass2 = nullptr;
@@ -520,7 +520,7 @@ void Tile::staticCtor()
Tile::coalBlock = (new Tile(173, Material::stone)) ->setBaseItemTypeAndMaterial(Item::eBaseItemType_block, Item::eMaterial_coal)->setDestroyTime(5.0f)->setExplodeable(10)->setSoundType(SOUND_STONE)->setIconName(L"coal_block")->setDescriptionId(IDS_TILE_COAL)->setUseDescriptionId(IDS_DESC_COAL_BLOCK);
//
Tile::packed_ice = (new PackedIceTile(174))->setDestroyTime(0.5f)->setSoundType(SOUND_GLASS)->setIconName(L"packed_ice")->setDescriptionId(IDS_TILE_PACKED_ICE)->setUseDescriptionId(IDS_DESC_PACKED_ICE);
Tile::packedIce = (new PackedIceTile(174))->setDestroyTime(0.5f)->setSoundType(SOUND_GLASS)->setIconName(L"packed_ice")->setDescriptionId(IDS_TILE_PACKED_ICE)->setUseDescriptionId(IDS_DESC_PACKED_ICE);
Tile::invertedDaylightDetector = static_cast<DaylightDetectorTile*>((new DaylightDetectorTile(178, true))->setDestroyTime(0.2f)->setSoundType(SOUND_WOOD)->setIconName(L"daylight_detector")->setDescriptionId(IDS_TILE_DAYLIGHT_DETECTOR)->setUseDescriptionId(IDS_DESC_DAYLIGHT_DETECTOR));
Tile::red_sandstone = (new RedSandStoneTile(179))->setBaseItemTypeAndMaterial(Item::eBaseItemType_structblock, Item::eMaterial_sand)->setSoundType(Tile::SOUND_STONE)->setDestroyTime(0.8f)->sendTileData()->setIconName(L"red_sandstone")->setDescriptionId(IDS_TILE_RED_SANDSTONE)->setUseDescriptionId(IDS_DESC_RED_SANDSTONE)->sendTileData();
+2 -2
View File
@@ -380,7 +380,7 @@ public:
static const int woolCarpet_Id = 171;
static const int clayHardened_Id = 172;
static const int coalBlock_Id = 173;
static const int packed_ice_Id = 174;
static const int packedIce_Id = 174;
static const int tallgrass2_Id = 175;
//176 standing_banner
//177 wall_banner
@@ -629,7 +629,7 @@ public:
static Tile* red_sandstone;
static Tile* stairs_red_sandstone;
static Tile* tree2Trunk;
static Tile* packed_ice;
static Tile* packedIce;
static Tile* seaLantern;
static Tile* prismarine;
@@ -1474,6 +1474,8 @@ set(_MINECRAFT_WORLD_COMMON_NET_MINECRAFT_WORLD_LEVEL_LEVELGEN_FEATURE
"${CMAKE_CURRENT_SOURCE_DIR}/LightGemFeature.h"
"${CMAKE_CURRENT_SOURCE_DIR}/MegaTreeFeature.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/MegaTreeFeature.h"
"${CMAKE_CURRENT_SOURCE_DIR}/MegaPineTreeFeature.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/MegaPineTreeFeature.h"
"${CMAKE_CURRENT_SOURCE_DIR}/MonsterRoomFeature.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/MonsterRoomFeature.h"
"${CMAKE_CURRENT_SOURCE_DIR}/OreFeature.cpp"
+8 -1
View File
@@ -1,4 +1,4 @@
![Tutorial World](.github/minecraft_title.png)
![Logo](.github/minecraft_title.png)
# Legacy Evolved
This project aims to backport the newer title updates back to the Minecraft: Legacy Console Edition Source Code Leak (which is based on TU19).
@@ -17,6 +17,13 @@ See our our [Contributor's Guide](./CONTRIBUTING.md) for more information on the
# Download
Users can download our [Nightly Build](https://github.com/piebotc/LegacyEvolved/releases/tag/nightly)! Simply download the `.zip` file and extract it!
# Acknowledgments
Huge thanks to the following projects:
- [Patoke/LCERenewed](https://github.com/Patoke/LCERenewed) - for some of the patches that required deep decompilation
- [smartcmd/MinecraftConsoles](https://github.com/smartcmd/MinecraftConsoles) - for creating such a great repo
## Build & Run
1. Install [Visual Studio 2022](https://aka.ms/vs/17/release/vs_community.exe) or [newer](https://visualstudio.microsoft.com/downloads/).