remove unneeded stuff

- remove BoxMixin as it's the same with MixinAABB (lmao)
- refactor MixinAABB's loaction
- disable problematic mixins for now
This commit is contained in:
Taiyou06
2024-07-07 04:11:54 +03:00
parent a0100cd103
commit 0dbf375906
4 changed files with 3 additions and 132 deletions

View File

@@ -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<MavenPublication>("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")
}

View File

@@ -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();
}
}

View File

@@ -12,7 +12,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package net.gensokyoreimagined.nitori.mixin;
package net.gensokyoreimagined.nitori.mixin.math.fast_util;
import net.minecraft.core.Direction;
import net.minecraft.world.phys.AABB;

View File

@@ -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"
]
}