From 6a73583f039eae49ca36b527604ee804293cf7aa Mon Sep 17 00:00:00 2001 From: Donothan73 <104037911+Donothan73@users.noreply.github.com> Date: Tue, 17 Mar 2026 19:52:08 -0400 Subject: [PATCH] Fixes --- Minecraft.Client/PreStitchedTextureMap.cpp | 4 +- Minecraft.World/BiomeDecorator.cpp | 8 +-- Minecraft.World/Bush.cpp | 2 +- Minecraft.World/DyePowderItem.cpp | 7 ++- Minecraft.World/HoeItem.cpp | 2 +- Minecraft.World/IslandFeature.cpp | 65 ++-------------------- Minecraft.World/LeafTile.cpp | 4 +- 7 files changed, 21 insertions(+), 71 deletions(-) diff --git a/Minecraft.Client/PreStitchedTextureMap.cpp b/Minecraft.Client/PreStitchedTextureMap.cpp index 2f918e33b..baf16784c 100644 --- a/Minecraft.Client/PreStitchedTextureMap.cpp +++ b/Minecraft.Client/PreStitchedTextureMap.cpp @@ -1007,8 +1007,8 @@ void PreStitchedTextureMap::loadUVs() ADD_ICON(20, 12, L"granite"); ADD_ICON(20, 13, L"alpha_grass_side"); ADD_ICON(20, 14, L"alpha_grass_top"); - ADD_ICON(20, 15, L"alpha_leaves"); + ADD_ICON(20, 15, L"leaves_alpha"); - ADD_ICON(21, 0, L"alpha_leaves_opaque"); + ADD_ICON(21, 0, L"leaves_alpha_opaque"); } } diff --git a/Minecraft.World/BiomeDecorator.cpp b/Minecraft.World/BiomeDecorator.cpp index 35d61968d..38b3259f2 100644 --- a/Minecraft.World/BiomeDecorator.cpp +++ b/Minecraft.World/BiomeDecorator.cpp @@ -87,10 +87,6 @@ void BiomeDecorator::_init() void BiomeDecorator::decorate() { - PIXBeginNamedEvent(0,"Decorate ores"); - decorateOres(); - PIXEndNamedEvent(); - PIXBeginNamedEvent(0,"Decorate Islands"); for (int i = 0; i < random->nextInt(3)-1; i++) { @@ -101,6 +97,10 @@ void BiomeDecorator::decorate() } PIXEndNamedEvent(); + PIXBeginNamedEvent(0,"Decorate ores"); + decorateOres(); + PIXEndNamedEvent(); + PIXBeginNamedEvent(0,"Decorate sand/clay/gravel"); for (int i = 0; i < sandCount; i++) { diff --git a/Minecraft.World/Bush.cpp b/Minecraft.World/Bush.cpp index 5575c837f..b074d620e 100644 --- a/Minecraft.World/Bush.cpp +++ b/Minecraft.World/Bush.cpp @@ -33,7 +33,7 @@ bool Bush::mayPlace(Level *level, int x, int y, int z) bool Bush::mayPlaceOn(int tile) { - return tile == Tile::grass_Id || tile == Tile::dirt_Id || tile == Tile::farmland_Id; + return tile == Tile::grass_Id || tile == Tile::dirt_Id || tile == Tile::farmland_Id || tile == Tile::alphaGrass_Id; } void Bush::neighborChanged(Level *level, int x, int y, int z, int type) diff --git a/Minecraft.World/DyePowderItem.cpp b/Minecraft.World/DyePowderItem.cpp index 61750bfd8..9ec1fbdb3 100644 --- a/Minecraft.World/DyePowderItem.cpp +++ b/Minecraft.World/DyePowderItem.cpp @@ -251,7 +251,7 @@ bool DyePowderItem::growCrop(shared_ptr itemInstance, Level *level } return true; } - else if (tile == Tile::grass_Id) + else if (tile == Tile::grass_Id || tile == Tile::alphaGrass_Id) { if(!bTestUseOnOnly) { @@ -273,6 +273,11 @@ bool DyePowderItem::growCrop(shared_ptr itemInstance, Level *level { goto mainloop; } + + if (level->getTile(xx, yy - 1, zz) != Tile::alphaGrass_Id || level->isSolidBlockingTile(xx, yy, zz)) + { + goto mainloop; + } } if (level->getTile(xx, yy, zz) == 0) diff --git a/Minecraft.World/HoeItem.cpp b/Minecraft.World/HoeItem.cpp index 9714e5fcd..9bc239938 100644 --- a/Minecraft.World/HoeItem.cpp +++ b/Minecraft.World/HoeItem.cpp @@ -21,7 +21,7 @@ bool HoeItem::useOn(shared_ptr instance, shared_ptr player int targetType = level->getTile(x, y, z); int above = level->getTile(x, y + 1, z); - if (face != 0 && above == 0 && (targetType == Tile::grass_Id || targetType == Tile::dirt_Id)) + if (face != 0 && above == 0 && (targetType == Tile::grass_Id || targetType == Tile::dirt_Id || targetType == Tile::alphaGrass_Id)) { if(!bTestUseOnOnly) { diff --git a/Minecraft.World/IslandFeature.cpp b/Minecraft.World/IslandFeature.cpp index 65ed2cf5a..0cdf97860 100644 --- a/Minecraft.World/IslandFeature.cpp +++ b/Minecraft.World/IslandFeature.cpp @@ -33,9 +33,9 @@ bool IslandFeature::place(Level *level, Random *random, int x, int y, int z) int minY = y; int minZ = z; - int maxX = x + 16; + int maxX = x + 24; int maxY = y + 8; - int maxZ = z + 16; + int maxZ = z + 24; bool intersects = levelGenOptions->checkIntersects(minX, minY, minZ, maxX, maxY, maxZ); if(intersects) @@ -48,9 +48,9 @@ bool IslandFeature::place(Level *level, Random *random, int x, int y, int z) int spots = random->nextInt(4) + 4; for (int i = 0; i < spots; i++) { - double xr = random->nextDouble() * 6 + 3; + double xr = random->nextDouble() * 8 + 8; double yr = random->nextDouble() * 4 + 2; - double zr = random->nextDouble() * 6 + 3; + double zr = random->nextDouble() * 8 + 8; double xp = random->nextDouble() * (16 - xr - 2) + 1 + xr / 2; double yp = random->nextDouble() * (8 - yr - 4) + 2 + yr / 2; @@ -110,69 +110,14 @@ bool IslandFeature::place(Level *level, Random *random, int x, int y, int z) level->setTileAndData(x + xx, y + yy+99+height, z + zz, Tile::dirt_Id, 0, Tile::UPDATE_CLIENTS); level->setTileAndData(x + xx, y + yy+98+height, z + zz, Tile::stone_Id, 0, Tile::UPDATE_CLIENTS); } - } - } - } - for (int xx = 0; xx < 16; xx++) - { - for (int zz = 0; zz < 16; zz++) - { - for (int yy = 4; yy < 8; yy++) - { if (grid[((xx) * 16 + (zz)) * 8 + (yy)]) { - if (level->getTile(x + xx, y + yy - 1, z + zz) == Tile::dirt_Id && level->getBrightness(LightLayer::Sky, x + xx, y + yy, z + zz) > 0) - { - Biome *b = level->getBiome(x + xx, z + zz); - if (b->topMaterial == Tile::mycel_Id) level->setTileAndData(x + xx, y + yy - 1, z + zz, Tile::mycel_Id, 0, Tile::UPDATE_CLIENTS); - else level->setTileAndData(x + xx, y + yy - 1, z + zz, Tile::grass_Id, 0, Tile::UPDATE_CLIENTS); - } + level->setTileAndData(x + xx, y + yy+101+height, z + zz, Tile::water_Id, 0, Tile::UPDATE_CLIENTS); } } } } - if (Tile::tiles[tile]->material == Material::lava) - { - for (int xx = 0; xx < 16; xx++) - { - for (int zz = 0; zz < 16; zz++) - { - for (int yy = 0; yy < 8; yy++) - { - bool check = !grid[((xx) * 16 + (zz)) * 8 + (yy)] && ( - (xx < 15 && grid[(((xx + 1) * 16 + (zz)) * 8 + (yy))]) - || (xx > 0 && grid[(((xx - 1) * 16 + (zz)) * 8 + (yy))]) - || (zz < 15 && grid[(((xx) * 16 + (zz + 1)) * 8 + (yy))]) - || (zz > 0 && grid[(((xx) * 16 + (zz - 1)) * 8 + (yy))]) - || (yy < 7 && grid[(((xx) * 16 + (zz)) * 8 + (yy + 1))]) - || (yy > 0 && grid[(((xx) * 16 + (zz)) * 8 + (yy - 1))])); - - if (check) - { - if ((yy<4 || random->nextInt(2)!=0) && level->getMaterial(x + xx, y + yy, z + zz)->isSolid()) - { - level->setTileAndData(x + xx, y + yy, z + zz, Tile::stone_Id, 0, Tile::UPDATE_CLIENTS); - } - } - } - } - } - } - - // 4J - brought forward from 1.8.2 - if (Tile::tiles[tile]->material == Material::water) - { - for (int xx = 0; xx < 16; xx++) - { - for (int zz = 0; zz < 16; zz++) - { - int yy = 4; - if (level->shouldFreezeIgnoreNeighbors(x + xx, y + yy, z + zz)) level->setTileAndData(x + xx, y + yy, z + zz, Tile::ice_Id, 0, Tile::UPDATE_CLIENTS); - } - } - } - return true; } \ No newline at end of file diff --git a/Minecraft.World/LeafTile.cpp b/Minecraft.World/LeafTile.cpp index 6cb9c264d..0a0a05d4f 100644 --- a/Minecraft.World/LeafTile.cpp +++ b/Minecraft.World/LeafTile.cpp @@ -11,10 +11,10 @@ const unsigned int LeafTile::LEAF_NAMES[LEAF_NAMES_LENGTH] = { IDS_TILE_LEAVES_O IDS_TILE_LEAVES_SPRUCE, IDS_TILE_LEAVES_BIRCH, IDS_TILE_LEAVES_JUNGLE, - IDS_TILE_LEAVES_OAK, + IDS_TILE_LEAVES_JUNGLE, }; -const wstring LeafTile::TEXTURES[2][5] = { {L"leaves", L"leaves_spruce", L"leaves", L"leaves_jungle", L"alpha_leaves"}, {L"leaves_opaque", L"leaves_spruce_opaque", L"leaves_opaque", L"leaves_jungle_opaque", L"alpha_leaves_opaque"},}; +const wstring LeafTile::TEXTURES[2][5] = { {L"leaves", L"leaves_spruce", L"leaves", L"leaves_jungle", L"leaves_alpha"}, {L"leaves_opaque", L"leaves_spruce_opaque", L"leaves_opaque", L"leaves_jungle_opaque", L"leaves_alpha_opaque"},}; LeafTile::LeafTile(int id) : TransparentTile(id, Material::leaves, false, isSolidRender()) {