FIX: render

ty shredder
This commit is contained in:
2026-05-09 14:41:31 +02:00
parent 263118f2e0
commit dfb3bf1da7
2 changed files with 11 additions and 3 deletions

View File

@@ -13,6 +13,7 @@
#include "../client/gamemode/GameMode.h" #include "../client/gamemode/GameMode.h"
#include "world/item/ItemInstance.h" #include "world/item/ItemInstance.h"
#include "world/level/LevelConstants.h" #include "world/level/LevelConstants.h"
#include <cstddef>
#ifndef STANDALONE_SERVER #ifndef STANDALONE_SERVER
#include "../client/gui/screens/DisconnectionScreen.h" #include "../client/gui/screens/DisconnectionScreen.h"
#endif #endif
@@ -120,6 +121,7 @@ void ClientSideNetworkHandler::onDisconnect(const RakNet::RakNetGUID& guid)
} }
} }
} }
minecraft->setLevel(NULL);
#ifndef STANDALONE_SERVER #ifndef STANDALONE_SERVER
minecraft->gui.addMessage("Disconnected from server"); minecraft->gui.addMessage("Disconnected from server");
#endif #endif
@@ -354,7 +356,7 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& source, RemoveEn
if (!level) return; if (!level) return;
Entity* entity = level->getEntity(packet->entityId); Entity* entity = level->getEntity(packet->entityId);
LOGI("RemoveEntityPacket %p %p, %d\n", entity, minecraft->player, entity?(int)(entity->isPlayer()): -1); // LOGI("RemoveEntityPacket %p %p, %d\n", entity, minecraft->player, entity?(int)(entity->isPlayer()): -1);
if (!entity) return; if (!entity) return;
level->removeEntity(entity); level->removeEntity(entity);

View File

@@ -22,6 +22,7 @@
#include "../../item/StoneSlabTileItem.h" #include "../../item/StoneSlabTileItem.h"
#include "../../item/SaplingTileItem.h" #include "../../item/SaplingTileItem.h"
#include "../../item/ItemCategory.h" #include "../../item/ItemCategory.h"
#include "world/level/LevelConstants.h"
const int Tile::RENDERLAYER_OPAQUE = 0; const int Tile::RENDERLAYER_OPAQUE = 0;
const int Tile::RENDERLAYER_ALPHATEST = 1; const int Tile::RENDERLAYER_ALPHATEST = 1;
@@ -512,10 +513,15 @@ bool Tile::shouldRenderFace( LevelSource* level, int x, int y, int z, int face )
{ {
if (face == 0 && y == -1) return false; if (face == 0 && y == -1) return false;
// For fixed size worlds //@todo: external constants rather than magic numbers // For fixed size worlds //@todo: external constants rather than magic numbers
// @fixme @ahtung temp fix
auto xz = LevelConstants::CHUNK_CACHE_WIDTH == 16 ? 256 :
LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_CACHE_WIDTH / (LevelConstants::CHUNK_CACHE_WIDTH * LevelConstants::CHUNK_CACHE_WIDTH / 256 / 2);
if (face == 2 && z == -1) return false; if (face == 2 && z == -1) return false;
if (face == 3 && z == 256) return false; if (face == 3 && z == xz) return false;
if (face == 4 && x == -1) return false; if (face == 4 && x == -1) return false;
if (face == 5 && x == 256) return false; if (face == 5 && x == xz) return false;
// Common // Common
if (face == 0 && yy0 > 0) return true; if (face == 0 && yy0 > 0) return true;
if (face == 1 && yy1 < 1) return true; if (face == 1 && yy1 < 1) return true;