diff options
author | Glease <4586901+Glease@users.noreply.github.com> | 2023-10-27 05:11:52 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-26 23:11:52 +0200 |
commit | 30b50a2ff5afa649c45b15696358f3e48db2924e (patch) | |
tree | 3317be240716c4138c19b6acd5759863c30fea60 /src/main/java/gtPlusPlus/preloader/asm | |
parent | ae0c26101ab49a040f00089fff65015b4c503ae1 (diff) | |
download | GT5-Unofficial-30b50a2ff5afa649c45b15696358f3e48db2924e.tar.gz GT5-Unofficial-30b50a2ff5afa649c45b15696358f3e48db2924e.tar.bz2 GT5-Unofficial-30b50a2ff5afa649c45b15696358f3e48db2924e.zip |
add back classes referenced by code injected with asm (#772)
* add back classes referenced by code injected with asm
* remove chunk debugging since the related command is removed
Diffstat (limited to 'src/main/java/gtPlusPlus/preloader/asm')
3 files changed, 0 insertions, 1256 deletions
diff --git a/src/main/java/gtPlusPlus/preloader/asm/AsmConfig.java b/src/main/java/gtPlusPlus/preloader/asm/AsmConfig.java index 8cdc772c39..b11eb66801 100644 --- a/src/main/java/gtPlusPlus/preloader/asm/AsmConfig.java +++ b/src/main/java/gtPlusPlus/preloader/asm/AsmConfig.java @@ -19,7 +19,6 @@ public class AsmConfig { public static boolean enableGtTooltipFix; public static boolean enableGtNbtFix; public static boolean enableGtCharcoalPitFix; - public static boolean enableChunkDebugging; public static boolean enableCofhPatch; public static boolean enableTcAspectSafety; public static boolean enabledLwjglKeybindingFix; @@ -64,12 +63,6 @@ public class AsmConfig { enabledFixEntitySetHealth = prop.getBoolean(false); propOrderDebug.add(prop.getName()); - prop = config.get("debug", "enableChunkDebugging", false); - prop.comment = "Enable/Disable Chunk Debugging Features, Must Be enabled on Client and Server."; - prop.setLanguageKey("gtpp.enableChunkDebugging").setRequiresMcRestart(true); - enableChunkDebugging = prop.getBoolean(false); - propOrderDebug.add(prop.getName()); - prop = config.get("debug", "enableGtNbtFix", true); prop.comment = "Enable/Disable GT NBT Persistency Fix"; prop.setLanguageKey("gtpp.enableGtNbtFix").setRequiresMcRestart(true); @@ -126,7 +119,6 @@ public class AsmConfig { config.save(); } - Preloader_Logger.INFO("Chunk Debugging - Enabled: " + enableChunkDebugging); Preloader_Logger.INFO("Gt Nbt Fix - Enabled: " + enableGtNbtFix); Preloader_Logger.INFO("Gt Tooltip Fix - Enabled: " + enableGtTooltipFix); Preloader_Logger.INFO("COFH Patch - Enabled: " + enableCofhPatch); diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Forge_ChunkLoading.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Forge_ChunkLoading.java deleted file mode 100644 index 9b6ec4bb25..0000000000 --- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_Forge_ChunkLoading.java +++ /dev/null @@ -1,1242 +0,0 @@ -package gtPlusPlus.preloader.asm.transformers; - -import static org.objectweb.asm.Opcodes.AASTORE; -import static org.objectweb.asm.Opcodes.ACC_PUBLIC; -import static org.objectweb.asm.Opcodes.ACC_STATIC; -import static org.objectweb.asm.Opcodes.ACONST_NULL; -import static org.objectweb.asm.Opcodes.ALOAD; -import static org.objectweb.asm.Opcodes.ANEWARRAY; -import static org.objectweb.asm.Opcodes.ARETURN; -import static org.objectweb.asm.Opcodes.ASM5; -import static org.objectweb.asm.Opcodes.ASTORE; -import static org.objectweb.asm.Opcodes.ATHROW; -import static org.objectweb.asm.Opcodes.CHECKCAST; -import static org.objectweb.asm.Opcodes.DUP; -import static org.objectweb.asm.Opcodes.F_APPEND; -import static org.objectweb.asm.Opcodes.F_FULL; -import static org.objectweb.asm.Opcodes.F_SAME; -import static org.objectweb.asm.Opcodes.GETFIELD; -import static org.objectweb.asm.Opcodes.GETSTATIC; -import static org.objectweb.asm.Opcodes.GOTO; -import static org.objectweb.asm.Opcodes.ICONST_0; -import static org.objectweb.asm.Opcodes.ICONST_1; -import static org.objectweb.asm.Opcodes.ICONST_2; -import static org.objectweb.asm.Opcodes.ICONST_3; -import static org.objectweb.asm.Opcodes.IFEQ; -import static org.objectweb.asm.Opcodes.IFLE; -import static org.objectweb.asm.Opcodes.IFNE; -import static org.objectweb.asm.Opcodes.IFNONNULL; -import static org.objectweb.asm.Opcodes.IFNULL; -import static org.objectweb.asm.Opcodes.IF_ACMPNE; -import static org.objectweb.asm.Opcodes.IF_ICMPLE; -import static org.objectweb.asm.Opcodes.IF_ICMPLT; -import static org.objectweb.asm.Opcodes.ILOAD; -import static org.objectweb.asm.Opcodes.INTEGER; -import static org.objectweb.asm.Opcodes.INVOKEINTERFACE; -import static org.objectweb.asm.Opcodes.INVOKESPECIAL; -import static org.objectweb.asm.Opcodes.INVOKESTATIC; -import static org.objectweb.asm.Opcodes.INVOKEVIRTUAL; -import static org.objectweb.asm.Opcodes.ISTORE; -import static org.objectweb.asm.Opcodes.NEW; -import static org.objectweb.asm.Opcodes.POP; -import static org.objectweb.asm.Opcodes.RETURN; -import static org.objectweb.asm.Opcodes.TOP; - -import org.apache.logging.log4j.Level; -import org.objectweb.asm.ClassReader; -import org.objectweb.asm.ClassVisitor; -import org.objectweb.asm.ClassWriter; -import org.objectweb.asm.Label; -import org.objectweb.asm.MethodVisitor; - -import cpw.mods.fml.relauncher.FMLRelaunchLog; - -public class ClassTransformer_Forge_ChunkLoading { - - // The qualified name of the class we plan to transform. - private static final String className = "net.minecraftforge.common.ForgeChunkManager"; - // net/minecraftforge/common/ForgeChunkManager - - private final boolean isValid; - private final ClassReader reader; - private final ClassWriter writer; - - String aChunkCoordIntPair; - String aItemStack; - String aWorld; - String aEntity; - - private static boolean doesMethodAlreadyExist = false; - - public ClassTransformer_Forge_ChunkLoading(byte[] basicClass, boolean obfuscated) { - - ClassReader aTempReader; - ClassWriter aTempWriter; - - aTempReader = new ClassReader(basicClass); - aTempWriter = new ClassWriter(aTempReader, ClassWriter.COMPUTE_FRAMES); - aTempReader.accept(new localClassVisitor(aTempWriter), 0); - - if (aTempReader != null && aTempWriter != null) { - isValid = true; - } else { - isValid = false; - } - reader = aTempReader; - writer = aTempWriter; - - if (reader != null && writer != null && !doesMethodAlreadyExist) { - - aChunkCoordIntPair = "net/minecraft/world/ChunkCoordIntPair"; - aWorld = "net/minecraft/world/World"; - aEntity = "net/minecraft/entity/Entity"; - - injectMethod("forceChunk"); - injectMethod("unforceChunk"); - injectMethod("requestTicket"); - injectMethod("releaseTicket"); - } - } - - public ClassWriter getWriter() { - return writer; - } - - public void injectMethod(String aMethodName) { - MethodVisitor mv; - FMLRelaunchLog.log( - "[GT++ ASM] Chunkloading Patch", - Level.INFO, - "Injecting " + aMethodName + " into " + className + "."); - switch (aMethodName) { - case "forceChunk" -> { - - mv = getWriter().visitMethod( - ACC_PUBLIC + ACC_STATIC, - "forceChunk", - "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;L" + aChunkCoordIntPair + ";)V", - null, - null); - mv.visitCode(); - Label l0 = new Label(); - mv.visitLabel(l0); - mv.visitLineNumber(730, l0); - mv.visitVarInsn(ALOAD, 0); - Label l1 = new Label(); - mv.visitJumpInsn(IFNULL, l1); - mv.visitVarInsn(ALOAD, 1); - Label l2 = new Label(); - mv.visitJumpInsn(IFNONNULL, l2); - mv.visitLabel(l1); - mv.visitLineNumber(732, l1); - mv.visitFrame(F_SAME, 0, null, 0, null); - mv.visitInsn(RETURN); - mv.visitLabel(l2); - mv.visitLineNumber(734, l2); - mv.visitFrame(F_SAME, 0, null, 0, null); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKESTATIC, - "net/minecraftforge/common/ForgeChunkManager$Ticket", - "access$500", - "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Lnet/minecraftforge/common/ForgeChunkManager$Type;", - false); - mv.visitFieldInsn( - GETSTATIC, - "net/minecraftforge/common/ForgeChunkManager$Type", - "ENTITY", - "Lnet/minecraftforge/common/ForgeChunkManager$Type;"); - Label l3 = new Label(); - mv.visitJumpInsn(IF_ACMPNE, l3); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKESTATIC, - "net/minecraftforge/common/ForgeChunkManager$Ticket", - "access$600", - "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)L" + aEntity + ";", - false); - mv.visitJumpInsn(IFNONNULL, l3); - Label l4 = new Label(); - mv.visitLabel(l4); - mv.visitLineNumber(736, l4); - mv.visitTypeInsn(NEW, "java/lang/RuntimeException"); - mv.visitInsn(DUP); - mv.visitLdcInsn("Attempted to use an entity ticket to force a chunk, without an entity"); - mv.visitMethodInsn( - INVOKESPECIAL, - "java/lang/RuntimeException", - "<init>", - "(Ljava/lang/String;)V", - false); - mv.visitInsn(ATHROW); - mv.visitLabel(l3); - mv.visitLineNumber(738, l3); - mv.visitFrame(F_SAME, 0, null, 0, null); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKEVIRTUAL, - "net/minecraftforge/common/ForgeChunkManager$Ticket", - "isPlayerTicket", - "()Z", - false); - Label l5 = new Label(); - mv.visitJumpInsn(IFEQ, l5); - mv.visitFieldInsn( - GETSTATIC, - "net/minecraftforge/common/ForgeChunkManager", - "playerTickets", - "Lcom/google/common/collect/SetMultimap;"); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKEINTERFACE, - "com/google/common/collect/SetMultimap", - "containsValue", - "(Ljava/lang/Object;)Z", - true); - Label l6 = new Label(); - mv.visitJumpInsn(IFNE, l6); - Label l7 = new Label(); - mv.visitJumpInsn(GOTO, l7); - mv.visitLabel(l5); - mv.visitFrame(F_SAME, 0, null, 0, null); - mv.visitFieldInsn( - GETSTATIC, - "net/minecraftforge/common/ForgeChunkManager", - "tickets", - "Ljava/util/Map;"); - mv.visitVarInsn(ALOAD, 0); - mv.visitFieldInsn( - GETFIELD, - "net/minecraftforge/common/ForgeChunkManager$Ticket", - "world", - "L" + aWorld + ";"); - mv.visitMethodInsn( - INVOKEINTERFACE, - "java/util/Map", - "get", - "(Ljava/lang/Object;)Ljava/lang/Object;", - true); - mv.visitTypeInsn(CHECKCAST, "com/google/common/collect/Multimap"); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKESTATIC, - "net/minecraftforge/common/ForgeChunkManager$Ticket", - "access$200", - "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/lang/String;", - false); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKEINTERFACE, - "com/google/common/collect/Multimap", - "containsEntry", - "(Ljava/lang/Object;Ljava/lang/Object;)Z", - true); - mv.visitJumpInsn(IFNE, l6); - mv.visitLabel(l7); - mv.visitLineNumber(740, l7); - mv.visitFrame(F_SAME, 0, null, 0, null); - mv.visitLdcInsn( - "The mod %s attempted to force load a chunk with an invalid ticket. This is not permitted."); - mv.visitInsn(ICONST_1); - mv.visitTypeInsn(ANEWARRAY, "java/lang/Object"); - mv.visitInsn(DUP); - mv.visitInsn(ICONST_0); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKESTATIC, - "net/minecraftforge/common/ForgeChunkManager$Ticket", - "access$200", - "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/lang/String;", - false); - mv.visitInsn(AASTORE); - mv.visitMethodInsn( - INVOKESTATIC, - "cpw/mods/fml/common/FMLLog", - "severe", - "(Ljava/lang/String;[Ljava/lang/Object;)V", - false); - Label l8 = new Label(); - mv.visitLabel(l8); - mv.visitLineNumber(741, l8); - mv.visitInsn(RETURN); - mv.visitLabel(l6); - mv.visitLineNumber(743, l6); - mv.visitFrame(F_SAME, 0, null, 0, null); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKESTATIC, - "net/minecraftforge/common/ForgeChunkManager$Ticket", - "access$700", - "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/util/LinkedHashSet;", - false); - mv.visitVarInsn(ALOAD, 1); - mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/LinkedHashSet", "add", "(Ljava/lang/Object;)Z", false); - mv.visitInsn(POP); - Label l9 = new Label(); - mv.visitLabel(l9); - mv.visitLineNumber(744, l9); - mv.visitVarInsn(ALOAD, 0); - mv.visitVarInsn(ALOAD, 1); - mv.visitMethodInsn( - INVOKESTATIC, - "gtPlusPlus/preloader/ChunkDebugger", - "storeLoadChunkToCache", - "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;L" + aChunkCoordIntPair + ";)V", - false); - Label l10 = new Label(); - mv.visitLabel(l10); - mv.visitLineNumber(745, l10); - mv.visitFieldInsn( - GETSTATIC, - "net/minecraftforge/common/MinecraftForge", - "EVENT_BUS", - "Lcpw/mods/fml/common/eventhandler/EventBus;"); - mv.visitTypeInsn(NEW, "net/minecraftforge/common/ForgeChunkManager$ForceChunkEvent"); - mv.visitInsn(DUP); - mv.visitVarInsn(ALOAD, 0); - mv.visitVarInsn(ALOAD, 1); - mv.visitMethodInsn( - INVOKESPECIAL, - "net/minecraftforge/common/ForgeChunkManager$ForceChunkEvent", - "<init>", - "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;L" + aChunkCoordIntPair + ";)V", - false); - mv.visitMethodInsn( - INVOKEVIRTUAL, - "cpw/mods/fml/common/eventhandler/EventBus", - "post", - "(Lcpw/mods/fml/common/eventhandler/Event;)Z", - false); - mv.visitInsn(POP); - Label l11 = new Label(); - mv.visitLabel(l11); - mv.visitLineNumber(747, l11); - mv.visitMethodInsn( - INVOKESTATIC, - "com/google/common/collect/ImmutableSetMultimap", - "builder", - "()Lcom/google/common/collect/ImmutableSetMultimap$Builder;", - false); - mv.visitFieldInsn( - GETSTATIC, - "net/minecraftforge/common/ForgeChunkManager", - "forcedChunks", - "Ljava/util/Map;"); - mv.visitVarInsn(ALOAD, 0); - mv.visitFieldInsn( - GETFIELD, - "net/minecraftforge/common/ForgeChunkManager$Ticket", - "world", - "L" + aWorld + ";"); - mv.visitMethodInsn( - INVOKEINTERFACE, - "java/util/Map", - "get", - "(Ljava/lang/Object;)Ljava/lang/Object;", - true); - mv.visitTypeInsn(CHECKCAST, "com/google/common/collect/Multimap"); - mv.visitMethodInsn( - INVOKEVIRTUAL, - "com/google/common/collect/ImmutableSetMultimap$Builder", - "putAll", - "(Lcom/google/common/collect/Multimap;)Lcom/google/common/collect/ImmutableSetMultimap$Builder;", - false); - mv.visitVarInsn(ALOAD, 1); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKEVIRTUAL, - "com/google/common/collect/ImmutableSetMultimap$Builder", - "put", - "(Ljava/lang/Object;Ljava/lang/Object;)Lcom/google/common/collect/ImmutableSetMultimap$Builder;", - false); - mv.visitMethodInsn( - INVOKEVIRTUAL, - "com/google/common/collect/ImmutableSetMultimap$Builder", - "build", - "()Lcom/google/common/collect/ImmutableSetMultimap;", - false); - mv.visitVarInsn(ASTORE, 2); - Label l12 = new Label(); - mv.visitLabel(l12); - mv.visitLineNumber(748, l12); - mv.visitFieldInsn( - GETSTATIC, - "net/minecraftforge/common/ForgeChunkManager", - "forcedChunks", - "Ljava/util/Map;"); - mv.visitVarInsn(ALOAD, 0); - mv.visitFieldInsn( - GETFIELD, - "net/minecraftforge/common/ForgeChunkManager$Ticket", - "world", - "L" + aWorld + ";"); - mv.visitVarInsn(ALOAD, 2); - mv.visitMethodInsn( - INVOKEINTERFACE, - "java/util/Map", - "put", - "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;", - true); - mv.visitInsn(POP); - Label l13 = new Label(); - mv.visitLabel(l13); - mv.visitLineNumber(749, l13); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKESTATIC, - "net/minecraftforge/common/ForgeChunkManager$Ticket", - "access$800", - "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)I", - false); - Label l14 = new Label(); - mv.visitJumpInsn(IFLE, l14); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKESTATIC, - "net/minecraftforge/common/ForgeChunkManager$Ticket", - "access$700", - "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/util/LinkedHashSet;", - false); - mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/LinkedHashSet", "size", "()I", false); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKESTATIC, - "net/minecraftforge/common/ForgeChunkManager$Ticket", - "access$800", - "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)I", - false); - mv.visitJumpInsn(IF_ICMPLE, l14); - Label l15 = new Label(); - mv.visitLabel(l15); - mv.visitLineNumber(751, l15); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKESTATIC, - "net/minecraftforge/common/ForgeChunkManager$Ticket", - "access$700", - "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/util/LinkedHashSet;", - false); - mv.visitMethodInsn( - INVOKEVIRTUAL, - "java/util/LinkedHashSet", - "iterator", - "()Ljava/util/Iterator;", - false); - mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Iterator", "next", "()Ljava/lang/Object;", true); - mv.visitTypeInsn(CHECKCAST, "" + aChunkCoordIntPair + ""); - mv.visitVarInsn(ASTORE, 3); - Label l16 = new Label(); - mv.visitLabel(l16); - mv.visitLineNumber(752, l16); - mv.visitVarInsn(ALOAD, 0); - mv.visitVarInsn(ALOAD, 3); - mv.visitMethodInsn( - INVOKESTATIC, - "net/minecraftforge/common/ForgeChunkManager", - "unforceChunk", - "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;L" + aChunkCoordIntPair + ";)V", - false); - mv.visitLabel(l14); - mv.visitLineNumber(754, l14); - mv.visitFrame(F_APPEND, 1, new Object[] { "com/google/common/collect/ImmutableSetMultimap" }, 0, null); - mv.visitInsn(RETURN); - Label l17 = new Label(); - mv.visitLabel(l17); - mv.visitLocalVariable( - "ticket", - "Lnet/minecraftforge/common/ForgeChunkManager$Ticket;", - null, - l0, - l17, - 0); - mv.visitLocalVariable("chunk", "L" + aChunkCoordIntPair + ";", null, l0, l17, 1); - mv.visitLocalVariable( - "newMap", - "Lcom/google/common/collect/ImmutableSetMultimap;", - "Lcom/google/common/collect/ImmutableSetMultimap<L" + aChunkCoordIntPair - + ";Lnet/minecraftforge/common/ForgeChunkManager$Ticket;>;", - l12, - l17, - 2); - mv.visitLocalVariable("removed", "L" + aChunkCoordIntPair + ";", null, l16, l14, 3); - mv.visitMaxs(5, 4); - mv.visitEnd(); - - } - case "unforceChunk" -> { - - mv = getWriter().visitMethod( - ACC_PUBLIC + ACC_STATIC, - "unforceChunk", - "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;L" + aChunkCoordIntPair + ";)V", - null, - null); - mv.visitCode(); - Label l0 = new Label(); - mv.visitLabel(l0); - mv.visitLineNumber(781, l0); - mv.visitVarInsn(ALOAD, 0); - Label l1 = new Label(); - mv.visitJumpInsn(IFNULL, l1); - mv.visitVarInsn(ALOAD, 1); - Label l2 = new Label(); - mv.visitJumpInsn(IFNONNULL, l2); - mv.visitLabel(l1); - mv.visitLineNumber(783, l1); - mv.visitFrame(F_SAME, 0, null, 0, null); - mv.visitInsn(RETURN); - mv.visitLabel(l2); - mv.visitLineNumber(785, l2); - mv.visitFrame(F_SAME, 0, null, 0, null); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKESTATIC, - "net/minecraftforge/common/ForgeChunkManager$Ticket", - "access$700", - "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/util/LinkedHashSet;", - false); - mv.visitVarInsn(ALOAD, 1); - mv.visitMethodInsn(INVOKEVIRTUAL, "java/util/LinkedHashSet", "remove", "(Ljava/lang/Object;)Z", false); - mv.visitInsn(POP); - Label l3 = new Label(); - mv.visitLabel(l3); - mv.visitLineNumber(786, l3); - mv.visitVarInsn(ALOAD, 1); - mv.visitMethodInsn( - INVOKESTATIC, - "gtPlusPlus/preloader/ChunkDebugger", - "removeLoadedChunkFromCache", - "(L" + aChunkCoordIntPair + ";)V", - false); - Label l4 = new Label(); - mv.visitLabel(l4); - mv.visitLineNumber(787, l4); - mv.visitFieldInsn( - GETSTATIC, - "net/minecraftforge/common/MinecraftForge", - "EVENT_BUS", - "Lcpw/mods/fml/common/eventhandler/EventBus;"); - mv.visitTypeInsn(NEW, "net/minecraftforge/common/ForgeChunkManager$UnforceChunkEvent"); - mv.visitInsn(DUP); - mv.visitVarInsn(ALOAD, 0); - mv.visitVarInsn(ALOAD, 1); - mv.visitMethodInsn( - INVOKESPECIAL, - "net/minecraftforge/common/ForgeChunkManager$UnforceChunkEvent", - "<init>", - "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;L" + aChunkCoordIntPair + ";)V", - false); - mv.visitMethodInsn( - INVOKEVIRTUAL, - "cpw/mods/fml/common/eventhandler/EventBus", - "post", - "(Lcpw/mods/fml/common/eventhandler/Event;)Z", - false); - mv.visitInsn(POP); - Label l5 = new Label(); - mv.visitLabel(l5); - mv.visitLineNumber(788, l5); - mv.visitFieldInsn( - GETSTATIC, - "net/minecraftforge/common/ForgeChunkManager", - "forcedChunks", - "Ljava/util/Map;"); - mv.visitVarInsn(ALOAD, 0); - mv.visitFieldInsn( - GETFIELD, - "net/minecraftforge/common/ForgeChunkManager$Ticket", - "world", - "L" + aWorld + ";"); - mv.visitMethodInsn( - INVOKEINTERFACE, - "java/util/Map", - "get", - "(Ljava/lang/Object;)Ljava/lang/Object;", - true); - mv.visitTypeInsn(CHECKCAST, "com/google/common/collect/Multimap"); - mv.visitMethodInsn( - INVOKESTATIC, - "com/google/common/collect/LinkedHashMultimap", - "create", - "(Lcom/google/common/collect/Multimap;)Lcom/google/common/collect/LinkedHashMultimap;", - false); - mv.visitVarInsn(ASTORE, 2); - Label l6 = new Label(); - mv.visitLabel(l6); - mv.visitLineNumber(789, l6); - mv.visitVarInsn(ALOAD, 2); - mv.visitVarInsn(ALOAD, 1); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKEVIRTUAL, - "com/google/common/collect/LinkedHashMultimap", - "remove", - "(Ljava/lang/Object;Ljava/lang/Object;)Z", - false); - mv.visitInsn(POP); - Label l7 = new Label(); - mv.visitLabel(l7); - mv.visitLineNumber(790, l7); - mv.visitVarInsn(ALOAD, 2); - mv.visitMethodInsn( - INVOKESTATIC, - "com/google/common/collect/ImmutableSetMultimap", - "copyOf", - "(Lcom/google/common/collect/Multimap;)Lcom/google/common/collect/ImmutableSetMultimap;", - false); - mv.visitVarInsn(ASTORE, 3); - Label l8 = new Label(); - mv.visitLabel(l8); - mv.visitLineNumber(791, l8); - mv.visitFieldInsn( - GETSTATIC, - "net/minecraftforge/common/ForgeChunkManager", - "forcedChunks", - "Ljava/util/Map;"); - mv.visitVarInsn(ALOAD, 0); - mv.visitFieldInsn( - GETFIELD, - "net/minecraftforge/common/ForgeChunkManager$Ticket", - "world", - "L" + aWorld + ";"); - mv.visitVarInsn(ALOAD, 3); - mv.visitMethodInsn( - INVOKEINTERFACE, - "java/util/Map", - "put", - "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;", - true); - mv.visitInsn(POP); - Label l9 = new Label(); - mv.visitLabel(l9); - mv.visitLineNumber(792, l9); - mv.visitInsn(RETURN); - Label l10 = new Label(); - mv.visitLabel(l10); - mv.visitLocalVariable( - "ticket", - "Lnet/minecraftforge/common/ForgeChunkManager$Ticket;", - null, - l0, - l10, - 0); - mv.visitLocalVariable("chunk", "L" + aChunkCoordIntPair + ";", null, l0, l10, 1); - mv.visitLocalVariable( - "copy", - "Lcom/google/common/collect/LinkedHashMultimap;", - "Lcom/google/common/collect/LinkedHashMultimap<L" + aChunkCoordIntPair - + ";Lnet/minecraftforge/common/ForgeChunkManager$Ticket;>;", - l6, - l10, - 2); - mv.visitLocalVariable( - "newMap", - "Lcom/google/common/collect/ImmutableSetMultimap;", - "Lcom/google/common/collect/ImmutableSetMultimap<L" + aChunkCoordIntPair - + ";Lnet/minecraftforge/common/ForgeChunkManager$Ticket;>;", - l8, - l10, - 3); - mv.visitMaxs(5, 4); - mv.visitEnd(); - - } - case "requestTicket" -> { - - mv = getWriter().visitMethod( - ACC_PUBLIC + ACC_STATIC, - "requestTicket", - "(Ljava/lang/Object;L" + aWorld - + ";Lnet/minecraftforge/common/ForgeChunkManager$Type;)Lnet/minecraftforge/common/ForgeChunkManager$Ticket;", - null, - null); - mv.visitCode(); - Label l0 = new Label(); - mv.visitLabel(l0); - mv.visitLineNumber(656, l0); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKESTATIC, - "net/minecraftforge/common/ForgeChunkManager", - "getContainer", - "(Ljava/lang/Object;)Lcpw/mods/fml/common/ModContainer;", - false); - mv.visitVarInsn(ASTORE, 3); - Label l1 = new Label(); - mv.visitLabel(l1); - mv.visitLineNumber(657, l1); - mv.visitVarInsn(ALOAD, 3); - Label l2 = new Label(); - mv.visitJumpInsn(IFNONNULL, l2); - Label l3 = new Label(); - mv.visitLabel(l3); - mv.visitLineNumber(659, l3); - mv.visitFieldInsn( - GETSTATIC, - "org/apache/logging/log4j/Level", - "ERROR", - "Lorg/apache/logging/log4j/Level;"); - mv.visitLdcInsn("Failed to locate the container for mod instance %s (%s : %x)"); - mv.visitInsn(ICONST_3); - mv.visitTypeInsn(ANEWARRAY, "java/lang/Object"); - mv.visitInsn(DUP); - mv.visitInsn(ICONST_0); - mv.visitVarInsn(ALOAD, 0); - mv.visitInsn(AASTORE); - mv.visitInsn(DUP); - mv.visitInsn(ICONST_1); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Object", "getClass", "()Ljava/lang/Class;", false); - mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Class", "getName", "()Ljava/lang/String;", false); - mv.visitInsn(AASTORE); - mv.visitInsn(DUP); - mv.visitInsn(ICONST_2); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKESTATIC, - "java/lang/System", - "identityHashCode", - "(Ljava/lang/Object;)I", - false); - mv.visitMethodInsn(INVOKESTATIC, "java/lang/Integer", "valueOf", "(I)Ljava/lang/Integer;", false); - mv.visitInsn(AASTORE); - mv.visitMethodInsn( - INVOKESTATIC, - "cpw/mods/fml/common/FMLLog", - "log", - "(Lorg/apache/logging/log4j/Level;Ljava/lang/String;[Ljava/lang/Object;)V", - false); - Label l4 = new Label(); - mv.visitLabel(l4); - mv.visitLineNumber(660, l4); - mv.visitInsn(ACONST_NULL); - mv.visitInsn(ARETURN); - mv.visitLabel(l2); - mv.visitLineNumber(662, l2); - mv.visitFrame(F_APPEND, 1, new Object[] { "cpw/mods/fml/common/ModContainer" }, 0, null); - mv.visitVarInsn(ALOAD, 3); - mv.visitMethodInsn( - INVOKEINTERFACE, - "cpw/mods/fml/common/ModContainer", - "getModId", - "()Ljava/lang/String;", - true); - mv.visitVarInsn(ASTORE, 4); - Label l5 = new Label(); - mv.visitLabel(l5); - mv.visitLineNumber(663, l5); - mv.visitFieldInsn( - GETSTATIC, - "net/minecraftforge/common/ForgeChunkManager", - "callbacks", - "Ljava/util/Map;"); - mv.visitVarInsn(ALOAD, 4); - mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Map", "containsKey", "(Ljava/lang/Object;)Z", true); - Label l6 = new Label(); - mv.visitJumpInsn(IFNE, l6); - Label l7 = new Label(); - mv.visitLabel(l7); - mv.visitLineNumber(665, l7); - mv.visitLdcInsn("The mod %s has attempted to request a ticket without a listener in place"); - mv.visitInsn(ICONST_1); - mv.visitTypeInsn(ANEWARRAY, "java/lang/Object"); - mv.visitInsn(DUP); - mv.visitInsn(ICONST_0); - mv.visitVarInsn(ALOAD, 4); - mv.visitInsn(AASTORE); - mv.visitMethodInsn( - INVOKESTATIC, - "cpw/mods/fml/common/FMLLog", - "severe", - "(Ljava/lang/String;[Ljava/lang/Object;)V", - false); - Label l8 = new Label(); - mv.visitLabel(l8); - mv.visitLineNumber(666, l8); - mv.visitTypeInsn(NEW, "java/lang/RuntimeException"); - mv.visitInsn(DUP); - mv.visitLdcInsn("Invalid ticket request"); - mv.visitMethodInsn( - INVOKESPECIAL, - "java/lang/RuntimeException", - "<init>", - "(Ljava/lang/String;)V", - false); - mv.visitInsn(ATHROW); - mv.visitLabel(l6); - mv.visitLineNumber(669, l6); - mv.visitFrame(F_APPEND, 1, new Object[] { "java/lang/String" }, 0, null); - mv.visitVarInsn(ALOAD, 4); - mv.visitMethodInsn( - INVOKESTATIC, - "net/minecraftforge/common/ForgeChunkManager", - "getMaxTicketLengthFor", - "(Ljava/lang/String;)I", - false); - mv.visitVarInsn(ISTORE, 5); - Label l9 = new Label(); - mv.visitLabel(l9); - mv.visitLineNumber(671, l9); - mv.visitFieldInsn( - GETSTATIC, - "net/minecraftforge/common/ForgeChunkManager", - "tickets", - "Ljava/util/Map;"); - mv.visitVarInsn(ALOAD, 1); - mv.visitMethodInsn( - INVOKEINTERFACE, - "java/util/Map", - "get", - "(Ljava/lang/Object;)Ljava/lang/Object;", - true); - mv.visitTypeInsn(CHECKCAST, "com/google/common/collect/Multimap"); - mv.visitVarInsn(ALOAD, 4); - mv.visitMethodInsn( - INVOKEINTERFACE, - "com/google/common/collect/Multimap", - "get", - "(Ljava/lang/Object;)Ljava/util/Collection;", - true); - mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Collection", "size", "()I", true); - mv.visitVarInsn(ILOAD, 5); - Label l10 = new Label(); - mv.visitJumpInsn(IF_ICMPLT, l10); - Label l11 = new Label(); - mv.visitLabel(l11); - mv.visitLineNumber(673, l11); - mv.visitFieldInsn( - GETSTATIC, - "net/minecraftforge/common/ForgeChunkManager", - "warnedMods", - "Ljava/util/Set;"); - mv.visitVarInsn(ALOAD, 4); - mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Set", "contains", "(Ljava/lang/Object;)Z", true); - Label l12 = new Label(); - mv.visitJumpInsn(IFNE, l12); - Label l13 = new Label(); - mv.visitLabel(l13); - mv.visitLineNumber(675, l13); - mv.visitLdcInsn( - "The mod %s has attempted to allocate a chunkloading ticket beyond it's currently allocated maximum : %d"); - mv.visitInsn(ICONST_2); - mv.visitTypeInsn(ANEWARRAY, "java/lang/Object"); - mv.visitInsn(DUP); - mv.visitInsn(ICONST_0); - mv.visitVarInsn(ALOAD, 4); - mv.visitInsn(AASTORE); - mv.visitInsn(DUP); - mv.visitInsn(ICONST_1); - mv.visitVarInsn(ILOAD, 5); - mv.visitMethodInsn(INVOKESTATIC, "java/lang/Integer", "valueOf", "(I)Ljava/lang/Integer;", false); - mv.visitInsn(AASTORE); - mv.visitMethodInsn( - INVOKESTATIC, - "cpw/mods/fml/common/FMLLog", - "info", - "(Ljava/lang/String;[Ljava/lang/Object;)V", - false); - Label l14 = new Label(); - mv.visitLabel(l14); - mv.visitLineNumber(676, l14); - mv.visitFieldInsn( - GETSTATIC, - "net/minecraftforge/common/ForgeChunkManager", - "warnedMods", - "Ljava/util/Set;"); - mv.visitVarInsn(ALOAD, 4); - mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Set", "add", "(Ljava/lang/Object;)Z", true); - mv.visitInsn(POP); - mv.visitLabel(l12); - mv.visitLineNumber(678, l12); - mv.visitFrame(F_APPEND, 1, new Object[] { INTEGER }, 0, null); - mv.visitInsn(ACONST_NULL); - mv.visitInsn(ARETURN); - mv.visitLabel(l10); - mv.visitLineNumber(680, l10); - mv.visitFrame(F_SAME, 0, null, 0, null); - mv.visitTypeInsn(NEW, "net/minecraftforge/common/ForgeChunkManager$Ticket"); - mv.visitInsn(DUP); - mv.visitVarInsn(ALOAD, 4); - mv.visitVarInsn(ALOAD, 2); - mv.visitVarInsn(ALOAD, 1); - mv.visitMethodInsn( - INVOKESPECIAL, - "net/minecraftforge/common/ForgeChunkManager$Ticket", - "<init>", - "(Ljava/lang/String;Lnet/minecraftforge/common/ForgeChunkManager$Type;L" + aWorld + ";)V", - false); - mv.visitVarInsn(ASTORE, 6); - Label l15 = new Label(); - mv.visitLabel(l15); - mv.visitLineNumber(681, l15); - mv.visitVarInsn(ALOAD, 6); - mv.visitVarInsn(ALOAD, 1); - mv.visitMethodInsn( - INVOKESTATIC, - "gtPlusPlus/preloader/ChunkDebugger", - "storeTicketToCache", - "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;L" + aWorld + ";)V", - false); - Label l16 = new Label(); - mv.visitLabel(l16); - mv.visitLineNumber(682, l16); - mv.visitFieldInsn( - GETSTATIC, - "net/minecraftforge/common/ForgeChunkManager", - "tickets", - "Ljava/util/Map;"); - mv.visitVarInsn(ALOAD, 1); - mv.visitMethodInsn( - INVOKEINTERFACE, - "java/util/Map", - "get", - "(Ljava/lang/Object;)Ljava/lang/Object;", - true); - mv.visitTypeInsn(CHECKCAST, "com/google/common/collect/Multimap"); - mv.visitVarInsn(ALOAD, 4); - mv.visitVarInsn(ALOAD, 6); - mv.visitMethodInsn( - INVOKEINTERFACE, - "com/google/common/collect/Multimap", - "put", - "(Ljava/lang/Object;Ljava/lang/Object;)Z", - true); - mv.visitInsn(POP); - Label l17 = new Label(); - mv.visitLabel(l17); - mv.visitLineNumber(683, l17); - mv.visitVarInsn(ALOAD, 6); - mv.visitInsn(ARETURN); - Label l18 = new Label(); - mv.visitLabel(l18); - mv.visitLocalVariable("mod", "Ljava/lang/Object;", null, l0, l18, 0); - mv.visitLocalVariable("world", "L" + aWorld + ";", null, l0, l18, 1); - mv.visitLocalVariable("type", "Lnet/minecraftforge/common/ForgeChunkManager$Type;", null, l0, l18, 2); - mv.visitLocalVariable("container", "Lcpw/mods/fml/common/ModContainer;", null, l1, l18, 3); - mv.visitLocalVariable("modId", "Ljava/lang/String;", null, l5, l18, 4); - mv.visitLocalVariable("allowedCount", "I", null, l9, l18, 5); - mv.visitLocalVariable( - "ticket", - "Lnet/minecraftforge/common/ForgeChunkManager$Ticket;", - null, - l15, - l18, - 6); - mv.visitMaxs(6, 7); - mv.visitEnd(); - - } - case "releaseTicket" -> { - - mv = getWriter().visitMethod( - ACC_PUBLIC + ACC_STATIC, - "releaseTicket", - "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)V", - null, - null); - mv.visitCode(); - Label l0 = new Label(); - mv.visitLabel(l0); - mv.visitLineNumber(693, l0); - mv.visitVarInsn(ALOAD, 0); - Label l1 = new Label(); - mv.visitJumpInsn(IFNONNULL, l1); - Label l2 = new Label(); - mv.visitLabel(l2); - mv.visitLineNumber(695, l2); - mv.visitInsn(RETURN); - mv.visitLabel(l1); - mv.visitLineNumber(697, l1); - mv.visitFrame(F_SAME, 0, null, 0, null); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKEVIRTUAL, - "net/minecraftforge/common/ForgeChunkManager$Ticket", - "isPlayerTicket", - "()Z", - false); - Label l3 = new Label(); - mv.visitJumpInsn(IFEQ, l3); - mv.visitFieldInsn( - GETSTATIC, - "net/minecraftforge/common/ForgeChunkManager", - "playerTickets", - "Lcom/google/common/collect/SetMultimap;"); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKEINTERFACE, - "com/google/common/collect/SetMultimap", - "containsValue", - "(Ljava/lang/Object;)Z", - true); - Label l4 = new Label(); - mv.visitJumpInsn(IFNE, l4); - Label l5 = new Label(); - mv.visitJumpInsn(GOTO, l5); - mv.visitLabel(l3); - mv.visitFrame(F_SAME, 0, null, 0, null); - mv.visitFieldInsn( - GETSTATIC, - "net/minecraftforge/common/ForgeChunkManager", - "tickets", - "Ljava/util/Map;"); - mv.visitVarInsn(ALOAD, 0); - mv.visitFieldInsn( - GETFIELD, - "net/minecraftforge/common/ForgeChunkManager$Ticket", - "world", - "L" + aWorld + ";"); - mv.visitMethodInsn( - INVOKEINTERFACE, - "java/util/Map", - "get", - "(Ljava/lang/Object;)Ljava/lang/Object;", - true); - mv.visitTypeInsn(CHECKCAST, "com/google/common/collect/Multimap"); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKESTATIC, - "net/minecraftforge/common/ForgeChunkManager$Ticket", - "access$200", - "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/lang/String;", - false); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKEINTERFACE, - "com/google/common/collect/Multimap", - "containsEntry", - "(Ljava/lang/Object;Ljava/lang/Object;)Z", - true); - mv.visitJumpInsn(IFNE, l4); - mv.visitLabel(l5); - mv.visitLineNumber(699, l5); - mv.visitFrame(F_SAME, 0, null, 0, null); - mv.visitInsn(RETURN); - mv.visitLabel(l4); - mv.visitLineNumber(701, l4); - mv.visitFrame(F_SAME, 0, null, 0, null); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKESTATIC, - "net/minecraftforge/common/ForgeChunkManager$Ticket", - "access$700", - "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/util/LinkedHashSet;", - false); - Label l6 = new Label(); - mv.visitJumpInsn(IFNULL, l6); - Label l7 = new Label(); - mv.visitLabel(l7); - mv.visitLineNumber(703, l7); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKESTATIC, - "net/minecraftforge/common/ForgeChunkManager$Ticket", - "access$700", - "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/util/LinkedHashSet;", - false); - mv.visitMethodInsn( - INVOKESTATIC, - "com/google/common/collect/ImmutableSet", - "copyOf", - "(Ljava/util/Collection;)Lcom/google/common/collect/ImmutableSet;", - false); - mv.visitMethodInsn( - INVOKEVIRTUAL, - "com/google/common/collect/ImmutableSet", - "iterator", - "()Ljava/util/Iterator;", - false); - mv.visitVarInsn(ASTORE, 2); - Label l8 = new Label(); - mv.visitJumpInsn(GOTO, l8); - Label l9 = new Label(); - mv.visitLabel(l9); - mv.visitFrame( - F_FULL, - 3, - new Object[] { "net/minecraftforge/common/ForgeChunkManager$Ticket", TOP, - "java/util/Iterator" }, - 0, - new Object[] {}); - mv.visitVarInsn(ALOAD, 2); - mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Iterator", "next", "()Ljava/lang/Object;", true); - mv.visitTypeInsn(CHECKCAST, "" + aChunkCoordIntPair + ""); - mv.visitVarInsn(ASTORE, 1); - Label l10 = new Label(); - mv.visitLabel(l10); - mv.visitLineNumber(705, l10); - mv.visitVarInsn(ALOAD, 0); - mv.visitVarInsn(ALOAD, 1); - mv.visitMethodInsn( - INVOKESTATIC, - "net/minecraftforge/common/ForgeChunkManager", - "unforceChunk", - "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;L" + aChunkCoordIntPair + ";)V", - false); - mv.visitLabel(l8); - mv.visitLineNumber(703, l8); - mv.visitFrame(F_SAME, 0, null, 0, null); - mv.visitVarInsn(ALOAD, 2); - mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Iterator", "hasNext", "()Z", true); - mv.visitJumpInsn(IFNE, l9); - mv.visitLabel(l6); - mv.visitLineNumber(708, l6); - mv.visitFrame( - F_FULL, - 1, - new Object[] { "net/minecraftforge/common/ForgeChunkManager$Ticket" }, - 0, - new Object[] {}); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKESTATIC, - "gtPlusPlus/preloader/ChunkDebugger", - "removeTicketFromCache", - "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)V", - false); - Label l11 = new Label(); - mv.visitLabel(l11); - mv.visitLineNumber(709, l11); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKEVIRTUAL, - "net/minecraftforge/common/ForgeChunkManager$Ticket", - "isPlayerTicket", - "()Z", - false); - Label l12 = new Label(); - mv.visitJumpInsn(IFEQ, l12); - Label l13 = new Label(); - mv.visitLabel(l13); - mv.visitLineNumber(711, l13); - mv.visitFieldInsn( - GETSTATIC, - "net/minecraftforge/common/ForgeChunkManager", - "playerTickets", - "Lcom/google/common/collect/SetMultimap;"); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKESTATIC, - "net/minecraftforge/common/ForgeChunkManager$Ticket", - "access$100", - "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/lang/String;", - false); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKEINTERFACE, - "com/google/common/collect/SetMultimap", - "remove", - "(Ljava/lang/Object;Ljava/lang/Object;)Z", - true); - mv.visitInsn(POP); - Label l14 = new Label(); - mv.visitLabel(l14); - mv.visitLineNumber(712, l14); - mv.visitFieldInsn( - GETSTATIC, - "net/minecraftforge/common/ForgeChunkManager", - "tickets", - "Ljava/util/Map;"); - mv.visitVarInsn(ALOAD, 0); - mv.visitFieldInsn( - GETFIELD, - "net/minecraftforge/common/ForgeChunkManager$Ticket", - "world", - "L" + aWorld + ";"); - mv.visitMethodInsn( - INVOKEINTERFACE, - "java/util/Map", - "get", - "(Ljava/lang/Object;)Ljava/lang/Object;", - true); - mv.visitTypeInsn(CHECKCAST, "com/google/common/collect/Multimap"); - mv.visitLdcInsn("Forge"); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKEINTERFACE, - "com/google/common/collect/Multimap", - "remove", - "(Ljava/lang/Object;Ljava/lang/Object;)Z", - true); - mv.visitInsn(POP); - Label l15 = new Label(); - mv.visitLabel(l15); - mv.visitLineNumber(713, l15); - Label l16 = new Label(); - mv.visitJumpInsn(GOTO, l16); - mv.visitLabel(l12); - mv.visitLineNumber(716, l12); - mv.visitFrame(F_SAME, 0, null, 0, null); - mv.visitFieldInsn( - GETSTATIC, - "net/minecraftforge/common/ForgeChunkManager", - "tickets", - "Ljava/util/Map;"); - mv.visitVarInsn(ALOAD, 0); - mv.visitFieldInsn( - GETFIELD, - "net/minecraftforge/common/ForgeChunkManager$Ticket", - "world", - "L" + aWorld + ";"); - mv.visitMethodInsn( - INVOKEINTERFACE, - "java/util/Map", - "get", - "(Ljava/lang/Object;)Ljava/lang/Object;", - true); - mv.visitTypeInsn(CHECKCAST, "com/google/common/collect/Multimap"); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKESTATIC, - "net/minecraftforge/common/ForgeChunkManager$Ticket", - "access$200", - "(Lnet/minecraftforge/common/ForgeChunkManager$Ticket;)Ljava/lang/String;", - false); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKEINTERFACE, - "com/google/common/collect/Multimap", - "remove", - "(Ljava/lang/Object;Ljava/lang/Object;)Z", - true); - mv.visitInsn(POP); - mv.visitLabel(l16); - mv.visitLineNumber(718, l16); - mv.visitFrame(F_SAME, 0, null, 0, null); - mv.visitInsn(RETURN); - Label l17 = new Label(); - mv.visitLabel(l17); - mv.visitLocalVariable( - "ticket", - "Lnet/minecraftforge/common/ForgeChunkManager$Ticket;", - null, - l0, - l17, - 0); - mv.visitLocalVariable("chunk", "L" + aChunkCoordIntPair + ";", null, l10, l8, 1); - mv.visitMaxs(3, 3); - mv.visitEnd(); - } - } - - FMLRelaunchLog.log("[GT++ ASM] Chunkloading Patch", Level.INFO, "Method injection complete."); - } - - public static final class localClassVisitor extends ClassVisitor { - - public localClassVisitor(ClassVisitor cv) { - super(ASM5, cv); - } - - @Override - public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { - if (name.equals("forceChunk") || name.equals("unforceChunk") - || name.equals("requestTicket") - || name.equals("releaseTicket")) { - FMLRelaunchLog.log("[GT++ ASM] Chunkloading Patch", Level.INFO, "Found method " + name + ", Patching."); - return null; - } - return super.visitMethod(access, name, desc, signature, exceptions); - } - } -} diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/Preloader_Transformer_Handler.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/Preloader_Transformer_Handler.java index 30a5bae031..abdff476ea 100644 --- a/src/main/java/gtPlusPlus/preloader/asm/transformers/Preloader_Transformer_Handler.java +++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/Preloader_Transformer_Handler.java @@ -55,12 +55,6 @@ public class Preloader_Transformer_Handler implements IClassTransformer { return new ClassTransformer_LWJGL_Keyboard(basicClass, isClientSettingsClass).getWriter().toByteArray(); } - // Enable mapping of Tickets and loaded chunks. - Forge - if (transformedName.equals(FORGE_CHUNK_MANAGER) && AsmConfig.enableChunkDebugging) { - Preloader_Logger.INFO("Chunkloading Patch", "Transforming " + transformedName); - return new ClassTransformer_Forge_ChunkLoading(basicClass, false).getWriter().toByteArray(); - } - // Fix the OreDictionary - Forge if (transformedName.equals(FORGE_ORE_DICTIONARY) && AsmConfig.enableOreDictPatch) { Preloader_Logger.INFO("OreDictTransformer", "Transforming " + transformedName); |