mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-07-11 19:21:02 +00:00
TU19: merge Minecraft.World/Blocks
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user