the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 75 lines 1.6 kB view raw
1#include "stdafx.h" 2#include "FenceTile_SPU.h" 3#include "ChunkRebuildData.h" 4 5 6 7void FenceTile_SPU::updateShape(ChunkRebuildData *level, int x, int y, int z, int forceData, TileEntity* forceEntity) // 4J added forceData, forceEntity param 8{ 9 bool n = connectsTo(level, x, y, z - 1); 10 bool s = connectsTo(level, x, y, z + 1); 11 bool w = connectsTo(level, x - 1, y, z); 12 bool e = connectsTo(level, x + 1, y, z); 13 14 float west = 6.0f / 16.0f; 15 float east = 10.0f / 16.0f; 16 float north = 6.0f / 16.0f; 17 float south = 10.0f / 16.0f; 18 19 if (n) 20 { 21 north = 0; 22 } 23 if (s) 24 { 25 south = 1; 26 } 27 if (w) 28 { 29 west = 0; 30 } 31 if (e) 32 { 33 east = 1; 34 } 35 36 setShape(west, 0, north, east, 1.0f, south); 37} 38 39bool FenceTile_SPU::blocksLight() 40{ 41 return false; 42} 43 44bool FenceTile_SPU::isSolidRender(bool isServerLevel) 45{ 46 return false; 47} 48 49int FenceTile_SPU::getRenderShape() 50{ 51 return Tile_SPU::SHAPE_FENCE; 52} 53 54bool FenceTile_SPU::connectsTo(ChunkRebuildData *level, int x, int y, int z) 55{ 56 int tile = level->getTile(x, y, z); 57 if (tile == id || tile == Tile_SPU::fenceGate_Id) 58 { 59 return true; 60 } 61 TileRef_SPU tileInstance(tile); 62 if (tileInstance.getPtr() != NULL) 63 { 64 if (tileInstance->getMaterial()->isSolidBlocking() && tileInstance->isCubeShaped()) 65 { 66 return tileInstance->getMaterial()->getID() != Material_SPU::vegetable_Id; 67 } 68 } 69 return false; 70} 71 72bool FenceTile_SPU::shouldRenderFace(ChunkRebuildData *level, int x, int y, int z, int face) 73{ 74 return true; 75}