aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/render
diff options
context:
space:
mode:
authorLéa Gris <lea.gris@noiraude.net>2022-12-20 07:07:57 +0100
committerGitHub <noreply@github.com>2022-12-20 07:07:57 +0100
commit287f3c409ff147cd93c10d400953e02962a428fb (patch)
treeb7afd52962c4651b01d7f60690d0f7c959650207 /src/main/java/gregtech/common/render
parent86252f7583c70022af0168295c59add4ed7777a5 (diff)
downloadGT5-Unofficial-287f3c409ff147cd93c10d400953e02962a428fb.tar.gz
GT5-Unofficial-287f3c409ff147cd93c10d400953e02962a428fb.tar.bz2
GT5-Unofficial-287f3c409ff147cd93c10d400953e02962a428fb.zip
Uv lock (#1564)
* fix(GT_TextureBuilder): State check belongs to the build method. * fix(texture): lock orientation of large turbine controller Large turbine controllers displays the rotor's center of a 3-by-3 connected textures displayed on surrounding casings. To keep the rotor's center seamlessly aligned with the connected textures from the casings, it need to UV lock its orientation. Addresses issue: https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/11953 * fix(GT_TextureBuilder): correctly check worldCoord's state
Diffstat (limited to 'src/main/java/gregtech/common/render')
-rw-r--r--src/main/java/gregtech/common/render/GT_TextureBuilder.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/gregtech/common/render/GT_TextureBuilder.java b/src/main/java/gregtech/common/render/GT_TextureBuilder.java
index f2ff07523c..0971933add 100644
--- a/src/main/java/gregtech/common/render/GT_TextureBuilder.java
+++ b/src/main/java/gregtech/common/render/GT_TextureBuilder.java
@@ -12,7 +12,7 @@ import java.util.List;
import net.minecraft.block.Block;
import net.minecraftforge.common.util.ForgeDirection;
-@SuppressWarnings("unused")
+@SuppressWarnings({"unused", "ClassWithTooManyFields"})
public class GT_TextureBuilder implements ITextureBuilder {
private final List<IIconContainer> iconContainerList;
private final List<ITexture> textureLayers;
@@ -81,14 +81,12 @@ public class GT_TextureBuilder implements ITextureBuilder {
@Override
public ITextureBuilder useWorldCoord() {
- if (fromBlock == null) throw new IllegalStateException("no from block");
this.worldCoord = true;
return this;
}
@Override
public ITextureBuilder noWorldCoord() {
- if (fromBlock == null) throw new IllegalStateException("no from block");
this.worldCoord = false;
return this;
}
@@ -105,6 +103,9 @@ public class GT_TextureBuilder implements ITextureBuilder {
return this;
}
+ /**
+ * @inheritDoc
+ */
@Override
public ITexture build() {
if (fromBlock != null) {
@@ -112,6 +113,7 @@ public class GT_TextureBuilder implements ITextureBuilder {
return new GT_CopiedCTMBlockTexture(fromBlock, fromSide.ordinal(), fromMeta, rgba, allowAlpha);
else return new GT_CopiedBlockTexture(fromBlock, fromSide.ordinal(), fromMeta, rgba, allowAlpha);
}
+ if (worldCoord != null) throw new IllegalStateException("worldCoord without from block");
if (!textureLayers.isEmpty()) return new GT_MultiTexture(textureLayers.toArray(new ITexture[0]));
switch (iconContainerList.size()) {
case 1: