From 0dbf37590607b555bc3a4fe09eb9a867f69fdd0e Mon Sep 17 00:00:00 2001 From: Taiyou06 Date: Sun, 7 Jul 2024 04:11:54 +0300 Subject: [PATCH] remove unneeded stuff - remove BoxMixin as it's the same with MixinAABB (lmao) - refactor MixinAABB's loaction - disable problematic mixins for now --- .../kotlin/mod.base-conventions.gradle.kts | 46 ----------- .../nitori/mixin/math/fast_util/BoxMixin.java | 79 ------------------- .../mixin/{ => math/fast_util}/MixinAABB.java | 2 +- src/main/resources/mixins.core.json | 8 +- 4 files changed, 3 insertions(+), 132 deletions(-) delete mode 100644 src/main/java/net/gensokyoreimagined/nitori/mixin/math/fast_util/BoxMixin.java rename src/main/java/net/gensokyoreimagined/nitori/mixin/{ => math/fast_util}/MixinAABB.java (97%) diff --git a/build-logic/src/main/kotlin/mod.base-conventions.gradle.kts b/build-logic/src/main/kotlin/mod.base-conventions.gradle.kts index 88fc3ae..30bdef9 100755 --- a/build-logic/src/main/kotlin/mod.base-conventions.gradle.kts +++ b/build-logic/src/main/kotlin/mod.base-conventions.gradle.kts @@ -3,7 +3,6 @@ plugins { id("io.github.goooler.shadow") id("io.papermc.paperweight.userdev") - id("com.diffplug.spotless") id("maven-publish") } @@ -39,48 +38,3 @@ tasks { dependsOn(reobfJar) } } - -spotless { - format("misc") { - target(project.files("*.gradle.kts", "gradle.properties", "settings.gradle.kts", "gradle/libs.versions.toml")) - - trimTrailingWhitespace() - indentWithSpaces(4) - endWithNewline() - } - - java { - licenseHeaderFile("LICENSE_header.txt") - } -} - -var jarFile = file("build/libs/%s-%s.jar".format(project.name, project.version)) -var jarArtifact = artifacts.add("default", jarFile) { - type = "jar" - builtBy("jar") -} - -publishing { - publications { - create("mavenJava") { - artifact(jarArtifact) - group = "plugins" - } - } - - repositories { - maven { - name = "gensorepo" - credentials { - username = project.findProperty("gpr.user") as String? ?: System.getenv("USERNAME") - password = project.findProperty("gpr.key") as String? ?: System.getenv("TOKEN") - } - // url to the releases maven repository - url = uri("https://repo.gensokyoreimagined.net/") - } - } -} - -tasks.named("publishMavenJavaPublicationToGensorepoRepository") { - dependsOn("reobfJar") -} \ No newline at end of file diff --git a/src/main/java/net/gensokyoreimagined/nitori/mixin/math/fast_util/BoxMixin.java b/src/main/java/net/gensokyoreimagined/nitori/mixin/math/fast_util/BoxMixin.java deleted file mode 100644 index 346b5ca..0000000 --- a/src/main/java/net/gensokyoreimagined/nitori/mixin/math/fast_util/BoxMixin.java +++ /dev/null @@ -1,79 +0,0 @@ -package net.gensokyoreimagined.nitori.mixin.math.fast_util; - -import net.minecraft.world.phys.AABB; -import net.minecraft.core.Direction; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; -import org.spongepowered.asm.mixin.Shadow; - -@Mixin(AABB.class) -public class BoxMixin { - static { - assert Direction.Axis.X.ordinal() == 0; - assert Direction.Axis.Y.ordinal() == 1; - assert Direction.Axis.Z.ordinal() == 2; - assert Direction.Axis.values().length == 3; - } - - @Shadow - @Final - public double minX; - - @Shadow - @Final - public double minY; - - @Shadow - @Final - public double minZ; - - @Shadow - @Final - public double maxX; - - @Shadow - @Final - public double maxY; - - @Shadow - @Final - public double maxZ; - - /** - * @reason Simplify the code to better help the JVM optimize it - * @author JellySquid - */ - @Overwrite - public double min(Direction.Axis axis) { - switch (axis.ordinal()) { - case 0: //X - return this.minX; - case 1: //Y - return this.minY; - case 2: //Z - return this.minZ; - } - - throw new IllegalArgumentException(); - } - - /** - * @reason Simplify the code to better help the JVM optimize it - * @author JellySquid - */ - @Overwrite - public double max(Direction.Axis axis) { - switch (axis.ordinal()) { - case 0: //X - return this.maxX; - case 1: //Y - return this.maxY; - case 2: //Z - return this.maxZ; - } - - throw new IllegalArgumentException(); - - } -} \ No newline at end of file diff --git a/src/main/java/net/gensokyoreimagined/nitori/mixin/MixinAABB.java b/src/main/java/net/gensokyoreimagined/nitori/mixin/math/fast_util/MixinAABB.java similarity index 97% rename from src/main/java/net/gensokyoreimagined/nitori/mixin/MixinAABB.java rename to src/main/java/net/gensokyoreimagined/nitori/mixin/math/fast_util/MixinAABB.java index ed58a36..82fc64d 100644 --- a/src/main/java/net/gensokyoreimagined/nitori/mixin/MixinAABB.java +++ b/src/main/java/net/gensokyoreimagined/nitori/mixin/math/fast_util/MixinAABB.java @@ -12,7 +12,7 @@ // // You should have received a copy of the GNU General Public License // along with this program. If not, see . -package net.gensokyoreimagined.nitori.mixin; +package net.gensokyoreimagined.nitori.mixin.math.fast_util; import net.minecraft.core.Direction; import net.minecraft.world.phys.AABB; diff --git a/src/main/resources/mixins.core.json b/src/main/resources/mixins.core.json index ae34f87..c438b7a 100755 --- a/src/main/resources/mixins.core.json +++ b/src/main/resources/mixins.core.json @@ -8,7 +8,7 @@ "server": [ "ChunkMapMixin", "ChunkMapMixin$TrackedEntity", - "MixinAABB", + "math.fast_util.MixinAABB", "MixinBlock", "MixinBlockPos", "MixinChunkEntitySlices", @@ -35,11 +35,7 @@ "util.MixinLevelBlockEntityRetrieval", "cached_hashcode.BlockNeighborGroupMixin", "shapes.blockstate_cache.BlockMixin", - "world.inline_height.WorldChunkMixin", "math.fast_blockops.DirectionMixin", - "math.fast_blockops.BlockPosMixin", - "math.fast_util.AxisCycleDirectionMixin.BackwardMixin", - "math.fast_util.AxisCycleDirectionMixin.ForwardMixin", - "math.fast_util.BoxMixin" + "math.fast_blockops.BlockPosMixin" ] }