Skip to content

Commit b75dc01

Browse files
authored
Merge pull request #215 from MoriyaShiine/1.21
Update to 25w36b
2 parents 459769c + 8c1f167 commit b75dc01

File tree

26 files changed

+65
-63
lines changed

26 files changed

+65
-63
lines changed

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
#
4+
# Linux start script should use lf
5+
/gradlew text eol=lf
6+
7+
# These are Windows script files and should use crlf
8+
*.bat text eol=crlf
9+

.github/workflows/build.yml

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,25 @@ on: [pull_request, push]
88

99
jobs:
1010
build:
11-
strategy:
12-
matrix:
13-
# Use these Java versions
14-
java: [
15-
21 # Minimum supported by Minecraft
16-
]
17-
# and run on both Linux and Windows
18-
os: [ubuntu-20.04, windows-latest]
19-
runs-on: ${{ matrix.os }}
11+
runs-on: ubuntu-24.04
2012
steps:
2113
- name: checkout repository
2214
uses: actions/checkout@v4
2315
with:
24-
fetch-depth: 0
25-
filter: 'blob:none'
16+
fetch-depth: 0
17+
filter: 'blob:none'
2618
- name: validate gradle wrapper
27-
uses: gradle/wrapper-validation-action@v1
28-
- name: setup jdk ${{ matrix.java }}
29-
uses: actions/setup-java@v1
19+
uses: gradle/actions/wrapper-validation@v4
20+
- name: setup jdk
21+
uses: actions/setup-java@v4
3022
with:
31-
java-version: ${{ matrix.java }}
23+
java-version: '21'
24+
distribution: 'microsoft'
3225
- name: make gradle wrapper executable
33-
if: ${{ runner.os != 'Windows' }}
3426
run: chmod +x ./gradlew
3527
- name: build
3628
run: ./gradlew build
3729
- name: capture build artifacts
38-
if: ${{ runner.os == 'Linux' && matrix.java == '21' }} # Only upload artifacts built from latest java on one OS
3930
uses: actions/upload-artifact@v4
4031
with:
4132
name: Artifacts

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import net.fabricmc.loom.task.RemapJarTask
44
import java.net.URI
55

66
plugins {
7-
id("fabric-loom") version "1.10-SNAPSHOT"
7+
id("fabric-loom") version "1.11-SNAPSHOT"
88
id("io.github.ladysnake.chenille") version "0.15.0"
99
id("org.cadixdev.licenser") version "0.6.1"
1010
}

