mirror of
https://github.com/GTNewHorizons/GTNHLib.git
synced 2026-11-28 07:35:51 +00:00
ideatus shutupus
This commit is contained in:
1 parent
9595859b22
commit
1efec8f3a9
2 files changed
+9
-6
No files matched your search
@@ -98,7 +98,7 @@ public class JSONModel implements BakedModel {
|
||||
// Assign vertexes
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
|
||||
final Vector3f vert = QuadBuilder.mapSideToVertex(from, to, i, f.getName()).mulPosition(rot)
|
||||
final Vector3f vert = QuadBuilder.mapSideToVertex(from, to, i, f.getName(), false).mulPosition(rot)
|
||||
.mulPosition(vRot);
|
||||
builder.pos(i, vert.x, vert.y, vert.z);
|
||||
x = min(x, vert.x);
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
package com.gtnewhorizon.gtnhlib.client.renderer.quad;
|
||||
|
||||
import com.gtnewhorizon.gtnhlib.client.model.impl.NdQuadBuilder;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.joml.Matrix4f;
|
||||
import org.joml.Vector3f;
|
||||
|
||||
import com.gtnewhorizon.gtnhlib.client.model.impl.NdQuadBuilder;
|
||||
|
||||
public interface QuadBuilder {
|
||||
|
||||
/**
|
||||
@@ -181,9 +180,10 @@ public interface QuadBuilder {
|
||||
/**
|
||||
* Modern Minecraft uses magic arrays to do this without breaking AO. This is the same thing, but without arrays.
|
||||
*/
|
||||
static Vector3f mapSideToVertex(Vector3f from, Vector3f to, int index, ForgeDirection side) {
|
||||
@Contract(value = "_, _, _, _, false -> !null", pure = true)
|
||||
static Vector3f mapSideToVertex(Vector3f from, Vector3f to, int index, ForgeDirection side, boolean allowNull) {
|
||||
|
||||
return switch (side) {
|
||||
var ret = switch (side) {
|
||||
case DOWN -> switch (index) {
|
||||
case 0 -> new Vector3f(from.x, from.y, to.z);
|
||||
case 1 -> new Vector3f(from.x, from.y, from.z);
|
||||
@@ -228,5 +228,8 @@ public interface QuadBuilder {
|
||||
};
|
||||
case UNKNOWN -> null;
|
||||
};
|
||||
|
||||
if (ret == null && !allowNull) throw new IllegalArgumentException("No vector matching UNKNOWN!");
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user