mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-06-10 22:45:24 +00:00
chore: format Minecraft.World
This commit is contained in:
@@ -4,13 +4,12 @@
|
||||
#include "../Headers/net.minecraft.world.h"
|
||||
#include "FenceTile.h"
|
||||
|
||||
FenceTile::FenceTile(int id, const std::wstring &texture, Material *material) : Tile( id, material, false)
|
||||
{
|
||||
this->texture = texture;
|
||||
FenceTile::FenceTile(int id, const std::wstring& texture, Material* material)
|
||||
: Tile(id, material, false) {
|
||||
this->texture = texture;
|
||||
}
|
||||
|
||||
AABB *FenceTile::getAABB(Level *level, int x, int y, int z)
|
||||
{
|
||||
AABB* FenceTile::getAABB(Level* level, int x, int y, int z) {
|
||||
bool n = connectsTo(level, x, y, z - 1);
|
||||
bool s = connectsTo(level, x, y, z + 1);
|
||||
bool w = connectsTo(level, x - 1, y, z);
|
||||
@@ -21,27 +20,26 @@ AABB *FenceTile::getAABB(Level *level, int x, int y, int z)
|
||||
float north = 6.0f / 16.0f;
|
||||
float south = 10.0f / 16.0f;
|
||||
|
||||
if (n)
|
||||
{
|
||||
if (n) {
|
||||
north = 0;
|
||||
}
|
||||
if (s)
|
||||
{
|
||||
if (s) {
|
||||
south = 1;
|
||||
}
|
||||
if (w)
|
||||
{
|
||||
if (w) {
|
||||
west = 0;
|
||||
}
|
||||
if (e)
|
||||
{
|
||||
if (e) {
|
||||
east = 1;
|
||||
}
|
||||
|
||||
return AABB::newTemp(x + west, y, z + north, x + east, y + 1.5f, z + south);
|
||||
return AABB::newTemp(x + west, y, z + north, x + east, y + 1.5f, z + south);
|
||||
}
|
||||
|
||||
void FenceTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, std::shared_ptr<TileEntity> forceEntity) // 4J added forceData, forceEntity param
|
||||
void FenceTile::updateShape(
|
||||
LevelSource* level, int x, int y, int z, int forceData,
|
||||
std::shared_ptr<TileEntity>
|
||||
forceEntity) // 4J added forceData, forceEntity param
|
||||
{
|
||||
bool n = connectsTo(level, x, y, z - 1);
|
||||
bool s = connectsTo(level, x, y, z + 1);
|
||||
@@ -53,80 +51,58 @@ void FenceTile::updateShape(LevelSource *level, int x, int y, int z, int forceDa
|
||||
float north = 6.0f / 16.0f;
|
||||
float south = 10.0f / 16.0f;
|
||||
|
||||
if (n)
|
||||
{
|
||||
if (n) {
|
||||
north = 0;
|
||||
}
|
||||
if (s)
|
||||
{
|
||||
if (s) {
|
||||
south = 1;
|
||||
}
|
||||
if (w)
|
||||
{
|
||||
if (w) {
|
||||
west = 0;
|
||||
}
|
||||
if (e)
|
||||
{
|
||||
if (e) {
|
||||
east = 1;
|
||||
}
|
||||
|
||||
setShape(west, 0, north, east, 1.0f, south);
|
||||
}
|
||||
|
||||
bool FenceTile::blocksLight()
|
||||
{
|
||||
return false;
|
||||
bool FenceTile::blocksLight() { return false; }
|
||||
|
||||
bool FenceTile::isSolidRender(bool isServerLevel) { return false; }
|
||||
|
||||
bool FenceTile::isCubeShaped() { return false; }
|
||||
|
||||
bool FenceTile::isPathfindable(LevelSource* level, int x, int y, int z) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FenceTile::isSolidRender(bool isServerLevel)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
int FenceTile::getRenderShape() { return Tile::SHAPE_FENCE; }
|
||||
|
||||
bool FenceTile::isCubeShaped()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FenceTile::isPathfindable(LevelSource *level, int x, int y, int z)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int FenceTile::getRenderShape()
|
||||
{
|
||||
return Tile::SHAPE_FENCE;
|
||||
}
|
||||
|
||||
bool FenceTile::connectsTo(LevelSource *level, int x, int y, int z)
|
||||
{
|
||||
bool FenceTile::connectsTo(LevelSource* level, int x, int y, int z) {
|
||||
int tile = level->getTile(x, y, z);
|
||||
if (tile == id || tile == Tile::fenceGate_Id)
|
||||
{
|
||||
if (tile == id || tile == Tile::fenceGate_Id) {
|
||||
return true;
|
||||
}
|
||||
Tile *tileInstance = Tile::tiles[tile];
|
||||
if (tileInstance != NULL)
|
||||
{
|
||||
if (tileInstance->material->isSolidBlocking() && tileInstance->isCubeShaped())
|
||||
{
|
||||
Tile* tileInstance = Tile::tiles[tile];
|
||||
if (tileInstance != NULL) {
|
||||
if (tileInstance->material->isSolidBlocking() &&
|
||||
tileInstance->isCubeShaped()) {
|
||||
return tileInstance->material != Material::vegetable;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool FenceTile::isFence(int tile)
|
||||
{
|
||||
return tile == Tile::fence_Id || tile == Tile::netherFence_Id;
|
||||
bool FenceTile::isFence(int tile) {
|
||||
return tile == Tile::fence_Id || tile == Tile::netherFence_Id;
|
||||
}
|
||||
|
||||
void FenceTile::registerIcons(IconRegister *iconRegister)
|
||||
{
|
||||
icon = iconRegister->registerIcon(texture);
|
||||
void FenceTile::registerIcons(IconRegister* iconRegister) {
|
||||
icon = iconRegister->registerIcon(texture);
|
||||
}
|
||||
|
||||
bool FenceTile::shouldRenderFace(LevelSource *level, int x, int y, int z, int face)
|
||||
{
|
||||
return true;
|
||||
bool FenceTile::shouldRenderFace(LevelSource* level, int x, int y, int z,
|
||||
int face) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user