From 694abca053fae1c539c159a6edf7237ae7954340 Mon Sep 17 00:00:00 2001 From: IanAnderson Date: Sat, 30 Sep 2023 11:09:24 -0700 Subject: [PATCH 1/3] 1.20.2 Port --- gradle.properties | 14 +++++++------- gradle/wrapper/gradle-wrapper.properties | 2 +- .../github/lucaargolo/seasons/FabricSeasons.java | 4 ++-- .../seasons/mixin/ServerWorldMixin.java | 16 ++++++++-------- .../seasons/utils/PlacedMeltablesState.java | 6 ++++++ .../seasons/utils/ReplacedMeltablesState.java | 6 ++++++ 6 files changed, 30 insertions(+), 18 deletions(-) diff --git a/gradle.properties b/gradle.properties index d3140d1..898d731 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,8 +1,8 @@ - # Done to increase the memory available to gradle. +# Done to increase the memory available to gradle. org.gradle.jvmargs=-Xmx4G # Gradle Plugins -loom_version=1.1-SNAPSHOT +loom_version=1.4-SNAPSHOT grgit_version=5.0.0 cursegradle_version=1.4.0 modrinth_version=2.7.3 @@ -13,16 +13,16 @@ mod_version=2.3+1.20 maven_group=io.github.lucaargolo # Fabric Properties -minecraft_version=1.20.1 -yarn_mappings=1.20.1+build.10 +minecraft_version=1.20.2 +yarn_mappings=1.20.2+build.2 loader_version=0.14.22 #Fabric api -fabric_version=0.86.1+1.20.1 +fabric_version=0.89.2+1.20.2 #Libraries -modmenu_version=7.2.1 -rei_version=12.0.645 +modmenu_version=8.0.0 +rei_version=13.0.666 #Publishing curseforge_id=413523 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e750102..db9a6b8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/io/github/lucaargolo/seasons/FabricSeasons.java b/src/main/java/io/github/lucaargolo/seasons/FabricSeasons.java index 54de714..ace26c0 100644 --- a/src/main/java/io/github/lucaargolo/seasons/FabricSeasons.java +++ b/src/main/java/io/github/lucaargolo/seasons/FabricSeasons.java @@ -144,11 +144,11 @@ public static boolean isMeltable(BlockPos blockPos) { } public static PlacedMeltablesState getPlacedMeltablesState(ServerWorld world) { - return world.getPersistentStateManager().getOrCreate(PlacedMeltablesState::createFromNbt, PlacedMeltablesState::new, "seasons_placed_meltables"); + return world.getPersistentStateManager().getOrCreate(PlacedMeltablesState.type, "seasons_placed_meltables"); } public static ReplacedMeltablesState getReplacedMeltablesState(ServerWorld world) { - return world.getPersistentStateManager().getOrCreate(ReplacedMeltablesState::createFromNbt, ReplacedMeltablesState::new, "seasons_replaced_meltables"); + return world.getPersistentStateManager().getOrCreate(ReplacedMeltablesState.type, "seasons_replaced_meltables"); } public static long getTimeToNextSeason(World world) { diff --git a/src/main/java/io/github/lucaargolo/seasons/mixin/ServerWorldMixin.java b/src/main/java/io/github/lucaargolo/seasons/mixin/ServerWorldMixin.java index d3b21e9..22ed1b4 100644 --- a/src/main/java/io/github/lucaargolo/seasons/mixin/ServerWorldMixin.java +++ b/src/main/java/io/github/lucaargolo/seasons/mixin/ServerWorldMixin.java @@ -32,23 +32,23 @@ protected ServerWorldMixin(MutableWorldProperties properties, RegistryKey super(properties, registryRef, registryManager, dimensionEntry, profiler, isClient, debugWorld, biomeAccess, maxChainedNeighborUpdates); } - @Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ServerWorld;setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Z", ordinal = 0), method = "tickChunk", locals = LocalCapture.CAPTURE_FAILSOFT) - public void setMeltableIce(WorldChunk chunk, int randomTickSpeed, CallbackInfo ci, ChunkPos chunkPos, boolean bl, int i, int j, Profiler profiler, BlockPos blockPos, BlockPos blockPos2, Biome biome) { + @Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ServerWorld;setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Z", ordinal = 0), method = "tickIceAndSnow", locals = LocalCapture.CAPTURE_FAILSOFT) + public void setMeltableIce(boolean raining, BlockPos pos, CallbackInfo ci, BlockPos blockPos, BlockPos blockPos2, Biome biome) { FabricSeasons.setMeltable(blockPos2); } - @Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ServerWorld;setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Z", ordinal = 1), method = "tickChunk", locals = LocalCapture.CAPTURE_FAILSOFT) - public void setMeltableLayeredSnow(WorldChunk chunk, int randomTickSpeed, CallbackInfo ci, ChunkPos chunkPos, boolean bl, int i, int j, Profiler profiler, BlockPos blockPos, BlockPos blockPos2, Biome biome) { + @Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ServerWorld;setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Z", ordinal = 1), method = "tickIceAndSnow", locals = LocalCapture.CAPTURE_FAILSOFT) + public void setMeltableLayeredSnow(boolean raining, BlockPos pos, CallbackInfo ci, BlockPos blockPos, BlockPos blockPos2, Biome biome) { FabricSeasons.setMeltable(blockPos); } - @Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ServerWorld;setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Z", ordinal = 2), method = "tickChunk", locals = LocalCapture.CAPTURE_FAILSOFT) - public void setMeltableSnow(WorldChunk chunk, int randomTickSpeed, CallbackInfo ci, ChunkPos chunkPos, boolean bl, int i, int j, Profiler profiler, BlockPos blockPos, BlockPos blockPos2, Biome biome) { + @Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ServerWorld;setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Z", ordinal = 2), method = "tickIceAndSnow", locals = LocalCapture.CAPTURE_FAILSOFT) + public void setMeltableSnow(boolean raining, BlockPos pos, CallbackInfo ci, BlockPos blockPos, BlockPos blockPos2, Biome biome) { FabricSeasons.setMeltable(blockPos); } - @Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/block/Block;precipitationTick(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/world/biome/Biome$Precipitation;)V"), method = "tickChunk", locals = LocalCapture.CAPTURE_FAILSOFT) - public void setReplacedMeltable(WorldChunk chunk, int randomTickSpeed, CallbackInfo ci, ChunkPos chunkPos, boolean bl, int i, int j, Profiler profiler, BlockPos blockPos, BlockPos blockPos2, Biome biome, int k, Biome.Precipitation precipitation, BlockState blockState3) { + @Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/block/Block;precipitationTick(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/world/biome/Biome$Precipitation;)V"), method = "tickIceAndSnow", locals = LocalCapture.CAPTURE_FAILSOFT) + public void setReplacedMeltable(boolean raining, BlockPos pos, CallbackInfo ci, BlockPos blockPos, BlockPos blockPos2, Biome biome, int k, Biome.Precipitation precipitation, BlockState blockState3) { Meltable.replaceBlockOnSnow((ServerWorld) (Object) this, blockPos, biome); } diff --git a/src/main/java/io/github/lucaargolo/seasons/utils/PlacedMeltablesState.java b/src/main/java/io/github/lucaargolo/seasons/utils/PlacedMeltablesState.java index 183c6b4..a402bd1 100644 --- a/src/main/java/io/github/lucaargolo/seasons/utils/PlacedMeltablesState.java +++ b/src/main/java/io/github/lucaargolo/seasons/utils/PlacedMeltablesState.java @@ -63,4 +63,10 @@ public static PlacedMeltablesState createFromNbt(NbtCompound nbt) { }); return state; } + + public static Type type = new Type<>( + PlacedMeltablesState::new, + PlacedMeltablesState::createFromNbt, + null + ); } diff --git a/src/main/java/io/github/lucaargolo/seasons/utils/ReplacedMeltablesState.java b/src/main/java/io/github/lucaargolo/seasons/utils/ReplacedMeltablesState.java index 827d23c..008c627 100644 --- a/src/main/java/io/github/lucaargolo/seasons/utils/ReplacedMeltablesState.java +++ b/src/main/java/io/github/lucaargolo/seasons/utils/ReplacedMeltablesState.java @@ -81,4 +81,10 @@ public static ReplacedMeltablesState createFromNbt(NbtCompound nbt) { }); return state; } + + public static Type type = new Type<>( + ReplacedMeltablesState::new, + ReplacedMeltablesState::createFromNbt, + null + ); } From 7a7209ec4847aa1c99ef8628ba0df5f6e4847558 Mon Sep 17 00:00:00 2001 From: Ian Anderson Date: Sun, 26 Nov 2023 13:04:01 -0700 Subject: [PATCH 2/3] Update gradle.properties --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 898d731..583af8a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ modrinth_version=2.7.3 github_api_version=1.314 # Mod Properties -mod_version=2.3+1.20 +mod_version=2.3+1.20.2 maven_group=io.github.lucaargolo # Fabric Properties From e034b1f8e6c6b08855c826c60ea72ca8f26e0101 Mon Sep 17 00:00:00 2001 From: IanAnderson Date: Thu, 21 Dec 2023 09:29:08 -0700 Subject: [PATCH 3/3] 1.20.2 Port --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 898d731..583af8a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ modrinth_version=2.7.3 github_api_version=1.314 # Mod Properties -mod_version=2.3+1.20 +mod_version=2.3+1.20.2 maven_group=io.github.lucaargolo # Fabric Properties