Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.launchwrapper.Launch;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.IBlockAccess;
Expand Down Expand Up @@ -64,6 +65,7 @@ public class ArchitectureCraftClient {
public static final PreviewRenderer previewRenderer = new PreviewRenderer();
final HashSet<Block> emissiveBlocks = new HashSet<>();
public static AngelicaCompat angelicaCompat;
public static boolean enabledHodgepodgeBottomFaceUVFix;

public void preInit(FMLPreInitializationEvent e) {
registerBlockRenderers();
Expand All @@ -85,6 +87,9 @@ public void postInit(FMLPostInitializationEvent e) {
if (Loader.isModLoaded("angelica")) {
angelicaCompat = new AngelicaCompat();
}

enabledHodgepodgeBottomFaceUVFix = (boolean) Launch.blackboard
.getOrDefault("hodgepodge.FixesConfig.fixBottomFaceUV", Boolean.FALSE);
}

public ArchitectureCraftClient(ArchitectureCraft mod) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import net.minecraft.util.EnumFacing;
import net.minecraft.util.IIcon;

import gcewing.architecture.ArchitectureCraftClient;
import gcewing.architecture.client.render.ITexture;
import gcewing.architecture.client.texture.ArchitectureTexture;
import gcewing.architecture.compat.Vector3;
Expand Down Expand Up @@ -137,30 +138,38 @@ public void addProjectedVertex(Vector3 p, EnumFacing face) {
double z = p.z - blockZ;

double u, v;
v = switch (face) {
case DOWN, UP -> {
switch (face) {
case UP -> {
u = x;
yield z;
v = z;
}
case DOWN -> {
if (ArchitectureCraftClient.enabledHodgepodgeBottomFaceUVFix) {
u = 1 - x;
} else {
u = x;
}
v = z;
}
case NORTH -> {
u = 1 - x;
yield 1 - y;
v = 1 - y;
}
case SOUTH -> {
u = x;
yield 1 - y;
v = 1 - y;
}
case WEST -> {
u = 1 - z;
yield 1 - y;
v = 1 - y;
}
case EAST -> {
u = z;
yield 1 - y;
v = 1 - y;
}
default -> {
u = 0;
yield 0;
v = 0;
}
};
addUVVertex(p, u, v);
Expand Down