From 5b243f88e1694449dd4652fe3e9c03037db7177c Mon Sep 17 00:00:00 2001 From: kwright02 Date: Fri, 11 Dec 2020 03:26:13 -0600 Subject: [PATCH] Fixed remapper typo (#313) --- .../fml/relauncher/SideOnly.java.patch | 50 +++++++++++++++++-- .../remappers/MagmaSuperClassRemapper.java | 2 +- 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/patches/net/minecraftforge/fml/relauncher/SideOnly.java.patch b/patches/net/minecraftforge/fml/relauncher/SideOnly.java.patch index 174127f..5858e49 100644 --- a/patches/net/minecraftforge/fml/relauncher/SideOnly.java.patch +++ b/patches/net/minecraftforge/fml/relauncher/SideOnly.java.patch @@ -1,9 +1,25 @@ --- ../src-base/minecraft/net/minecraftforge/fml/relauncher/SideOnly.java +++ ../src-work/minecraft/net/minecraftforge/fml/relauncher/SideOnly.java -@@ -17,6 +17,405 @@ - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - +@@ -1,3 +1,421 @@ ++/* ++ * Minecraft Forge ++ * Copyright (c) 2016-2018. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation version 2.1 ++ * of the License. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ +/* + * Minecraft Forge + * Copyright (c) 2016-2018. @@ -406,3 +422,29 @@ package net.minecraftforge.fml.relauncher; import java.lang.annotation.ElementType; +@@ -5,8 +423,24 @@ + import java.lang.annotation.RetentionPolicy; + import java.lang.annotation.Target; + ++import net.minecraftforge.fml.common.SidedProxy; ++ ++ ++/** ++ * Marks the associated element as being only available on a certain {@link Side}. This is ++ * generally meant for internal Forge and FML use only and should only be used on mod classes ++ * when other more common mechanisms, such as using a {@link SidedProxy} fail to work. ++ * ++ * Note, this will only apply to the direct element marked. This code: ++ * @SideOnly public MyField field = new MyField(); will not work, as the initializer ++ * is a separate piece of code to the actual field declaration, and will not be able to find ++ * it's field on the wrong side. ++ * ++ * @author cpw ++ * ++ */ + @Retention(RetentionPolicy.RUNTIME) +-@Target( {ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR}) ++@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR}) + public @interface SideOnly + { + Side value(); diff --git a/src/main/java/org/magmafoundation/magma/remapper/remappers/MagmaSuperClassRemapper.java b/src/main/java/org/magmafoundation/magma/remapper/remappers/MagmaSuperClassRemapper.java index f555568..84dc518 100644 --- a/src/main/java/org/magmafoundation/magma/remapper/remappers/MagmaSuperClassRemapper.java +++ b/src/main/java/org/magmafoundation/magma/remapper/remappers/MagmaSuperClassRemapper.java @@ -98,7 +98,7 @@ public static void initialize(ClassNode classNode) { } if ((insnNode.owner + ";" + insnNode.name).equals("javax/script/ScriptEngineManager;") && insnNode.desc.equals("()V")) { insnNode.desc = "(Ljava/lang/ClassLoader;)V"; - methodNode.instructions.insertBefore(insnNode, new MethodInsnNode(Opcodes.INVOKESTATIC, "java/lang/ClassLoader", "getSytemClassLoader", "()Ljava/lang/ClassLoader;", false)); + methodNode.instructions.insertBefore(insnNode, new MethodInsnNode(Opcodes.INVOKESTATIC, "java/lang/ClassLoader", "getSystemClassLoader", "()Ljava/lang/ClassLoader;", false)); methodNode.maxStack++; } }