mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-17 02:55:02 +00:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
203b552993 | ||
|
|
96e2f42251 |
No files matched your search
@@ -97,6 +97,9 @@ dependencies {
|
||||
// Hodgepodge
|
||||
transformedMod("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev")
|
||||
|
||||
// Better Crashes
|
||||
compileOnly("com.github.GTNewHorizons:BetterCrashes:1.4.0-GTNH:dev")
|
||||
|
||||
|
||||
// Tests
|
||||
testImplementation(platform('org.junit:junit-bom:5.9.2'))
|
||||
|
||||
@@ -16,6 +16,7 @@ public class ModStatus {
|
||||
*/
|
||||
public static boolean isOldNEIDLoaded;
|
||||
|
||||
public static boolean isBetterCrashesLoaded;
|
||||
public static boolean isNEIDMetadataExtended;
|
||||
public static boolean isLotrLoaded;
|
||||
public static boolean isChunkAPILoaded;
|
||||
@@ -24,6 +25,7 @@ public class ModStatus {
|
||||
public static boolean isHoloInventoryLoaded;
|
||||
|
||||
public static void preInit(){
|
||||
isBetterCrashesLoaded = Loader.isModLoaded("bettercrashes");
|
||||
isNEIDLoaded = Loader.isModLoaded("neid");
|
||||
isOldNEIDLoaded = Loader.isModLoaded("notenoughIDs");
|
||||
isLotrLoaded = Loader.isModLoaded("lotr");
|
||||
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package com.gtnewhorizons.angelica.compat.bettercrashes;
|
||||
|
||||
import com.gtnewhorizons.angelica.glsm.GLStateManager;
|
||||
import com.gtnewhorizons.angelica.mixins.interfaces.IRenderGlobalExt;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import vfyjxf.bettercrashes.utils.StateManager;
|
||||
|
||||
import static com.gtnewhorizons.angelica.loading.AngelicaTweaker.LOGGER;
|
||||
|
||||
@Optional.Interface(modid = "angelica", iface = "vfyjxf.bettercrashes.utils.StateManager.IResettable")
|
||||
public class BetterCrashesCompat implements StateManager.IResettable {
|
||||
private static BetterCrashesCompat INSTANCE;
|
||||
|
||||
public static void init() {
|
||||
if (INSTANCE == null) {
|
||||
INSTANCE = new BetterCrashesCompat();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public BetterCrashesCompat() {
|
||||
LOGGER.info("BetterCrashesCompat initialized");
|
||||
this.register();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetState() {
|
||||
LOGGER.info("Reloading SodiumRenderer");
|
||||
((IRenderGlobalExt) Minecraft.getMinecraft().renderGlobal).reload();
|
||||
LOGGER.info("Resetting GLStateManager");
|
||||
GLStateManager.reset();
|
||||
}
|
||||
}
|
||||
@@ -105,7 +105,6 @@ public class GLStateManager {
|
||||
@Getter protected static final DepthStateStack depthState = new DepthStateStack();
|
||||
@Getter protected static final BooleanStateStack depthTest = new BooleanStateStack(GL11.GL_DEPTH_TEST);
|
||||
|
||||
// @Getter private static final FogState fogState = new FogState();
|
||||
@Getter protected static final FogStateStack fogState = new FogStateStack();
|
||||
@Getter protected static final BooleanStateStack fogMode = new BooleanStateStack(GL11.GL_FOG);
|
||||
@Getter protected static final Color4Stack color = new Color4Stack();
|
||||
@@ -125,6 +124,19 @@ public class GLStateManager {
|
||||
|
||||
@Getter protected static final ViewPortStateStack viewportState = new ViewPortStateStack();
|
||||
|
||||
public static void reset() {
|
||||
runningSplash = true;
|
||||
while(!attribs.isEmpty()) {
|
||||
attribs.popInt();
|
||||
}
|
||||
for(IStateStack<?> stack : Feature.maskToFeatures(GL11.GL_ALL_ATTRIB_BITS)) {
|
||||
while(!stack.isEmpty()) {
|
||||
stack.pop();
|
||||
}
|
||||
}
|
||||
modelViewMatrix.clear();
|
||||
projectionMatrix.clear();
|
||||
}
|
||||
|
||||
// Iris Listeners
|
||||
private static Runnable blendFuncListener = null;
|
||||
|
||||
@@ -34,4 +34,7 @@ public class AlphaStateStack extends AlphaState implements IStateStack<AlphaStat
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return pointer == 0;
|
||||
}
|
||||
}
|
||||
@@ -34,4 +34,7 @@ public class BlendStateStack extends BlendState implements IStateStack<BlendStat
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return pointer == 0;
|
||||
}
|
||||
}
|
||||
@@ -39,4 +39,7 @@ public class BooleanStateStack extends BooleanState implements IStateStack<Boole
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return pointer == 0;
|
||||
}
|
||||
}
|
||||
@@ -39,4 +39,7 @@ public class Color4Stack extends Color4 implements IStateStack<Color4Stack> {
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return pointer == 0;
|
||||
}
|
||||
}
|
||||
@@ -34,4 +34,7 @@ public class ColorMaskStack extends ColorMask implements IStateStack<ColorMaskSt
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return pointer == 0;
|
||||
}
|
||||
}
|
||||
@@ -34,4 +34,7 @@ public class DepthStateStack extends DepthState implements IStateStack<DepthStat
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return pointer == 0;
|
||||
}
|
||||
}
|
||||
@@ -34,4 +34,7 @@ public class FogStateStack extends FogState implements IStateStack<FogStateStack
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return pointer == 0;
|
||||
}
|
||||
}
|
||||
@@ -6,4 +6,6 @@ public interface IStateStack<T>{
|
||||
|
||||
T pop();
|
||||
|
||||
boolean isEmpty();
|
||||
|
||||
}
|
||||
@@ -39,4 +39,7 @@ public class IntegerStateStack extends IntegerState implements IStateStack<Integ
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return pointer == 0;
|
||||
}
|
||||
}
|
||||
@@ -34,4 +34,7 @@ public class MatrixModeStack extends MatrixMode implements IStateStack<MatrixMod
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return pointer == 0;
|
||||
}
|
||||
}
|
||||
@@ -37,4 +37,8 @@ public class TextureBindingStack extends TextureBinding implements IStateStack<T
|
||||
public TextureBinding peek() {
|
||||
return stack[pointer];
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return pointer == 0;
|
||||
}
|
||||
}
|
||||
@@ -32,4 +32,8 @@ public class Vector3dStack extends Vector3d implements IStateStack<Vector3dStack
|
||||
set(stack[--pointer]);
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return pointer == 0;
|
||||
}
|
||||
}
|
||||
@@ -34,4 +34,7 @@ public class ViewPortStateStack extends ViewportState implements IStateStack<Vie
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return pointer == 0;
|
||||
}
|
||||
}
|
||||
@@ -385,7 +385,7 @@ public enum Mixins {
|
||||
),
|
||||
MCPATCHER_FORGE_CUSTOM_ITEM_TEXTURES(new Builder("MCP:F Custom Item Textures")
|
||||
.setSide(Side.CLIENT).setPhase(Phase.EARLY)
|
||||
.setApplyIf(() -> AngelicaConfig.enableNotFineFeatures && MCPatcherForgeConfig.instance().customItemTexturesEnabled)
|
||||
.setApplyIf(() -> AngelicaConfig.enableMCPatcherForgeFeatures && MCPatcherForgeConfig.instance().customItemTexturesEnabled)
|
||||
.addTargetedMod(TargetedMod.VANILLA)
|
||||
.addMixinClasses(addPrefix("mcpatcherforge.cit.",
|
||||
"client.renderer.entity.MixinRenderBiped",
|
||||
@@ -410,7 +410,7 @@ public enum Mixins {
|
||||
),
|
||||
MCPATCHER_FORGE_EXTENDED_HD(new Builder("MCP:F Extended hd")
|
||||
.setSide(Side.CLIENT).setPhase(Phase.EARLY)
|
||||
.setApplyIf(() -> AngelicaConfig.enableNotFineFeatures && MCPatcherForgeConfig.instance().extendedHDEnabled)
|
||||
.setApplyIf(() -> AngelicaConfig.enableMCPatcherForgeFeatures && MCPatcherForgeConfig.instance().extendedHDEnabled)
|
||||
.addTargetedMod(TargetedMod.VANILLA)
|
||||
.addMixinClasses(addPrefix("mcpatcherforge.hd.",
|
||||
"MixinTextureClock",
|
||||
@@ -420,7 +420,7 @@ public enum Mixins {
|
||||
),
|
||||
MCPATCHER_FORGE_EXTENDED_HD_FONT(new Builder("MCP:F Extended HD Font")
|
||||
.setSide(Side.CLIENT).setPhase(Phase.EARLY)
|
||||
.setApplyIf(() -> (AngelicaConfig.enableNotFineFeatures && MCPatcherForgeConfig.instance().extendedHDEnabled && MCPatcherForgeConfig.instance().hdFont))
|
||||
.setApplyIf(() -> (AngelicaConfig.enableMCPatcherForgeFeatures && MCPatcherForgeConfig.instance().extendedHDEnabled && MCPatcherForgeConfig.instance().hdFont))
|
||||
.addTargetedMod(TargetedMod.VANILLA)
|
||||
.addExcludedMod(TargetedMod.COFHCORE)
|
||||
.addMixinClasses("mcpatcherforge.hd.MixinFontRenderer")
|
||||
|
||||
@@ -254,6 +254,10 @@ public class MixinRenderGlobal implements IRenderGlobalExt {
|
||||
|
||||
@Inject(method = "loadRenderers", at = @At("RETURN"))
|
||||
private void onReload(CallbackInfo ci) {
|
||||
reload();
|
||||
}
|
||||
|
||||
public void reload() {
|
||||
RenderDevice.enterManagedCode();
|
||||
|
||||
try {
|
||||
|
||||
@@ -2,5 +2,6 @@ package com.gtnewhorizons.angelica.mixins.interfaces;
|
||||
|
||||
public interface IRenderGlobalExt {
|
||||
void scheduleTerrainUpdate();
|
||||
void reload();
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.gtnewhorizons.angelica.proxy;
|
||||
import com.google.common.base.Objects;
|
||||
import com.gtnewhorizons.angelica.common.BlockTest;
|
||||
import com.gtnewhorizons.angelica.compat.ModStatus;
|
||||
import com.gtnewhorizons.angelica.compat.bettercrashes.BetterCrashesCompat;
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import com.gtnewhorizons.angelica.glsm.GLStateManager;
|
||||
import com.gtnewhorizons.angelica.glsm.debug.OpenGLDebugging;
|
||||
@@ -81,7 +82,7 @@ public class ClientProxy extends CommonProxy {
|
||||
if(AngelicaConfig.enableSodium) {
|
||||
// Register all blocks. Because blockids are unique to a world, this must be done each load
|
||||
GameData.getBlockRegistry().forEach(o -> {
|
||||
|
||||
|
||||
final Block b = (Block) o;
|
||||
AngelicaBlockSafetyRegistry.canBlockRenderOffThread(b, true, true);
|
||||
AngelicaBlockSafetyRegistry.canBlockRenderOffThread(b, false, true);
|
||||
@@ -119,6 +120,10 @@ public class ClientProxy extends CommonProxy {
|
||||
ClientRegistry.registerKeyBinding(glsmKeyBinding);
|
||||
|
||||
Loader.loadModels();
|
||||
|
||||
if(ModStatus.isBetterCrashesLoaded) {
|
||||
BetterCrashesCompat.init();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean wasGLSMKeyPressed;
|
||||
|
||||
Reference in new issue
Block a user