From a4b62700407c2bf9f63d8ecb0db78e252d9a1842 Mon Sep 17 00:00:00 2001 From: HyCraftHD Date: Sat, 4 Dec 2021 15:25:26 +0100 Subject: [PATCH 1/6] Update gradle and buildscripts for 1.18 --- build.gradle | 8 ++++---- gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 2924986..ee33eec 100644 --- a/build.gradle +++ b/build.gradle @@ -26,7 +26,7 @@ curseforge { changelog = file('changelog.md') changelogType = 'markdown' releaseType = 'release' - addGameVersion 'Java 16' + addGameVersion 'Java 17' } } @@ -38,10 +38,10 @@ version = ver group = 'eu.gir' archivesBaseName = 'GIRC-Redstone' -java.toolchain.languageVersion = JavaLanguageVersion.of(16) +java.toolchain.languageVersion = JavaLanguageVersion.of(17) minecraft { - mappings channel: 'official', version: '1.17.1' + mappings channel: 'official', version: '1.18' runs { client { @@ -75,7 +75,7 @@ repositories { } dependencies { - minecraft 'net.minecraftforge:forge:1.17.1-37.0.84' + minecraft 'net.minecraftforge:forge:1.18-38.0.14' } jar { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ffed3a2..84d1f85 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.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 9cc71ceeb13720233c6fcbb3fe825bb10a94fbf6 Mon Sep 17 00:00:00 2001 From: HyCraftHD Date: Sat, 4 Dec 2021 15:35:39 +0100 Subject: [PATCH 2/6] Update mods.toml and pack.mcmeta --- src/main/resources/META-INF/mods.toml | 6 +++--- src/main/resources/pack.mcmeta | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 26d7348..82f2706 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -1,5 +1,5 @@ modLoader="javafml" -loaderVersion="[36,)" +loaderVersion="[38,)" issueTrackerURL="https://github.com/German-Immersive-Railroading-Community/GIRC-Redstone/issues" license="Apache License Version 2.0" @@ -18,13 +18,13 @@ Works in unloaded Chunks TM. [[dependencies.gircredstone]] modId="forge" mandatory=true - versionRange="[25,)" + versionRange="[38,)" ordering="NONE" side="BOTH" [[dependencies.gircredstone]] modId="minecraft" mandatory=true - versionRange="[1.17.1]" + versionRange="[1.18, 1.19)" ordering="NONE" side="BOTH" \ No newline at end of file diff --git a/src/main/resources/pack.mcmeta b/src/main/resources/pack.mcmeta index 4018267..5b94fca 100644 --- a/src/main/resources/pack.mcmeta +++ b/src/main/resources/pack.mcmeta @@ -1,7 +1,6 @@ { "pack": { - "description": "examplemod resources", - "pack_format": 3, - "_comment": "A pack_format of 3 should be used starting with Minecraft 1.11. All resources, including language files, should be lowercase (eg: en_us.lang). A pack_format of 2 will load your mod resources with LegacyV2Adapter, which requires language files to have uppercase letters (eg: en_US.lang)." - } + "description": "GIRC Redstone", + "pack_format": 8 + } } From d511989d4e57e2360d82af888a203facc1e01a41 Mon Sep 17 00:00:00 2001 From: HyCraftHD Date: Sat, 4 Dec 2021 15:38:50 +0100 Subject: [PATCH 3/6] Remove wrong @OnlyIn annotation. They were removed from methods in 1.18 due to mojangs proguard config only removing classes now and not methods. --- src/main/java/eu/gir/gircredstone/item/Linkingtool.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/java/eu/gir/gircredstone/item/Linkingtool.java b/src/main/java/eu/gir/gircredstone/item/Linkingtool.java index 619891f..ace690c 100644 --- a/src/main/java/eu/gir/gircredstone/item/Linkingtool.java +++ b/src/main/java/eu/gir/gircredstone/item/Linkingtool.java @@ -22,8 +22,6 @@ import net.minecraft.world.item.context.UseOnContext; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; public class Linkingtool extends Item { @@ -96,7 +94,6 @@ public InteractionResult onItemUseFirst(ItemStack stack, UseOnContext ctx) { return InteractionResult.FAIL; } - @OnlyIn(Dist.CLIENT) @Override public void appendHoverText(ItemStack stack, @Nullable Level LevelIn, List tooltip, TooltipFlag flagIn) { final CompoundTag nbt = stack.getTag(); From f4a17827106b47b9eb9d9d2c202fecd9167bb0de Mon Sep 17 00:00:00 2001 From: HyCraftHD Date: Sat, 4 Dec 2021 15:44:15 +0100 Subject: [PATCH 4/6] Fix new lines not working in toml file descriptions --- src/main/resources/META-INF/mods.toml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 82f2706..50ee8cc 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -9,11 +9,7 @@ version="${file.jarVersion}" displayName="GIRC Redstone" displayURL="https://girc.eu/" authors="MrTroble, Jeronimo" -description=''' -The official Wireless Redstone Mod for GIR. - -Works in unloaded Chunks TM. -''' +description="The official Wireless Redstone Mod for GIR.\nWorks in unloaded Chunks TM." [[dependencies.gircredstone]] modId="forge" From be03ae0f007aa62afb87018be8d0e68fd508eeab Mon Sep 17 00:00:00 2001 From: HyCraftHD Date: Sat, 4 Dec 2021 15:51:45 +0100 Subject: [PATCH 5/6] Fix block models being not updated past 1.12 state --- .../resources/assets/gircredstone/blockstates/acceptor.json | 2 +- src/main/resources/assets/gircredstone/blockstates/emitter.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/assets/gircredstone/blockstates/acceptor.json b/src/main/resources/assets/gircredstone/blockstates/acceptor.json index 8c30378..b526612 100644 --- a/src/main/resources/assets/gircredstone/blockstates/acceptor.json +++ b/src/main/resources/assets/gircredstone/blockstates/acceptor.json @@ -1 +1 @@ -{"variants": {"power=false": {"model": "gircredstone:acceptor_off"}, "power=true": {"model": "gircredstone:acceptor_on"}}} \ No newline at end of file +{"variants": {"power=false": {"model": "gircredstone:block/acceptor_off"}, "power=true": {"model": "gircredstone:block/acceptor_on"}}} \ No newline at end of file diff --git a/src/main/resources/assets/gircredstone/blockstates/emitter.json b/src/main/resources/assets/gircredstone/blockstates/emitter.json index 3c9fb64..328edad 100644 --- a/src/main/resources/assets/gircredstone/blockstates/emitter.json +++ b/src/main/resources/assets/gircredstone/blockstates/emitter.json @@ -1 +1 @@ -{"variants": {"normal": {"model": "gircredstone:emitter"}}} \ No newline at end of file +{"variants": {"": {"model": "gircredstone:block/emitter"}}} \ No newline at end of file From f74ca9ead07562d26d0fa10d23f506634e9a0e74 Mon Sep 17 00:00:00 2001 From: HyCraftHD Date: Sat, 4 Dec 2021 15:52:01 +0100 Subject: [PATCH 6/6] Fix tile entity saving methods to use the correct ones --- .../gir/gircredstone/tile/TileRedstoneEmitter.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/eu/gir/gircredstone/tile/TileRedstoneEmitter.java b/src/main/java/eu/gir/gircredstone/tile/TileRedstoneEmitter.java index aa53a40..986afb9 100644 --- a/src/main/java/eu/gir/gircredstone/tile/TileRedstoneEmitter.java +++ b/src/main/java/eu/gir/gircredstone/tile/TileRedstoneEmitter.java @@ -17,14 +17,15 @@ public TileRedstoneEmitter(BlockPos pos, BlockState state) { private BlockPos linkedpos = null; @Override - public void deserializeNBT(CompoundTag nbt) { - super.deserializeNBT(nbt); - this.linkedpos = Linkingtool.readBlockPosFromNBT(nbt); + public void load(CompoundTag compound) { + super.load(compound); + this.linkedpos = Linkingtool.readBlockPosFromNBT(compound); } - + @Override - public CompoundTag serializeNBT() { - return Linkingtool.writeBlockPosToNBT(linkedpos, super.serializeNBT()); + protected void saveAdditional(CompoundTag compound) { + super.saveAdditional(compound); + Linkingtool.writeBlockPosToNBT(linkedpos, compound); } public boolean link(final BlockPos pos) {