Skip to content

Commit 3c1b63d

Browse files
committed
26.1-snapshot-2
1 parent 179ccda commit 3c1b63d

File tree

12 files changed

+57
-40
lines changed

12 files changed

+57
-40
lines changed

fabric-data-attachment-api-v1/src/main/java/net/fabricmc/fabric/impl/attachment/sync/AttachmentTargetInfo.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public void appendDebugInformation(MutableComponent component) {
137137

138138
record ChunkTarget(ChunkPos pos) implements AttachmentTargetInfo<ChunkAccess> {
139139
static final StreamCodec<ByteBuf, ChunkTarget> PACKET_CODEC = ByteBufCodecs.VAR_LONG
140-
.map(ChunkPos::new, ChunkPos::toLong)
140+
.map(ChunkPos::unpack, ChunkPos::pack)
141141
.map(ChunkTarget::new, ChunkTarget::pos);
142142

143143
@Override
@@ -147,7 +147,7 @@ public Type<ChunkAccess> getType() {
147147

148148
@Override
149149
public AttachmentTarget getTarget(Level level) {
150-
return level.getChunk(pos.x, pos.z);
150+
return level.getChunk(pos.x(), pos.z());
151151
}
152152

153153
@Override
@@ -161,7 +161,7 @@ public void appendDebugInformation(MutableComponent component) {
161161
component
162162
.append(Component.translatable(
163163
"fabric-data-attachment-api-v1.unknown-target.chunk-position",
164-
Component.literal(pos.x + ", " + pos.z).withStyle(ChatFormatting.YELLOW)
164+
Component.literal(pos.x() + ", " + pos.z()).withStyle(ChatFormatting.YELLOW)
165165
))
166166
.append(CommonComponents.NEW_LINE);
167167
}

fabric-data-attachment-api-v1/src/testmodClient/java/net/fabricmc/fabric/test/attachment/client/gametest/PersistenceGametest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public void runTest(ClientGameTestContext context) {
8888
originChunk.setAttached(PERSISTENT, "chunk_data");
8989

9090
ProtoChunk farChunk = (ProtoChunk) overworld.getChunkSource()
91-
.getChunk(FAR_CHUNK_POS.x, FAR_CHUNK_POS.z, ChunkStatus.STRUCTURE_STARTS, true);
91+
.getChunk(FAR_CHUNK_POS.x(), FAR_CHUNK_POS.z(), ChunkStatus.STRUCTURE_STARTS, true);
9292
farChunk.setAttached(PERSISTENT, "protochunk_data");
9393
LOGGER.info("Set persistent attachments");
9494
});
@@ -117,7 +117,7 @@ public void runTest(ClientGameTestContext context) {
117117
);
118118

119119
ChunkAccess farChunk = overworld.getChunkSource()
120-
.getChunk(FAR_CHUNK_POS.x, FAR_CHUNK_POS.z, ChunkStatus.EMPTY, true);
120+
.getChunk(FAR_CHUNK_POS.x(), FAR_CHUNK_POS.z(), ChunkStatus.EMPTY, true);
121121

122122
if (farChunk instanceof ImposterProtoChunk) {
123123
LOGGER.warn("Far chunk already generated, can't test persistence in ProtoChunk.");
@@ -132,7 +132,7 @@ public void runTest(ClientGameTestContext context) {
132132
spContext.getClientLevel().waitForChunksDownload();
133133

134134
spContext.getServer().runOnServer(server -> {
135-
LevelChunk farChunk = server.overworld().getChunk(FAR_CHUNK_POS.x, FAR_CHUNK_POS.z);
135+
LevelChunk farChunk = server.overworld().getChunk(FAR_CHUNK_POS.x(), FAR_CHUNK_POS.z());
136136

137137
assertAttached(
138138
farChunk,

fabric-gametest-api-v1/src/main/java/net/fabricmc/fabric/api/gametest/v1/GameTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,9 @@
8686
* Whether the test should have sky access. When {@code false} the test will be enclosed by barrier blocks.
8787
*/
8888
boolean skyAccess() default false;
89+
90+
/**
91+
* The number of empty block layers to place around the structure as padding.
92+
*/
93+
int padding() default 1;
8994
}

fabric-gametest-api-v1/src/main/java/net/fabricmc/fabric/impl/gametest/TestAnnotationLocator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ TestData<Holder<TestEnvironmentDefinition<?>>> testData(Registry<TestEnvironment
168168
gameTest.manualOnly(),
169169
gameTest.maxAttempts(),
170170
gameTest.requiredSuccesses(),
171-
gameTest.skyAccess()
171+
gameTest.skyAccess(),
172+
gameTest.padding()
172173
);
173174
}
174175

fabric-lifecycle-events-v1/src/client/java/net/fabricmc/fabric/mixin/event/lifecycle/client/ClientChunkCacheMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ private void onChunkUnload(ChunkPos pos, CallbackInfo ci, @Local LevelChunk chun
6969
)
7070
)
7171
private void onUpdateLoadDistance(int loadDistance, CallbackInfo ci, @Local ClientChunkCache.Storage clientChunkCacheStorage, @Local LevelChunk oldChunk, @Local ChunkPos chunkPos) {
72-
if (!clientChunkCacheStorage.inRange(chunkPos.x, chunkPos.z)) {
72+
if (!clientChunkCacheStorage.inRange(chunkPos.x(), chunkPos.z())) {
7373
ClientChunkEvents.CHUNK_UNLOAD.invoker().onChunkUnload(this.level, oldChunk);
7474
}
7575
}

fabric-lifecycle-events-v1/src/testmod/java/net/fabricmc/fabric/test/event/lifecycle/ServerChunkLifecycleTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ private static void setupFullChunkStatusChangeTest() {
105105
throw new AssertionError("FULL_CHUNK_STATUS_CHANGE for " + dimensionId + " " + chunkPos + " NOT SEQUENTIAL: " + oldChunkStatus + "->" + newChunkStatus);
106106
}
107107

108-
FullChunkStatusEvent prevEvent = eventsPerChunk.computeIfAbsent(dimensionId, obj -> new Long2ObjectOpenHashMap<>()).computeIfAbsent(chunkPos.toLong(), l -> new FullChunkStatusEvent(FullChunkStatus.INACCESSIBLE, FullChunkStatus.INACCESSIBLE));
108+
FullChunkStatusEvent prevEvent = eventsPerChunk.computeIfAbsent(dimensionId, obj -> new Long2ObjectOpenHashMap<>()).computeIfAbsent(chunkPos.pack(), l -> new FullChunkStatusEvent(FullChunkStatus.INACCESSIBLE, FullChunkStatus.INACCESSIBLE));
109109

110110
if (prevEvent.newChunkStatus() != oldChunkStatus) { // check if newChunkStatus from the previous event == oldChunkStatus for this current event. Catches any out-of-sync firing issues.
111111
throw new AssertionError("FULL_CHUNK_STATUS_CHANGE for " + dimensionId + " " + chunkPos + " PREVIOUS_EVENT: " + prevEvent.oldChunkStatus() + "->" + prevEvent.newChunkStatus() + " / CURRENT_EVENT: " + oldChunkStatus + "->" + newChunkStatus);
112112
}
113113

114-
eventsPerChunk.get(dimensionId).put(chunkPos.toLong(), new FullChunkStatusEvent(oldChunkStatus, newChunkStatus));
114+
eventsPerChunk.get(dimensionId).put(chunkPos.pack(), new FullChunkStatusEvent(oldChunkStatus, newChunkStatus));
115115
numOfEventsPerLevel.computeIfAbsent(dimensionId, obj -> new Object2IntOpenHashMap<>()).mergeInt(newChunkStatus, 1, Integer::sum);
116116
});
117117

fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/api/networking/v1/PlayerLookup.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public static Collection<ServerPlayer> tracking(BlockEntity blockEntity) {
155155
public static Collection<ServerPlayer> tracking(ServerLevel level, BlockPos pos) {
156156
Objects.requireNonNull(pos, "BlockPos cannot be null");
157157

158-
return tracking(level, new ChunkPos(pos));
158+
return tracking(level, ChunkPos.containing(pos));
159159
}
160160

161161
/**

fabric-object-builder-api-v1/src/testmodClient/java/net/fabricmc/fabric/test/object/builder/client/TrackStackEntityRenderer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import com.mojang.blaze3d.vertex.PoseStack;
2020
import org.jspecify.annotations.Nullable;
2121

22+
import net.minecraft.client.model.animal.chicken.AdultChickenModel;
2223
import net.minecraft.client.model.animal.chicken.ChickenModel;
2324
import net.minecraft.client.model.geom.ModelLayers;
2425
import net.minecraft.client.renderer.SubmitNodeCollector;
@@ -35,7 +36,7 @@
3536

3637
public class TrackStackEntityRenderer extends MobRenderer<TrackStackEntity, TrackStackEntityRenderer.RenderState, ChickenModel> {
3738
public TrackStackEntityRenderer(EntityRendererProvider.Context context) {
38-
super(context, new ChickenModel(context.bakeLayer(ModelLayers.CHICKEN)), 0.3f);
39+
super(context, new AdultChickenModel(context.bakeLayer(ModelLayers.CHICKEN)), 0.3f);
3940
}
4041

4142
@Override

fabric-rendering-v1/src/client/java/net/fabricmc/fabric/mixin/client/rendering/ClientLevelMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public abstract class ClientLevelMixin {
4747
@Inject(method = "onChunkLoaded(Lnet/minecraft/world/level/ChunkPos;)V", at = @At("RETURN"))
4848
private void onResetChunkColor(ChunkPos chunkPos, CallbackInfo ci) {
4949
for (BlockTintCache cache : customColorCache.values()) {
50-
cache.invalidateForChunk(chunkPos.x, chunkPos.z);
50+
cache.invalidateForChunk(chunkPos.x(), chunkPos.z());
5151
}
5252
}
5353

fabric-resource-loader-v1/src/testmod/resources/data/minecraft/wolf_variant/woods.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
"tame": "fabric-resource-loader-v1-testmod:entity/wolf/green",
55
"wild": "fabric-resource-loader-v1-testmod:entity/wolf/green"
66
},
7+
"baby_assets": {
8+
"angry": "fabric-resource-loader-v1-testmod:entity/wolf/green",
9+
"tame": "fabric-resource-loader-v1-testmod:entity/wolf/green",
10+
"wild": "fabric-resource-loader-v1-testmod:entity/wolf/green"
11+
},
712
"spawn_conditions": [
813
{
914
"condition": {

0 commit comments

Comments
 (0)