aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/render
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/common/render')
-rw-r--r--src/main/java/gregtech/common/render/GT_IconFlipped.java17
-rw-r--r--src/main/java/gregtech/common/render/GT_MultiTexture.java7
-rw-r--r--src/main/java/gregtech/common/render/GT_TextureBuilder.java2
3 files changed, 22 insertions, 4 deletions
diff --git a/src/main/java/gregtech/common/render/GT_IconFlipped.java b/src/main/java/gregtech/common/render/GT_IconFlipped.java
index c3eee2900f..d4f96fed4f 100644
--- a/src/main/java/gregtech/common/render/GT_IconFlipped.java
+++ b/src/main/java/gregtech/common/render/GT_IconFlipped.java
@@ -11,6 +11,8 @@ public class GT_IconFlipped implements IIcon {
private final boolean flipV;
public GT_IconFlipped(IIcon baseIcon, boolean flipU, boolean flipV) {
+ if(baseIcon == null)
+ System.out.println("HI");
this.baseIcon = baseIcon;
this.flipU = flipU;
this.flipV = flipV;
@@ -19,6 +21,7 @@ public class GT_IconFlipped implements IIcon {
/**
* Returns the width of the icon, in pixels.
*/
+ @Override
public int getIconWidth() {
return this.baseIcon.getIconWidth();
}
@@ -26,6 +29,7 @@ public class GT_IconFlipped implements IIcon {
/**
* Returns the height of the icon, in pixels.
*/
+ @Override
public int getIconHeight() {
return this.baseIcon.getIconHeight();
}
@@ -33,6 +37,7 @@ public class GT_IconFlipped implements IIcon {
/**
* Returns the minimum U coordinate to use when rendering with this icon.
*/
+ @Override
public float getMinU() {
return this.flipU ? this.baseIcon.getMaxU() : this.baseIcon.getMinU();
}
@@ -40,6 +45,7 @@ public class GT_IconFlipped implements IIcon {
/**
* Returns the maximum U coordinate to use when rendering with this icon.
*/
+ @Override
public float getMaxU() {
return this.flipU ? this.baseIcon.getMinU() : this.baseIcon.getMaxU();
}
@@ -47,14 +53,16 @@ public class GT_IconFlipped implements IIcon {
/**
* Gets a U coordinate on the icon. 0 returns uMin and 16 returns uMax. Other arguments return in-between values.
*/
+ @Override
public float getInterpolatedU(double p_94214_1_) {
- float f = this.getMaxU() - this.getMinU();
+ final float f = this.getMaxU() - this.getMinU();
return this.getMinU() + f * ((float) p_94214_1_ / 16.0F);
}
/**
* Returns the minimum V coordinate to use when rendering with this icon.
*/
+ @Override
public float getMinV() {
return this.flipV ? this.baseIcon.getMaxV() : this.baseIcon.getMinV();
}
@@ -62,6 +70,7 @@ public class GT_IconFlipped implements IIcon {
/**
* Returns the maximum V coordinate to use when rendering with this icon.
*/
+ @Override
public float getMaxV() {
return this.flipV ? this.baseIcon.getMinV() : this.baseIcon.getMaxV();
}
@@ -69,12 +78,14 @@ public class GT_IconFlipped implements IIcon {
/**
* Gets a V coordinate on the icon. 0 returns vMin and 16 returns vMax. Other arguments return in-between values.
*/
+ @Override
public float getInterpolatedV(double p_94207_1_) {
- float f = this.getMaxV() - this.getMinV();
+ final float f = this.getMaxV() - this.getMinV();
return this.getMinV() + f * ((float) p_94207_1_ / 16.0F);
}
+ @Override
public String getIconName() {
return this.baseIcon.getIconName();
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gregtech/common/render/GT_MultiTexture.java b/src/main/java/gregtech/common/render/GT_MultiTexture.java
index b72a6b1953..2d78b9b988 100644
--- a/src/main/java/gregtech/common/render/GT_MultiTexture.java
+++ b/src/main/java/gregtech/common/render/GT_MultiTexture.java
@@ -1,5 +1,6 @@
package gregtech.common.render;
+import gregtech.GT_Mod;
import gregtech.api.interfaces.ITexture;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
@@ -11,6 +12,12 @@ import net.minecraft.client.renderer.RenderBlocks;
public class GT_MultiTexture extends GT_TextureBase implements ITexture {
protected final ITexture[] mTextures;
+
+ public static GT_MultiTexture get(ITexture... aTextures) {
+ return GT_Mod.instance.isClientSide() ? new GT_MultiTexture(aTextures) : null;
+ }
+
+
protected GT_MultiTexture(ITexture... aTextures) {
mTextures = aTextures;
}
diff --git a/src/main/java/gregtech/common/render/GT_TextureBuilder.java b/src/main/java/gregtech/common/render/GT_TextureBuilder.java
index f79e438dd7..708720ad40 100644
--- a/src/main/java/gregtech/common/render/GT_TextureBuilder.java
+++ b/src/main/java/gregtech/common/render/GT_TextureBuilder.java
@@ -139,7 +139,7 @@ public class GT_TextureBuilder implements ITextureBuilder {
private static Boolean apply(Block b, Byte m) {
Class<?> clazz = b.getClass();
while (clazz != Block.class) {
- String className = clazz.getName();
+ final String className = clazz.getName();
if (GT_Values.mCTMDisabledBlock.contains(className)) return false;
if (GT_Values.mCTMEnabledBlock.contains(className)) return true;
clazz = clazz.getSuperclass();