From 41995278df53ef8df275f7e5cee300b8092827c6 Mon Sep 17 00:00:00 2001 From: PepperCode1 <44146161+PepperCode1@users.noreply.github.com> Date: Tue, 14 May 2024 22:07:28 -0700 Subject: [PATCH] WIP - Port to 1.20.5 --- .github/workflows/build.yml | 2 +- build.gradle | 6 +++--- gradle.properties | 10 +++++----- .../client/properties/BaseCtmProperties.java | 4 ++-- .../client/properties/PropertiesParsingHelper.java | 4 +--- .../client/resource/CtmPropertiesLoader.java | 4 ++-- .../continuity/client/resource/CustomBlockLayers.java | 4 ++-- src/main/resources/continuity.mixins.json | 2 +- src/main/resources/fabric.mod.json | 4 ++-- src/main/resources/resourcepacks/default/pack.mcmeta | 4 ++-- .../resourcepacks/glass_pane_culling_fix/pack.mcmeta | 4 ++-- 11 files changed, 23 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 94a463c..60a04b4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: temurin - java-version: 17 + java-version: 21 check-latest: true - name: Build artifacts run: ./gradlew build --stacktrace diff --git a/build.gradle b/build.gradle index b9eac7b..98c2766 100644 --- a/build.gradle +++ b/build.gradle @@ -62,7 +62,7 @@ processResources { } tasks.withType(JavaCompile).configureEach { - it.options.release = 17 + it.options.release = 21 } java { @@ -71,8 +71,8 @@ java { // If you remove this line, sources will not be generated. withSourcesJar() - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 } jar { diff --git a/gradle.properties b/gradle.properties index bedcae5..243cc81 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,17 +4,17 @@ org.gradle.parallel = true # Fabric Properties loom_version = 1.6.11 -minecraft_version = 1.20.2 -yarn_mappings = 1.20.2+build.4 +minecraft_version = 1.20.5 +yarn_mappings = 1.20.5+build.1 loader_version = 0.15.10 # Mod Properties mod_version = 3.0.0-beta.5 -mod_minecraft_version = 1.20.2 +mod_minecraft_version = 1.20.5 maven_group = me.pepperbell archives_base_name = continuity # Dependencies -fabric_version = 0.89.0+1.20.2 -modmenu_version = 8.0.1 +fabric_version = 0.97.6+1.20.5 +modmenu_version = 10.0.0-beta.1 canvas_version = 20.2.2627 diff --git a/src/main/java/me/pepperbell/continuity/client/properties/BaseCtmProperties.java b/src/main/java/me/pepperbell/continuity/client/properties/BaseCtmProperties.java index 0f687b8..fe5b761 100644 --- a/src/main/java/me/pepperbell/continuity/client/properties/BaseCtmProperties.java +++ b/src/main/java/me/pepperbell/continuity/client/properties/BaseCtmProperties.java @@ -81,7 +81,7 @@ public class BaseCtmProperties implements CtmProperties { public BaseCtmProperties(Properties properties, Identifier resourceId, ResourcePack pack, int packPriority, ResourceManager resourceManager, String method) { this.properties = properties; this.resourceId = resourceId; - this.packName = pack.getName(); + this.packName = pack.getId(); this.packPriority = packPriority; this.resourceManager = resourceManager; this.method = method; @@ -605,7 +605,7 @@ protected void parseResourceCondition() { } } else if (packStr.equals("programmer_art")) { Optional optionalResource = resourceManager.getResource(resourceId); - if (optionalResource.isPresent() && !optionalResource.get().getPack().getName().equals("programmer_art")) { + if (optionalResource.isPresent() && !optionalResource.get().getPack().getId().equals("programmer_art")) { valid = false; break; } diff --git a/src/main/java/me/pepperbell/continuity/client/properties/PropertiesParsingHelper.java b/src/main/java/me/pepperbell/continuity/client/properties/PropertiesParsingHelper.java index ed914a4..53f5ba7 100644 --- a/src/main/java/me/pepperbell/continuity/client/properties/PropertiesParsingHelper.java +++ b/src/main/java/me/pepperbell/continuity/client/properties/PropertiesParsingHelper.java @@ -12,8 +12,6 @@ import org.apache.commons.io.FilenameUtils; import org.jetbrains.annotations.Nullable; -import com.google.common.collect.ImmutableMap; - import it.unimi.dsi.fastutil.Hash; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; @@ -242,7 +240,7 @@ public static Predicate parseBlockStates(Properties properties, Stri } predicateMap.put(block, state -> { - ImmutableMap, Comparable> targetValueMap = state.getEntries(); + Map, Comparable> targetValueMap = state.getEntries(); for (Map.Entry, ObjectOpenHashSet>> entry : entryArray) { Comparable targetValue = targetValueMap.get(entry.getKey()); if (targetValue != null) { diff --git a/src/main/java/me/pepperbell/continuity/client/resource/CtmPropertiesLoader.java b/src/main/java/me/pepperbell/continuity/client/resource/CtmPropertiesLoader.java index 6b4173c..91c03bf 100644 --- a/src/main/java/me/pepperbell/continuity/client/resource/CtmPropertiesLoader.java +++ b/src/main/java/me/pepperbell/continuity/client/resource/CtmPropertiesLoader.java @@ -81,7 +81,7 @@ private void loadAll(ResourcePack pack, int packPriority) { properties.load(stream); load(properties, resourceId, pack, packPriority); } catch (Exception e) { - ContinuityClient.LOGGER.error("Failed to load CTM properties from file '" + resourceId + "' in pack '" + pack.getName() + "'", e); + ContinuityClient.LOGGER.error("Failed to load CTM properties from file '" + resourceId + "' in pack '" + pack.getId() + "'", e); } } }); @@ -94,7 +94,7 @@ private void load(Properties properties, Identifier resourceId, ResourcePack pac if (loader != null) { load(loader, properties, resourceId, pack, packPriority, method); } else { - ContinuityClient.LOGGER.error("Unknown 'method' value '" + method + "' in file '" + resourceId + "' in pack '" + pack.getName() + "'"); + ContinuityClient.LOGGER.error("Unknown 'method' value '" + method + "' in file '" + resourceId + "' in pack '" + pack.getId() + "'"); } } diff --git a/src/main/java/me/pepperbell/continuity/client/resource/CustomBlockLayers.java b/src/main/java/me/pepperbell/continuity/client/resource/CustomBlockLayers.java index 0b16bf5..fe82229 100644 --- a/src/main/java/me/pepperbell/continuity/client/resource/CustomBlockLayers.java +++ b/src/main/java/me/pepperbell/continuity/client/resource/CustomBlockLayers.java @@ -69,9 +69,9 @@ private static void reload(ResourceManager manager) { try (InputStream inputStream = resource.getInputStream()) { Properties properties = new Properties(); properties.load(inputStream); - reload(properties, LOCATION, resource.getResourcePackName()); + reload(properties, LOCATION, resource.getPackId()); } catch (IOException e) { - ContinuityClient.LOGGER.error("Failed to load custom block layers from file '" + LOCATION + "' from pack '" + resource.getResourcePackName() + "'", e); + ContinuityClient.LOGGER.error("Failed to load custom block layers from file '" + LOCATION + "' from pack '" + resource.getPackId() + "'", e); } } } diff --git a/src/main/resources/continuity.mixins.json b/src/main/resources/continuity.mixins.json index 199375e..5c217b7 100644 --- a/src/main/resources/continuity.mixins.json +++ b/src/main/resources/continuity.mixins.json @@ -2,7 +2,7 @@ "required": true, "minVersion": "0.8", "package": "me.pepperbell.continuity.client.mixin", - "compatibilityLevel": "JAVA_17", + "compatibilityLevel": "JAVA_21", "client": [ "AtlasLoaderMixin", "BakedModelManagerMixin", diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index fb8bd80..def2299 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -31,9 +31,9 @@ ], "depends": { - "minecraft": ">=1.20.2 <=1.20.4", + "minecraft": ">=1.20.5", "fabricloader": ">=0.15.0", - "fabric-api": ">=0.89.0" + "fabric-api": ">=0.97.6" }, "custom": { diff --git a/src/main/resources/resourcepacks/default/pack.mcmeta b/src/main/resources/resourcepacks/default/pack.mcmeta index 0ac0158..655ac88 100644 --- a/src/main/resources/resourcepacks/default/pack.mcmeta +++ b/src/main/resources/resourcepacks/default/pack.mcmeta @@ -1,7 +1,7 @@ { "pack": { - "pack_format": 18, - "supported_formats": [18, 22], + "pack_format": 32, + "supported_formats": [32, 999], "description": { "translate": "resourcePack.continuity.default.description" } diff --git a/src/main/resources/resourcepacks/glass_pane_culling_fix/pack.mcmeta b/src/main/resources/resourcepacks/glass_pane_culling_fix/pack.mcmeta index 977c44e..827b01b 100644 --- a/src/main/resources/resourcepacks/glass_pane_culling_fix/pack.mcmeta +++ b/src/main/resources/resourcepacks/glass_pane_culling_fix/pack.mcmeta @@ -1,7 +1,7 @@ { "pack": { - "pack_format": 18, - "supported_formats": [18, 22], + "pack_format": 32, + "supported_formats": [32, 999], "description": { "translate": "resourcePack.continuity.glass_pane_culling_fix.description" }