65 lines
3.2 KiB
Java
65 lines
3.2 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*/
|
|
package net.minecraft.client.renderer;
|
|
|
|
import net.minecraft.core.Direction;
|
|
import net.minecraft.util.Util;
|
|
|
|
public enum FaceInfo {
|
|
DOWN(new VertexInfo(Constants.MIN_X, Constants.MIN_Y, Constants.MAX_Z), new VertexInfo(Constants.MIN_X, Constants.MIN_Y, Constants.MIN_Z), new VertexInfo(Constants.MAX_X, Constants.MIN_Y, Constants.MIN_Z), new VertexInfo(Constants.MAX_X, Constants.MIN_Y, Constants.MAX_Z)),
|
|
UP(new VertexInfo(Constants.MIN_X, Constants.MAX_Y, Constants.MIN_Z), new VertexInfo(Constants.MIN_X, Constants.MAX_Y, Constants.MAX_Z), new VertexInfo(Constants.MAX_X, Constants.MAX_Y, Constants.MAX_Z), new VertexInfo(Constants.MAX_X, Constants.MAX_Y, Constants.MIN_Z)),
|
|
NORTH(new VertexInfo(Constants.MAX_X, Constants.MAX_Y, Constants.MIN_Z), new VertexInfo(Constants.MAX_X, Constants.MIN_Y, Constants.MIN_Z), new VertexInfo(Constants.MIN_X, Constants.MIN_Y, Constants.MIN_Z), new VertexInfo(Constants.MIN_X, Constants.MAX_Y, Constants.MIN_Z)),
|
|
SOUTH(new VertexInfo(Constants.MIN_X, Constants.MAX_Y, Constants.MAX_Z), new VertexInfo(Constants.MIN_X, Constants.MIN_Y, Constants.MAX_Z), new VertexInfo(Constants.MAX_X, Constants.MIN_Y, Constants.MAX_Z), new VertexInfo(Constants.MAX_X, Constants.MAX_Y, Constants.MAX_Z)),
|
|
WEST(new VertexInfo(Constants.MIN_X, Constants.MAX_Y, Constants.MIN_Z), new VertexInfo(Constants.MIN_X, Constants.MIN_Y, Constants.MIN_Z), new VertexInfo(Constants.MIN_X, Constants.MIN_Y, Constants.MAX_Z), new VertexInfo(Constants.MIN_X, Constants.MAX_Y, Constants.MAX_Z)),
|
|
EAST(new VertexInfo(Constants.MAX_X, Constants.MAX_Y, Constants.MAX_Z), new VertexInfo(Constants.MAX_X, Constants.MIN_Y, Constants.MAX_Z), new VertexInfo(Constants.MAX_X, Constants.MIN_Y, Constants.MIN_Z), new VertexInfo(Constants.MAX_X, Constants.MAX_Y, Constants.MIN_Z));
|
|
|
|
private static final FaceInfo[] BY_FACING;
|
|
private final VertexInfo[] infos;
|
|
|
|
public static FaceInfo fromFacing(Direction direction) {
|
|
return BY_FACING[direction.get3DDataValue()];
|
|
}
|
|
|
|
private FaceInfo(VertexInfo ... infos) {
|
|
this.infos = infos;
|
|
}
|
|
|
|
public VertexInfo getVertexInfo(int index) {
|
|
return this.infos[index];
|
|
}
|
|
|
|
static {
|
|
BY_FACING = Util.make(new FaceInfo[6], map -> {
|
|
map[Constants.MIN_Y] = DOWN;
|
|
map[Constants.MAX_Y] = UP;
|
|
map[Constants.MIN_Z] = NORTH;
|
|
map[Constants.MAX_Z] = SOUTH;
|
|
map[Constants.MIN_X] = WEST;
|
|
map[Constants.MAX_X] = EAST;
|
|
});
|
|
}
|
|
|
|
public static class VertexInfo {
|
|
public final int xFace;
|
|
public final int yFace;
|
|
public final int zFace;
|
|
|
|
private VertexInfo(int x, int y, int z) {
|
|
this.xFace = x;
|
|
this.yFace = y;
|
|
this.zFace = z;
|
|
}
|
|
}
|
|
|
|
public static final class Constants {
|
|
public static final int MAX_Z = Direction.SOUTH.get3DDataValue();
|
|
public static final int MAX_Y = Direction.UP.get3DDataValue();
|
|
public static final int MAX_X = Direction.EAST.get3DDataValue();
|
|
public static final int MIN_Z = Direction.NORTH.get3DDataValue();
|
|
public static final int MIN_Y = Direction.DOWN.get3DDataValue();
|
|
public static final int MIN_X = Direction.WEST.get3DDataValue();
|
|
}
|
|
}
|
|
|