Compare commits

...
Author SHA1 Message Date
David Lindström 3d76cb3073 Use instanceof instead of direct cast to protect against scenarios where mods like FMB use the same rendering code for world, inventory and preview, where the two latter happens in passes that are not rendered using a CapturingTesselator 2025-05-27 14:10:07 -07:00
kotmatross28729 45fb120223 Fix COLOR_BUFFER_BIT leak in ShaderPackScreen 2025-05-25 08:25:59 -07:00
Jason Mitchell d7a196eb5c Use invokeExact instead of invoke 2025-05-25 08:25:05 -07:00
Jason Mitchell 4d53e2af9b Holoinventory compat via reflection 2025-05-25 08:25:05 -07:00
Jason Mitchell cb6336a365 Backhand Compat via Reflection 2025-05-25 08:25:05 -07:00
Jason Mitchell 5095021e0e Capture shader outline 2025-05-16 18:08:27 -07:00
Caedis f88ecbf68d Replace Baubles with Baubles Expanded (#949) 2025-05-13 10:26:50 -04:00
Darren Eberly 7da9b9eb1c Compat for security craft (#948) 2025-05-12 23:34:15 -04:00
Pxx500 02c394108f enable ctm, disable everything unnecessary 2025-05-05 12:44:46 -07:00
Fabian Maurer 720aaca1b7 Add functionality to fake blockId for shaders 2025-04-24 14:11:24 -07:00
Midnight145 1e71b1c4d8 liteloader docs update 2025-04-17 17:41:58 -07:00
くぁーりぃ df4c423e93 fix config load (#914) 2025-04-07 19:10:39 +00:00
JuliaandJason Mitchell 78e0074e5a Apply linear filter to unifont glyphs at odd scale factors (#907)
* Apply linear filter to unifont glyphs at odd scale factors

* Prevent glyph texture bleeding by adjusting UV coordinates with a slight offset

* Tiny bit of tuning

---------

Co-authored-by: Jason Mitchell <[email protected]>
2025-04-07 17:37:46 +02:00
31 changed files with 442 additions and 129 deletions

No files matched your search

+2 -1
View File
@@ -15,7 +15,7 @@
# Required Dependencies
* [UniMixins](https://github.com/LegacyModdingMC/UniMixins/releases) >= 0.1.19
* [GTNHLib](https://github.com/GTNewHorizons/GTNHLib/releases) >= 0.6.6
* [GTNHLib](https://github.com/GTNewHorizons/GTNHLib/releases) >= 0.6.20
* NOTE: Some mods are not required, but a specific version is required if present - see: `Permanent Incompatibilities` below.
# Known (temporary) Incompatibilities
@@ -29,6 +29,7 @@
* FalseTweaks - Not currently planned (Looking for volunteers) [Might work if you effectively disable most of the mod]
* SmoothFont - Not currently planned (Looking for volunteers)
* RPLE - Not currently planned (Looking for volunteers)
* LiteLoader - Install [LiteloaderLoader](https://github.com/Midnight145/LiteloaderLoader)
# Permanent Incompatibilities
* OptiFine [Disabled, won't fix]
+3 -5
View File
@@ -61,7 +61,7 @@ dependencies {
// Iris Shaders
compileOnly('org.jetbrains:annotations:26.0.2')
api("com.github.GTNewHorizons:GTNHLib:0.6.13:dev")
api("com.github.GTNewHorizons:GTNHLib:0.6.20:dev")
shadowImplementation("org.anarres:jcpp:1.4.14") // Apache 2.0
shadowImplementation("org.taumc:glsl-transformation-lib:0.2.0-4.g6b42bca") {
exclude module: "antlr4" // we only want to shadow the runtime module
@@ -75,7 +75,7 @@ dependencies {
// Notfine Deps
compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev")
devOnlyNonPublishable("com.github.GTNewHorizons:Baubles:1.0.4:dev")
devOnlyNonPublishable("com.github.GTNewHorizons:Baubles-Expanded:2.1.7-GTNH:dev")
compileOnly("com.github.GTNewHorizons:twilightforest:2.7.5:dev") { transitive = false }
compileOnly(rfg.deobf('curse.maven:witchery-69673:2234410'))
compileOnly("com.github.GTNewHorizons:TinkersConstruct:1.13.10-GTNH:dev") { transitive = false }
@@ -84,7 +84,6 @@ dependencies {
compileOnly("com.github.GTNewHorizons:ThaumicHorizons:1.7.1:dev")
compileOnly("com.github.GTNewHorizons:Battlegear2:1.4.2:dev") { transitive = false }
compileOnly('com.github.GTNewHorizons:Backhand:1.6.11') { transitive = false }
compileOnly("com.falsepattern:chunkapi-mc1.7.10:0.5.1:api") { transitive = false }
compileOnly("com.falsepattern:endlessids-mc1.7.10:1.5-beta0003:dev") { transitive = false }
@@ -99,8 +98,7 @@ dependencies {
compileOnly(rfg.deobf("curse.maven:campfirebackport-387444:4611675"))
compileOnly(rfg.deobf("curse.maven:xaeros-minimap-263420:5060684"))
compileOnly("com.github.GTNewHorizons:HoloInventory:2.5.1-GTNH:dev")
compileOnly(rfg.deobf("curse.maven:security-craft-64760:2818228"))
runtimeOnlyNonPublishable(rfg.deobf("CoreTweaks:CoreTweaks:0.3.3.2"))
@@ -7,8 +7,9 @@ import com.gtnewhorizons.angelica.mixins.interfaces.FontRendererAccessor;
import it.unimi.dsi.fastutil.chars.Char2ShortOpenHashMap;
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import jss.util.RandomXoshiro256StarStar;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
@@ -150,7 +151,7 @@ public class BatchingFontRenderer {
return idx;
}
private void pushDrawCmd(int startIdx, int idxCount, ResourceLocation texture) {
private void pushDrawCmd(int startIdx, int idxCount, ResourceLocation texture, boolean isUnicode) {
if (!batchCommands.isEmpty()) {
final FontDrawCmd lastCmd = batchCommands.get(batchCommands.size() - 1);
final int prevEndVtx = lastCmd.startVtx + lastCmd.idxCount;
@@ -166,7 +167,7 @@ public class BatchingFontRenderer {
}
}
final FontDrawCmd cmd = batchCommandPool.pop();
cmd.reset(startIdx, idxCount, texture);
cmd.reset(startIdx, idxCount, texture, isUnicode);
batchCommands.add(cmd);
}
@@ -174,12 +175,14 @@ public class BatchingFontRenderer {
public int startVtx;
public int idxCount;
public boolean isUnicode;
public ResourceLocation texture;
public void reset(int startVtx, int vtxCount, ResourceLocation texture) {
public void reset(int startVtx, int vtxCount, ResourceLocation texture, boolean isUnicode) {
this.startVtx = startVtx;
this.idxCount = vtxCount;
this.texture = texture;
this.isUnicode = isUnicode;
}
@Override
@@ -280,7 +283,21 @@ public class BatchingFontRenderer {
}
batchIndices.limit(cmd.startVtx + cmd.idxCount);
batchIndices.position(cmd.startVtx);
Minecraft mc = Minecraft.getMinecraft();
int scaleFactor = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight).getScaleFactor();
boolean shouldApplyFilter = cmd.isUnicode && scaleFactor % 2 != 0;
if (shouldApplyFilter) {
GLStateManager.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
GLStateManager.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
}
GL11.glDrawElements(GL11.GL_TRIANGLES, batchIndices);
if (shouldApplyFilter) {
GLStateManager.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST);
GLStateManager.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
}
}
GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
@@ -367,7 +384,7 @@ public class BatchingFontRenderer {
if (curUnderline && underlineStartX != underlineEndX) {
final int ulIdx = idxWriterIndex;
pushUntexRect(underlineStartX, underlineY, underlineEndX - underlineStartX, 1.0f, curColor);
pushDrawCmd(ulIdx, 6, null);
pushDrawCmd(ulIdx, 6, null, false);
underlineStartX = underlineEndX;
}
if (curStrikethrough && strikethroughStartX != strikethroughEndX) {
@@ -378,7 +395,7 @@ public class BatchingFontRenderer {
strikethroughEndX - strikethroughStartX,
1.0f,
curColor);
pushDrawCmd(ulIdx, 6, null);
pushDrawCmd(ulIdx, 6, null, false);
strikethroughStartX = strikethroughEndX;
}
@@ -462,13 +479,13 @@ public class BatchingFontRenderer {
final int endColumn = this.glyphWidth[chr] & 15;
final float startColumnF = (float) startColumn;
final float endColumnF = (float) (endColumn + 1);
uStart = ((float) (chr % 16 * 16) + startColumnF) / 256.0f;
vStart = ((float) ((chr & 255) / 16 * 16)) / 256.0f;
uStart = ((float) (chr % 16 * 16) + startColumnF + 0.21f) / 256.0f;
vStart = ((float) ((chr & 255) / 16 * 16) + 0.21f) / 256.0f;
final float chrWidth = endColumnF - startColumnF - 0.02F;
glyphW = chrWidth / 2.0f + 1.0f;
xAdvance = (endColumnF - startColumnF) / 2.0F + 1.0F;
uSz = chrWidth / 256.0f;
vSz = 15.98f / 256.0f;
uSz = (chrWidth - 0.42f) / 256.0f;
vSz = (16.0f - 0.42f) / 256.0f;
} else {
// Draw "ASCII" char
@@ -556,7 +573,7 @@ public class BatchingFontRenderer {
vtxCount += 4;
}
pushDrawCmd(idxId, vtxCount / 2 * 3, texture);
pushDrawCmd(idxId, vtxCount / 2 * 3, texture, chr > 255);
curX += xAdvance + (curBold ? shadowOffset : 0.0f);
underlineEndX = curX;
strikethroughEndX = curX;
@@ -565,7 +582,7 @@ public class BatchingFontRenderer {
if (curUnderline && underlineStartX != underlineEndX) {
final int ulIdx = idxWriterIndex;
pushUntexRect(underlineStartX, underlineY, underlineEndX - underlineStartX, 1.0f, curColor);
pushDrawCmd(ulIdx, 6, null);
pushDrawCmd(ulIdx, 6, null, false);
}
if (curStrikethrough && strikethroughStartX != strikethroughEndX) {
final int ulIdx = idxWriterIndex;
@@ -575,7 +592,7 @@ public class BatchingFontRenderer {
strikethroughEndX - strikethroughStartX,
1.0f,
curColor);
pushDrawCmd(ulIdx, 6, null);
pushDrawCmd(ulIdx, 6, null, false);
}
} finally {
@@ -1,13 +1,18 @@
package com.gtnewhorizons.angelica.compat;
import com.gtnewhorizons.angelica.compat.backhand.BackhandReflectionCompat;
import com.gtnewhorizons.angelica.compat.holoinventory.HoloInventoryReflectionCompat;
import com.gtnewhorizons.angelica.helpers.LoadControllerHelper;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.versioning.DefaultArtifactVersion;
import mods.battlegear2.Battlegear;
import net.dries007.holoInventory.HoloInventory;
import xonin.backhand.Backhand;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class ModStatus {
public static final Logger LOGGER = LogManager.getLogger("ModCompat");
public static BackhandReflectionCompat backhandCompat;
/**
* Mixin Version
*/
@@ -16,7 +21,6 @@ public class ModStatus {
* ASM Version
*/
public static boolean isOldNEIDLoaded;
public static boolean isBetterCrashesLoaded;
public static boolean isNEIDMetadataExtended;
public static boolean isLotrLoaded;
@@ -31,6 +35,11 @@ public class ModStatus {
public static boolean isBaublesLoaded;
public static void preInit(){
isBackhandLoaded = Loader.isModLoaded("backhand");
if(isBackhandLoaded) {
isBackhandLoaded = BackhandReflectionCompat.isBackhandLoaded();
}
isBetterCrashesLoaded = Loader.isModLoaded("bettercrashes");
isNEIDLoaded = Loader.isModLoaded("neid");
isOldNEIDLoaded = Loader.isModLoaded("notenoughIDs");
@@ -40,16 +49,12 @@ public class ModStatus {
isXaerosMinimapLoaded = Loader.isModLoaded("XaeroMinimap");
isHoloInventoryLoaded = Loader.isModLoaded("holoinventory");
isBattlegearLoaded = Loader.isModLoaded("battlegear2");
isBackhandLoaded = Loader.isModLoaded("backhand");
isThaumcraftLoaded = Loader.isModLoaded("Thaumcraft");
isThaumicHorizonsLoaded = Loader.isModLoaded("ThaumicHorizons");
isBaublesLoaded = Loader.isModLoaded("Baubles");
if (isHoloInventoryLoaded){
isHoloInventoryLoaded = new DefaultArtifactVersion("2.4.4-GTNH")
.compareTo(
LoadControllerHelper.getOwningMod(HoloInventory.class).getProcessedVersion()
) <= 0;
if (isHoloInventoryLoaded) {
isHoloInventoryLoaded = HoloInventoryReflectionCompat.isHoloInventoryLoaded();
}
// remove compat with original release of BG2
@@ -60,17 +65,9 @@ public class ModStatus {
) <= 0;
}
if (isBackhandLoaded){
isBackhandLoaded = new DefaultArtifactVersion("1.6.9")
.compareTo(
LoadControllerHelper.getOwningMod(Backhand.class).getProcessedVersion()
) <= 0;
}
isNEIDMetadataExtended = false;
if (isNEIDLoaded) {
int majorVersion = Integer.parseInt(Loader.instance().getIndexedModList().get("neid").getVersion().split("\\.")[0]);
final int majorVersion = Integer.parseInt(Loader.instance().getIndexedModList().get("neid").getVersion().split("\\.")[0]);
if (majorVersion >= 2) {
isNEIDMetadataExtended = true;
}
@@ -0,0 +1,76 @@
package com.gtnewhorizons.angelica.compat.backhand;
import com.gtnewhorizons.angelica.helpers.LoadControllerHelper;
import cpw.mods.fml.common.versioning.DefaultArtifactVersion;
import cpw.mods.fml.relauncher.ReflectionHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import static com.gtnewhorizons.angelica.compat.ModStatus.LOGGER;
public class BackhandReflectionCompat {
private static final String BACKHAND_CLASS = "xonin.backhand.Backhand";
private static final String ITEM_RENDERER_HOOKS_CLASS = "xonin.backhand.client.hooks.ItemRendererHooks";
private static final String BACKHAND_UTILS_CLASS = "xonin.backhand.api.core.BackhandUtils";
private static boolean isLoaded;
private static final MethodHandle renderOffhandReturn;
private static final MethodHandle getOffhandItem;
static {
MethodHandle renderOffhandReturnTemp = null;
MethodHandle getOffhandItemTemp = null;
try {
final Class<?> backhandClass = ReflectionHelper.getClass(BackhandReflectionCompat.class.getClassLoader(), BACKHAND_CLASS);
final boolean versionCheck = new DefaultArtifactVersion("1.6.9").compareTo(LoadControllerHelper.getOwningMod(backhandClass).getProcessedVersion()) <= 0;
if (versionCheck) {
final MethodHandles.Lookup lookup = MethodHandles.lookup();
final Class<?> itemRendererHooksClass = ReflectionHelper.getClass(BackhandReflectionCompat.class.getClassLoader(), ITEM_RENDERER_HOOKS_CLASS);
final Class<?> backhandUtilsClass = ReflectionHelper.getClass(BackhandReflectionCompat.class.getClassLoader(), BACKHAND_UTILS_CLASS);
renderOffhandReturnTemp = lookup.findStatic(itemRendererHooksClass, "renderOffhandReturn", MethodType.methodType(void.class, float.class));
getOffhandItemTemp = lookup.findStatic(backhandUtilsClass, "getOffhandItem", MethodType.methodType(ItemStack.class, EntityPlayer.class));
isLoaded = true;
LOGGER.info("Backhand compat loaded");
}
} catch (Exception e) {
LOGGER.error("Failed to load Backhand compat", e);
isLoaded = false;
}
renderOffhandReturn = renderOffhandReturnTemp;
getOffhandItem = getOffhandItemTemp;
}
public static boolean isBackhandLoaded() {
return isLoaded;
}
public static void renderOffhand(float partialTicks) {
if (isLoaded && renderOffhandReturn != null) {
try {
renderOffhandReturn.invokeExact(partialTicks);
} catch (Throwable e) {
LOGGER.error("Failed to invoke Backhand renderOffhandReturn", e);
isLoaded = false;
}
}
}
public static ItemStack getOffhandItem(EntityPlayer player) {
if (isLoaded && getOffhandItem != null) {
try {
return (ItemStack) getOffhandItem.invokeExact(player);
} catch (Throwable e) {
LOGGER.error("Failed to invoke Backhand getOffhandItem", e);
isLoaded = false;
}
}
return null;
}
}
@@ -0,0 +1,97 @@
package com.gtnewhorizons.angelica.compat.holoinventory;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.lang.reflect.Field;
import static com.gtnewhorizons.angelica.compat.ModStatus.LOGGER;
public class HoloInventoryReflectionCompat {
private static final String RENDERER_CLASS = "net.dries007.holoInventory.client.Renderer";
private static boolean isLoaded;
private static final MethodHandle renderEventPostMethod;
private static final MethodHandle renderEventMethod;
private static final MethodHandle angelicaOverrideSetter;
static {
MethodHandle renderEventPostMethodTemp = null;
MethodHandle renderEventMethodTemp = null;
MethodHandle angelicaOverrideSetterTemp = null;
final Object rendererInstance;
final Class<?> rendererClass;
try {
rendererClass = Class.forName(RENDERER_CLASS);
// Get and cache the Renderer.INSTANCE
final Field instanceField = rendererClass.getDeclaredField("INSTANCE");
instanceField.setAccessible(true);
rendererInstance = instanceField.get(null);
final MethodHandles.Lookup lookup = MethodHandles.lookup();
try {
renderEventPostMethodTemp = lookup.findVirtual(rendererClass, "renderEvent", MethodType.methodType(void.class, RenderGameOverlayEvent.Post.class));
} catch (NoSuchMethodException e) {
// Fallback for 2.5.0-GTNH and earlier
renderEventMethodTemp = lookup.findVirtual(rendererClass, "renderEvent", MethodType.methodType(void.class, RenderGameOverlayEvent.class));
}
final Field angelicaOverrideField = rendererClass.getDeclaredField("angelicaOverride");
angelicaOverrideField.setAccessible(true);
angelicaOverrideSetterTemp = lookup.unreflectSetter(angelicaOverrideField);
// Bind the method handles to the instance
if (rendererInstance != null) {
if (renderEventPostMethodTemp != null) {
renderEventPostMethodTemp = renderEventPostMethodTemp.bindTo(rendererInstance);
}
if (renderEventMethodTemp != null) {
renderEventMethodTemp = renderEventMethodTemp.bindTo(rendererInstance);
}
angelicaOverrideSetterTemp = angelicaOverrideSetterTemp.bindTo(rendererInstance);
}
isLoaded = true;
LOGGER.info("Successfully initialized HoloInventory compatibility layer");
} catch (Exception e) {
LOGGER.warn("Failed to initialize HoloInventory compatibility layer", e);
isLoaded = false;
}
renderEventPostMethod = renderEventPostMethodTemp;
renderEventMethod = renderEventMethodTemp;
angelicaOverrideSetter = angelicaOverrideSetterTemp;
}
public static boolean isHoloInventoryLoaded() {
return isLoaded;
}
public static void renderEvent(RenderGameOverlayEvent event) {
if (!isLoaded) return;
try {
if (event instanceof RenderGameOverlayEvent.Post && renderEventPostMethod != null) {
renderEventPostMethod.invokeExact((RenderGameOverlayEvent.Post) event);
} else {
renderEventMethod.invokeExact(event);
}
} catch (Throwable e) {
LOGGER.error("Failed to invoke HoloInventory renderEvent", e);
isLoaded = false;
}
}
public static void setAngelicaOverride(boolean value) {
if (!isLoaded) return;
try {
angelicaOverrideSetter.invokeExact(value);
} catch (Throwable e) {
LOGGER.error("Failed to set HoloInventory angelicaOverride", e);
isLoaded = false;
}
}
}
@@ -4,7 +4,6 @@ package com.gtnewhorizons.angelica.compat.mojang;
import com.gtnewhorizons.angelica.compat.ModStatus;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import xonin.backhand.api.core.BackhandUtils;
public enum InteractionHand {
MAIN_HAND,
@@ -15,7 +14,7 @@ public enum InteractionHand {
public ItemStack getItemInHand(EntityPlayer player){
if (ModStatus.isBackhandLoaded && this == InteractionHand.OFF_HAND){ // off hand (requires backhand)
return BackhandUtils.getOffhandItem(player);
return ModStatus.backhandCompat.getOffhandItem(player);
}
else { // main hand
return player.getHeldItem();
@@ -38,7 +38,7 @@ public class AngelicaConfig {
public static boolean enableIris;
@Config.Comment("Enable MCPatcherForge features, still in Alpha. Individual features are toggled in mcpatcher.json")
@Config.DefaultBoolean(false)
@Config.DefaultBoolean(true)
@Config.RequiresMcRestart
public static boolean enableMCPatcherForgeFeatures;
@@ -39,4 +39,9 @@ public class CompatConfig {
@Config.DefaultBoolean(true)
@Config.RequiresMcRestart
public static boolean fixImmersiveEngineering;
@Config.Comment("Apply fixes to Security Craft")
@Config.DefaultBoolean(true)
@Config.RequiresMcRestart
public static boolean fixSecurityCraft;
}
@@ -27,7 +27,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import xonin.backhand.api.core.BackhandUtils;
import java.util.Set;
import java.util.concurrent.locks.ReentrantReadWriteLock;
@@ -383,7 +382,7 @@ public class DynamicLights {
}
}
else if (ModStatus.isBackhandLoaded && living instanceof EntityPlayer player){
ItemStack offhand = BackhandUtils.getOffhandItem(player);
ItemStack offhand = ModStatus.backhandCompat.getOffhandItem(player);
if (offhand != null) {
luminance = Math.max(luminance, getLuminanceFromItemStack(offhand, inWater));
}
@@ -2,13 +2,13 @@ package com.gtnewhorizons.angelica.hudcaching;
import com.gtnewhorizon.gtnhlib.client.renderer.TessellatorManager;
import com.gtnewhorizons.angelica.compat.ModStatus;
import com.gtnewhorizons.angelica.compat.holoinventory.HoloInventoryReflectionCompat;
import com.gtnewhorizons.angelica.config.AngelicaConfig;
import com.gtnewhorizons.angelica.mixins.interfaces.GuiIngameAccessor;
import com.gtnewhorizons.angelica.mixins.interfaces.GuiIngameForgeAccessor;
import com.gtnewhorizons.angelica.mixins.interfaces.RenderGameOverlayEventAccessor;
import com.kentington.thaumichorizons.common.ThaumicHorizons;
import cpw.mods.fml.common.eventhandler.EventPriority;
import net.dries007.holoInventory.client.Renderer;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.event.world.WorldEvent;
import org.lwjgl.opengl.GL11;
@@ -60,7 +60,6 @@ public class HUDCaching {
public static final HUDCaching INSTANCE = new HUDCaching();
private HUDCaching() {}
// highest so it runs before the GLSM load event
@@ -99,7 +98,7 @@ public class HUDCaching {
renderingCacheOverride = false;
mc.getFramebuffer().bindFramebuffer(false);
} else {
renderer.setupOverlayRendering();
renderer.setupOverlayRendering();
}
ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
@@ -112,52 +111,50 @@ public class HUDCaching {
// render bits that were captured when rendering into cache
GuiIngameAccessor gui = (GuiIngameAccessor) ingame;
if (renderVignetteCaptured)
{
if (renderVignetteCaptured) {
gui.callRenderVignette(mc.thePlayer.getBrightness(partialTicks), width, height);
} else {
GLStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
GLStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
}
if (ingame instanceof GuiIngameForge) {
GuiIngameForgeAccessor guiForge = ((GuiIngameForgeAccessor) ingame);
if (renderHelmetCaptured) {
guiForge.callRenderHelmet(resolution, partialTicks, hasScreen, mouseX, mouseY);
GuiIngameForgeAccessor guiForge = ((GuiIngameForgeAccessor) ingame);
if (renderHelmetCaptured) {
guiForge.callRenderHelmet(resolution, partialTicks, hasScreen, mouseX, mouseY);
if (ModStatus.isHoloInventoryLoaded) {
Renderer.INSTANCE.angelicaOverride = false;
HoloInventoryReflectionCompat.setAngelicaOverride(false);
// only settings the partial ticks as mouseX and mouseY are not used in renderEvent
((RenderGameOverlayEventAccessor) fakePostEvent).setPartialTicks(partialTicks);
Renderer.INSTANCE.renderEvent(fakePostEvent);
HoloInventoryReflectionCompat.renderEvent(fakePostEvent);
}
}
if (renderPortalCapturedTicks > 0) {
guiForge.callRenderPortal(width, height, partialTicks);
}
if (renderCrosshairsCaptured) {
if (ModStatus.isXaerosMinimapLoaded){
}
if (renderPortalCapturedTicks > 0) {
guiForge.callRenderPortal(width, height, partialTicks);
}
if (renderCrosshairsCaptured) {
if (ModStatus.isXaerosMinimapLoaded) {
// this fixes the crosshair going invisible when no lines are being drawn under the minimap
GLStateManager.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
}
guiForge.callRenderCrosshairs(width, height);
}
if (ModStatus.isThaumcraftLoaded || ModStatus.isThaumicHorizonsLoaded){
guiForge.callRenderCrosshairs(width, height);
}
if (ModStatus.isThaumcraftLoaded || ModStatus.isThaumicHorizonsLoaded) {
((RenderGameOverlayEventAccessor) fakeTextEvent).setPartialTicks(partialTicks);
((RenderGameOverlayEventAccessor) fakeTextEvent).setResolution(resolution);
((RenderGameOverlayEventAccessor) fakeTextEvent).setMouseX(mouseX);
((RenderGameOverlayEventAccessor) fakeTextEvent).setMouseY(mouseY);
if (ModStatus.isThaumcraftLoaded){
if (ModStatus.isThaumcraftLoaded) {
Thaumcraft.instance.renderEventHandler.renderOverlay(fakeTextEvent);
}
if (ModStatus.isThaumicHorizonsLoaded){
if (ModStatus.isThaumicHorizonsLoaded) {
ThaumicHorizons.instance.renderEventHandler.renderOverlay(fakeTextEvent);
}
}
} else {
if (renderHelmetCaptured)
{
if (renderHelmetCaptured) {
gui.callRenderPumpkinBlur(width, height);
}
if (renderPortalCapturedTicks > 0)
{
if (renderPortalCapturedTicks > 0) {
gui.callRenderPortal(renderPortalCapturedTicks, width, height);
}
}
@@ -180,19 +177,19 @@ public class HUDCaching {
* the state before we start rendering
*/
public static void fixGLStateBeforeRenderingCache() {
GLStateManager.glDepthMask(true);
GLStateManager.enableDepthTest();
GLStateManager.enableAlphaTest();
GLStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
GLStateManager.disableBlend();
GLStateManager.glDepthMask(true);
GLStateManager.enableDepthTest();
GLStateManager.enableAlphaTest();
GLStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
GLStateManager.disableBlend();
}
private static void resetFramebuffer(int width, int height) {
if (framebuffer.framebufferWidth != width || framebuffer.framebufferHeight != height) {
framebuffer.createBindFramebuffer(width, height);
framebuffer.createBindFramebuffer(width, height);
framebuffer.setFramebufferFilter(GL11.GL_NEAREST);
} else {
framebuffer.framebufferClear();
framebuffer.framebufferClear();
}
// copy depth buffer from MC
OpenGlHelper.func_153171_g(GL30.GL_READ_FRAMEBUFFER, mc.getFramebuffer().framebufferObject);
@@ -214,10 +211,9 @@ public class HUDCaching {
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
}
// moved to here due to the method being called from a mixin
public static void disableHoloInventory() {
if (ModStatus.isHoloInventoryLoaded) {
Renderer.INSTANCE.angelicaOverride = true;
HoloInventoryReflectionCompat.setAngelicaOverride(true);
}
}
@@ -226,6 +226,14 @@ public enum Mixins {
.setApplyIf(() -> AngelicaConfig.removeUnicodeEvenScaling)
.addMixinClasses("angelica.bugfixes.MixinScaledResolution_UnicodeFix")),
SECURITYCRAFT_COMPAT(new Builder("Fix reflection in SecurityCraft for compat with Angelica").setPhase(Phase.LATE)
.addTargetedMod(TargetedMod.SECURITYCRAFT).setSide(Side.CLIENT)
.setApplyIf(() -> CompatConfig.fixSecurityCraft)
.addMixinClasses(
"client.securitycraft.MixinBlockReinforcedFenceGate",
"client.securitycraft.MixinBlockReinforcedIronBars"
)),
EXTRA_UTILITIES_THREAD_SAFETY(new Builder("Enable thread safety fixes in Extra Utilities").setPhase(Phase.LATE)
.addTargetedMod(TargetedMod.EXTRAUTILS).setSide(Side.CLIENT)
.setApplyIf(() -> CompatConfig.fixExtraUtils)
@@ -25,6 +25,7 @@ public enum TargetedMod {
, MRTJPCORE("MrTJPCore", null, "MrTJPCoreMod")
, NATURA("Natura", null, "Natura")
, PROJECTRED_ILLUMINATION("ProjectRed Illumination", null, "ProjRed|Illumination")
, SECURITYCRAFT("SecurityCraft", null, "securitycraft")
, SMART_RENDER("Smart Render", null, "SmartRender")
, THAUMCRAFT("Thaumcraft", null, "Thaumcraft")
, TINKERS_CONSTRUCT("Tinker's Construct", null, "TConstruct")
@@ -11,7 +11,7 @@ public class MCPatcherForgeConfig {
@Config(modid = "mcpatcherforge", category = "custom_colors")
public static class CustomColors {
@Config.Comment("Enable the custom colors module")
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean enabled;
@@ -32,31 +32,31 @@ public class MCPatcherForgeConfig {
@Config.RequiresMcRestart
public static int fogBlendRadius;
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean swampColors;
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean water;
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean tree;
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean redstone;
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean stem;
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean otherBlocks;
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean smoothBiomes;
@@ -64,43 +64,43 @@ public class MCPatcherForgeConfig {
@Config.RequiresMcRestart
public static boolean testColorSmoothing;
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean potion;
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean particle;
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean fog;
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean clouds;
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean map;
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean dye;
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean text;
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean xporb;
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean egg;
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean lightmaps;
}
@@ -108,7 +108,7 @@ public class MCPatcherForgeConfig {
@Config(modid = "mcpatcherforge", category = "custom_item_textures")
public static class CustomItemTextures {
@Config.Comment("Enable the custom item textures module")
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean enabled;
@@ -117,15 +117,15 @@ public class MCPatcherForgeConfig {
@Config.RequiresMcRestart
public static LogLevel logging;
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean items;
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean enchantments;
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean armor;
}
@@ -164,7 +164,7 @@ public class MCPatcherForgeConfig {
@Config(modid = "mcpatcherforge", category = "extended_hd")
public static class ExtendedHD {
@Config.Comment("Enable the extended hd module")
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean enabled;
@@ -186,27 +186,27 @@ public class MCPatcherForgeConfig {
@Config.Name("lod bias")
public static int lodBias;
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean animations;
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean fancyCompass;
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean fancyClock;
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean useGL13;
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean useScratchTexture;
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
@Config.Name("HDFont")
public static boolean hdFont;
@@ -223,7 +223,7 @@ public class MCPatcherForgeConfig {
@Config(modid = "mcpatcherforge", category = "random_mobs")
public static class RandomMobs {
@Config.Comment("Enable the random mobs module")
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean enabled;
@@ -232,7 +232,7 @@ public class MCPatcherForgeConfig {
@Config.RequiresMcRestart
public static LogLevel logging;
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean leashLine;
}
@@ -240,7 +240,7 @@ public class MCPatcherForgeConfig {
@Config(modid = "mcpatcherforge", category = "better_skies")
public static class BetterSkies {
@Config.Comment("Enable the better skies module")
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean enabled;
@@ -253,15 +253,15 @@ public class MCPatcherForgeConfig {
@Config.RequiresMcRestart
public static int horizon;
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean brightenFireworks;
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean skybox;
@Config.DefaultBoolean(true)
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean unloadTextures;
}
@@ -9,6 +9,8 @@ import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.EnumSet;
import java.util.Set;
public class VideoSettings {
private final File optionsFile;
@@ -19,11 +21,12 @@ public class VideoSettings {
public void loadSettings() {
try {
if (!optionsFile.exists()) {
if (!optionsFile.exists() && !optionsFile.createNewFile()) {
return;
}
BufferedReader bufferedreader = new BufferedReader(new FileReader(optionsFile));
String settingString;
Set<Settings> loadedSettings = EnumSet.noneOf(Settings.class);
while((settingString = bufferedreader.readLine()) != null) {
try {
@@ -31,12 +34,19 @@ public class VideoSettings {
Settings setting = Settings.valueOf(fragments[0]);
setting.option.deserialize(fragments[1]);
setting.applyChanges();
loadedSettings.add(setting);
} catch (Exception exception) {
NotFine.logger.warn("Skipping bad option: " + settingString);
}
}
bufferedreader.close();
for (Settings setting : Settings.values()) {
if (!loadedSettings.contains(setting)) {
setting.applyChanges();
}
}
} catch (Exception exception) {
NotFine.logger.error("Failed to load options", exception);
}
@@ -17,7 +17,7 @@ public class ChunkModelVertexTransformer extends AbstractVertexTransformer<Model
}
@Override
public void writeQuad(float x, float y, float z, int color, float u, float v, int light) {
this.delegate.writeQuad(x + this.offset.x, y + this.offset.y, z + this.offset.z, color, u, v, light);
public void writeQuad(float x, float y, float z, int color, float u, float v, int light, int shaderBlockId) {
this.delegate.writeQuad(x + this.offset.x, y + this.offset.y, z + this.offset.z, color, u, v, light, shaderBlockId);
}
}
@@ -12,6 +12,7 @@ public interface ModelVertexSink extends VertexSink {
* @param u The u-texture of the vertex
* @param v The y-texture of the vertex
* @param light The packed light-map coordinates of the vertex
* @param shaderBlockId The blockId to be passed to the shader
*/
void writeQuad(float x, float y, float z, int color, float u, float v, int light);
void writeQuad(float x, float y, float z, int color, float u, float v, int light, int shaderBlockId);
}
@@ -14,7 +14,7 @@ public class HFPModelVertexBufferWriterNio extends VertexBufferWriterNio impleme
}
@Override
public void writeQuad(float x, float y, float z, int color, float u, float v, int light) {
public void writeQuad(float x, float y, float z, int color, float u, float v, int light, int shaderBlockId) {
this.writeQuadInternal(
ModelVertexUtil.denormalizeVertexPositionFloatAsShort(x),
ModelVertexUtil.denormalizeVertexPositionFloatAsShort(y),
@@ -14,7 +14,7 @@ public class HFPModelVertexBufferWriterUnsafe extends VertexBufferWriterUnsafe i
}
@Override
public void writeQuad(float x, float y, float z, int color, float u, float v, int light) {
public void writeQuad(float x, float y, float z, int color, float u, float v, int light, int shaderBlockId) {
this.writeQuadInternal(
ModelVertexUtil.denormalizeVertexPositionFloatAsShort(x),
ModelVertexUtil.denormalizeVertexPositionFloatAsShort(y),
@@ -13,7 +13,7 @@ public class SFPModelVertexBufferWriterNio extends VertexBufferWriterNio impleme
}
@Override
public void writeQuad(float x, float y, float z, int color, float u, float v, int light) {
public void writeQuad(float x, float y, float z, int color, float u, float v, int light, int shaderBlockId) {
int i = this.writeOffset;
ByteBuffer buffer = this.byteBuffer;
@@ -13,7 +13,7 @@ public class SFPModelVertexBufferWriterUnsafe extends VertexBufferWriterUnsafe i
}
@Override
public void writeQuad(float x, float y, float z, int color, float u, float v, int light) {
public void writeQuad(float x, float y, float z, int color, float u, float v, int light, int shaderBlockId) {
long i = this.writePointer;
memPutFloat(i, x);
@@ -150,6 +150,7 @@ public class BlockRenderer {
final ModelQuadOrientation order = (useSodiumLight || this.useSeparateAo) ? ModelQuadOrientation.orient(light.br) : ModelQuadOrientation.NORMAL;
int shaderBlockId = quad.getShaderBlockId();
for (int dstIndex = 0; dstIndex < 4; dstIndex++) {
final int srcIndex = order.getVertexIndex(dstIndex);
@@ -173,7 +174,7 @@ public class BlockRenderer {
final int lm = (useSeparateAo) ? ModelQuadUtil.mergeBakedLight(quad.getLight(srcIndex), light.lm[srcIndex]) :
(useSodiumLight) ? light.lm[srcIndex] : quad.getLight(srcIndex);
sink.writeQuad(x, y, z, color, u, v, lm);
sink.writeQuad(x, y, z, color, u, v, lm, shaderBlockId);
}
final TextureAtlasSprite sprite = quad.rubidium$getSprite();
@@ -405,7 +405,7 @@ public class FluidRenderer {
int light = this.quadLightData.lm[vertexIdx];
sink.writeQuad(x, y, z, color, u, v, light);
sink.writeQuad(x, y, z, color, u, v, light, -1);
vertexIdx += lightOrder;
}
+39
View File
@@ -1,13 +1,18 @@
package net.coderbot.iris;
import com.google.common.base.Throwables;
import com.gtnewhorizon.gtnhlib.client.renderer.CapturingTessellator;
import com.gtnewhorizon.gtnhlib.client.renderer.TessellatorManager;
import com.gtnewhorizons.angelica.AngelicaMod;
import com.gtnewhorizons.angelica.Tags;
import com.gtnewhorizons.angelica.config.AngelicaConfig;
import com.mojang.realmsclient.gui.ChatFormatting;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.InputEvent;
import it.unimi.dsi.fastutil.objects.Object2IntMap;
import lombok.Getter;
import net.coderbot.iris.block_rendering.BlockRenderingSettings;
import net.coderbot.iris.config.IrisConfig;
import net.coderbot.iris.gl.shader.StandardMacros;
import net.coderbot.iris.gui.screen.ShaderPackScreen;
@@ -24,7 +29,9 @@ import net.coderbot.iris.shaderpack.option.OptionSet;
import net.coderbot.iris.shaderpack.option.Profile;
import net.coderbot.iris.shaderpack.option.values.MutableOptionValues;
import net.coderbot.iris.shaderpack.option.values.OptionValues;
import net.coderbot.iris.sodium.block_context.BlockContextHolder;
import net.coderbot.iris.texture.pbr.PBRTextureManager;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.multiplayer.WorldClient;
@@ -639,4 +646,36 @@ public class Iris {
ClientRegistry.registerKeyBinding(toggleShadersKeybind);
ClientRegistry.registerKeyBinding(shaderpackScreenKeybind);
}
static BlockContextHolder contextHolder;
private static int getShaderMaterialOverrideId(Block block, int meta) {
if (contextHolder == null) {
final Object2IntMap<Block> blockMatches = BlockRenderingSettings.INSTANCE.getBlockMatches();
if (blockMatches == null) {
return -1;
}
contextHolder = new BlockContextHolder(blockMatches);
}
contextHolder.set(block, (short) block.getRenderType());
return contextHolder.blockId;
}
public static void setShaderMaterialOverride(Block block, int meta) {
if (!AngelicaConfig.enableIris)
return;
int blockId = getShaderMaterialOverrideId(block, meta);
if (TessellatorManager.get() instanceof CapturingTessellator tess)
tess.setShaderBlockId(blockId);
}
public static void resetShaderMaterialOverride() {
if (!AngelicaConfig.enableIris)
return;
if (TessellatorManager.get() instanceof CapturingTessellator tess)
tess.setShaderBlockId(-1);
}
}
@@ -1,5 +1,6 @@
package net.coderbot.iris.gui.screen;
import com.gtnewhorizons.angelica.glsm.GLStateManager;
import com.gtnewhorizons.angelica.loading.AngelicaTweaker;
import net.coderbot.iris.Iris;
import net.coderbot.iris.gui.GuiUtil;
@@ -21,6 +22,7 @@ import org.jetbrains.annotations.Nullable;
import org.lwjgl.Sys;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
import java.io.IOException;
import java.net.URI;
@@ -90,6 +92,8 @@ public class ShaderPackScreen extends GuiScreen implements HudHideable {
}
@Override
public void drawScreen(int mouseX, int mouseY, float delta) {
GLStateManager.glPushAttrib(GL11.GL_COLOR_BUFFER_BIT);
if(dirty) {
dirty = false;
this.initGui();
@@ -167,6 +171,8 @@ public class ShaderPackScreen extends GuiScreen implements HudHideable {
} else {
this.fontRendererObj.drawStringWithShadow(irisTextComponent, 2, this.height - 10, 0xFFFFFF);
}
GLStateManager.glPopAttrib();
}
@Override
@@ -30,7 +30,7 @@ public class XHFPModelVertexBufferWriterNio extends VertexBufferWriterNio implem
}
@Override
public void writeQuad(float x, float y, float z, int color, float u, float v, int light) {
public void writeQuad(float x, float y, float z, int color, float u, float v, int light, int shaderBlockId) {
uSum += u;
vSum += v;
@@ -42,7 +42,7 @@ public class XHFPModelVertexBufferWriterNio extends VertexBufferWriterNio implem
ModelVertexUtil.denormalizeVertexTextureFloatAsShort(u),
ModelVertexUtil.denormalizeVertexTextureFloatAsShort(v),
light,
contextHolder.blockId,
shaderBlockId != -1 ? (short)shaderBlockId : contextHolder.blockId,
contextHolder.renderType,
ExtendedDataHelper.computeMidBlock(x, y, z, contextHolder.localPosX, contextHolder.localPosY, contextHolder.localPosZ)
);
@@ -30,7 +30,7 @@ public class XHFPModelVertexBufferWriterUnsafe extends VertexBufferWriterUnsafe
}
@Override
public void writeQuad(float x, float y, float z, int color, float u, float v, int light) {
public void writeQuad(float x, float y, float z, int color, float u, float v, int light, int shaderBlockId) {
uSum += u;
vSum += v;
@@ -42,7 +42,7 @@ public class XHFPModelVertexBufferWriterUnsafe extends VertexBufferWriterUnsafe
ModelVertexUtil.denormalizeVertexTextureFloatAsShort(u),
ModelVertexUtil.denormalizeVertexTextureFloatAsShort(v),
light,
contextHolder.blockId,
shaderBlockId != -1 ? (short)shaderBlockId : contextHolder.blockId,
contextHolder.renderType,
ExtendedDataHelper.computeMidBlock(x, y, z, contextHolder.localPosX, contextHolder.localPosY, contextHolder.localPosZ)
);
@@ -9,7 +9,6 @@ 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;
import xonin.backhand.client.hooks.ItemRendererHooks;
@Mixin(ItemRenderer.class)
public class MixinItemRendererBackhand {
@@ -21,13 +20,13 @@ public class MixinItemRendererBackhand {
ci.cancel();
if (ModStatus.isBackhandLoaded){
iris$skipTranslucentHandsBackhand(partialTicks, ci);
ItemRendererHooks.renderOffhandReturn(partialTicks);
ModStatus.backhandCompat.renderOffhand(partialTicks);
}
} else if (!HandRenderer.INSTANCE.isRenderingSolid() && !isHandTranslucent) {
ci.cancel();
if (ModStatus.isBackhandLoaded){
iris$skipTranslucentHandsBackhand(partialTicks, ci);
ItemRendererHooks.renderOffhandReturn(partialTicks);
ModStatus.backhandCompat.renderOffhand(partialTicks);
}
}
}
@@ -3,9 +3,12 @@ package com.gtnewhorizons.angelica.mixins.early.shaders;
import com.llamalad7.mixinextras.sugar.Share;
import com.llamalad7.mixinextras.sugar.ref.LocalRef;
import net.coderbot.iris.Iris;
import net.coderbot.iris.layer.GbufferPrograms;
import net.coderbot.iris.pipeline.WorldRenderingPhase;
import net.coderbot.iris.pipeline.WorldRenderingPipeline;
import net.minecraft.client.renderer.RenderGlobal;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.MovingObjectPosition;
import org.lwjgl.opengl.GL11;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
@@ -53,4 +56,12 @@ public class MixinRenderGlobal {
GL11.glRotatef(pipeline.get().getSunPathRotation(), 0.0F, 0.0F, 1.0F);
}
@Inject(method="drawSelectionBox", at=@At(value="HEAD"))
private void iris$startOutline(EntityPlayer player, MovingObjectPosition pos, int p_72731_3_, float p_72731_4_, CallbackInfo ci) {
GbufferPrograms.beginOutline();
}
@Inject(method="drawSelectionBox", at=@At(value="RETURN"))
private void iris$endOutline(EntityPlayer player, MovingObjectPosition pos, int p_72731_3_, float p_72731_4_, CallbackInfo ci) {
GbufferPrograms.endOutline();
}
}
@@ -0,0 +1,30 @@
package com.gtnewhorizons.angelica.mixins.late.client.securitycraft;
import net.geforcemods.securitycraft.blocks.reinforced.BlockReinforcedFenceGate;
import net.minecraft.block.BlockFenceGate;
import net.minecraft.block.material.Material;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(value = BlockReinforcedFenceGate.class, remap = false)
public class MixinBlockReinforcedFenceGate extends BlockFenceGate {
// We're no-oping this method and instead adding the getMaterial override
// Doesn't technically do the same thing as the original, but it's more stable and probably fine
// If need be we could probably set the field based on the field name rather than the index
// but no reflection is better than some reflection
@Redirect(
method = "<init>",
at = @At(
value = "INVOKE",
target = "Lcpw/mods/fml/common/ObfuscationReflectionHelper;setPrivateValue(Ljava/lang/Class;Ljava/lang/Object;Ljava/lang/Object;I)V"
)
)
private void angelica$fixReflection(Class<?> clazz, Object instance, Object value, int fieldIndex) {}
@Override
public Material getMaterial() {
return Material.iron;
}
}
@@ -0,0 +1,22 @@
package com.gtnewhorizons.angelica.mixins.late.client.securitycraft;
import net.geforcemods.securitycraft.blocks.reinforced.BlockReinforcedIronBars;
import net.minecraft.block.Block;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(value = BlockReinforcedIronBars.class, remap = false)
public abstract class MixinBlockReinforcedIronBars {
@Redirect(
method = "<init>",
at = @At(
value = "INVOKE",
target = "Lcpw/mods/fml/common/ObfuscationReflectionHelper;setPrivateValue(Ljava/lang/Class;Ljava/lang/Object;Ljava/lang/Object;I)V"
)
)
private void angelica$fixReflection(Class<?> clazz, Object instance, Object value, int fieldIndex) {
((Block) instance).setStepSound(Block.soundTypeMetal);
}
}