From f005b4e4852c1b80524390d57681b9f4691a6a92 Mon Sep 17 00:00:00 2001 From: Fireblade <72758695+Firebladedoge229@users.noreply.github.com> Date: Sun, 24 May 2026 23:53:05 -0400 Subject: [PATCH] fix: merge conflicts (again) --- Minecraft.Client/GameRenderer.cpp | 1 - Minecraft.World/Creeper.cpp | 2 +- Minecraft.World/SlimeTile.cpp | 5 ----- Minecraft.World/SlimeTile.h | 1 - Minecraft.World/StructureRecipies.cpp | 4 ++-- Minecraft.World/TallGrass2.cpp | 32 ++++++++++++++++++++++++++- Minecraft.World/TallGrass2.h | 1 + 7 files changed, 35 insertions(+), 11 deletions(-) diff --git a/Minecraft.Client/GameRenderer.cpp b/Minecraft.Client/GameRenderer.cpp index 8800ca0c..532ad094 100644 --- a/Minecraft.Client/GameRenderer.cpp +++ b/Minecraft.Client/GameRenderer.cpp @@ -147,7 +147,6 @@ GameRenderer::GameRenderer(Minecraft *mc) this->mc = mc; itemInHandRenderer = nullptr; -#ifndef MINECRAFT_SERVER_BUILD // 4J-PB - set up the local players iteminhand renderers here - needs to be done with lighting enabled so that the render geometry gets compiled correctly #ifndef MINECRAFT_SERVER_BUILD glEnable(GL_LIGHTING); diff --git a/Minecraft.World/Creeper.cpp b/Minecraft.World/Creeper.cpp index 3f674891..1469d09e 100644 --- a/Minecraft.World/Creeper.cpp +++ b/Minecraft.World/Creeper.cpp @@ -207,7 +207,7 @@ bool Creeper::mobInteract(shared_ptr player) { shared_ptr item = player->inventory->getSelected(); - if (item == nullptr || item->id != Item::flintAndSteel_Id) + if (item == nullptr || item->id != Item::flint_and_steel_Id) return Mob::mobInteract(player); playSound(eSoundType_FIRE_NEWIGNITE, 1, random->nextFloat() * 0.4f + 0.8f); diff --git a/Minecraft.World/SlimeTile.cpp b/Minecraft.World/SlimeTile.cpp index 3f7c0bd3..3dc45b0b 100644 --- a/Minecraft.World/SlimeTile.cpp +++ b/Minecraft.World/SlimeTile.cpp @@ -27,11 +27,6 @@ bool SlimeTile::shouldRenderFace(LevelSource *level, int x, int y, int z, int fa return true; } -int SlimeTile::getResourceCount(Random *random) -{ - return 0; -} - bool SlimeTile::isSolidRender() { return false; diff --git a/Minecraft.World/SlimeTile.h b/Minecraft.World/SlimeTile.h index 15aeacaa..9747d18d 100644 --- a/Minecraft.World/SlimeTile.h +++ b/Minecraft.World/SlimeTile.h @@ -11,7 +11,6 @@ public: virtual bool shouldRenderFace(LevelSource *level, int x, int y, int z, int face); virtual int getRenderShape(); virtual bool isSolidRender(); - virtual int getResourceCount(Random *random); virtual int getPistonPushReaction(); // slime block logic diff --git a/Minecraft.World/StructureRecipies.cpp b/Minecraft.World/StructureRecipies.cpp index c4f6ac77..54e29580 100644 --- a/Minecraft.World/StructureRecipies.cpp +++ b/Minecraft.World/StructureRecipies.cpp @@ -82,14 +82,14 @@ void StructureRecipies::addRecipes(Recipes *r) L"#Q", // L"Q#", // - L'#', Tile::cobblestone, L'Q', Item::netherQuartz, + L'#', Tile::cobblestone, L'Q', Item::nether_quartz, L'S'); r->addShapedRecipy(new ItemInstance(Tile::stone_Id, 1, StoneTile::GRANITE), // L"sczcig", L"#Q", // - L'#', new ItemInstance(Tile::stone_Id, 1, StoneTile::DIORITE), L'Q', Item::netherQuartz, + L'#', new ItemInstance(Tile::stone_Id, 1, StoneTile::DIORITE), L'Q', Item::nether_quartz, L'S'); r->addShapedRecipy(new ItemInstance(Tile::stone_Id, 2, StoneTile::ANDESITE), // diff --git a/Minecraft.World/TallGrass2.cpp b/Minecraft.World/TallGrass2.cpp index d1792d4c..0de30953 100644 --- a/Minecraft.World/TallGrass2.cpp +++ b/Minecraft.World/TallGrass2.cpp @@ -233,13 +233,17 @@ void TallGrass2::neighborChanged(Level* level, int x, int y, int z, int type) { int data = level->getData(x, y, z); bool isUpper = (data & UPPER_BIT) != 0; + int variant = data & ~UPPER_BIT; if (!isUpper) { int upperTileId = level->getTile(x, y + 1, z); if (!canSurvive(level, x, y, z) || (upperTileId != id)) { - spawnResources(level, x, y, z, data, 0); + if (variant != SUNFLOWER) + { + spawnResources(level, x, y, z, data, 0); + } level->setTileAndData(x, y, z, 0, 0, Tile::UPDATE_CLIENTS); if (upperTileId == id) level->removeTile(x, y + 1, z); @@ -273,6 +277,14 @@ void TallGrass2::tick(Level* level, int x, int y, int z, Random* random) int TallGrass2::getResource(int data, Random* random, int playerBonusLevel) { + (void)random; + (void)playerBonusLevel; + + if ((data & ~UPPER_BIT) == SUNFLOWER) + { + return Tile::double_plant_Id; + } + return -1; } @@ -281,6 +293,11 @@ int TallGrass2::getResourceCountForLootBonus(int bonusLevel, Random* random) return 1; } +int TallGrass2::getSpawnResourcesAuxValue(int data) +{ + return data & ~UPPER_BIT; +} + bool TallGrass2::isSilkTouchable() { return true; @@ -295,6 +312,19 @@ shared_ptr TallGrass2::getSilkTouchItemInstance(int data) void TallGrass2::playerDestroy(Level* level, shared_ptr player, int x, int y, int z, int data) { + if ((data & ~UPPER_BIT) == SUNFLOWER) + { + if (!level->isClientSide && !player->abilities.instabuild) + { + player->awardStat( + GenericStats::blocksMined(id), + GenericStats::param_blocksMined(id, data, 1)); + + popResource(level, x, y, z, std::make_shared(this, 1, SUNFLOWER)); + } + return; + } + if (!level->isClientSide && player->getSelectedItem() != nullptr && player->getSelectedItem()->id == Item::shears->id) diff --git a/Minecraft.World/TallGrass2.h b/Minecraft.World/TallGrass2.h index 3d4ad78d..7c890de3 100644 --- a/Minecraft.World/TallGrass2.h +++ b/Minecraft.World/TallGrass2.h @@ -55,6 +55,7 @@ public: virtual int getResource(int data, Random* random, int playerBonusLevel) override; virtual int getResourceCountForLootBonus(int bonusLevel, Random* random) override; + virtual int getSpawnResourcesAuxValue(int data) override; virtual void playerDestroy(Level* level, shared_ptr player, int x, int y, int z, int data) override; virtual void playerWillDestroy(Level* level, int x, int y, int z, int data, shared_ptr player) override;