-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
And another one ̷b̷i̷t̷e̷s̷ ̷t̷h̷e̷ ̷d̷u̷s̷t̷ patch : 2
This is the last patch, I swear
- Loading branch information
1 parent
52540a3
commit 862dd57
Showing
12 changed files
with
275 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 0 additions & 37 deletions
37
...com/kotmatross/shadersfixer/mixins/late/client/hbm/client/MixinItemRenderWeaponGlass.java
This file was deleted.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
...a/com/kotmatross/shadersfixer/mixins/late/client/hbm/client/MixinModelArmorWingsPheo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.kotmatross.shadersfixer.mixins.late.client.hbm.client; | ||
|
||
import com.hbm.render.model.ModelArmorWingsPheo; | ||
import com.kotmatross.shadersfixer.Utils; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(value = ModelArmorWingsPheo.class, priority = 999) | ||
public class MixinModelArmorWingsPheo { | ||
|
||
@Inject(method = "renderFlame", | ||
at = @At(value = "HEAD") | ||
, remap = false) | ||
private static void renderFlame(CallbackInfo ci) { | ||
Utils.Fix(); | ||
} | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/com/kotmatross/shadersfixer/mixins/late/client/hbm/client/MixinModelNo9.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.kotmatross.shadersfixer.mixins.late.client.hbm.client; | ||
|
||
import com.hbm.render.model.ModelNo9; | ||
import com.kotmatross.shadersfixer.Utils; | ||
import net.minecraft.entity.Entity; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(value = ModelNo9.class, priority = 999) | ||
public class MixinModelNo9 { | ||
|
||
@Inject(method = "func_78088_a", | ||
at = @At(value = "INVOKE", target = "Lcom/hbm/render/loader/ModelRendererObj;render(F)V", ordinal = 2, shift = At.Shift.BEFORE) | ||
, remap = false) | ||
private void func_78088_a(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7, CallbackInfo ci) { | ||
Utils.Fix(); | ||
} | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
...in/java/com/kotmatross/shadersfixer/mixins/late/client/hbm/client/MixinRenderCharger.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.kotmatross.shadersfixer.mixins.late.client.hbm.client; | ||
|
||
import com.hbm.main.ResourceManager; | ||
import com.hbm.render.tileentity.RenderCharger; | ||
import com.kotmatross.shadersfixer.Utils; | ||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; | ||
import net.minecraft.tileentity.TileEntity; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(value = RenderCharger.class, priority = 999) | ||
public abstract class MixinRenderCharger extends TileEntitySpecialRenderer { | ||
|
||
@Inject(method = "func_147500_a", | ||
at = @At(value = "INVOKE", target = "Lnet/minecraftforge/client/model/IModelCustom;renderPart(Ljava/lang/String;)V", ordinal = 3, shift = At.Shift.BEFORE) | ||
, remap = false) | ||
private void func_147500_a(TileEntity tile, double x, double y, double z, float interp, CallbackInfo ci) { | ||
Utils.Fix(); | ||
} | ||
|
||
@Inject(method = "func_147500_a", | ||
at = @At(value = "INVOKE", target = "Lnet/minecraftforge/client/model/IModelCustom;renderPart(Ljava/lang/String;)V", ordinal = 3, shift = At.Shift.AFTER) | ||
, remap = false) | ||
private void func_147500_a2(TileEntity tile, double x, double y, double z, float interp, CallbackInfo ci) { | ||
bindTexture(ResourceManager.charger_tex); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...va/com/kotmatross/shadersfixer/mixins/late/client/hbm/client/MixinRenderFurnaceSteel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.kotmatross.shadersfixer.mixins.late.client.hbm.client; | ||
|
||
import com.hbm.render.tileentity.RenderFurnaceSteel; | ||
import com.kotmatross.shadersfixer.Utils; | ||
import net.minecraft.tileentity.TileEntity; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(value = RenderFurnaceSteel.class, priority = 999) | ||
public class MixinRenderFurnaceSteel { | ||
@Inject(method = "func_147500_a", | ||
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/Tessellator;startDrawingQuads()V", shift = At.Shift.BEFORE) | ||
) | ||
private void func_147500_a(TileEntity tileEntity, double x, double y, double z, float f, CallbackInfo ci) { | ||
Utils.Fix(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
163 changes: 163 additions & 0 deletions
163
...n/java/com/kotmatross/shadersfixer/mixins/late/client/hbm/client/MixinRenderRefueler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
package com.kotmatross.shadersfixer.mixins.late.client.hbm.client; | ||
|
||
import com.hbm.main.ResourceManager; | ||
import com.hbm.render.tileentity.IItemRendererProvider; | ||
import com.hbm.render.tileentity.RenderRefueler; | ||
import com.hbm.tileentity.machine.TileEntityRefueler; | ||
import com.kotmatross.shadersfixer.AngelicaUtils; | ||
import com.kotmatross.shadersfixer.Utils; | ||
import net.minecraft.client.renderer.GLAllocation; | ||
import net.minecraft.client.renderer.Tessellator; | ||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; | ||
import net.minecraft.tileentity.TileEntity; | ||
import net.minecraft.util.MathHelper; | ||
import org.lwjgl.opengl.GL11; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Overwrite; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
|
||
import java.awt.*; | ||
import java.nio.DoubleBuffer; | ||
|
||
@Mixin(value = RenderRefueler.class, priority = 999) | ||
public abstract class MixinRenderRefueler extends TileEntitySpecialRenderer implements IItemRendererProvider { | ||
@Shadow | ||
private static DoubleBuffer clip = null; | ||
|
||
/** | ||
* @author kotmatross | ||
* @reason fix liquid rendering (glClipPlane doesn't work with shaders) | ||
*/ | ||
@Overwrite | ||
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float interp) { | ||
TileEntityRefueler refueler = (TileEntityRefueler) tile; | ||
|
||
GL11.glPushMatrix(); | ||
{ | ||
|
||
GL11.glTranslated(x + 0.5, y, z + 0.5); | ||
GL11.glEnable(GL11.GL_LIGHTING); | ||
GL11.glEnable(GL11.GL_CULL_FACE); | ||
GL11.glRotatef(90, 0F, 1F, 0F); | ||
switch (tile.getBlockMetadata()) { | ||
case 4 -> GL11.glRotatef(90, 0F, 1F, 0F); | ||
case 3 -> GL11.glRotatef(180, 0F, 1F, 0F); | ||
case 5 -> GL11.glRotatef(270, 0F, 1F, 0F); | ||
case 2 -> GL11.glRotatef(0, 0F, 1F, 0F); | ||
} | ||
|
||
GL11.glShadeModel(GL11.GL_SMOOTH); | ||
|
||
bindTexture(ResourceManager.refueler_tex); | ||
ResourceManager.refueler.renderPart("Fueler"); | ||
|
||
if(!AngelicaUtils.isShaderEnabled()) { | ||
if(clip == null) { | ||
clip = GLAllocation.createDirectByteBuffer(8*4).asDoubleBuffer(); | ||
clip.put(new double[] {0, 1, 0, -0.125 }); | ||
clip.rewind(); | ||
} | ||
GL11.glEnable(GL11.GL_CLIP_PLANE0); | ||
GL11.glClipPlane(GL11.GL_CLIP_PLANE0, clip); | ||
} | ||
|
||
GL11.glEnable(GL11.GL_BLEND); | ||
GL11.glDisable(GL11.GL_TEXTURE_2D); | ||
|
||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); | ||
|
||
double fillLevel = refueler.prevFillLevel + (refueler.fillLevel - refueler.prevFillLevel) * interp; | ||
|
||
if(!AngelicaUtils.isShaderEnabled()) { | ||
GL11.glTranslated(0, (1 - fillLevel) * -0.625, 0); | ||
|
||
Color color = new Color(refueler.tank.getTankType().getColor()); | ||
GL11.glColor4f(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 0.75F); | ||
ResourceManager.refueler.renderPart("Fluid"); | ||
GL11.glColor4f(1, 1, 1, 1); | ||
} else { | ||
Tessellator tess = Tessellator.instance; | ||
|
||
double height = (fillLevel * 0.70113) + 0.09; //Max Y on model + offset | ||
|
||
|
||
height = MathHelper.clamp_double(height, 0.0, 0.70113); | ||
|
||
double initialY = 0.12; //Min Y on model | ||
|
||
Utils.Fix(); | ||
|
||
tess.startDrawingQuads(); | ||
tess.setColorOpaque_I(refueler.tank.getTankType().getColor()); | ||
|
||
//1 | ||
tess.addVertex(-0.4375, initialY, -0.095); | ||
tess.addVertex(-0.4375, initialY + height, -0.095); | ||
tess.addVertex(-0.31875, initialY + height, -0.063181); | ||
tess.addVertex(-0.31875, initialY, -0.063181); | ||
|
||
//2 | ||
tess.addVertex(-0.31875, initialY, -0.063181); | ||
tess.addVertex(-0.31875, initialY + height, -0.063181); | ||
tess.addVertex(-0.231819,initialY + height ,0.02375); | ||
tess.addVertex(-0.231819,initialY,0.02375); | ||
|
||
//3 | ||
tess.addVertex(-0.231819,initialY,0.02375); | ||
tess.addVertex(-0.231819,initialY + height ,0.02375); | ||
tess.addVertex(-0.2, initialY + height,0.1425); | ||
tess.addVertex(-0.2, initialY,0.1425); | ||
|
||
//4 | ||
tess.addVertex(-0.2, initialY,0.1425); | ||
tess.addVertex(-0.2, initialY + height,0.1425); | ||
tess.addVertex(-0.231819,initialY + height,0.26125); | ||
tess.addVertex(-0.231819,initialY,0.26125); | ||
|
||
//5 | ||
tess.addVertex(-0.231819,initialY,0.26125); | ||
tess.addVertex(-0.231819,initialY + height,0.26125); | ||
tess.addVertex(-0.31875, initialY + height, 0.348181); | ||
tess.addVertex(-0.31875, initialY, 0.348181); | ||
|
||
//6 | ||
tess.addVertex(-0.31875, initialY, 0.348181); | ||
tess.addVertex(-0.31875, initialY + height, 0.348181); | ||
tess.addVertex(-0.4375,initialY + height, 0.38); | ||
tess.addVertex(-0.4375,initialY , 0.38); | ||
|
||
tess.draw(); | ||
|
||
|
||
//Top | ||
tess.startDrawing(GL11.GL_POLYGON); | ||
tess.setColorOpaque_I(refueler.tank.getTankType().getColor()); | ||
|
||
//FKING GL_CCW | ||
tess.addVertex(-0.4375, initialY + height, 0.38); | ||
tess.addVertex(-0.31875, initialY + height, 0.348181); | ||
tess.addVertex(-0.231819, initialY + height, 0.26125); | ||
tess.addVertex(-0.2, initialY + height, 0.1425); | ||
tess.addVertex(-0.231819, initialY + height, 0.02375); | ||
tess.addVertex(-0.31875, initialY + height, -0.063181); | ||
tess.addVertex(-0.4375, initialY + height, -0.095); | ||
|
||
tess.draw(); | ||
|
||
} | ||
|
||
GL11.glColor4f(1, 1, 1, 1); | ||
|
||
GL11.glEnable(GL11.GL_TEXTURE_2D); | ||
GL11.glDisable(GL11.GL_BLEND); | ||
|
||
if(!AngelicaUtils.isShaderEnabled()) { | ||
GL11.glDisable(GL11.GL_CLIP_PLANE0); | ||
} | ||
|
||
GL11.glShadeModel(GL11.GL_FLAT); | ||
|
||
} | ||
GL11.glPopMatrix(); | ||
} | ||
} |