mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-24 09:07:48 +00:00
27 lines
785 B
C++
27 lines
785 B
C++
#include "../Platform/stdafx.h"
|
|
#include "../Headers/net.minecraft.world.h"
|
|
#include "RailTile.h"
|
|
|
|
RailTile::RailTile(int id) : BaseRailTile(id, false) {}
|
|
|
|
Icon* RailTile::getTexture(int face, int data) {
|
|
if (data >= 6) {
|
|
return iconTurn;
|
|
} else {
|
|
return icon;
|
|
}
|
|
}
|
|
|
|
void RailTile::registerIcons(IconRegister* iconRegister) {
|
|
BaseRailTile::registerIcons(iconRegister);
|
|
iconTurn = iconRegister->registerIcon(getIconName() + L"_turned");
|
|
}
|
|
|
|
void RailTile::updateState(Level* level, int x, int y, int z, int data, int dir,
|
|
int type) {
|
|
if (type > 0 && Tile::tiles[type]->isSignalSource()) {
|
|
if (Rail(level, x, y, z).countPotentialConnections() == 3) {
|
|
updateDir(level, x, y, z, false);
|
|
}
|
|
}
|
|
} |