Add more TAWs for custom RenderLayers (#3981)

This commit is contained in:
Aaron 2024-08-04 08:52:54 -04:00 committed by GitHub
parent ba9dae065f
commit 176f90366d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 37 additions and 0 deletions

View file

@ -44,6 +44,8 @@ task generateAccessWidener {
FileSystems.newFileSystem(URI.create("jar:${clientJar.toUri()}"), [create: false]).withCloseable { fs -> FileSystems.newFileSystem(URI.create("jar:${clientJar.toUri()}"), [create: false]).withCloseable { fs ->
generateRenderPhaseFields(lines, fs) generateRenderPhaseFields(lines, fs)
lines.add("")
generateRenderPhaseInnerClasses(lines, fs)
} }
file('src/main/resources/fabric-transitive-access-wideners-v1.accesswidener').text = String.join('\n', lines) + '\n' file('src/main/resources/fabric-transitive-access-wideners-v1.accesswidener').text = String.join('\n', lines) + '\n'
@ -115,6 +117,17 @@ def generateRenderPhaseFields(List<String> lines, FileSystem fs) {
} }
} }
def generateRenderPhaseInnerClasses(List<String> lines, FileSystem fs) {
lines.add("# Protected static inner classes of RenderPhase")
for (def innerClass : loadClass(fs.getPath("net/minecraft/client/render/RenderPhase.class")).innerClasses) {
// All protected static inner classes of RenderPhase
if ((innerClass.access & Opcodes.ACC_PROTECTED) != 0 && (innerClass.access & Opcodes.ACC_STATIC) != 0) {
lines.add("transitive-accessible class net/minecraft/client/render/RenderPhase\$${innerClass.innerName}")
}
}
}
ClassNode loadClass(Path path) { ClassNode loadClass(Path path) {
def node = new ClassNode() def node = new ClassNode()

View file

@ -58,6 +58,9 @@ transitive-accessible class net/minecraft/client/model/ModelPart$Quad
transitive-accessible method net/minecraft/client/render/RenderLayer of (Lnet/minecraft/client/render/RenderPhase$ShaderProgram;)Lnet/minecraft/client/render/RenderLayer$MultiPhaseParameters; transitive-accessible method net/minecraft/client/render/RenderLayer of (Lnet/minecraft/client/render/RenderPhase$ShaderProgram;)Lnet/minecraft/client/render/RenderLayer$MultiPhaseParameters;
transitive-accessible method net/minecraft/client/render/RenderLayer of (Ljava/lang/String;Lnet/minecraft/client/render/VertexFormat;Lnet/minecraft/client/render/VertexFormat$DrawMode;IZZLnet/minecraft/client/render/RenderLayer$MultiPhaseParameters;)Lnet/minecraft/client/render/RenderLayer$MultiPhase; transitive-accessible method net/minecraft/client/render/RenderLayer of (Ljava/lang/String;Lnet/minecraft/client/render/VertexFormat;Lnet/minecraft/client/render/VertexFormat$DrawMode;IZZLnet/minecraft/client/render/RenderLayer$MultiPhaseParameters;)Lnet/minecraft/client/render/RenderLayer$MultiPhase;
transitive-accessible method net/minecraft/client/render/RenderLayer of (Ljava/lang/String;Lnet/minecraft/client/render/VertexFormat;Lnet/minecraft/client/render/VertexFormat$DrawMode;ILnet/minecraft/client/render/RenderLayer$MultiPhaseParameters;)Lnet/minecraft/client/render/RenderLayer$MultiPhase; transitive-accessible method net/minecraft/client/render/RenderLayer of (Ljava/lang/String;Lnet/minecraft/client/render/VertexFormat;Lnet/minecraft/client/render/VertexFormat$DrawMode;ILnet/minecraft/client/render/RenderLayer$MultiPhaseParameters;)Lnet/minecraft/client/render/RenderLayer$MultiPhase;
transitive-accessible class net/minecraft/client/render/RenderLayer$MultiPhase
transitive-accessible class net/minecraft/client/render/RenderLayer$MultiPhaseParameters
transitive-accessible class net/minecraft/client/render/RenderLayer$OutlineMode
# Registering custom block entity renderers # Registering custom block entity renderers
transitive-accessible method net/minecraft/client/render/block/entity/BlockEntityRendererFactories register (Lnet/minecraft/block/entity/BlockEntityType;Lnet/minecraft/client/render/block/entity/BlockEntityRendererFactory;)V transitive-accessible method net/minecraft/client/render/block/entity/BlockEntityRendererFactories register (Lnet/minecraft/block/entity/BlockEntityType;Lnet/minecraft/client/render/block/entity/BlockEntityRendererFactory;)V
@ -333,3 +336,21 @@ transitive-accessible field net/minecraft/client/render/RenderPhase ITEM_ENTITY_
transitive-accessible field net/minecraft/client/render/RenderPhase FULL_LINE_WIDTH Lnet/minecraft/client/render/RenderPhase$LineWidth; transitive-accessible field net/minecraft/client/render/RenderPhase FULL_LINE_WIDTH Lnet/minecraft/client/render/RenderPhase$LineWidth;
transitive-accessible field net/minecraft/client/render/RenderPhase NO_COLOR_LOGIC Lnet/minecraft/client/render/RenderPhase$ColorLogic; transitive-accessible field net/minecraft/client/render/RenderPhase NO_COLOR_LOGIC Lnet/minecraft/client/render/RenderPhase$ColorLogic;
transitive-accessible field net/minecraft/client/render/RenderPhase OR_REVERSE Lnet/minecraft/client/render/RenderPhase$ColorLogic; transitive-accessible field net/minecraft/client/render/RenderPhase OR_REVERSE Lnet/minecraft/client/render/RenderPhase$ColorLogic;
# Protected static inner classes of RenderPhase
transitive-accessible class net/minecraft/client/render/RenderPhase$Transparency
transitive-accessible class net/minecraft/client/render/RenderPhase$ShaderProgram
transitive-accessible class net/minecraft/client/render/RenderPhase$Texture
transitive-accessible class net/minecraft/client/render/RenderPhase$TextureBase
transitive-accessible class net/minecraft/client/render/RenderPhase$Texturing
transitive-accessible class net/minecraft/client/render/RenderPhase$Lightmap
transitive-accessible class net/minecraft/client/render/RenderPhase$Overlay
transitive-accessible class net/minecraft/client/render/RenderPhase$Cull
transitive-accessible class net/minecraft/client/render/RenderPhase$DepthTest
transitive-accessible class net/minecraft/client/render/RenderPhase$WriteMaskState
transitive-accessible class net/minecraft/client/render/RenderPhase$Layering
transitive-accessible class net/minecraft/client/render/RenderPhase$Target
transitive-accessible class net/minecraft/client/render/RenderPhase$LineWidth
transitive-accessible class net/minecraft/client/render/RenderPhase$ColorLogic
transitive-accessible class net/minecraft/client/render/RenderPhase$OffsetTexturing
transitive-accessible class net/minecraft/client/render/RenderPhase$Textures

View file

@ -53,6 +53,9 @@ transitive-accessible class net/minecraft/client/model/ModelPart$Quad
transitive-accessible method net/minecraft/client/render/RenderLayer of (Lnet/minecraft/client/render/RenderPhase$ShaderProgram;)Lnet/minecraft/client/render/RenderLayer$MultiPhaseParameters; transitive-accessible method net/minecraft/client/render/RenderLayer of (Lnet/minecraft/client/render/RenderPhase$ShaderProgram;)Lnet/minecraft/client/render/RenderLayer$MultiPhaseParameters;
transitive-accessible method net/minecraft/client/render/RenderLayer of (Ljava/lang/String;Lnet/minecraft/client/render/VertexFormat;Lnet/minecraft/client/render/VertexFormat$DrawMode;IZZLnet/minecraft/client/render/RenderLayer$MultiPhaseParameters;)Lnet/minecraft/client/render/RenderLayer$MultiPhase; transitive-accessible method net/minecraft/client/render/RenderLayer of (Ljava/lang/String;Lnet/minecraft/client/render/VertexFormat;Lnet/minecraft/client/render/VertexFormat$DrawMode;IZZLnet/minecraft/client/render/RenderLayer$MultiPhaseParameters;)Lnet/minecraft/client/render/RenderLayer$MultiPhase;
transitive-accessible method net/minecraft/client/render/RenderLayer of (Ljava/lang/String;Lnet/minecraft/client/render/VertexFormat;Lnet/minecraft/client/render/VertexFormat$DrawMode;ILnet/minecraft/client/render/RenderLayer$MultiPhaseParameters;)Lnet/minecraft/client/render/RenderLayer$MultiPhase; transitive-accessible method net/minecraft/client/render/RenderLayer of (Ljava/lang/String;Lnet/minecraft/client/render/VertexFormat;Lnet/minecraft/client/render/VertexFormat$DrawMode;ILnet/minecraft/client/render/RenderLayer$MultiPhaseParameters;)Lnet/minecraft/client/render/RenderLayer$MultiPhase;
transitive-accessible class net/minecraft/client/render/RenderLayer$MultiPhase
transitive-accessible class net/minecraft/client/render/RenderLayer$MultiPhaseParameters
transitive-accessible class net/minecraft/client/render/RenderLayer$OutlineMode
# Registering custom block entity renderers # Registering custom block entity renderers
transitive-accessible method net/minecraft/client/render/block/entity/BlockEntityRendererFactories register (Lnet/minecraft/block/entity/BlockEntityType;Lnet/minecraft/client/render/block/entity/BlockEntityRendererFactory;)V transitive-accessible method net/minecraft/client/render/block/entity/BlockEntityRendererFactories register (Lnet/minecraft/block/entity/BlockEntityType;Lnet/minecraft/client/render/block/entity/BlockEntityRendererFactory;)V