refactor: make Tile::getAABB return optional<AABB>

This commit is contained in:
orng
2026-03-28 00:11:19 -05:00
parent 78b5255224
commit 7158fd398f
71 changed files with 205 additions and 139 deletions

View File

@@ -5,6 +5,7 @@
#include "../Headers/net.minecraft.world.h"
#include "../Headers/net.minecraft.h"
#include "CocoaTile.h"
#include "Util/AABB.h"
const std::wstring CocoaTile::TEXTURE_AGES[] = {L"cocoa_0", L"cocoa_1",
L"cocoa_2"};
@@ -56,7 +57,7 @@ bool CocoaTile::isCubeShaped() { return false; }
bool CocoaTile::isSolidRender(bool isServerLevel) { return false; }
AABB* CocoaTile::getAABB(Level* level, int x, int y, int z) {
std::optional<AABB> CocoaTile::getAABB(Level* level, int x, int y, int z) {
updateShape(level, x, y, z);
return DirectionalTile::getAABB(level, x, y, z);
}
@@ -157,4 +158,4 @@ void CocoaTile::registerIcons(IconRegister* iconRegister) {
for (int i = 0; i < COCOA_TEXTURES_LENGTH; i++) {
icons[i] = iconRegister->registerIcon(TEXTURE_AGES[i]);
}
}
}