diff --git a/LICENSE.md b/LICENSE similarity index 100% rename from LICENSE.md rename to LICENSE diff --git a/build.gradle.kts b/build.gradle.kts index ff1f6ce..b4ef4f1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,14 +1,14 @@ import java.time.Instant plugins { - id(/*net.fabricmc.*/ "fabric-loom") version "0.10.66" - id("io.github.juuxel.loom-quiltflower-mini") version "1.2.1" - id("net.nemerosa.versioning") version "2.15.1" + id(/*net.fabricmc.*/ "fabric-loom") version "0.12.48" + id("io.github.juuxel.loom-quiltflower") version "1.7.2" + id("net.nemerosa.versioning") version "3.0.0" id("org.gradle.signing") } group = "dev.sapphic" -version = "2.2.0" +version = "2.3.0" if ("CI" in System.getenv()) { version = "$version-${versioning.info.build}" @@ -46,19 +46,25 @@ repositories { } dependencies { - minecraft("com.mojang:minecraft:1.18.1") - mappings(loom.officialMojangMappings()) + minecraft("com.mojang:minecraft:1.19") + mappings(loom.layered { + officialMojangMappings { + nameSyntheticMembers = true + } + }) - modImplementation("net.fabricmc:fabric-loader:0.13.0") + modImplementation("net.fabricmc:fabric-loader:0.14.7") implementation("com.google.code.findbugs:jsr305:3.0.2") implementation("org.jetbrains:annotations:23.0.0") - implementation("org.checkerframework:checker-qual:3.21.1") + implementation("org.checkerframework:checker-qual:3.22.1") - modCompileOnly("curse.maven:charm-318872:3393290") { // 1.17-3.3.2 + modCompileOnly("curse.maven:charm-318872:3829804") { // 1.19-4.1.2 isTransitive = false } - modCompileOnly("curse.maven:red-bits-403914:3612273") { // 1.12.0 + // Binary compatible with unpublished 1.19 codebase + // https://github.com/magistermaks/mod-redbits/tree/ab96a1aa0625e662065789802625423b8ffd7a51 + modCompileOnly("curse.maven:red-bits-403914:3822702") { // 1.13.3 isTransitive = false } } @@ -71,12 +77,13 @@ tasks { isFork = true compilerArgs.addAll( listOf( - "-Xlint:all", - "-Xlint:-processing", - "-parameters" // JEP 118 + "-Xlint:all", "-Xlint:-processing", + // Enable parameter name class metadata + // https://openjdk.java.net/jeps/118 + "-parameters" ) ) - release.set(8) + release.set(17) } } @@ -87,7 +94,7 @@ tasks { } jar { - from("/LICENSE.md") + from("/LICENSE") manifest.attributes( "Build-Timestamp" to Instant.now(), @@ -138,19 +145,15 @@ tasks { sign(remapJar.get()) } + val signSourcesJar by creating(Sign::class) { dependsOn(remapSourcesJar) - /* - Loom does not expose remapSourcesJar as a Jar task - so we target the original sourcesJar task here - NOTE This will fail when the internals change - */ doFirst { - antSignJar(getByName("sourcesJar")) + antSignJar(remapSourcesJar.get()) } - sign(getByName("sourcesJar")) + sign(remapSourcesJar.get()) } assemble { diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7454180..41d9927 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ee6ba9a..e1e0c8d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=c9490e938b221daf0094982288e4038deed954a3f12fb54cbf270ddf4e37d879 -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip +distributionSha256Sum=e6d864e3b5bc05cc62041842b306383fc1fefcec359e70cebb1d470a6094ca82 +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/dev/sapphic/plated/PressurePlates.java b/src/main/java/dev/sapphic/plated/PressurePlates.java index 4dff2ac..71ca300 100644 --- a/src/main/java/dev/sapphic/plated/PressurePlates.java +++ b/src/main/java/dev/sapphic/plated/PressurePlates.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Chloe Dawn + * Copyright 2022 Chloe Dawn * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/dev/sapphic/plated/client/mixin/ModelBakeryMixin.java b/src/main/java/dev/sapphic/plated/client/mixin/ModelBakeryMixin.java index a0f6197..efc508a 100644 --- a/src/main/java/dev/sapphic/plated/client/mixin/ModelBakeryMixin.java +++ b/src/main/java/dev/sapphic/plated/client/mixin/ModelBakeryMixin.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Chloe Dawn + * Copyright 2022 Chloe Dawn * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,9 +40,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.regex.Matcher; import java.util.regex.Pattern; @Mixin(ModelBakery.class) @@ -50,13 +47,13 @@ abstract class ModelBakeryMixin { @Unique private static final Pattern BLOCK_STATE_KEY_PATTERN = - Pattern.compile("blockstates/(?.*)[.]json"); + Pattern.compile("^blockstates/(?.*)[.]json$"); @Unique private static final Direction[] DIRECTIONS = Direction.values(); @Unique private static @Nullable ResourceLocation resolve(final ResourceLocation rl) { - final Matcher matcher = BLOCK_STATE_KEY_PATTERN.matcher(rl.getPath()); + final var matcher = BLOCK_STATE_KEY_PATTERN.matcher(rl.getPath()); if (matcher.find()) { return ResourceLocation.tryParse(rl.getNamespace() + ':' + matcher.group("key")); @@ -72,8 +69,8 @@ private static Variant rotated(final Variant v, final Transformation transformat @Unique private static String facing(final Direction direction, final String variantString) { - final String facing = PressurePlates.FACING.getName() + '=' + direction.getName(); - final String[] variants = ObjectArrays.concat(facing, variantString.split("[,]")); + final var facing = PressurePlates.FACING.getName() + '=' + direction.getName(); + final var variants = ObjectArrays.concat(facing, variantString.split(",")); Arrays.sort(variants); @@ -82,26 +79,27 @@ private static String facing(final Direction direction, final String variantStri @ModifyVariable( method = - "lambda$loadModel$17(" - + "Lnet/minecraft/server/packs/resources/Resource;" + "lambda$loadModel$17(" + + "Lnet/minecraft/resources/ResourceLocation;" + + "Lnet/minecraft/server/packs/resources/Resource;" + ")Lcom/mojang/datafixers/util/Pair;", require = 1, allow = 1, at = @At("RETURN")) private Pair applyPressurePlateRotation( - final Pair pair, final Resource resource) { - if (Registry.BLOCK.get(resolve(resource.getLocation())) instanceof BasePressurePlateBlock) { - final Map groups = pair.getSecond().getVariants(); + final Pair pair, final ResourceLocation location, final Resource resource) { + if (Registry.BLOCK.get(resolve(location)) instanceof BasePressurePlateBlock) { + final var groups = pair.getSecond().getVariants(); - for (final String variantString : new HashSet<>(groups.keySet())) { - final List variants = groups.remove(variantString).getVariants(); + for (final var variantString : new HashSet<>(groups.keySet())) { + final var variants = groups.remove(variantString).getVariants(); - for (final Direction direction : DIRECTIONS) { - final List rotatedVariants = new ArrayList<>(variants.size()); - final Transformation transformation = + for (final var direction : DIRECTIONS) { + final var rotatedVariants = new ArrayList(variants.size()); + final var transformation = new Transformation(null, direction.getRotation(), null, null); - for (final Variant variant : variants) { + for (final var variant : variants) { rotatedVariants.add(rotated(variant, transformation)); } diff --git a/src/main/java/dev/sapphic/plated/client/mixin/package-info.java b/src/main/java/dev/sapphic/plated/client/mixin/package-info.java index 9c03c3e..e8036b1 100644 --- a/src/main/java/dev/sapphic/plated/client/mixin/package-info.java +++ b/src/main/java/dev/sapphic/plated/client/mixin/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Chloe Dawn + * Copyright 2022 Chloe Dawn * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/dev/sapphic/plated/mixin/BasePressurePlateBlockMixin.java b/src/main/java/dev/sapphic/plated/mixin/BasePressurePlateBlockMixin.java index c1b754a..19429a9 100644 --- a/src/main/java/dev/sapphic/plated/mixin/BasePressurePlateBlockMixin.java +++ b/src/main/java/dev/sapphic/plated/mixin/BasePressurePlateBlockMixin.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Chloe Dawn + * Copyright 2022 Chloe Dawn * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,11 +55,11 @@ abstract class BasePressurePlateBlockMixin extends Block implements SimpleWaterl @Override public @Nullable BlockState getStateForPlacement(final BlockPlaceContext context) { - final Level level = context.getLevel(); - final BlockPos pos = context.getClickedPos(); - final Direction clickedFace = context.getClickedFace(); - final boolean waterlogged = level.getFluidState(pos).getType() == Fluids.WATER; - BlockState state = + final var level = context.getLevel(); + final var pos = context.getClickedPos(); + final var clickedFace = context.getClickedFace(); + final var waterlogged = level.getFluidState(pos).getType() == Fluids.WATER; + var state = this.defaultBlockState().setValue(FACING, clickedFace).setValue(WATERLOGGED, waterlogged); // Always prefer the clicked face @@ -67,7 +67,7 @@ abstract class BasePressurePlateBlockMixin extends Block implements SimpleWaterl return state; } - for (final Direction face : FACES) { + for (final var face : FACES) { if (face == clickedFace) { continue; } diff --git a/src/main/java/dev/sapphic/plated/mixin/PressurePlateBlockMixin.java b/src/main/java/dev/sapphic/plated/mixin/PressurePlateBlockMixin.java index 21239da..24a83f1 100644 --- a/src/main/java/dev/sapphic/plated/mixin/PressurePlateBlockMixin.java +++ b/src/main/java/dev/sapphic/plated/mixin/PressurePlateBlockMixin.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Chloe Dawn + * Copyright 2022 Chloe Dawn * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/dev/sapphic/plated/mixin/WeightedPressurePlateBlockMixin.java b/src/main/java/dev/sapphic/plated/mixin/WeightedPressurePlateBlockMixin.java index da04af6..c09209f 100644 --- a/src/main/java/dev/sapphic/plated/mixin/WeightedPressurePlateBlockMixin.java +++ b/src/main/java/dev/sapphic/plated/mixin/WeightedPressurePlateBlockMixin.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Chloe Dawn + * Copyright 2022 Chloe Dawn * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/dev/sapphic/plated/mixin/charm/PlayerPressurePlateBlockMixin.java b/src/main/java/dev/sapphic/plated/mixin/charm/PlayerPressurePlateBlockMixin.java index c5dd3cb..950382d 100644 --- a/src/main/java/dev/sapphic/plated/mixin/charm/PlayerPressurePlateBlockMixin.java +++ b/src/main/java/dev/sapphic/plated/mixin/charm/PlayerPressurePlateBlockMixin.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Chloe Dawn + * Copyright 2022 Chloe Dawn * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/dev/sapphic/plated/mixin/charm/package-info.java b/src/main/java/dev/sapphic/plated/mixin/charm/package-info.java index be409b8..e88d339 100644 --- a/src/main/java/dev/sapphic/plated/mixin/charm/package-info.java +++ b/src/main/java/dev/sapphic/plated/mixin/charm/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Chloe Dawn + * Copyright 2022 Chloe Dawn * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/dev/sapphic/plated/mixin/package-info.java b/src/main/java/dev/sapphic/plated/mixin/package-info.java index 13b73c0..de19d25 100644 --- a/src/main/java/dev/sapphic/plated/mixin/package-info.java +++ b/src/main/java/dev/sapphic/plated/mixin/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Chloe Dawn + * Copyright 2022 Chloe Dawn * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/dev/sapphic/plated/mixin/redbits/ComplexPressurePlateBlockMixin.java b/src/main/java/dev/sapphic/plated/mixin/redbits/ComplexPressurePlateBlockMixin.java index b189992..44ad059 100644 --- a/src/main/java/dev/sapphic/plated/mixin/redbits/ComplexPressurePlateBlockMixin.java +++ b/src/main/java/dev/sapphic/plated/mixin/redbits/ComplexPressurePlateBlockMixin.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Chloe Dawn + * Copyright 2022 Chloe Dawn * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/dev/sapphic/plated/mixin/redbits/package-info.java b/src/main/java/dev/sapphic/plated/mixin/redbits/package-info.java index 7b92667..af3549a 100644 --- a/src/main/java/dev/sapphic/plated/mixin/redbits/package-info.java +++ b/src/main/java/dev/sapphic/plated/mixin/redbits/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Chloe Dawn + * Copyright 2022 Chloe Dawn * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/dev/sapphic/plated/package-info.java b/src/main/java/dev/sapphic/plated/package-info.java index eb484d8..b454956 100644 --- a/src/main/java/dev/sapphic/plated/package-info.java +++ b/src/main/java/dev/sapphic/plated/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Chloe Dawn + * Copyright 2022 Chloe Dawn * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 2ca5ec1..ba47027 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -6,14 +6,10 @@ "description": "Allows placement of pressure plates on any solid face of a block.", "license": "Apache-2.0", "depends": { - "minecraft": "1.18.x", - "fabricloader": ">=0.12.11", + "minecraft": "1.19", + "fabricloader": ">=0.14.6", "java": ">=8" }, - "conflicts": { - "charm": "<3.1.1", - "red-bits": "<1.7.0" - }, "mixins": [ "mixins/plated/mixins.client.json", "mixins/plated/mixins.server.json"