diff options
| author | daoge <3523206925@qq.com> | 2026-03-03 03:04:10 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-03 03:04:10 +0800 |
| commit | b3feddfef372618c8a9d7a0abcaf18cfad866c18 (patch) | |
| tree | 267761c3bb39241ba5c347bfbe2254d06686e287 /Minecraft.World/TheEndPortalFrameTile.cpp | |
| parent | 84c31a2331f7a0ec85b9d438992e244f60e5020f (diff) | |
feat: TU19 (Dec 2014) Features & Content (#155)
* try to resolve merge conflict
* feat: TU19 (Dec 2014) Features & Content (#32)
* December 2014 files
* Working release build
* Fix compilation issues
* Add sound to Windows64Media
* Add DLC content and force Tutorial DLC
* Revert "Add DLC content and force Tutorial DLC"
This reverts commit 97a43994725008e35fceb984d5549df9c8cea470.
* Disable broken light packing
* Disable breakpoint during DLC texture map load
Allows DLC loading but the DLC textures are still broken
* Fix post build not working
* ...
* fix vs2022 build
* fix cmake build
---------
Co-authored-by: Loki <lokirautio@gmail.com>
Diffstat (limited to 'Minecraft.World/TheEndPortalFrameTile.cpp')
| -rw-r--r-- | Minecraft.World/TheEndPortalFrameTile.cpp | 56 |
1 files changed, 38 insertions, 18 deletions
diff --git a/Minecraft.World/TheEndPortalFrameTile.cpp b/Minecraft.World/TheEndPortalFrameTile.cpp index cab8319f..f7b10a05 100644 --- a/Minecraft.World/TheEndPortalFrameTile.cpp +++ b/Minecraft.World/TheEndPortalFrameTile.cpp @@ -1,6 +1,7 @@ #include "stdafx.h" #include "TheEndPortalFrameTile.h" #include "net.minecraft.world.level.h" +#include "net.minecraft.world.level.redstone.h" #include "net.minecraft.world.h" #include "Facing.h" @@ -14,15 +15,15 @@ TheEndPortalFrameTile::TheEndPortalFrameTile(int id) : Tile(id, Material::glass, Icon *TheEndPortalFrameTile::getTexture(int face, int data) { - if (face == Facing::UP) + if (face == Facing::UP) { - return iconTop; - } - if (face == Facing::DOWN) + return iconTop; + } + if (face == Facing::DOWN) { - return Tile::whiteStone->getTexture(face); - } - return icon; + return Tile::endStone->getTexture(face); + } + return icon; } void TheEndPortalFrameTile::registerIcons(IconRegister *iconRegister) @@ -54,16 +55,16 @@ void TheEndPortalFrameTile::updateDefaultShape() void TheEndPortalFrameTile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr<Entity> source) { - setShape(0, 0, 0, 1, 13.0f / 16.0f, 1); - Tile::addAABBs(level, x, y, z, box, boxes, source); + setShape(0, 0, 0, 1, 13.0f / 16.0f, 1); + Tile::addAABBs(level, x, y, z, box, boxes, source); - int data = level->getData(x, y, z); - if (hasEye(data)) + int data = level->getData(x, y, z); + if (hasEye(data)) { - setShape(5.0f / 16.0f, 13.0f / 16.0f, 5.0f / 16.0f, 11.0f / 16.0f, 1, 11.0f / 16.0f); - Tile::addAABBs(level, x, y, z, box, boxes, source); - } - updateDefaultShape(); + setShape(5.0f / 16.0f, 13.0f / 16.0f, 5.0f / 16.0f, 11.0f / 16.0f, 1, 11.0f / 16.0f); + Tile::addAABBs(level, x, y, z, box, boxes, source); + } + updateDefaultShape(); } bool TheEndPortalFrameTile::hasEye(int data) @@ -76,8 +77,27 @@ int TheEndPortalFrameTile::getResource(int data, Random *random, int playerBonus return 0; } -void TheEndPortalFrameTile::setPlacedBy(Level *level, int x, int y, int z, shared_ptr<Mob> by) +void TheEndPortalFrameTile::setPlacedBy(Level *level, int x, int y, int z, shared_ptr<LivingEntity> by, shared_ptr<ItemInstance> itemInstance) { - int dir = (((Mth::floor(by->yRot * 4 / (360) + 0.5)) & 3) + 2) % 4; - level->setData(x, y, z, dir); + int dir = (((Mth::floor(by->yRot * 4 / (360) + 0.5)) & 3) + 2) % 4; + level->setData(x, y, z, dir, Tile::UPDATE_CLIENTS); } + +bool TheEndPortalFrameTile::hasAnalogOutputSignal() +{ + return true; +} + +int TheEndPortalFrameTile::getAnalogOutputSignal(Level *level, int x, int y, int z, int dir) +{ + int data = level->getData(x, y, z); + + if (hasEye(data)) + { + return Redstone::SIGNAL_MAX; + } + else + { + return Redstone::SIGNAL_NONE; + } +}
\ No newline at end of file |
