From 1011c714c458afc515523b53e6e8151da6d9c10b Mon Sep 17 00:00:00 2001 From: Fireblade <3+fireblade@noreply.neolegacy.dev> Date: Sat, 18 Jul 2026 19:01:12 -0400 Subject: [PATCH] fix: grass path fixes: - grass path not being on the shovel's diggable list, hence the slow breaking speed whilst mining the block - grass path AABB collisions, creating a discrepency between farmland + the grass path tile where the former could walk up more tiles than the latter --- Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp | 2 +- Minecraft.World/GrassPathTile.cpp | 6 ++++++ Minecraft.World/GrassPathTile.h | 1 + Minecraft.World/ShovelItem.cpp | 1 + Minecraft.World/ShovelItem.h | 2 +- 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp b/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp index 1a307870..6a0e6015 100644 --- a/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp +++ b/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp @@ -82,6 +82,7 @@ void IUIScene_CreativeMenu::staticCtor() DEF(eCreativeInventory_BuildingBlocks) ITEM(Tile::stone_Id) ITEM(Tile::grass_Id) + ITEM(Tile::grass_path_Id) ITEM_AUX(Tile::dirt_Id, 0) ITEM(Tile::cobblestone_Id) ITEM(Tile::sand_Id) @@ -165,7 +166,6 @@ void IUIScene_CreativeMenu::staticCtor() ITEM(Tile::mycelium_Id) ITEM_AUX(Tile::dirt_Id, DirtTile::COARSE_DIRT) ITEM_AUX(Tile::dirt_Id, DirtTile::PODZOL) - ITEM(Tile::grass_path_Id) ITEM(Tile::nether_brick_Id) ITEM(Tile::red_nether_brick_Id) ITEM(Tile::end_stone_Id) diff --git a/Minecraft.World/GrassPathTile.cpp b/Minecraft.World/GrassPathTile.cpp index 153208ef..f5d2f08c 100644 --- a/Minecraft.World/GrassPathTile.cpp +++ b/Minecraft.World/GrassPathTile.cpp @@ -1,5 +1,6 @@ #include "stdafx.h" #include "net.minecraft.world.level.h" +#include "net.minecraft.world.phys.h" #include "Material.h" #include "IconRegister.h" #include "Facing.h" @@ -24,6 +25,11 @@ bool GrassPathTile::isCubeShaped() return false; } +AABB *GrassPathTile::getAABB(Level *level, int x, int y, int z) +{ + return AABB::newTemp(x + 0, y + 0, z + 0, x + 1, y + 1, z + 1); +} + void GrassPathTile::registerIcons(IconRegister *iconRegister) { iconTop = iconRegister->registerIcon(L"grass_path_top"); diff --git a/Minecraft.World/GrassPathTile.h b/Minecraft.World/GrassPathTile.h index cbabc8da..160d4d68 100644 --- a/Minecraft.World/GrassPathTile.h +++ b/Minecraft.World/GrassPathTile.h @@ -12,6 +12,7 @@ public: virtual void updateDefaultShape() override; virtual bool isSolidRender(bool isServerLevel = false) override; virtual bool isCubeShaped() override; + virtual AABB *getAABB(Level *level, int x, int y, int z); virtual void neighborChanged(Level *level, int x, int y, int z, int neighborId) override; virtual void registerIcons(IconRegister *iconRegister) override; virtual Icon *getTexture(int face, int data) override; diff --git a/Minecraft.World/ShovelItem.cpp b/Minecraft.World/ShovelItem.cpp index 06dddcb2..4b5acde8 100644 --- a/Minecraft.World/ShovelItem.cpp +++ b/Minecraft.World/ShovelItem.cpp @@ -21,6 +21,7 @@ void ShovelItem::staticCtor() diggables->data[7] = Tile::farmland; diggables->data[8] = Tile::soulsand; diggables->data[9] = Tile::mycel; + diggables->data[10] = Tile::grass_path; } ShovelItem::ShovelItem(int id, const Tier *tier) : DiggerItem(id, 1, tier, diggables) diff --git a/Minecraft.World/ShovelItem.h b/Minecraft.World/ShovelItem.h index d4a13e71..cc6a81ef 100644 --- a/Minecraft.World/ShovelItem.h +++ b/Minecraft.World/ShovelItem.h @@ -1,7 +1,7 @@ #pragma once #include "DiggerItem.h" -#define SHOVEL_DIGGABLES 10 +#define SHOVEL_DIGGABLES 11 class ShovelItem : public DiggerItem { private: