Skip to content

Commit 44c8f49

Browse files
committed
Initial 26.1 snapshot update pass
1 parent 5acbb85 commit 44c8f49

42 files changed

Lines changed: 153 additions & 343 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

fabric/src/main/java/ca/spottedleaf/moonrise/fabric/FabricHooks.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,9 @@ public void setCurrentlyLoading(final GenerationChunkHolder holder, final LevelC
8686
@Override
8787
public void chunkFullStatusComplete(final LevelChunk newChunk, final ProtoChunk original) {
8888
if (HAS_FABRIC_LIFECYCLE_EVENTS) {
89-
ServerChunkEvents.CHUNK_LOAD.invoker().onChunkLoad((ServerLevel)newChunk.getLevel(), newChunk);
90-
if (!(original instanceof ImposterProtoChunk)) {
89+
final boolean generated = !(original instanceof ImposterProtoChunk);
90+
ServerChunkEvents.CHUNK_LOAD.invoker().onChunkLoad((ServerLevel)newChunk.getLevel(), newChunk, generated);
91+
if (generated) {
9192
ServerChunkEvents.CHUNK_GENERATE.invoker().onChunkGenerate((ServerLevel)newChunk.getLevel(), newChunk);
9293
}
9394
}

fabric/src/main/java/ca/spottedleaf/moonrise/fabric/mixin/collisions/EntityMixin.java

Lines changed: 0 additions & 165 deletions
This file was deleted.

fabric/src/main/resources/fabric.mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"accessWidener": "moonrise.accesswidener",
3737
"depends": {
3838
"fabricloader": ">=${loader_version}",
39-
"minecraft": ">1.21.10 <1.21.12",
39+
"minecraft": ">1.21.11 <26.2",
4040
"fabric-command-api-v2": "*"
4141
},
4242
"custom": {

fabric/src/main/resources/moonrise-fabric.mixins.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"mixins": [
55
"chunk_system.FabricMinecraftServerMixin",
66
"chunk_system.FabricServerLevelMixin",
7-
"collisions.EntityMixin",
87
"tick_loop.PacketProcessorMixin"
98
],
109
"client": [

neoforge/src/main/java/ca/spottedleaf/moonrise/neoforge/NeoForgeHooks.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public void onChunkHolderTicketChange(final ServerLevel world, final ChunkHolder
109109
final ChunkPos pos = holder.getPos();
110110

111111
EventHooks.fireChunkTicketLevelUpdated(
112-
world, CoordinateUtils.getChunkKey(pos.x, pos.z),
112+
world, CoordinateUtils.getChunkKey(pos.x(), pos.z()),
113113
oldLevel, newLevel, holder
114114
);
115115
}

neoforge/src/main/resources/META-INF/neoforge.mods.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ side = "BOTH"
2828
[[dependencies.moonrise]]
2929
modId = "minecraft"
3030
type = "required"
31-
versionRange = "(1.21.10,1.21.12)"
31+
versionRange = "(1.21.11,26.2)"
3232
ordering = "NONE"
3333
side = "BOTH"
3434

settings.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ rootProject.name = "Moonrise"
5656

5757
include("fabric")
5858
findProject(":fabric")!!.name = "Moonrise-Fabric"
59-
include("neoforge")
60-
findProject(":neoforge")!!.name = "Moonrise-NeoForge"
59+
//include("neoforge")
60+
//findProject(":neoforge")!!.name = "Moonrise-NeoForge"
6161

6262
// includeBuild("../YamlConfig") // Uncomment to use local YamlConfig
6363
// includeBuild("../ConcurrentUtil") // Uncomment to use local ConcurrentUtil

src/main/java/ca/spottedleaf/moonrise/common/misc/NearbyPlayers.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public void addPlayer(final ServerPlayer player) {
8282

8383
for (int i = 0; i < TOTAL_MAP_TYPES; ++i) {
8484
// use 0 for default, will be updated by tickPlayer
85-
(newTrackers[i] = new TrackedPlayer(player, MAP_TYPES[i])).add(chunk.x, chunk.z, 0);
85+
(newTrackers[i] = new TrackedPlayer(player, MAP_TYPES[i])).add(chunk.x(), chunk.z(), 0);
8686
}
8787

8888
// update view distances
@@ -118,12 +118,12 @@ public void tickPlayer(final ServerPlayer player) {
118118

119119
final ChunkPos chunk = player.chunkPosition();
120120

121-
players[NearbyMapType.GENERAL.ordinal()].update(chunk.x, chunk.z, GENERAL_AREA_VIEW_DISTANCE);
122-
players[NearbyMapType.GENERAL_SMALL.ordinal()].update(chunk.x, chunk.z, GENERAL_SMALL_VIEW_DISTANCE);
123-
players[NearbyMapType.GENERAL_REALLY_SMALL.ordinal()].update(chunk.x, chunk.z, GENERAL_REALLY_SMALL_VIEW_DISTANCE);
124-
players[NearbyMapType.TICK_VIEW_DISTANCE.ordinal()].update(chunk.x, chunk.z, PlatformHooks.get().getTickViewDistance(player));
125-
players[NearbyMapType.VIEW_DISTANCE.ordinal()].update(chunk.x, chunk.z, PlatformHooks.get().getViewDistance(player));
126-
players[NearbyMapType.SPAWN_RANGE.ordinal()].update(chunk.x, chunk.z, ChunkTickConstants.PLAYER_SPAWN_TRACK_RANGE); // Moonrise - chunk tick iteration
121+
players[NearbyMapType.GENERAL.ordinal()].update(chunk.x(), chunk.z(), GENERAL_AREA_VIEW_DISTANCE);
122+
players[NearbyMapType.GENERAL_SMALL.ordinal()].update(chunk.x(), chunk.z(), GENERAL_SMALL_VIEW_DISTANCE);
123+
players[NearbyMapType.GENERAL_REALLY_SMALL.ordinal()].update(chunk.x(), chunk.z(), GENERAL_REALLY_SMALL_VIEW_DISTANCE);
124+
players[NearbyMapType.TICK_VIEW_DISTANCE.ordinal()].update(chunk.x(), chunk.z(), PlatformHooks.get().getTickViewDistance(player));
125+
players[NearbyMapType.VIEW_DISTANCE.ordinal()].update(chunk.x(), chunk.z(), PlatformHooks.get().getViewDistance(player));
126+
players[NearbyMapType.SPAWN_RANGE.ordinal()].update(chunk.x(), chunk.z(), ChunkTickConstants.PLAYER_SPAWN_TRACK_RANGE); // Moonrise - chunk tick iteration
127127
}
128128

129129
public TrackedChunk getChunk(final ChunkPos pos) {
@@ -255,7 +255,7 @@ protected void removeCallback(final ServerPlayer parameter, final int chunkX, fi
255255

256256
final TrackedChunk chunk = NearbyPlayers.this.byChunk.get(chunkKey);
257257
if (chunk == null) {
258-
throw new IllegalStateException("Chunk should exist at " + new ChunkPos(chunkKey));
258+
throw new IllegalStateException("Chunk should exist at " + ChunkPos.unpack(chunkKey));
259259
}
260260

261261
final NearbyMapType type = this.type;

src/main/java/ca/spottedleaf/moonrise/common/util/BaseChunkSystemHooks.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public void onChunkHolderDelete(final ServerLevel level, final ChunkHolder holde
8989
@Override
9090
public void onChunkPreBorder(final LevelChunk chunk, final ChunkHolder holder) {
9191
((ChunkSystemServerChunkCache)((ServerLevel)chunk.getLevel()).getChunkSource())
92-
.moonrise$setFullChunk(chunk.getPos().x, chunk.getPos().z, chunk);
92+
.moonrise$setFullChunk(chunk.getPos().x(), chunk.getPos().z(), chunk);
9393
}
9494

9595
@Override
@@ -111,7 +111,7 @@ public void onChunkNotBorder(final LevelChunk chunk, final ChunkHolder holder) {
111111
@Override
112112
public void onChunkPostNotBorder(final LevelChunk chunk, final ChunkHolder holder) {
113113
((ChunkSystemServerChunkCache)((ServerLevel)chunk.getLevel()).getChunkSource())
114-
.moonrise$setFullChunk(chunk.getPos().x, chunk.getPos().z, null);
114+
.moonrise$setFullChunk(chunk.getPos().x(), chunk.getPos().z(), null);
115115
}
116116

117117
@Override

src/main/java/ca/spottedleaf/moonrise/common/util/CoordinateUtils.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ public static long getChunkKey(final BlockPos pos) {
1717

1818
public static long getChunkKey(final Entity entity) {
1919
final ChunkPos pos = entity.chunkPosition();
20-
return ((long)pos.z << 32) | (pos.x & 0xFFFFFFFFL);
20+
return ((long)pos.z() << 32) | (pos.x() & 0xFFFFFFFFL);
2121
}
2222

2323
public static long getChunkKey(final ChunkPos pos) {
24-
return ((long)pos.z << 32) | (pos.x & 0xFFFFFFFFL);
24+
return ((long)pos.z() << 32) | (pos.x() & 0xFFFFFFFFL);
2525
}
2626

2727
public static long getChunkKey(final SectionPos pos) {
@@ -71,9 +71,9 @@ public static long getChunkSectionKey(final SectionPos pos) {
7171
}
7272

7373
public static long getChunkSectionKey(final ChunkPos pos, final int y) {
74-
return ((pos.x & SECTION_X_MASK) << SECTION_X_SHIFT)
74+
return ((pos.x() & SECTION_X_MASK) << SECTION_X_SHIFT)
7575
| ((y & SECTION_Y_MASK) << SECTION_Y_SHIFT)
76-
| ((pos.z & SECTION_Z_MASK) << SECTION_Z_SHIFT);
76+
| ((pos.z() & SECTION_Z_MASK) << SECTION_Z_SHIFT);
7777
}
7878

7979
public static long getChunkSectionKey(final BlockPos pos) {

0 commit comments

Comments
 (0)