the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#pragma once
2#include "Tile_SPU.h"
3#include "DiodeTile_SPU.h"
4
5class RedStoneDustTile_SPU : public Tile_SPU
6{
7public:
8 static const int TEXTURE_CROSS = 0;
9 static const int TEXTURE_LINE = 1;
10 static const int TEXTURE_CROSS_OVERLAY = 2;
11 static const int TEXTURE_LINE_OVERLAY = 3;
12
13 RedStoneDustTile_SPU(int id) : Tile_SPU(id) {}
14 virtual bool isSolidRender(bool isServerLevel = false) { return false; }
15 virtual bool isCubeShaped() { return false; }
16 virtual int getRenderShape() { return Tile_SPU::SHAPE_RED_DUST; }
17 virtual int getColor() const { return 0x800000; }// 4J Added
18 virtual int getColor(LevelSource *level, int x, int y, int z) { return 0x800000; }
19 virtual int getColor(LevelSource *level, int x, int y, int z, int data) { return 0x800000; } // 4J added
20 static Icon_SPU *getTextureByName(int name)
21 {
22 switch(name)
23 {
24 case TEXTURE_CROSS: return &ms_pTileData->redStoneDust_iconCross;
25 case TEXTURE_LINE: return &ms_pTileData->redStoneDust_iconLine;
26 case TEXTURE_CROSS_OVERLAY: return &ms_pTileData->redStoneDust_iconCrossOver;
27 case TEXTURE_LINE_OVERLAY: return &ms_pTileData->redStoneDust_iconLineOver;
28 }
29 return NULL;
30 }
31
32 static bool shouldConnectTo(ChunkRebuildData *level, int x, int y, int z, int direction)
33 {
34 int t = level->getTile(x, y, z);
35 if (t == Tile_SPU::redStoneDust_Id) return true;
36 if (t == 0) return false;
37 if (t == Tile_SPU::diode_off_Id || t == Tile_SPU::diode_on_Id)
38 {
39 int data = level->getData(x, y, z);
40 return direction == (data & DiodeTile_SPU::DIRECTION_MASK) || direction == Direction::DIRECTION_OPPOSITE[data & DiodeTile_SPU::DIRECTION_MASK];
41 }
42 else if (TileRef_SPU(t)->isSignalSource() && direction != Direction::UNDEFINED) return true;
43
44 return false;
45
46 }
47
48};