Files
MinecraftConsoles/Minecraft.World/RailTile.cpp

36 lines
688 B
C++
Raw Normal View History

2026-03-01 12:16:08 +08:00
#include "stdafx.h"
#include "net.minecraft.world.h"
#include "RailTile.h"
RailTile::RailTile(int id) : BaseRailTile(id, false)
2026-03-01 12:16:08 +08:00
{
}
Icon *RailTile::getTexture(int face, int data)
{
if (data >= 6)
2026-03-01 12:16:08 +08:00
{
return iconTurn;
2026-03-01 12:16:08 +08:00
}
else
{
return icon;
2026-03-01 12:16:08 +08:00
}
}
void RailTile::registerIcons(IconRegister *iconRegister)
2026-03-01 12:16:08 +08:00
{
BaseRailTile::registerIcons(iconRegister);
iconTurn = iconRegister->registerIcon(getIconName() + L"_turned");
2026-03-01 12:16:08 +08:00
}
void RailTile::updateState(Level *level, int x, int y, int z, int data, int dir, int type)
2026-03-01 12:16:08 +08:00
{
if (type > 0 && Tile::tiles[type]->isSignalSource())
2026-03-01 12:16:08 +08:00
{
if (Rail(level, x, y, z).countPotentialConnections() == 3)
2026-03-01 12:16:08 +08:00
{
updateDir(level, x, y, z, false);
2026-03-01 12:16:08 +08:00
}
}
}