mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-21 04:42:17 +00:00
Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7da9b9eb1c | ||
|
|
02c394108f | ||
|
|
720aaca1b7 | ||
|
|
1e71b1c4d8 | ||
|
|
df4c423e93 | ||
|
|
78e0074e5a |
No files matched your search
@@ -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]
|
||||
|
||||
+2
-1
@@ -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
|
||||
@@ -99,6 +99,7 @@ dependencies {
|
||||
|
||||
compileOnly(rfg.deobf("curse.maven:campfirebackport-387444:4611675"))
|
||||
compileOnly(rfg.deobf("curse.maven:xaeros-minimap-263420:5060684"))
|
||||
compileOnly(rfg.deobf("curse.maven:security-craft-64760:2818228"))
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:HoloInventory:2.5.1-GTNH:dev")
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
+2
-2
@@ -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);
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -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);
|
||||
}
|
||||
+1
-1
@@ -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),
|
||||
|
||||
+1
-1
@@ -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),
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
CapturingTessellator tess = (CapturingTessellator) TessellatorManager.get();
|
||||
tess.setShaderBlockId(blockId);
|
||||
}
|
||||
|
||||
public static void resetShaderMaterialOverride() {
|
||||
if (!AngelicaConfig.enableIris)
|
||||
return;
|
||||
CapturingTessellator tess = (CapturingTessellator) TessellatorManager.get();
|
||||
tess.setShaderBlockId(-1);
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -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)
|
||||
);
|
||||
|
||||
+2
-2
@@ -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)
|
||||
);
|
||||
|
||||
+30
@@ -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;
|
||||
}
|
||||
}
|
||||
+22
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user