From b691c43c44ff180d10e7d4a9afc83b98551ff586 Mon Sep 17 00:00:00 2001 From: daoge_cmd <3523206925@qq.com> Date: Sun, 1 Mar 2026 12:16:08 +0800 Subject: Initial commit --- .../SPU_Tasks/ChunkUpdate/RedStoneDustTile_SPU.h | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/RedStoneDustTile_SPU.h (limited to 'Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/RedStoneDustTile_SPU.h') diff --git a/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/RedStoneDustTile_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/RedStoneDustTile_SPU.h new file mode 100644 index 00000000..0e461118 --- /dev/null +++ b/Minecraft.Client/PS3/SPU_Tasks/ChunkUpdate/RedStoneDustTile_SPU.h @@ -0,0 +1,48 @@ +#pragma once +#include "Tile_SPU.h" +#include "DiodeTile_SPU.h" + +class RedStoneDustTile_SPU : public Tile_SPU +{ +public: + static const int TEXTURE_CROSS = 0; + static const int TEXTURE_LINE = 1; + static const int TEXTURE_CROSS_OVERLAY = 2; + static const int TEXTURE_LINE_OVERLAY = 3; + + RedStoneDustTile_SPU(int id) : Tile_SPU(id) {} + virtual bool isSolidRender(bool isServerLevel = false) { return false; } + virtual bool isCubeShaped() { return false; } + virtual int getRenderShape() { return Tile_SPU::SHAPE_RED_DUST; } + virtual int getColor() const { return 0x800000; }// 4J Added + virtual int getColor(LevelSource *level, int x, int y, int z) { return 0x800000; } + virtual int getColor(LevelSource *level, int x, int y, int z, int data) { return 0x800000; } // 4J added + static Icon_SPU *getTextureByName(int name) + { + switch(name) + { + case TEXTURE_CROSS: return &ms_pTileData->redStoneDust_iconCross; + case TEXTURE_LINE: return &ms_pTileData->redStoneDust_iconLine; + case TEXTURE_CROSS_OVERLAY: return &ms_pTileData->redStoneDust_iconCrossOver; + case TEXTURE_LINE_OVERLAY: return &ms_pTileData->redStoneDust_iconLineOver; + } + return NULL; + } + + static bool shouldConnectTo(ChunkRebuildData *level, int x, int y, int z, int direction) + { + int t = level->getTile(x, y, z); + if (t == Tile_SPU::redStoneDust_Id) return true; + if (t == 0) return false; + if (t == Tile_SPU::diode_off_Id || t == Tile_SPU::diode_on_Id) + { + int data = level->getData(x, y, z); + return direction == (data & DiodeTile_SPU::DIRECTION_MASK) || direction == Direction::DIRECTION_OPPOSITE[data & DiodeTile_SPU::DIRECTION_MASK]; + } + else if (TileRef_SPU(t)->isSignalSource() && direction != Direction::UNDEFINED) return true; + + return false; + + } + +}; \ No newline at end of file -- cgit v1.2.3