Skip to content

Commit

Permalink
Readd removed methods (#9)
Browse files Browse the repository at this point in the history
* upd JM

* re-add changed methods
  • Loading branch information
Lyfts authored Sep 24, 2024
1 parent 1a8bdb0 commit b01058d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ dependencies {
api("com.github.GTNewHorizons:GTNHLib:0.5.5:dev")
runtimeOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.6.34-GTNH:dev")

compileOnlyApi(rfg.deobf('maven.modrinth:journeymap:5.2.5'))
compileOnlyApi(rfg.deobf('maven.modrinth:journeymap:5.2.6'))
compileOnly(deobfCurse('xaeros-minimap-263420:5637000'))
compileOnly(deobfCurse('xaeros-world-map-317780:5658209'))
compileOnly(deobf('https://media.forgecdn.net/files/2462/146/mod_voxelMap_1.7.0b_for_1.7.10.litemod', 'mod_voxelMap_1.7.0b_for_1.7.10.jar'))
Expand Down
22 changes: 10 additions & 12 deletions src/main/java/com/gtnewhorizons/navigator/api/util/DrawUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import org.lwjgl.opengl.GL11;

@SuppressWarnings("unused")
public class DrawUtils {

public static void drawGradientRect(double minPixelX, double minPixelY, double maxPixelX, double maxPixelY,
Expand Down Expand Up @@ -55,37 +56,30 @@ public static void drawGradientRect(double minPixelX, double minPixelY, double m

public static void drawQuad(ResourceLocation texture, double x, double y, double width, double height, int color,
int alpha) {

GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);

GL11.glEnable(GL11.GL_TEXTURE_2D);
Minecraft.getMinecraft()
.getTextureManager()
.bindTexture(texture);

float[] c = floats(color);
GL11.glColor4f(c[0], c[1], c[2], alpha);

Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
addRectToBufferWithUV(tessellator, x, y, width, height, color, alpha, 0, 0, 1, 1);
tessellator.draw();
}

public static void drawQuad(IIcon icon, double x, double y, double width, double height, int color, int alpha) {
public static void drawQuad(ResourceLocation texture, double x, double y, double width, double height, int color,
float alpha) {
drawQuad(texture, x, y, width, height, color, (int) alpha);
}

public static void drawQuad(IIcon icon, double x, double y, double width, double height, int color, int alpha) {
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);

GL11.glEnable(GL11.GL_TEXTURE_2D);
Minecraft.getMinecraft()
.getTextureManager()
.bindTexture(TextureMap.locationBlocksTexture);

float[] c = floats(color);
GL11.glColor4f(c[0], c[1], c[2], alpha);

Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
addRectToBufferWithUV(
Expand All @@ -103,6 +97,10 @@ public static void drawQuad(IIcon icon, double x, double y, double width, double
tessellator.draw();
}

public static void drawQuad(IIcon icon, double x, double y, double width, double height, int color, float alpha) {
drawQuad(icon, x, y, width, height, color, (int) alpha);
}

public static void addRectToBuffer(Tessellator tessellator, double x, double y, double w, double h, int color,
int alpha) {
int[] c = ints(color, alpha);
Expand Down

0 comments on commit b01058d

Please sign in to comment.