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/TickNextTickData.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/TickNextTickData.cpp')
| -rw-r--r-- | Minecraft.World/TickNextTickData.cpp | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/Minecraft.World/TickNextTickData.cpp b/Minecraft.World/TickNextTickData.cpp index 96771be1..277be1f8 100644 --- a/Minecraft.World/TickNextTickData.cpp +++ b/Minecraft.World/TickNextTickData.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" - +#include "net.minecraft.world.level.tile.h" #include "TickNextTickData.h" int64_t TickNextTickData::C = 0; @@ -13,41 +13,53 @@ TickNextTickData::TickNextTickData(int x, int y, int z, int tileId) this->y = y; this->z = z; this->tileId = tileId; + priorityTilt = 0; } -bool TickNextTickData::equals(const void *o) const +bool TickNextTickData::equals(const TickNextTickData *o) const { // TODO 4J Is this safe to cast it before we do a dynamic_cast? Will the dynamic_cast still fail? // We cannot dynamic_cast a void* - if ( dynamic_cast<TickNextTickData *>( (TickNextTickData *) o ) != NULL) + if ( o != NULL) { TickNextTickData *t = (TickNextTickData *) o; - return x == t->x && y == t->y && z == t->z && tileId == t->tileId; + return x == t->x && y == t->y && z == t->z && Tile::isMatching(tileId, t->tileId); } return false; } int TickNextTickData::hashCode() const { - return (((x * 1024 * 1024) + (z * 1024) + y) * 256) + tileId; + return (((x * 1024 * 1024) + (z * 1024) + y) * 256); } TickNextTickData *TickNextTickData::delay(int64_t l) { - this->m_delay = l; + m_delay = l; return this; } +void TickNextTickData::setPriorityTilt(int priorityTilt) +{ + this->priorityTilt = priorityTilt; +} + int TickNextTickData::compareTo(const TickNextTickData *tnd) const { if (m_delay < tnd->m_delay) return -1; if (m_delay > tnd->m_delay) return 1; + if (priorityTilt != tnd->priorityTilt) return priorityTilt - tnd->priorityTilt; if (c < tnd->c) return -1; if (c > tnd->c) return 1; return 0; } +bool TickNextTickData::operator==(const TickNextTickData &k) +{ + return equals( &k ); +} + //A class that takes two arguments of the same type as the container elements and returns a bool. //The expression comp(a,b), where comp is an object of this comparison class and a and b are elements of the container, //shall return true if a is to be placed at an earlier position than b in a strict weak ordering operation. @@ -65,5 +77,5 @@ int TickNextTickData::hash_fnct(const TickNextTickData &k) bool TickNextTickData::eq_test(const TickNextTickData &x, const TickNextTickData &y) { - return ( x.x == y.x ) && ( x.y == y.y ) && ( x.z == y.z ) && ( x.tileId == y.tileId ); + return x.equals(&y); }
\ No newline at end of file |
