From 03b5a37915e03083841a82586039cca106aa334e Mon Sep 17 00:00:00 2001 From: Pyrofab Date: Wed, 29 Nov 2023 00:06:22 +0100 Subject: [PATCH] Update to 1.20.3 --- .../cca/test/block/CcaBlockTestSuite.java | 17 +++++++++-------- .../level/common/MixinLevelProperties.java | 10 +++------- changelog.md | 5 +++++ gradle.properties | 14 +++++++------- 4 files changed, 24 insertions(+), 22 deletions(-) diff --git a/cardinal-components-block/src/testmod/java/dev/onyxstudios/cca/test/block/CcaBlockTestSuite.java b/cardinal-components-block/src/testmod/java/dev/onyxstudios/cca/test/block/CcaBlockTestSuite.java index 395eaada..0d42a3dc 100644 --- a/cardinal-components-block/src/testmod/java/dev/onyxstudios/cca/test/block/CcaBlockTestSuite.java +++ b/cardinal-components-block/src/testmod/java/dev/onyxstudios/cca/test/block/CcaBlockTestSuite.java @@ -91,28 +91,29 @@ public void canQueryThroughLookup(TestContext ctx) { @GameTest(templateName = EMPTY_STRUCTURE) public void beComponentsTick(TestContext ctx) { - ctx.setBlockState(BlockPos.ORIGIN, Blocks.END_PORTAL); - ctx.waitAndRun(5, () -> { - int ticks = Objects.requireNonNull(ctx.getBlockEntity(BlockPos.ORIGIN)).getComponent(TickingTestComponent.KEY).serverTicks(); + BlockPos pos = new BlockPos(1, 1, 1); + ctx.setBlockState(pos, Blocks.END_PORTAL); + ctx.addFinalTaskWithDuration(5, () -> { + int ticks = Objects.requireNonNull(ctx.getBlockEntity(pos)).getComponent(TickingTestComponent.KEY).serverTicks(); GameTestUtil.assertTrue("Component should tick 5 times", ticks == 5); - ctx.complete(); }); } @GameTest(templateName = EMPTY_STRUCTURE) public void beComponentsLoadUnload(TestContext ctx) { - BlockEntity firstCommandBlock = new CommandBlockBlockEntity(ctx.getAbsolutePos(BlockPos.ORIGIN), Blocks.CHAIN_COMMAND_BLOCK.getDefaultState()); + BlockPos pos = new BlockPos(1, 1, 1); + BlockEntity firstCommandBlock = new CommandBlockBlockEntity(ctx.getAbsolutePos(pos), Blocks.CHAIN_COMMAND_BLOCK.getDefaultState()); GameTestUtil.assertTrue( "Load counter should not be incremented until the block entity joins the world", LoadAwareTestComponent.KEY.get(firstCommandBlock).getLoadCounter() == 0 ); - ctx.setBlockState(BlockPos.ORIGIN, Blocks.CHAIN_COMMAND_BLOCK); - BlockEntity commandBlock = Objects.requireNonNull(ctx.getBlockEntity(BlockPos.ORIGIN)); + ctx.setBlockState(pos, Blocks.CHAIN_COMMAND_BLOCK); + BlockEntity commandBlock = Objects.requireNonNull(ctx.getBlockEntity(pos)); GameTestUtil.assertTrue( "Load counter should be incremented once when the block entity joins the world", LoadAwareTestComponent.KEY.get(commandBlock).getLoadCounter() == 1 ); - ctx.setBlockState(BlockPos.ORIGIN, Blocks.AIR); + ctx.setBlockState(pos, Blocks.AIR); ctx.waitAndRun(1, () -> { GameTestUtil.assertTrue( "Load counter should be decremented when the block entity leaves the world", diff --git a/cardinal-components-level/src/main/java/dev/onyxstudios/cca/mixin/level/common/MixinLevelProperties.java b/cardinal-components-level/src/main/java/dev/onyxstudios/cca/mixin/level/common/MixinLevelProperties.java index c3345f32..e9057630 100644 --- a/cardinal-components-level/src/main/java/dev/onyxstudios/cca/mixin/level/common/MixinLevelProperties.java +++ b/cardinal-components-level/src/main/java/dev/onyxstudios/cca/mixin/level/common/MixinLevelProperties.java @@ -22,7 +22,6 @@ */ package dev.onyxstudios.cca.mixin.level.common; -import com.mojang.datafixers.DataFixer; import com.mojang.serialization.Dynamic; import com.mojang.serialization.Lifecycle; import dev.onyxstudios.cca.api.v3.component.ComponentContainer; @@ -36,18 +35,15 @@ import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; import net.minecraft.entity.boss.dragon.EnderDragonFight; import net.minecraft.nbt.NbtCompound; -import net.minecraft.nbt.NbtElement; import net.minecraft.network.PacketByteBuf; import net.minecraft.network.packet.s2c.common.CustomPayloadS2CPacket; import net.minecraft.registry.DynamicRegistryManager; -import net.minecraft.server.MinecraftServer; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.world.border.WorldBorder; import net.minecraft.world.gen.GeneratorOptions; import net.minecraft.world.level.LevelInfo; import net.minecraft.world.level.LevelProperties; import net.minecraft.world.level.ServerWorldProperties; -import net.minecraft.world.level.storage.SaveVersionInfo; import net.minecraft.world.timer.Timer; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Unique; @@ -66,13 +62,13 @@ public abstract class MixinLevelProperties implements ServerWorldProperties, Com @Unique private ComponentContainer components; - @Inject(method = "Lnet/minecraft/world/level/LevelProperties;(Lcom/mojang/datafixers/DataFixer;ILnet/minecraft/nbt/NbtCompound;ZIIIFJJIIIZIZZZLnet/minecraft/world/border/WorldBorder$Properties;IILjava/util/UUID;Ljava/util/Set;Ljava/util/Set;Lnet/minecraft/world/timer/Timer;Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/entity/boss/dragon/EnderDragonFight$Data;Lnet/minecraft/world/level/LevelInfo;Lnet/minecraft/world/gen/GeneratorOptions;Lnet/minecraft/world/level/LevelProperties$SpecialProperty;Lcom/mojang/serialization/Lifecycle;)V", at = @At("RETURN")) - private void initComponents(DataFixer dataFixer, int dataVersion, NbtCompound playerData, boolean modded, int spawnX, int spawnY, int spawnZ, float spawnAngle, long time, long timeOfDay, int version, int clearWeatherTime, int rainTime, boolean raining, int thunderTime, boolean thundering, boolean initialized, boolean difficultyLocked, WorldBorder.Properties worldBorder, int wanderingTraderSpawnDelay, int wanderingTraderSpawnChance, UUID wanderingTraderId, Set serverBrands, Set removedFeatures, Timer scheduledEvents, NbtCompound customBossEvents, EnderDragonFight.Data dragonFight, LevelInfo levelInfo, GeneratorOptions generatorOptions, LevelProperties.SpecialProperty specialProperty, Lifecycle lifecycle, CallbackInfo ci) { + @Inject(method = "(Lnet/minecraft/nbt/NbtCompound;ZIIIFJJIIIZIZZZLnet/minecraft/world/border/WorldBorder$Properties;IILjava/util/UUID;Ljava/util/Set;Ljava/util/Set;Lnet/minecraft/world/timer/Timer;Lnet/minecraft/nbt/NbtCompound;Lnet/minecraft/entity/boss/dragon/EnderDragonFight$Data;Lnet/minecraft/world/level/LevelInfo;Lnet/minecraft/world/gen/GeneratorOptions;Lnet/minecraft/world/level/LevelProperties$SpecialProperty;Lcom/mojang/serialization/Lifecycle;)V", at = @At("RETURN")) + private void initComponents(NbtCompound playerData, boolean modded, int spawnX, int spawnY, int spawnZ, float spawnAngle, long time, long timeOfDay, int version, int clearWeatherTime, int rainTime, boolean raining, int thunderTime, boolean thundering, boolean initialized, boolean difficultyLocked, WorldBorder.Properties worldBorder, int wanderingTraderSpawnDelay, int wanderingTraderSpawnChance, UUID wanderingTraderId, Set serverBrands, Set removedFeatures, Timer scheduledEvents, NbtCompound customBossEvents, EnderDragonFight.Data dragonFight, LevelInfo levelInfo, GeneratorOptions generatorOptions, LevelProperties.SpecialProperty specialProperty, Lifecycle lifecycle, CallbackInfo ci) { this.components = StaticLevelComponentPlugin.createContainer(this); } @Inject(method = "readProperties", at = @At("RETURN")) - private static void readComponents(Dynamic dynamic, DataFixer dataFixer, int dataVersion, NbtCompound playerData, LevelInfo levelInfo, SaveVersionInfo saveVersionInfo, LevelProperties.SpecialProperty specialProperty, GeneratorOptions generatorOptions, Lifecycle lifecycle, CallbackInfoReturnable cir) { + private static void readComponents(Dynamic dynamic, LevelInfo info, LevelProperties.SpecialProperty specialProperty, GeneratorOptions generatorOptions, Lifecycle lifecycle, CallbackInfoReturnable cir) { ((ComponentProvider) cir.getReturnValue()).getComponentContainer().fromDynamic(dynamic); } diff --git a/changelog.md b/changelog.md index b9982e31..8a2198bc 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,8 @@ +------------------------------------------------------ +Version 5.4.0 +------------------------------------------------------ +Updated to 1.20.3 + ------------------------------------------------------ Version 5.3.0 ------------------------------------------------------ diff --git a/gradle.properties b/gradle.properties index e1a3ac6d..187980e6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,20 +4,20 @@ org.gradle.parallel=true fabric.loom.multiProjectOptimisation=true #see https://fabricmc.net/develop/ -minecraft_version=1.20.2-pre2 -yarn_mappings=5 -loader_version=0.14.22 +minecraft_version=1.20.3-pre4 +yarn_mappings=2 +loader_version=0.14.25 #Fabric api -fabric_api_version=0.88.3+1.20.2 +fabric_api_version=0.91.1+1.20.3 elmendorf_version=0.12.0 #Publishing -mod_version = 5.3.0 +mod_version = 5.4.0 curseforge_id = 318449 modrinth_id = K01OU20C -curseforge_versions = 1.20.2-Snapshot -modrinth_versions = 1.20.2-pre2 +curseforge_versions = 1.20.3-Snapshot +modrinth_versions = 1.20.3-pre4 release_type = release display_name = Cardinal-Components-API owners = Ladysnake