cardinal-components-base/src/main/java/org/ladysnake/cca/api/v3/component/ComponentKey.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public void syncWith(ServerPlayerEntity player, ComponentProvider provider) {
200200
@ApiStatus.Experimental
201201
public void syncWith(ServerPlayerEntity player, ComponentProvider provider, ComponentPacketWriter writer, PlayerSyncPredicate predicate) {
202202
if (predicate.shouldSyncWith(player)) {
203-
RegistryByteBuf buf = new RegistryByteBuf(Unpooled.buffer(), player.getWorld().getRegistryManager());
203+
RegistryByteBuf buf = new RegistryByteBuf(Unpooled.buffer(), player.getEntityWorld().getRegistryManager());
204204
writer.writeSyncPacket(buf, player);
205205
CustomPayload payload = provider.toComponentPacket(this, predicate.isRequiredOnClient(), buf);
206206

cardinal-components-block/src/main/java/org/ladysnake/cca/internal/block/StaticBlockComponentPlugin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ private StaticBlockComponentPlugin() {
6868

6969
@Nullable
7070
public <T extends BlockEntity> BlockEntityTicker<T> getComponentTicker(World world, T be, @Nullable BlockEntityTicker<T> base) {
71-
if (world.isClient && this.clientTicking.contains(be.getClass())) {
71+
if (world.isClient() && this.clientTicking.contains(be.getClass())) {
7272
if (base == null) return (w, pos, state, blockEntity) -> blockEntity.asComponentProvider().getComponentContainer().tickClientComponents();
7373
return (w, pos, state, blockEntity) -> {
7474
blockEntity.asComponentProvider().getComponentContainer().tickClientComponents();
7575
base.tick(w, pos, state, blockEntity);
7676
};
77-
} else if (!world.isClient && this.serverTicking.contains(be.getClass())) {
77+
} else if (!world.isClient() && this.serverTicking.contains(be.getClass())) {
7878
if (base == null) return (w, pos, state, blockEntity) -> blockEntity.asComponentProvider().getComponentContainer().tickServerComponents();
7979
return (w, pos, state, blockEntity) -> {
8080
blockEntity.asComponentProvider().getComponentContainer().tickServerComponents();

cardinal-components-block/src/main/java/org/ladysnake/cca/mixin/block/common/MixinBlockEntity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public ComponentContainer getComponentContainer() {
9393
public Iterable<ServerPlayerEntity> getRecipientsForComponentSync() {
9494
World world = this.getWorld();
9595

96-
if (world != null && !world.isClient) {
96+
if (world != null && !world.isClient()) {
9797
return PlayerLookup.tracking((BlockEntity) (Object) this);
9898
}
9999
return List.of();

cardinal-components-chunk/src/main/java/org/ladysnake/cca/mixin/chunk/common/MixinChunk.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@
2222
*/
2323
package org.ladysnake.cca.mixin.chunk.common;
2424

25-
import net.minecraft.registry.Registry;
2625
import net.minecraft.util.math.ChunkPos;
2726
import net.minecraft.world.HeightLimitView;
28-
import net.minecraft.world.biome.Biome;
2927
import net.minecraft.world.chunk.Chunk;
3028
import net.minecraft.world.chunk.ChunkSection;
29+
import net.minecraft.world.chunk.PalettesFactory;
3130
import net.minecraft.world.chunk.UpgradeData;
3231
import net.minecraft.world.gen.chunk.BlendingData;
3332
import org.ladysnake.cca.api.v3.component.ComponentContainer;
@@ -45,7 +44,7 @@ public abstract class MixinChunk implements ComponentProvider {
4544
private ComponentContainer components;
4645

4746
@Inject(method = "<init>", at = @At("RETURN"))
48-
private void initComponents(ChunkPos pos, UpgradeData upgradeData, HeightLimitView heightLimitView, Registry<Biome> biome, long inhabitedTime, ChunkSection[] sectionArrayInitializer, BlendingData blendingData, CallbackInfo ci) {
47+
private void initComponents(ChunkPos pos, UpgradeData upgradeData, HeightLimitView heightLimitView, PalettesFactory palettesFactory, long inhabitedTime, ChunkSection[] sectionArray, BlendingData blendingData, CallbackInfo ci) {
4948
this.components = StaticChunkComponentPlugin.createContainer((Chunk) (Object) this);
5049
}
5150

cardinal-components-chunk/src/main/java/org/ladysnake/cca/mixin/chunk/common/MixinSerializedChunk.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
package org.ladysnake.cca.mixin.chunk.common;
2424

2525
import net.minecraft.nbt.NbtCompound;
26-
import net.minecraft.registry.DynamicRegistryManager;
2726
import net.minecraft.server.world.ServerWorld;
2827
import net.minecraft.storage.NbtReadView;
2928
import net.minecraft.util.ErrorReporter;
3029
import net.minecraft.util.math.ChunkPos;
3130
import net.minecraft.world.HeightLimitView;
3231
import net.minecraft.world.chunk.Chunk;
32+
import net.minecraft.world.chunk.PalettesFactory;
3333
import net.minecraft.world.chunk.ProtoChunk;
3434
import net.minecraft.world.chunk.SerializedChunk;
3535
import net.minecraft.world.chunk.WrapperProtoChunk;
@@ -50,7 +50,7 @@ public abstract class MixinSerializedChunk {
5050
private @Nullable NbtCompound cca$serializedComponents;
5151

5252
@Inject(method = "fromNbt", at = @At("RETURN"))
53-
private static void fromNbt(HeightLimitView world, DynamicRegistryManager registryManager, NbtCompound nbt, CallbackInfoReturnable<SerializedChunk> cir) {
53+
private static void fromNbt(HeightLimitView world, PalettesFactory palettesFactory, NbtCompound nbt, CallbackInfoReturnable<SerializedChunk> cir) {
5454
MixinSerializedChunk ret = (MixinSerializedChunk) (Object) cir.getReturnValue();
5555
if (ret != null) {
5656
ret.cca$serializedComponents = nbt.getCompound(AbstractComponentContainer.NBT_KEY).orElse(null);

cardinal-components-chunk/src/main/java/org/ladysnake/cca/mixin/chunk/common/MixinWorldChunk.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,14 @@
2424

2525
import net.fabricmc.fabric.api.networking.v1.PlayerLookup;
2626
import net.minecraft.network.RegistryByteBuf;
27-
import net.minecraft.registry.Registry;
2827
import net.minecraft.server.network.ServerPlayerEntity;
2928
import net.minecraft.server.world.ServerWorld;
3029
import net.minecraft.util.math.ChunkPos;
3130
import net.minecraft.world.HeightLimitView;
3231
import net.minecraft.world.World;
33-
import net.minecraft.world.biome.Biome;
3432
import net.minecraft.world.chunk.Chunk;
3533
import net.minecraft.world.chunk.ChunkSection;
34+
import net.minecraft.world.chunk.PalettesFactory;
3635
import net.minecraft.world.chunk.ProtoChunk;
3736
import net.minecraft.world.chunk.UpgradeData;
3837
import net.minecraft.world.chunk.WorldChunk;
@@ -53,8 +52,8 @@
5352

5453
@Mixin(WorldChunk.class)
5554
public abstract class MixinWorldChunk extends Chunk implements ComponentProvider {
56-
public MixinWorldChunk(ChunkPos pos, UpgradeData upgradeData, HeightLimitView heightLimitView, Registry<Biome> biome, long inhabitedTime, @Nullable ChunkSection[] sectionArrayInitializer, @Nullable BlendingData blendingData) {
57-
super(pos, upgradeData, heightLimitView, biome, inhabitedTime, sectionArrayInitializer, blendingData);
55+
public MixinWorldChunk(ChunkPos pos, UpgradeData upgradeData, HeightLimitView heightLimitView, PalettesFactory palettesFactory, long inhabitedTime, @Nullable ChunkSection[] sectionArray, @Nullable BlendingData blendingData) {
56+
super(pos, upgradeData, heightLimitView, palettesFactory, inhabitedTime, sectionArray, blendingData);
5857
}
5958

6059
@Shadow

cardinal-components-chunk/src/testmod/java/org/ladysnake/cca/test/chunk/CcaChunkTestSuite.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public void chunksSerialize(TestContext ctx) {
4343
Chunk c = new WorldChunk(ctx.getWorld(), pos);
4444
c.getComponent(Vita.KEY).setVitality(42);
4545
NbtCompound nbt = SerializedChunk.fromChunk(ctx.getWorld(), c).serialize();
46-
Chunk c1 = SerializedChunk.fromNbt(ctx.getWorld(), ctx.getWorld().getRegistryManager(), nbt)
46+
Chunk c1 = SerializedChunk.fromNbt(ctx.getWorld(), ctx.getWorld().getPalettesFactory(), nbt)
4747
.convert(ctx.getWorld(), ctx.getWorld().getPointOfInterestStorage(), new StorageKey("", ctx.getWorld().getRegistryKey(), ""), pos);
4848
ctx.assertEquals(42, c1.getComponent(Vita.KEY).getVitality(), Text.literal("Chunk component data should survive deserialization -"));
4949
ctx.complete();

0 commit comments

Comments
 (0)