mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-20 20:32:14 +00:00
More TESR fixes, make VBO mixins toggleable
This commit is contained in:
1 parent
2c767f2970
commit
a96a973d44
4 files changed
+28
-2
No files matched your search
@@ -27,6 +27,11 @@ public class AngelicaConfig {
|
||||
@Config.RequiresMcRestart
|
||||
public static boolean enableNotFineOptimizations;
|
||||
|
||||
@Config.Comment("Replace some vanilla render paths with more optimized versions. Disable if you encounter mixin conflicts.")
|
||||
@Config.DefaultBoolean(true)
|
||||
@Config.RequiresMcRestart
|
||||
public static boolean enableVBO;
|
||||
|
||||
@Config.Comment("Enable NotFine features")
|
||||
@Config.DefaultBoolean(true)
|
||||
@Config.RequiresMcRestart
|
||||
|
||||
@@ -29,7 +29,7 @@ public enum Mixins {
|
||||
)
|
||||
),
|
||||
ANGELICA_VBO(
|
||||
new Builder("Angelica VBO").addTargetedMod(TargetedMod.VANILLA).setSide(Side.CLIENT)
|
||||
new Builder("Angelica VBO").addTargetedMod(TargetedMod.VANILLA).setApplyIf(() -> AngelicaConfig.enableVBO).setSide(Side.CLIENT)
|
||||
.setPhase(Phase.EARLY).addMixinClasses(
|
||||
"angelica.vbo.MixinWavefrontObject"
|
||||
,"angelica.vbo.MixinRenderGlobal"
|
||||
@@ -97,6 +97,7 @@ public enum Mixins {
|
||||
,"sodium.MixinBiomeGenBase"
|
||||
,"sodium.MixinChunk"
|
||||
,"sodium.MixinChunkProviderServer"
|
||||
,"sodium.MixinClientRegistry"
|
||||
,"sodium.MixinEntity"
|
||||
,"sodium.MixinRenderManager"
|
||||
,"sodium.MixinExtendedBlockStorage"
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.sodium;
|
||||
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Mixin(ClientRegistry.class)
|
||||
public class MixinClientRegistry {
|
||||
@Redirect(method = "bindTileEntitySpecialRenderer", at = @At(value = "INVOKE", target = "Ljava/util/Map;put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"), remap = false)
|
||||
private static Object skipPuttingNullRenderer(Map instance, Object key, Object value) {
|
||||
if(value != null && key != null) {
|
||||
return instance.put(key, value);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -33,7 +33,7 @@ public class MixinTileEntityRendererDispatcher {
|
||||
*/
|
||||
@Redirect(method = "getSpecialRendererByClass", at = @At(value = "INVOKE", target = "Ljava/util/Map;put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"))
|
||||
private Object skipPuttingNullRenderer(Map instance, Object key, Object value) {
|
||||
if(value != null) {
|
||||
if(value != null && key != null) {
|
||||
return instance.put(key, value);
|
||||
} else {
|
||||
return null;
|
||||
|
||||
Reference in new issue
Block a user