diff --git a/build.gradle b/build.gradle index f3a7fa2..50c3291 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1699290261 +//version: 1702141377 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -28,27 +28,12 @@ import java.util.concurrent.TimeUnit buildscript { repositories { - mavenCentral() - - maven { - name 'forge' - url 'https://maven.minecraftforge.net' - } maven { // GTNH RetroFuturaGradle and ASM Fork name "GTNH Maven" url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" allowInsecureProtocol = true } - maven { - name 'sonatype' - url 'https://oss.sonatype.org/content/repositories/snapshots/' - } - maven { - name 'Scala CI dependencies' - url 'https://repo1.maven.org/maven2/' - } - mavenLocal() } } @@ -69,7 +54,7 @@ plugins { id 'com.diffplug.spotless' version '6.13.0' apply false // 6.13.0 is the last jvm8 supporting version id 'com.modrinth.minotaur' version '2.+' apply false id 'com.matthewprenger.cursegradle' version '1.4.0' apply false - id 'com.gtnewhorizons.retrofuturagradle' version '1.3.24' + id 'com.gtnewhorizons.retrofuturagradle' version '1.3.26' } print("You might want to check out './gradlew :faq' if your build fails.\n") @@ -302,7 +287,7 @@ if (apiPackage) { } if (accessTransformersFile) { - for (atFile in accessTransformersFile.split(",")) { + for (atFile in accessTransformersFile.split(" ")) { String targetFile = "src/main/resources/META-INF/" + atFile.trim() if (!getFile(targetFile).exists()) { throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile) @@ -628,7 +613,7 @@ repositories { } maven { name = "ic2" - url = getURL("https://maven.ic2.player.to/", "https://maven2.ic2.player.to/") + url = getURL("https://maven2.ic2.player.to/", "https://maven.ic2.player.to/") content { includeGroup "net.industrial-craft" } @@ -687,6 +672,8 @@ configurations.all { substitute module('com.github.GTNewHorizons:SpongePoweredMixin') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods") substitute module('com.github.GTNewHorizons:SpongeMixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods") substitute module('io.github.legacymoddingmc:unimixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Our previous unimixins upload was missing the dev classifier") + + substitute module('org.scala-lang:scala-library:2.11.1') using module('org.scala-lang:scala-library:2.11.5') because('To allow mixing with Java 8 targets') } } @@ -793,12 +780,12 @@ ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies" } dependencies { - def lwjgl3ifyVersion = '1.5.1' + def lwjgl3ifyVersion = '1.5.7' if (modId != 'lwjgl3ify') { java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}") } if (modId != 'hodgepodge') { - java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.17') + java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.35') } java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") {transitive = false} @@ -1310,7 +1297,7 @@ def addCurseForgeRelation(String type, String name) { // Updating -def buildscriptGradleVersion = "8.2.1" +def buildscriptGradleVersion = "8.5" tasks.named('wrapper', Wrapper).configure { gradleVersion = buildscriptGradleVersion diff --git a/dependencies.gradle b/dependencies.gradle index 631e192..9b98e86 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -2,5 +2,5 @@ dependencies { api("com.github.GTNewHorizons:CodeChickenLib:1.1.8:dev") - devOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.4.9-GTNH:dev") + devOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.4.13-GTNH:dev") } diff --git a/gradle.properties b/gradle.properties index 5f604e9..b8fc318 100644 --- a/gradle.properties +++ b/gradle.properties @@ -38,7 +38,7 @@ apiPackage = # Specify the configuration file for Forge's access transformers here. I must be placed into /src/main/resources/META-INF/ # Example value: mymodid_at.cfg -accessTransformersFile = +accessTransformersFile = multipart_at.cfg # Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled! usesMixins = false @@ -56,4 +56,4 @@ containsMixinsAndOrCoreModOnly = false # If enabled, you may use 'shadowImplementation' for dependencies. They will be integrated in your jar. It is your # responsibility check the licence and request permission for distribution, if required. -usesShadowedDependencies = false +usesShadowedDependencies = false \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index c1962a7..033e24c 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 17a8ddc..1af9e09 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index aeb74cb..fcb6fca 100755 --- a/gradlew +++ b/gradlew @@ -130,10 +130,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. diff --git a/src/main/resources/META-INF/multipart_at.cfg b/src/main/resources/META-INF/multipart_at.cfg new file mode 100644 index 0000000..c6a776f --- /dev/null +++ b/src/main/resources/META-INF/multipart_at.cfg @@ -0,0 +1 @@ +public net.minecraft.block.BlockButton func_150043_b(I)V #function that sets up hitboxes for that meta \ No newline at end of file diff --git a/src/main/scala/codechicken/multipart/minecraft/ButtonPart.java b/src/main/scala/codechicken/multipart/minecraft/ButtonPart.java index 15e87c9..829a20e 100644 --- a/src/main/scala/codechicken/multipart/minecraft/ButtonPart.java +++ b/src/main/scala/codechicken/multipart/minecraft/ButtonPart.java @@ -20,8 +20,31 @@ public class ButtonPart extends McSidedMetaPart implements IFaceRedstonePart { public static BlockButton stoneButton = (BlockButton) Blocks.stone_button; public static BlockButton woodenButton = (BlockButton) Blocks.wooden_button; - public static int[] metaSideMap = new int[] { -1, 4, 5, 2, 3 }; + public static int[] metaSideMap = new int[] { -1, 4, 5, 2, 3, -1, -1, -1 }; public static int[] sideMetaMap = new int[] { -1, -1, 3, 4, 1, 2 }; + public static Cuboid6[] cuboidRegions = setupCuboids(); + + /** + * Capture the boxes of all 16 button states, copying all button hitboxes directly We do this so any button mixins + * will use the proper mixed hitbox size. So mods like Et Futurum Requiem which add floor/ceiling buttons need no + * extra setup to have proper block bounds. + */ + private static Cuboid6[] setupCuboids() { + Cuboid6[] regions = new Cuboid6[16]; + for (int i = 0; i < regions.length; i++) { + woodenButton.setBlockBoundsForItemRender(); // Reset bounds + woodenButton.func_150043_b(i); // Set button bounds based on meta; this is how buttons change their hitbox + regions[i] = new Cuboid6( + woodenButton.getBlockBoundsMinX(), + woodenButton.getBlockBoundsMinY(), + woodenButton.getBlockBoundsMinZ(), + woodenButton.getBlockBoundsMaxX(), + woodenButton.getBlockBoundsMaxY(), + woodenButton.getBlockBoundsMaxZ()); // Use the button hitbox to generate a Cuboid6 region. This + // isn't the actual instance, we'll copy from this later. + } + return regions; + } public static BlockButton getButton(int meta) { return (meta & 0x10) > 0 ? woodenButton : stoneButton; @@ -58,19 +81,12 @@ public class ButtonPart extends McSidedMetaPart implements IFaceRedstonePart { @Override public Cuboid6 getBounds() { - int m = meta & 7; - double d = pressed() ? 0.0625 : 0.125; - - if (m == 1) return new Cuboid6(0.0, 0.375, 0.5 - 0.1875, d, 0.625, 0.5 + 0.1875); - if (m == 2) return new Cuboid6(1.0 - d, 0.375, 0.5 - 0.1875, 1.0, 0.625, 0.5 + 0.1875); - if (m == 3) return new Cuboid6(0.5 - 0.1875, 0.375, 0.0, 0.5 + 0.1875, 0.625, d); - if (m == 4) return new Cuboid6(0.5 - 0.1875, 0.375, 1.0 - d, 0.5 + 0.1875, 0.625, 1.0); - - return null; // falloff + // Somehow I got a crash here for meta 20? Let's wrap it to be safe + return cuboidRegions[meta & 15].copy();// these objects get transformed I think, so we need to make a copy. } public static McBlockPart placement(World world, BlockCoord pos, int side, int type) { - if (side == 0 || side == 1) return null; + if (sideMetaMap[side ^ 1] == -1) return null; pos = pos.copy().offset(side ^ 1); if (!world.isSideSolid(pos.x, pos.y, pos.z, ForgeDirection.getOrientation(side))) return null; diff --git a/src/main/scala/codechicken/multipart/minecraft/McSidedMetaPart.java b/src/main/scala/codechicken/multipart/minecraft/McSidedMetaPart.java index e853b34..51139ca 100644 --- a/src/main/scala/codechicken/multipart/minecraft/McSidedMetaPart.java +++ b/src/main/scala/codechicken/multipart/minecraft/McSidedMetaPart.java @@ -24,8 +24,11 @@ public abstract class McSidedMetaPart extends McMetaPart implements TFacePart { } public boolean canStay() { - BlockCoord pos = new BlockCoord(tile()).offset(sideForMeta(meta)); - return world().isSideSolid(pos.x, pos.y, pos.z, ForgeDirection.getOrientation(sideForMeta(meta) ^ 1)); + int side = sideForMeta(meta); + if (side < 0 || side > 5) return false; + + BlockCoord pos = new BlockCoord(tile()).offset(side); + return world().isSideSolid(pos.x, pos.y, pos.z, ForgeDirection.getOrientation(side ^ 1)); } public boolean dropIfCantStay() {