Skip to content

Commit

Permalink
Switch decompiler constants to their named variants (#70)
Browse files Browse the repository at this point in the history
Just ran `./gradlew applyDecompilerCleanupToMain` to make the code more readable

(cherry picked from commit 7f42969)
  • Loading branch information
eigenraven authored and Dream-Master committed May 20, 2024
1 parent 8aaa62a commit 69f0a4d
Show file tree
Hide file tree
Showing 69 changed files with 435 additions and 397 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public void renderParticle(final Tessellator p_70539_1_, final float p_70539_2_,
UtilsFX.bindTexture(FXContainment.portaltex);
GL11.glPushMatrix();
GL11.glDepthMask(false);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
final float f6 = 3.0f * this.particleScale;
final float f7 = (float) (this.posX - FXContainment.interpPosX);
final float f8 = (float) (this.posY - FXContainment.interpPosY);
Expand Down Expand Up @@ -79,7 +79,7 @@ public void renderParticle(final Tessellator p_70539_1_, final float p_70539_2_,
f9 + p_70539_5_ * f6 - p_70539_7_ * f6,
f2,
f5);
GL11.glDisable(3042);
GL11.glDisable(GL11.GL_BLEND);
GL11.glDepthMask(true);
GL11.glPopMatrix();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ public void renderParticle(final Tessellator tessellator, final float f, final f
final float f3, final float f4, final float f5) {
tessellator.draw();
GL11.glPushMatrix();
GL11.glDisable(2884);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 1);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
if (model == null) {
model = AdvancedModelLoader.loadModel(FXSonic.MODEL);
}
Expand All @@ -93,8 +93,8 @@ public void renderParticle(final Tessellator tessellator, final float f, final f
GL11.glScaled(0.5, 0.5, -0.5);
GL11.glColor4f(0.0f, b, b, 1.0f);
model.renderAll();
GL11.glDisable(3042);
GL11.glEnable(2884);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glPopMatrix();
Minecraft.getMinecraft().renderEngine.bindTexture(UtilsFX.getParticleTexture());
tessellator.startDrawingQuads();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,21 @@ public GuiBloodInfuser(final EntityPlayer p, final TileBloodInfuser tile) {
protected void drawGuiContainerBackgroundLayer(final float p_146976_1_, final int p_146976_2_,
final int p_146976_3_) {
GL11.glPushMatrix();
GL11.glEnable(3042);
GL11.glEnable(GL11.GL_BLEND);
UtilsFX.bindTexture(new ResourceLocation("thaumichorizons", "textures/gui/guibloodinfuser.png"));
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
final int var5 = (this.width - this.xSize) / 2;
final int var6 = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize);
GL11.glDisable(3042);
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
}

protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
this.drawEssentiaSelected();
this.drawAspectList();
GL11.glPushMatrix();
GL11.glEnable(3042);
GL11.glEnable(GL11.GL_BLEND);
UtilsFX.bindTexture(new ResourceLocation("thaumichorizons", "textures/gui/guibloodinfuser.png"));
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
if (this.canScrollLeft()) {
Expand Down Expand Up @@ -234,7 +234,7 @@ protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
--this.flashTimer;
this.drawFlash();
}
GL11.glDisable(3042);
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
}

Expand Down Expand Up @@ -419,10 +419,10 @@ void drawEssentiaSelected() {
void drawQuestionMark(final int x, final int y, final Color color) {
final Minecraft mc = Minecraft.getMinecraft();
GL11.glPushMatrix();
GL11.glDisable(2896);
GL11.glAlphaFunc(516, 0.003921569f);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569f);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glPushMatrix();
mc.renderEngine.bindTexture(new ResourceLocation("thaumcraft", "textures/aspects/_unknown.png"));
GL11.glColor4f(color.getRed() / 255.0f, color.getGreen() / 255.0f, color.getBlue() / 255.0f, 0.8f);
Expand All @@ -435,10 +435,10 @@ void drawQuestionMark(final int x, final int y, final Color color) {
var9.addVertexWithUV(x + 0.0, y + 0.0, this.zLevel, 0.0, 0.0);
var9.draw();
GL11.glPopMatrix();
GL11.glDisable(3042);
GL11.glDisable(GL11.GL_BLEND);
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
GL11.glAlphaFunc(516, 0.1f);
GL11.glEnable(2896);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1f);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
UtilsFX.bindTexture("textures/gui/gui_focuspouch.png");
final float t = this.zLevel;
this.zLevel = 200.0f;
GL11.glEnable(3042);
GL11.glEnable(GL11.GL_BLEND);
this.drawTexturedModalRect(8 + this.blockSlot * 18, 209, 240, 0, 16, 16);
GL11.glDisable(3042);
GL11.glDisable(GL11.GL_BLEND);
this.zLevel = t;
}

Expand All @@ -51,8 +51,8 @@ protected void drawGuiContainerBackgroundLayer(final float par1, final int par2,
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
final int var5 = (this.width - this.xSize) / 2;
final int var6 = (this.height - this.ySize) / 2;
GL11.glEnable(3042);
GL11.glEnable(GL11.GL_BLEND);
this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize);
GL11.glDisable(3042);
GL11.glDisable(GL11.GL_BLEND);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ protected void drawGuiContainerForegroundLayer() {}
protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
UtilsFX.bindTexture("thaumichorizons", "textures/gui/guifingers.png");
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
GL11.glEnable(3042);
GL11.glEnable(GL11.GL_BLEND);
final int var5 = (this.width - this.xSize) / 2;
final int var6 = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize);
GL11.glDisable(3042);
GL11.glDisable(GL11.GL_BLEND);
ItemWandCasting wand = null;
if (this.tileEntity.getStackInSlot(10) != null
&& this.tileEntity.getStackInSlot(10).getItem() instanceof ItemWandCasting) {
Expand Down Expand Up @@ -97,9 +97,9 @@ protected void drawGuiContainerBackgroundLayer(final float par1, final int par2,
final float var7 = 0.33f;
GL11.glColor4f(var7, var7, var7, 0.66f);
GuiFingers.itemRender.renderWithColor = false;
GL11.glEnable(2896);
GL11.glEnable(2884);
GL11.glEnable(3042);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_BLEND);
GuiFingers.itemRender.renderItemAndEffectIntoGUI(
this.mc.fontRenderer,
this.mc.renderEngine,
Expand All @@ -113,8 +113,8 @@ protected void drawGuiContainerBackgroundLayer(final float par1, final int par2,
var5 + 160,
var6 + 64);
GuiFingers.itemRender.renderWithColor = true;
GL11.glDisable(3042);
GL11.glDisable(2896);
GL11.glDisable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslatef((float) (var5 + 168), (float) (var6 + 46), 0.0f);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ public GuiInjector(final EntityPlayer p) {
protected void drawGuiContainerBackgroundLayer(final float p_146976_1_, final int p_146976_2_,
final int p_146976_3_) {
GL11.glPushMatrix();
GL11.glEnable(3042);
GL11.glEnable(GL11.GL_BLEND);
UtilsFX.bindTexture(new ResourceLocation("thaumichorizons", "textures/gui/guiinjector.png"));
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
final int var5 = (this.width - this.xSize) / 2;
final int var6 = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize);
GL11.glDisable(3042);
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ public GuiInspiratron(final InventoryPlayer player, final TileInspiratron tile)
protected void drawGuiContainerBackgroundLayer(final float p_146976_1_, final int p_146976_2_,
final int p_146976_3_) {
GL11.glPushMatrix();
GL11.glEnable(3042);
GL11.glEnable(GL11.GL_BLEND);
UtilsFX.bindTexture(new ResourceLocation("thaumichorizons", "textures/gui/guiinspiratron.png"));
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
final int var5 = (this.width - this.xSize) / 2;
final int var6 = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize);
final int i1 = this.tile.getTimeRemainingScaled(28);
this.drawTexturedModalRect(var5 + 66, var6 + 102, 176, 158 - i1, 44, i1);
GL11.glDisable(3042);
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public GuiSoulExtractor(final InventoryPlayer player, final TileSoulExtractor ti
protected void drawGuiContainerBackgroundLayer(final float p_146976_1_, final int p_146976_2_,
final int p_146976_3_) {
GL11.glPushMatrix();
GL11.glEnable(3042);
GL11.glEnable(GL11.GL_BLEND);
UtilsFX.bindTexture(new ResourceLocation("thaumichorizons", "textures/gui/guisieve.png"));
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
final int var5 = (this.width - this.xSize) / 2;
Expand All @@ -39,7 +39,7 @@ protected void drawGuiContainerBackgroundLayer(final float p_146976_1_, final in
final int i1 = this.tile.getTimeRemainingScaled(39);
this.drawTexturedModalRect(var5 + 91, var6 + 58 - i1, 176, 166 - i1, 35, i1);
}
GL11.glDisable(3042);
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ public GuiSoulforge(final EntityPlayer player, final TileSoulforge tile) {
protected void drawGuiContainerBackgroundLayer(final float p_146976_1_, final int p_146976_2_,
final int p_146976_3_) {
GL11.glPushMatrix();
GL11.glEnable(3042);
GL11.glEnable(GL11.GL_BLEND);
UtilsFX.bindTexture(new ResourceLocation("thaumichorizons", "textures/gui/guidynamo.png"));
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
final int var5 = (this.width - this.xSize) / 2;
final int var6 = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize);
GL11.glDisable(3042);
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public GuiVat(final EntityPlayer p, final TileVat t) {
protected void drawGuiContainerBackgroundLayer(final float p_146976_1_, final int p_146976_2_,
final int p_146976_3_) {
GL11.glPushMatrix();
GL11.glEnable(3042);
GL11.glEnable(GL11.GL_BLEND);
UtilsFX.bindTexture(new ResourceLocation("thaumichorizons", "textures/gui/guivat.png"));
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
final int var5 = (this.width - this.xSize) / 2;
Expand Down Expand Up @@ -114,7 +114,7 @@ protected void drawGuiContainerBackgroundLayer(final float p_146976_1_, final in
16);
}
}
GL11.glDisable(3042);
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ public GuiVisDynamo(final EntityPlayer player, final TileVisDynamo tileEntity) {

protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
GL11.glPushMatrix();
GL11.glEnable(3042);
GL11.glEnable(GL11.GL_BLEND);
UtilsFX.bindTexture(new ResourceLocation("thaumichorizons", "textures/gui/guidynamo.png"));
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
final int var5 = (this.width - this.xSize) / 2;
final int var6 = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize);
GL11.glDisable(3042);
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;

import com.kentington.thaumichorizons.common.ThaumicHorizons;
import com.kentington.thaumichorizons.common.entities.EntityBoatThaumium;
Expand Down Expand Up @@ -245,14 +246,14 @@ private void renderFocusRadialHUD(final double sw, final double sh, final long t
return;
}
GL11.glPushMatrix();
GL11.glClear(256);
GL11.glMatrixMode(5889);
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GL11.glOrtho(0.0, sw, sh, 0.0, 1000.0, 3000.0);
GL11.glMatrixMode(5888);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glLoadIdentity();
GL11.glTranslatef(0.0f, 0.0f, -2000.0f);
GL11.glDisable(2929);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glDepthMask(false);
GL11.glPushMatrix();
GL11.glTranslated(sw / 2.0, sh / 2.0, 0.0);
Expand All @@ -261,9 +262,9 @@ private void renderFocusRadialHUD(final double sw, final double sh, final long t
UtilsFX.bindTexture("textures/misc/radial.png");
GL11.glPushMatrix();
GL11.glRotatef(partialTicks + mc.thePlayer.ticksExisted % 720 / 2.0f, 0.0f, 0.0f, 1.0f);
GL11.glAlphaFunc(516, 0.003921569f);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569f);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
UtilsFX.renderQuadCenteredFromTexture(
width * 2.75f * RenderEventHandler.radialHudScale,
0.5f,
Expand All @@ -272,15 +273,15 @@ private void renderFocusRadialHUD(final double sw, final double sh, final long t
200,
771,
0.5f);
GL11.glDisable(3042);
GL11.glAlphaFunc(516, 0.1f);
GL11.glDisable(GL11.GL_BLEND);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1f);
GL11.glPopMatrix();
UtilsFX.bindTexture("textures/misc/radial2.png");
GL11.glPushMatrix();
GL11.glRotatef(-(partialTicks + mc.thePlayer.ticksExisted % 720 / 2.0f), 0.0f, 0.0f, 1.0f);
GL11.glAlphaFunc(516, 0.003921569f);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569f);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
UtilsFX.renderQuadCenteredFromTexture(
width * 2.55f * RenderEventHandler.radialHudScale,
0.5f,
Expand All @@ -289,18 +290,18 @@ private void renderFocusRadialHUD(final double sw, final double sh, final long t
200,
771,
0.5f);
GL11.glDisable(3042);
GL11.glAlphaFunc(516, 0.1f);
GL11.glDisable(GL11.GL_BLEND);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1f);
GL11.glPopMatrix();
if (lens != null) {
GL11.glPushMatrix();
GL11.glEnable(32826);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
RenderHelper.enableGUIStandardItemLighting();
final ItemStack item = new ItemStack((Item) lens);
item.stackTagCompound = null;
ri.renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, item, -8, -8);
RenderHelper.disableStandardItemLighting();
GL11.glDisable(32826);
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
final int mx = (int) (i - sw / 2.0);
final int my = (int) (j - sh / 2.0);
Expand All @@ -316,19 +317,19 @@ private void renderFocusRadialHUD(final double sw, final double sh, final long t
final float pieSlice = 360.0f / this.fociItem.size();
String key = this.foci.firstKey();
for (int a = 0; a < this.fociItem.size(); ++a) {
final double xx = MathHelper.cos(currentRot / 180.0f * 3.141593f) * width;
final double yy = MathHelper.sin(currentRot / 180.0f * 3.141593f) * width;
final double xx = MathHelper.cos(currentRot / 180.0f * (float) Math.PI) * width;
final double yy = MathHelper.sin(currentRot / 180.0f * (float) Math.PI) * width;
currentRot += pieSlice;
GL11.glPushMatrix();
GL11.glTranslated(xx, yy, 100.0);
GL11.glScalef(this.fociScale.get(key), this.fociScale.get(key), this.fociScale.get(key));
GL11.glEnable(32826);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
RenderHelper.enableGUIStandardItemLighting();
final ItemStack item2 = this.fociItem.get(key).copy();
item2.stackTagCompound = null;
ri.renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, item2, -8, -8);
RenderHelper.disableStandardItemLighting();
GL11.glDisable(32826);
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
if (!THKeyHandler.radialLock && THKeyHandler.radialActive) {
final int mx2 = (int) (i - sw / 2.0 - xx);
Expand Down Expand Up @@ -360,8 +361,8 @@ private void renderFocusRadialHUD(final double sw, final double sh, final long t
11);
}
GL11.glDepthMask(true);
GL11.glEnable(2929);
GL11.glDisable(3042);
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glDisable(GL11.GL_BLEND);
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
GL11.glPopMatrix();
}
Expand Down
Loading

0 comments on commit 69f0a4d

Please sign in to comment.