aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2019-08-18 13:53:52 +0100
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2019-08-18 13:53:52 +0100
commit46d5bb75a9bfc5c9731b9476006b060328ca34d6 (patch)
tree7b6fdcf184c383fc15ac22b3a3350c9145f2e5df /src
parent5adad05da2f1182d90ed5c596932b4b583ece73e (diff)
downloadGT5-Unofficial-46d5bb75a9bfc5c9731b9476006b060328ca34d6.tar.gz
GT5-Unofficial-46d5bb75a9bfc5c9731b9476006b060328ca34d6.tar.bz2
GT5-Unofficial-46d5bb75a9bfc5c9731b9476006b060328ca34d6.zip
$ Removed call to non-existent EIO function, supplementing it with my own.
Diffstat (limited to 'src')
-rw-r--r--src/Java/gtPlusPlus/nei/handlers/NeiTextureHandler.java91
1 files changed, 85 insertions, 6 deletions
diff --git a/src/Java/gtPlusPlus/nei/handlers/NeiTextureHandler.java b/src/Java/gtPlusPlus/nei/handlers/NeiTextureHandler.java
index f433def57d..30c159ca93 100644
--- a/src/Java/gtPlusPlus/nei/handlers/NeiTextureHandler.java
+++ b/src/Java/gtPlusPlus/nei/handlers/NeiTextureHandler.java
@@ -1,29 +1,63 @@
package gtPlusPlus.nei.handlers;
-import crazypants.render.RenderUtil;
import gtPlusPlus.core.lib.CORE;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.client.renderer.texture.TextureManager;
+import net.minecraft.client.renderer.texture.TextureMap;
+import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
+
/**
* Based on crazypants.enderio.gui.IconEIO
+ *
* @author Original EIO Author
*
+ * This is free and unencumbered software released into the public
+ * domain.
+ *
+ * Anyone is free to copy, modify, publish, use, compile, sell, or
+ * distribute this software, either in source code form or as a compiled
+ * binary, for any purpose, commercial or non-commercial, and by any
+ * means.
+ *
+ * In jurisdictions that recognize copyright laws, the author or authors
+ * of this software dedicate any and all copyright interest in the
+ * software to the public domain. We make this dedication for the
+ * benefit of the public at large and to the detriment of our heirs and
+ * successors. We intend this dedication to be an overt act of
+ * relinquishment in perpetuity of all present and future rights to this
+ * software under copyright law.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * For more information, please refer to <http://unlicense.org/>
+ *
+ * https://github.com/SleepyTrousers/EnderIO/blob/release/1.7.10/2.2/src/main/java/crazypants/render/RenderUtil.java
+ *
*/
public final class NeiTextureHandler {
-
+
public static final NeiTextureHandler RECIPE = new NeiTextureHandler(16, 132, 16, 16);
public static final NeiTextureHandler RECIPE_BUTTON = new NeiTextureHandler(128, 116, 24, 24);
-
+
public final double minU;
public final double maxU;
public final double minV;
public final double maxV;
public final double width;
public final double height;
-
- public static final ResourceLocation TEXTURE = new ResourceLocation(CORE.MODID+":textures/gui/nei/widgets.png");
+
+ public static final ResourceLocation TEXTURE = new ResourceLocation(CORE.MODID + ":textures/gui/nei/widgets.png");
public NeiTextureHandler(int x, int y) {
this(x, y, 16, 16);
@@ -61,7 +95,7 @@ public final class NeiTextureHandler {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
Tessellator tessellator = Tessellator.instance;
if (doDraw) {
- RenderUtil.bindTexture(TEXTURE);
+ bindTexture(TEXTURE);
tessellator.startDrawingQuads();
}
@@ -82,4 +116,49 @@ public final class NeiTextureHandler {
}
}
+
+ public static final ResourceLocation BLOCK_TEX;
+ public static final ResourceLocation ITEM_TEX;
+ public static final ResourceLocation GLINT_TEX;
+ public static int BRIGHTNESS_MAX;
+
+ static {
+ BLOCK_TEX = TextureMap.locationBlocksTexture;
+ ITEM_TEX = TextureMap.locationItemsTexture;
+ GLINT_TEX = new ResourceLocation("textures/misc/enchanted_item_glint.png");
+ BRIGHTNESS_MAX = 15728880;
+ }
+
+ public static TextureManager engine() {
+ return Minecraft.getMinecraft().renderEngine;
+ }
+
+ public static void bindItemTexture(ItemStack stack) {
+ engine().bindTexture(stack.getItemSpriteNumber() == 0 ? BLOCK_TEX : ITEM_TEX);
+ }
+
+ public static void bindItemTexture() {
+ engine().bindTexture(ITEM_TEX);
+ }
+
+ public static void bindBlockTexture() {
+ engine().bindTexture(BLOCK_TEX);
+ }
+
+ public static void bindGlintTexture() {
+ engine().bindTexture(BLOCK_TEX);
+ }
+
+ public static void bindTexture(String string) {
+ engine().bindTexture(new ResourceLocation(string));
+ }
+
+ public static void bindTexture(ResourceLocation tex) {
+ engine().bindTexture(tex);
+ }
+
+ public static FontRenderer fontRenderer() {
+ return Minecraft.getMinecraft().fontRenderer;
+ }
+
} \ No newline at end of file