Files
GabsPuNs-MinecraftConsoles/Minecraft.Client/Chunk.h
GabsPuNs f79ca9e411 Support for TU24 has been extended.
Since the TU25 update still requires a lot of work and the TU24 version does not yet include all the features, I have decided to continue working with the TU24 version for now.

Merge latest changes from Minecraft Consoles:
* Added support for Big-Endian DLCs.
* Fix redstone tick persistence on chunk unload.
* Fix pistons permanently breaking server-wide on dedicated servers.
* Fix Ender Dragon damage and End Poem crash.
* Disable font mipmapping to get rid of artifacts on signs.

Other:
* Music Fixes.
* Added missing sounds (Caves, Horse Eat, Sheep Shear, Water Swim, Thorns)
* Remove duplicated sounds.
* Added High Quality ver of "The End Dragon Alive" music.
* Fix Mobs sounds volume.
* Added Old Swing Animation Option.
* Added Graphics Mode (Potato, Fast, Fancy and Extra)
* Fix a small memory leak with signs.
* Fixed Pig Zombies attacking creative players.
2026-03-28 06:27:19 -04:00

85 lines
1.8 KiB
C++

#pragma once
#include "AllowAllCuller.h"
#include "Tesselator.h"
#include "..\Minecraft.World\ArrayWithLength.h"
#include "LevelRenderer.h"
class Level;
class TileEntity;
class Entity;
using namespace std;
class ClipChunk
{
public:
Chunk *chunk;
int globalIdx;
bool visible;
float aabb[6];
int xm, ym, zm;
};
class Chunk
{
private:
static const int XZSIZE = LevelRenderer::CHUNK_XZSIZE;
static const int SIZE = LevelRenderer::CHUNK_SIZE;
public:
Level *level;
static LevelRenderer *levelRenderer;
private:
#ifndef _LARGE_WORLDS
static Tesselator *t;
#else
public:
static unsigned char *GetTileIdsStorage();
#endif
public:
static int updates;
int x, y, z;
int xRender, yRender, zRender;
int xRenderOffs, yRenderOffs, zRenderOffs;
int xm, ym, zm;
shared_ptr<AABB> bb;
ClipChunk *clipChunk;
int id;
//public:
// vector<shared_ptr<TileEntity> > renderableTileEntities; // 4J - removed
private:
LevelRenderer::rteMap *globalRenderableTileEntities;
CRITICAL_SECTION *globalRenderableTileEntities_cs;
bool assigned;
public:
Chunk(Level *level, LevelRenderer::rteMap &globalRenderableTileEntities, CRITICAL_SECTION &globalRenderableTileEntities_cs, int x, int y, int z, ClipChunk *clipChunk);
Chunk();
void setPos(int x, int y, int z);
private:
void translateToPos();
public:
void makeCopyForRebuild(Chunk *source);
void rebuild();
#ifdef __PS3__
void rebuild_SPU();
#endif // __PS3__
float distanceToSqr(shared_ptr<Entity> player) const;
float squishedDistanceToSqr(shared_ptr<Entity> player);
void reset();
void _delete();
int getList(int layer);
void cull(Culler *culler);
void renderBB() ;
bool isEmpty();
void setDirty();
void clearDirty(); // 4J added
bool emptyFlagSet(int layer);
~Chunk();
};