Compare commits

..
Author SHA1 Message Date
embeddedt ac60c01788 Delete vanilla block bounds fields 2023-12-27 09:06:16 -08:00
Caedis 9410902937 Add FalseTweaks and SmoothFont to temp incompatibilities (#70)
* Update README.MD

Add FalseTweaks to temp incompatibilities

* and add SmoothFont
2023-12-27 03:59:27 -06:00
Jason Mitchell 52776530d8 Handle GL_COMPILE separately from GL_COMPILE_AND_EXECUTE
* Should fix OpenComputer issues
2023-12-26 17:19:35 -08:00
Jason Mitchell 9cebb352ad Opt in debug
* Less stutter with buggy stuff
2023-12-26 15:12:44 -08:00
embeddedt d810eaf876 Use client world for main thread renders 2023-12-26 12:45:45 -08:00
Jason Mitchell 1a1ca32721 Update 000-report-bug.yml 2023-12-26 09:10:00 -08:00
9 changed files with 74 additions and 25 deletions

No files matched your search

+3 -3
View File
@@ -45,9 +45,9 @@ body:
- type: textarea
id: modlist
attributes:
label: Mod List
description: "List of mods, ideally a minimal reproducible set (can be retrieved from latest.log)"
placeholder: "List of mods go here"
label: Mod List or GTNH Pack Version
description: "List of mods, ideally a minimal reproducible set (can be retrieved from latest.log). If using GTNH please indicate pack version and any changed mods, not the entire modlist."
placeholder: "List of mods or GTNH Pack version goes here"
validations:
required: true
- type: checkboxes
+2
View File
@@ -9,6 +9,8 @@
* Forge Relocation - Currently non Thread Safe; safe if not in use
* ProjectRed Frames - Currently non Thread Safe; safe if not in use
* EndlessIDs - Future compat planned
* FalseTweaks - Future compat planned
* SmoothFont - Future compat planned
* RPLE - Future compat planned
# Permanent Incompatibilities
@@ -1,5 +1,6 @@
package com.gtnewhorizons.angelica.glsm;
import com.gtnewhorizons.angelica.AngelicaMod;
import com.gtnewhorizons.angelica.config.AngelicaConfig;
import com.gtnewhorizons.angelica.glsm.states.AlphaState;
import com.gtnewhorizons.angelica.glsm.states.BlendState;
@@ -85,7 +86,7 @@ public class GLStateManager {
private static Thread CurrentThread = MainThread;
private static boolean runningSplash = false;
private static boolean inGLNewList = false;
private static int glListMode = 0;
private static boolean hudCaching$blendEnabled;
@@ -399,10 +400,12 @@ public class GLStateManager {
}
public static void glBindTexture(int target, int texture) {
if(inGLNewList) {
// Binding a texture, while building a list, is not allowed and is a silent noop
Throwable throwable = new Throwable();
LOGGER.info("Naughty naughty, someone's making a texture binding in a display list!", throwable);
if(glListMode == GL11.GL_COMPILE ) {
if(AngelicaMod.lwjglDebug) {
// Binding a texture, while building a list, is not allowed and is a silent noop
final Throwable throwable = new Throwable();
LOGGER.info("Naughty naughty, someone's making a texture binding in a display list!", throwable);
}
return;
}
@@ -666,18 +669,19 @@ public class GLStateManager {
}
public static void glNewList(int list, int mode) {
if(inGLNewList) {
if(glListMode > 0) {
throw new RuntimeException("glNewList called inside of a display list!");
}
inGLNewList = true;
glListMode = mode;
GL11.glNewList(list, mode);
}
public static void glEndList() {
if(!inGLNewList) {
if(glListMode == 0) {
throw new RuntimeException("glEndList called outside of a display list!");
}
inGLNewList = false;
glListMode = 0;
GL11.glEndList();
}
@@ -1,5 +1,6 @@
package com.gtnewhorizons.angelica.loading;
import com.gtnewhorizons.angelica.transform.BlockTransformer;
import com.gtnewhorizons.angelica.transform.RedirectorTransformer;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.relauncher.FMLLaunchHandler;
@@ -74,6 +75,7 @@ public class MixinCompatHackTweaker implements ITweaker {
if (FMLLaunchHandler.side().isClient()) {
// Run after Mixins, but before LWJGl3ify
Launch.classLoader.registerTransformer(RedirectorTransformer.class.getName());
Launch.classLoader.registerTransformer(BlockTransformer.class.getName());
}
return new String[0];
@@ -1,5 +1,6 @@
package com.gtnewhorizons.angelica.mixins.early.sodium.startup;
import com.gtnewhorizons.angelica.AngelicaMod;
import com.gtnewhorizons.angelica.glsm.GLStateManager;
import com.gtnewhorizons.angelica.loading.AngelicaTweaker;
import net.coderbot.iris.Iris;
@@ -19,7 +20,7 @@ public class MixinInitDebug {
}
// Temp -- move this into common debug code
Iris.identifyCapabilities();
Iris.setDebug(true);
Iris.setDebug(AngelicaMod.lwjglDebug);
}
}
@@ -0,0 +1,44 @@
package com.gtnewhorizons.angelica.transform;
import com.google.common.collect.ImmutableList;
import net.minecraft.launchwrapper.IClassTransformer;
import org.apache.commons.lang3.tuple.Pair;
import org.spongepowered.asm.lib.ClassReader;
import org.spongepowered.asm.lib.ClassWriter;
import org.spongepowered.asm.lib.tree.ClassNode;
import java.util.List;
public class BlockTransformer implements IClassTransformer {
public static final String BlockClass = "net/minecraft/block/Block";
private static final String BlockClassFriendly = BlockClass.replace('/', '.');
public static final List<Pair<String, String>> BlockBoundsFields = ImmutableList.of(
Pair.of("minX", "field_149759_B"),
Pair.of("minY", "field_149760_C"),
Pair.of("minZ", "field_149754_D"),
Pair.of("maxX", "field_149755_E"),
Pair.of("maxY", "field_149756_F"),
Pair.of("maxZ", "field_149757_G")
);
/**
* Delete the global vanilla bounding box fields off the Block object. {@link RedirectorTransformer}
* replaces these with a thread-safe alternative.
*/
@Override
public byte[] transform(String name, String transformedName, byte[] basicClass) {
if(basicClass != null && transformedName.equals(BlockClassFriendly)) {
final ClassReader cr = new ClassReader(basicClass);
final ClassNode cn = new ClassNode();
cr.accept(cn, 0);
cn.fields.removeIf(node -> BlockBoundsFields.stream().anyMatch(pair -> node.name.equals(pair.getLeft()) || node.name.equals(pair.getRight())));
ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
cn.accept(cw);
basicClass = cw.toByteArray();
}
return basicClass;
}
}
@@ -31,6 +31,8 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import static com.gtnewhorizons.angelica.transform.BlockTransformer.*;
/**
* This transformer redirects all Tessellator.instance field accesses to go through our TessellatorManager.
* As well as redirect some GL calls to our custom GLStateManager
@@ -50,7 +52,6 @@ public class RedirectorTransformer implements IClassTransformer {
private static final String EXTBlendFunc = "org/lwjgl/opengl/EXTBlendFuncSeparate";
private static final String ARBMultiTexture = "org/lwjgl/opengl/ARBMultitexture";
private static final String TessellatorClass = "net/minecraft/client/renderer/Tessellator";
private static final String BlockClass = "net/minecraft/block/Block";
private static final String MinecraftClient = "net.minecraft.client";
private static final String SplashProgress = "cpw.mods.fml.client.SplashProgress";
private static final String ThreadedBlockData = "com/gtnewhorizons/angelica/glsm/ThreadedBlockData";
@@ -59,15 +60,6 @@ public class RedirectorTransformer implements IClassTransformer {
"initializeTextures", "func_77474_a"
);
private static final List<Pair<String, String>> BlockBoundsFields = ImmutableList.of(
Pair.of("minX", "field_149759_B"),
Pair.of("minY", "field_149760_C"),
Pair.of("minZ", "field_149754_D"),
Pair.of("maxX", "field_149755_E"),
Pair.of("maxY", "field_149756_F"),
Pair.of("maxZ", "field_149757_G")
);
private static final ClassConstantPoolParser cstPoolParser = new ClassConstantPoolParser(GL11, GL13, GL14, OpenGlHelper, EXTBlendFunc, ARBMultiTexture, TessellatorClass, BlockClass,
Project);
private static final Map<String, Map<String, String>> methodRedirects = new HashMap<>();
@@ -229,7 +229,7 @@ public class ChunkRenderRebuildTask<T extends ChunkGraphicsState> extends ChunkR
int baseY = this.render.getOriginY();
int baseZ = this.render.getOriginZ();
BlockPos renderOffset = this.offset;
RenderBlocks rb = new RenderBlocks(slice);
RenderBlocks rb = new RenderBlocks(slice.getWorld());
for (int relY = 0; relY < 16; relY++) {
if (cancellationSource.isCancelled()) {
return;
@@ -258,7 +258,7 @@ public class ChunkRenderRebuildTask<T extends ChunkGraphicsState> extends ChunkR
long seed = MathUtil.hashPos(pos.x, pos.y, pos.z);
if(AngelicaConfig.enableIris) buffers.iris$setMaterialId(block, ExtendedDataHelper.BLOCK_RENDER_TYPE);
if (cache.getBlockRenderer().renderModel(cache.getWorldSlice(), Tessellator.instance, rb, block, meta, pos, buffers.get(pass), true, seed)) {
if (cache.getBlockRenderer().renderModel(slice.getWorld(), Tessellator.instance, rb, block, meta, pos, buffers.get(pass), true, seed)) {
bounds.addBlock(relX, relY, relZ);
}
}
@@ -355,4 +355,8 @@ public class WorldSlice implements IBlockAccess {
case UNKNOWN -> 1.0f;
};
}
public World getWorld() {
return this.world;
}
}