mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
Light block pick fix
This commit is contained in:
parent
26a9d6adb7
commit
daef2225bf
|
|
@ -4,25 +4,15 @@
|
|||
#include "LightSourceTile.h"
|
||||
|
||||
LightSourceTile::LightSourceTile(int id)
|
||||
: Tile(id, Material::air, /*isSolidRender=*/false)
|
||||
: Tile(id, Material::decoration, /*isSolidRender=*/false)
|
||||
{
|
||||
setLightEmission(1.0f);
|
||||
setDestroyTime(0.0f);
|
||||
}
|
||||
|
||||
AABB* LightSourceTile::getAABB(Level* level, int x, int y, int z)
|
||||
{
|
||||
return nullptr; // íåò ôèçè÷åñêîé êîëëèçèè
|
||||
}
|
||||
|
||||
AABB* LightSourceTile::getTileAABB(Level* level, int x, int y, int z)
|
||||
{
|
||||
return nullptr; // íåò êîëëèçèè äëÿ âûäåëåíèÿ
|
||||
}
|
||||
|
||||
bool LightSourceTile::isSolidRender(bool isServerLevel)
|
||||
{
|
||||
return false; // íå çàêðûâàåò ñîñåäíèå ãðàíè
|
||||
return false;
|
||||
}
|
||||
|
||||
bool LightSourceTile::isCubeShaped()
|
||||
|
|
@ -32,10 +22,40 @@ bool LightSourceTile::isCubeShaped()
|
|||
|
||||
int LightSourceTile::getRenderShape()
|
||||
{
|
||||
return Tile::SHAPE_INVISIBLE; // ðåíäåð ïðîïóñêàåòñÿ
|
||||
return Tile::SHAPE_INVISIBLE;
|
||||
}
|
||||
|
||||
AABB* LightSourceTile::getAABB(Level* level, int x, int y, int z)
|
||||
{
|
||||
return nullptr; // íåò ôèçè÷åñêîé êîëëèçèè
|
||||
}
|
||||
|
||||
AABB* LightSourceTile::getTileAABB(Level* level, int x, int y, int z)
|
||||
{
|
||||
return nullptr; // íåò ðàìêè âûäåëåíèÿ
|
||||
}
|
||||
|
||||
HitResult* LightSourceTile::clip(Level* level, int x, int y, int z, Vec3* a, Vec3* b)
|
||||
{
|
||||
return nullptr; // ëó÷ ïðîõîäèò ñêâîçü áëîê, ïðèöåë íå ðåàãèðóåò
|
||||
}
|
||||
|
||||
float LightSourceTile::getDestroyProgress(shared_ptr<Player> player, Level* level, int x, int y, int z)
|
||||
{
|
||||
return 0.0f; // ïðîãðåññ ðàçðóøåíèÿ âñåãäà 0 — ñëîìàòü íåâîçìîæíî
|
||||
}
|
||||
|
||||
bool LightSourceTile::mayPick()
|
||||
{
|
||||
return false; // íåëüçÿ ïîäîáðàòü ñðåäíåé êíîïêîé
|
||||
}
|
||||
|
||||
int LightSourceTile::getResourceCount(Random* random)
|
||||
{
|
||||
return 0; // íå âûáðàñûâàåò íè÷åãî
|
||||
}
|
||||
|
||||
bool LightSourceTile::isPathfindable(LevelSource* level, int x, int y, int z)
|
||||
{
|
||||
return true; // ìîáû ïðîõîäÿò ñêâîçü áëîê
|
||||
return true; // ìîáû ïðîõîäÿò íàñêâîçü
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,15 +6,29 @@ class LightSourceTile : public Tile
|
|||
public:
|
||||
LightSourceTile(int id);
|
||||
|
||||
// Íĺň ęîëëčçčč
|
||||
AABB* getAABB(Level* level, int x, int y, int z) override;
|
||||
AABB* getTileAABB(Level* level, int x, int y, int z) override;
|
||||
|
||||
// Íåò âèçóàëà
|
||||
bool isSolidRender(bool isServerLevel) override;
|
||||
bool isCubeShaped() override;
|
||||
int getRenderShape() override;
|
||||
|
||||
// Нет коллизии с сущностями
|
||||
AABB* getAABB(Level* level, int x, int y, int z) override;
|
||||
|
||||
// Нет рамки выделения при наведении
|
||||
AABB* getTileAABB(Level* level, int x, int y, int z) override;
|
||||
|
||||
// Нельзя навести прицел — луч сквозь блок
|
||||
HitResult* clip(Level* level, int x, int y, int z, Vec3* a, Vec3* b) override;
|
||||
|
||||
// Нельзя сломать
|
||||
float getDestroyProgress(shared_ptr<Player> player, Level* level, int x, int y, int z) override;
|
||||
|
||||
// Нельзя подобрать средней кнопкой мыши
|
||||
bool mayPick() override;
|
||||
|
||||
// Не выбрасывает предметы при удалении
|
||||
int getResourceCount(Random* random) override;
|
||||
|
||||
// Íå ìåøàåò äâèæåíèþ
|
||||
bool isPathfindable(LevelSource* level, int x, int y, int z) override;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue