Skip to content

Commit

Permalink
And another one ̷b̷i̷t̷e̷s̷ ̷t̷h̷e̷ ̷d̷u̷s̷t̷ patch : 2
Browse files Browse the repository at this point in the history
This is the last patch, I swear
  • Loading branch information
kotmatross28729 committed Feb 24, 2025
1 parent 52540a3 commit 862dd57
Show file tree
Hide file tree
Showing 12 changed files with 275 additions and 47 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# 3.3 hot-fix-patch-5
*Last patch (I hope)*

* **[Hbm's NTM:Space]** Completely fixed horizon/sunset with angelica shaders
* **[Hbm's NTM]** Fixed rendering of refueler liquid with angelica shaders (liquid was rendered under refueler, without clip)
* **[Hbm's NTM]** Fixed lamp on the miner's helmet with angelica shaders
* **[Hbm's NTM]** Fixed lamp on the charger with angelica shaders
* **[Hbm's NTM]** Fixed fire rendering in a steel furnace with angelica shaders

# 3.3 hot-fix-patch-4

*Yeah, I'm too lazy to change 3.3 to 3.4, that's why we now have patches (awhile)*
Expand Down
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ dependencies {
compileOnly name: 'Avaritia-1.51'
compileOnly name: 'Eln-1.21.9'
compileOnly name: 'OpenComputers-1.10.23-GTNH-dev'
compileOnly name: 'HBM-NTM-.1.0.27_X5180'
compileOnly name: 'HBM-NTM-[1.0.27_X5243]'
compileOnly name: 'HBM-NTM-.1.0.27_X5244_H261-DUMMY'
compileOnly name: 'DynamicSurroundings-1.7.10-1.0.7.5'
compileOnly name: 'LittleMaidMobEnhanced-1.7.10-1.4.4'
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ public List<String> getMixins(Set<String> loadedMods) {
mixins.add("client.hbm.client.MixinItemRenderDetonatorLaser"); //LED on top, sine wave on the side
mixins.add("client.hbm.client.MixinItemRendererMeteorSword"); //Lighting glitch in 3rd person view
mixins.add("client.hbm.client.MixinItemRenderLibrary"); //Radiation-Powered Engine lights render in hand
mixins.add("client.hbm.client.MixinItemRenderWeaponGlass"); //!Model itself, sine wave on the side, brighter sine wave with shaders
mixins.add("client.hbm.client.MixinModelArmorEnvsuit"); //Armor helmet lamps
mixins.add("client.hbm.client.MixinRenderBAT9000"); //Liquid inside
mixins.add("client.hbm.client.MixinRenderBeam"); //Immolator/ HPP LaserJet projectile
Expand Down Expand Up @@ -350,8 +349,14 @@ public List<String> getMixins(Set<String> loadedMods) {
mixins.add("client.hbm.client.sedna.guns.MixinItemRenderMareslegAkimbo");

mixins.add("client.hbm.client.MixinRenderChemical"); //Antimatter thing
mixins.add("client.hbm.client.MixinRenderSolidifier");
mixins.add("client.hbm.client.MixinRenderLiquefactor");
mixins.add("client.hbm.client.MixinRenderSolidifier"); //Liquid inside
mixins.add("client.hbm.client.MixinRenderLiquefactor"); //Liquid inside

mixins.add("client.hbm.client.MixinRenderRefueler");
mixins.add("client.hbm.client.MixinModelNo9"); //Lamp
mixins.add("client.hbm.client.MixinRenderCharger"); //Lamp
mixins.add("client.hbm.client.MixinRenderFurnaceSteel"); //Heat thing
mixins.add("client.hbm.client.MixinModelArmorWingsPheo"); //idk

if(ShaderFixerConfig.HbmExtendedHazardDescriptions) {
mixins.add("client.hbm.client.descr.MixinHazardTypeAsbestos");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ public class MixinEntityRenderer {


@Inject(method = "renderHand", at = @At(value = "HEAD"))
public void HandleInterp(float interp, int p_78476_2_, CallbackInfo ci)
{
public void HandleInterp(float interp, int p_78476_2_, CallbackInfo ci) {
if(shaders_fixer$checkVibe()) {
try {ShadersFixerLateMixins.handleInterpolation(interp);} catch (NoClassDefFoundError ignored){} //INTERPOLATE FOV (SCOPE)
}
Expand Down Expand Up @@ -81,8 +80,7 @@ private boolean FOVConfigApply(boolean useFOVSetting) {
}

@ModifyConstant(method = "getFOVModifier", constant = @Constant(floatValue = 70.0F))
public float ModifyBaseFOV(float fov, @Local EntityLivingBase entityplayer)
{
public float ModifyBaseFOV(float fov, @Local EntityLivingBase entityplayer) {
if(shaders_fixer$checkVibe()) {
fov = ShadersFixerLateMixins.getGunsBaseFOV(entityplayer.getHeldItem());
return fov;
Expand Down

This file was deleted.

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();
}

}
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();
}

}
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);
}
}
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();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.hbm.render.tileentity.RenderRBMKLid;
import com.kotmatross.shadersfixer.Utils;
import net.minecraft.tileentity.TileEntity;
import org.lwjgl.opengl.GL11;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -27,8 +28,6 @@ public float IncreaseBrightness(float brightness) {
return 0.4F;
}


//TODO: check if need glDepthMask disabled
@Unique
public int shaders_fixer$program;

Expand All @@ -38,13 +37,15 @@ public float IncreaseBrightness(float brightness) {
public void func_147500_aPR(TileEntity te, double x, double y, double z, float i, CallbackInfo ci) {
shaders_fixer$program = Utils.GLGetCurrentProgram();
Utils.GLUseDefaultProgram();
GL11.glDepthMask(false);
}

@Inject(method = "func_147500_a",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/client/renderer/Tessellator;draw()I", shift = At.Shift.AFTER))
public void func_147500_aPRE(TileEntity te, double x, double y, double z, float i, CallbackInfo ci) {
Utils.GLUseProgram(shaders_fixer$program);
GL11.glDepthMask(true);
}

}
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();
}
}

0 comments on commit 862dd57

Please sign in to comment.