TU19: merge Minecraft.World/Blocks

This commit is contained in:
Tropical
2026-03-21 15:52:50 -05:00
parent f25cd66f4d
commit 9b6046cb83
242 changed files with 8083 additions and 4657 deletions

View File

@@ -1,6 +1,6 @@
#include "../Platform/stdafx.h"
#include "../Headers/net.minecraft.world.item.h"
#include "../Headers/net.minecraft.world.level.h"
#include "../Headers/net.minecraft.world.phys.h"
#include "../Headers/net.minecraft.world.h"
#include "FenceTile.h"
@@ -9,7 +9,8 @@ FenceTile::FenceTile(int id, const std::wstring& texture, Material* material)
this->texture = texture;
}
AABB* FenceTile::getAABB(Level* level, int x, int y, int z) {
void FenceTile::addAABBs(Level* level, int x, int y, int z, AABB* box,
AABBList* boxes, std::shared_ptr<Entity> source) {
bool n = connectsTo(level, x, y, z - 1);
bool s = connectsTo(level, x, y, z + 1);
bool w = connectsTo(level, x - 1, y, z);
@@ -26,14 +27,31 @@ AABB* FenceTile::getAABB(Level* level, int x, int y, int z) {
if (s) {
south = 1;
}
if (n || s) {
setShape(west, 0, north, east, 1.5f, south);
Tile::addAABBs(level, x, y, z, box, boxes, source);
}
north = 6.0f / 16.0f;
south = 10.0f / 16.0f;
if (w) {
west = 0;
}
if (e) {
east = 1;
}
if (w || e || (!n && !s)) {
setShape(west, 0, north, east, 1.5f, south);
Tile::addAABBs(level, x, y, z, box, boxes, source);
}
return AABB::newTemp(x + west, y, z + north, x + east, y + 1.5f, z + south);
if (n) {
north = 0;
}
if (s) {
south = 1;
}
setShape(west, 0, north, east, 1.0f, south);
}
void FenceTile::updateShape(
@@ -67,8 +85,6 @@ void FenceTile::updateShape(
setShape(west, 0, north, east, 1.0f, south);
}
bool FenceTile::blocksLight() { return false; }
bool FenceTile::isSolidRender(bool isServerLevel) { return false; }
bool FenceTile::isCubeShaped() { return false; }
@@ -106,3 +122,13 @@ bool FenceTile::shouldRenderFace(LevelSource* level, int x, int y, int z,
int face) {
return true;
}
bool FenceTile::use(Level* level, int x, int y, int z,
std::shared_ptr<Player> player, int clickedFace,
float clickX, float clickY, float clickZ, bool soundOnly) {
if (level->isClientSide) return true;
if (LeashItem::bindPlayerMobs(player, level, x, y, z)) {
return true;
}
return false;
}