Compare commits

...
4 Commits
19 changed files with 680 additions and 256 deletions

No files matched your search

+553 -199
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -1,5 +1,5 @@
// Add your dependencies here // Add your dependencies here
dependencies { dependencies {
api('com.github.GTNewHorizons:CodeChickenLib:1.1.6:dev') api('com.github.GTNewHorizons:CodeChickenLib:1.1.9:dev')
} }
+38 -6
View File
@@ -21,16 +21,19 @@ forgeVersion = 10.13.4.1614
# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty # Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty
developmentEnvironmentUserName = Developer developmentEnvironmentUserName = Developer
# Define a source file of your project with: # Generate a class with String fields for the mod id, name, version and group name named with the fields below
generateGradleTokenClass = codechicken.core.asm.Tags
gradleTokenModId = MODID
gradleTokenModName = MODNAME
gradleTokenVersion = VERSION
gradleTokenGroupName = GROUPNAME
# [DEPRECATED]
# Multiple source files can be defined here by providing a comma-seperated list: Class1.java,Class2.java,Class3.java
# public static final String VERSION = "GRADLETOKEN_VERSION"; # public static final String VERSION = "GRADLETOKEN_VERSION";
# The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's # The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's
# version in @Mod([...], version = VERSION, [...]) # version in @Mod([...], version = VERSION, [...])
# Leave these properties empty to skip individual token replacements # Leave these properties empty to skip individual token replacements
replaceGradleTokenInFile = CodeChickenCoreModContainer.java replaceGradleTokenInFile =
gradleTokenModId = GRADLETOKEN_MODID
gradleTokenModName = GRADLETOKEN_MODNAME
gradleTokenVersion = GRADLETOKEN_VERSION
gradleTokenGroupName =
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can # In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
# leave this property empty. # leave this property empty.
@@ -58,3 +61,32 @@ containsMixinsAndOrCoreModOnly = true
# If enabled, you may use 'shadowImplementation' for dependencies. They will be integrated in your jar. It is your # If enabled, you may use 'shadowImplementation' for dependencies. They will be integrated in your jar. It is your
# responsibility check the licence and request permission for distribution, if required. # responsibility check the licence and request permission for distribution, if required.
usesShadowedDependencies = false usesShadowedDependencies = false
# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.
# The project's numeric ID on CurseForge. You can find this in the About Project box.
# Leave this empty if you don't want to publish on CurseForge.
curseForgeProjectId = 746279
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
# Syntax: type1:name1;type2:name2;...
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
# and the name is the CurseForge project id of the other mod.
# curseForgeRelations =
# Publishing to modrinth requires you to set the MODRINTH_TOKEN environment variable to your current modrinth API token.
# The project's ID on Modrinth. Can be either the slug or the ID.
# Leave this empty if you don't want to publish on Modrinth.
modrinthProjectId = codechickencore-unofficial
# The project's relations on Modrinth. You can use this to refer to other projects on Modrinth.
# Syntax: scope1-type1:name1;scope2-type2:name2;...
# Where scope can be one of [required, optional, incompatible, embedded],
# type can be one of [project, version],
# and the name is the Modrinth project or version slug/id of the other mod.
# modrinthRelations =
-8
View File
@@ -1,12 +1,4 @@
// Add any additional repositiroes for your dependencies here // Add any additional repositiroes for your dependencies here
repositories { repositories {
maven {
name 'GTNH Maven'
url 'http://jenkins.usrv.eu:8081/nexus/content/groups/public/'
allowInsecureProtocol
}
maven {
url 'https://jitpack.io'
}
} }
@@ -14,10 +14,9 @@ import net.minecraft.client.Minecraft;
import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChatComponentText;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import codechicken.core.launch.CodeChickenCorePlugin;
import com.google.common.base.Function; import com.google.common.base.Function;
import codechicken.core.launch.CodeChickenCorePlugin;
import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.versioning.ComparableVersion; import cpw.mods.fml.common.versioning.ComparableVersion;
import cpw.mods.fml.relauncher.FMLInjectionData; import cpw.mods.fml.relauncher.FMLInjectionData;
@@ -13,11 +13,10 @@ import net.minecraft.launchwrapper.Launch;
import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.ClassNode;
import codechicken.core.launch.CodeChickenCorePlugin;
import codechicken.lib.asm.ASMHelper;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import codechicken.core.launch.CodeChickenCorePlugin;
import codechicken.lib.asm.ASMHelper;
import cpw.mods.fml.common.FMLLog; import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.ModClassLoader; import cpw.mods.fml.common.ModClassLoader;
@@ -1,9 +1,24 @@
package codechicken.core; package codechicken.core;
import static org.lwjgl.opengl.GL11.*; import static org.lwjgl.opengl.GL11.GL_ALWAYS;
import static org.lwjgl.opengl.GL11.GL_EQUAL;
import static org.lwjgl.opengl.GL11.GL_KEEP;
import static org.lwjgl.opengl.GL11.GL_PACK_ALIGNMENT;
import static org.lwjgl.opengl.GL11.GL_REPLACE;
import static org.lwjgl.opengl.GL11.GL_STENCIL_INDEX;
import static org.lwjgl.opengl.GL11.GL_STENCIL_TEST;
import static org.lwjgl.opengl.GL11.GL_UNPACK_ALIGNMENT;
import static org.lwjgl.opengl.GL11.GL_UNSIGNED_BYTE;
import static org.lwjgl.opengl.GL11.GL_ZERO;
import static org.lwjgl.opengl.GL11.glColorMask;
import static org.lwjgl.opengl.GL11.glDisable;
import static org.lwjgl.opengl.GL11.glEnable;
import static org.lwjgl.opengl.GL11.glPixelStorei;
import static org.lwjgl.opengl.GL11.glReadPixels; import static org.lwjgl.opengl.GL11.glReadPixels;
import static org.lwjgl.opengl.GL11.glStencilFunc;
import static org.lwjgl.opengl.GL11.glStencilOp;
import java.awt.*; import java.awt.Dimension;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
@@ -13,10 +13,10 @@ import net.minecraft.inventory.Container;
import net.minecraft.server.MinecraftServer; import net.minecraft.server.MinecraftServer;
import net.minecraft.util.IChatComponent; import net.minecraft.util.IChatComponent;
import codechicken.lib.asm.ObfMapping;
import com.mojang.authlib.GameProfile; import com.mojang.authlib.GameProfile;
import codechicken.lib.asm.ObfMapping;
public class ServerUtils extends CommonUtils { public class ServerUtils extends CommonUtils {
public static MinecraftServer mc() { public static MinecraftServer mc() {
@@ -3,10 +3,9 @@ package codechicken.core.asm;
import java.io.IOException; import java.io.IOException;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import codechicken.lib.asm.ObfMapping;
import com.google.common.collect.ImmutableBiMap; import com.google.common.collect.ImmutableBiMap;
import codechicken.lib.asm.ObfMapping;
import cpw.mods.fml.common.asm.transformers.AccessTransformer; import cpw.mods.fml.common.asm.transformers.AccessTransformer;
import cpw.mods.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper; import cpw.mods.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper;
@@ -6,17 +6,19 @@ import java.util.List;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
import com.google.common.eventbus.EventBus;
import com.google.common.eventbus.Subscribe;
import codechicken.core.CCUpdateChecker; import codechicken.core.CCUpdateChecker;
import codechicken.core.ClientUtils; import codechicken.core.ClientUtils;
import codechicken.core.featurehack.LiquidTextures; import codechicken.core.featurehack.LiquidTextures;
import codechicken.core.internal.CCCEventHandler; import codechicken.core.internal.CCCEventHandler;
import codechicken.core.launch.CodeChickenCorePlugin; import codechicken.core.launch.CodeChickenCorePlugin;
import codechicken.lib.config.ConfigFile; import codechicken.lib.config.ConfigFile;
import cpw.mods.fml.common.DummyModContainer;
import com.google.common.eventbus.EventBus; import cpw.mods.fml.common.FMLCommonHandler;
import com.google.common.eventbus.Subscribe; import cpw.mods.fml.common.LoadController;
import cpw.mods.fml.common.ModMetadata;
import cpw.mods.fml.common.*;
import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.versioning.ArtifactVersion; import cpw.mods.fml.common.versioning.ArtifactVersion;
@@ -39,9 +41,9 @@ public class CodeChickenCoreModContainer extends DummyModContainer {
private static ModMetadata getModMetadata() { private static ModMetadata getModMetadata() {
final ModMetadata modMetadata = new ModMetadata(); final ModMetadata modMetadata = new ModMetadata();
modMetadata.name = "GRADLETOKEN_MODNAME"; modMetadata.name = "CodeChicken Core";
modMetadata.modId = "GRADLETOKEN_MODID"; modMetadata.modId = "CodeChickenCore";
modMetadata.version = "GRADLETOKEN_VERSION"; modMetadata.version = Tags.VERSION;
return modMetadata; return modMetadata;
} }
@@ -2,7 +2,11 @@ package codechicken.core.asm;
import java.io.IOException; import java.io.IOException;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.*; import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import net.minecraft.launchwrapper.IClassTransformer; import net.minecraft.launchwrapper.IClassTransformer;
@@ -16,6 +20,9 @@ import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.MethodInsnNode; import org.objectweb.asm.tree.MethodInsnNode;
import org.objectweb.asm.tree.MethodNode; import org.objectweb.asm.tree.MethodNode;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import codechicken.lib.asm.ASMHelper; import codechicken.lib.asm.ASMHelper;
import codechicken.lib.asm.ASMInit; import codechicken.lib.asm.ASMInit;
import codechicken.lib.asm.CC_ClassWriter; import codechicken.lib.asm.CC_ClassWriter;
@@ -23,10 +30,6 @@ import codechicken.lib.asm.ObfMapping;
import codechicken.obfuscator.IHeirachyEvaluator; import codechicken.obfuscator.IHeirachyEvaluator;
import codechicken.obfuscator.ObfuscationMap.ObfuscationEntry; import codechicken.obfuscator.ObfuscationMap.ObfuscationEntry;
import codechicken.obfuscator.ObfuscationRun; import codechicken.obfuscator.ObfuscationRun;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import cpw.mods.fml.common.asm.transformers.AccessTransformer; import cpw.mods.fml.common.asm.transformers.AccessTransformer;
import cpw.mods.fml.relauncher.IFMLLoadingPlugin; import cpw.mods.fml.relauncher.IFMLLoadingPlugin;
@@ -1,6 +1,6 @@
package codechicken.core.asm; package codechicken.core.asm;
import static org.objectweb.asm.Opcodes.*; import static org.objectweb.asm.Opcodes.ASM4;
import java.io.File; import java.io.File;
import java.io.PrintWriter; import java.io.PrintWriter;
@@ -1,6 +1,6 @@
package codechicken.core.asm; package codechicken.core.asm;
import static codechicken.lib.asm.InsnComparator.*; import static codechicken.lib.asm.InsnComparator.findOnce;
import java.util.Map; import java.util.Map;
@@ -11,10 +11,14 @@ import org.objectweb.asm.tree.JumpInsnNode;
import org.objectweb.asm.tree.LabelNode; import org.objectweb.asm.tree.LabelNode;
import org.objectweb.asm.tree.MethodNode; import org.objectweb.asm.tree.MethodNode;
import codechicken.lib.asm.*; import codechicken.lib.asm.ASMBlock;
import codechicken.lib.asm.ASMInit;
import codechicken.lib.asm.ASMReader;
import codechicken.lib.asm.ModularASMTransformer;
import codechicken.lib.asm.ModularASMTransformer.MethodReplacer; import codechicken.lib.asm.ModularASMTransformer.MethodReplacer;
import codechicken.lib.asm.ModularASMTransformer.MethodTransformer; import codechicken.lib.asm.ModularASMTransformer.MethodTransformer;
import codechicken.lib.asm.ModularASMTransformer.MethodWriter; import codechicken.lib.asm.ModularASMTransformer.MethodWriter;
import codechicken.lib.asm.ObfMapping;
import codechicken.lib.config.ConfigTag; import codechicken.lib.config.ConfigTag;
public class TweakTransformer implements IClassTransformer, Opcodes { public class TweakTransformer implements IClassTransformer, Opcodes {
@@ -1,6 +1,7 @@
package codechicken.core.gui; package codechicken.core.gui;
import java.awt.*; import java.awt.Dimension;
import java.awt.Rectangle;
import codechicken.lib.math.MathHelper; import codechicken.lib.math.MathHelper;
import codechicken.lib.vec.Rectangle4i; import codechicken.lib.vec.Rectangle4i;
@@ -1,6 +1,6 @@
package codechicken.core.gui; package codechicken.core.gui;
import java.awt.*; import java.awt.Rectangle;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
@@ -1,6 +1,7 @@
package codechicken.core.launch; package codechicken.core.launch;
import java.awt.*; import java.awt.Desktop;
import java.awt.GraphicsEnvironment;
import java.io.File; import java.io.File;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import java.lang.reflect.Field; import java.lang.reflect.Field;
@@ -20,7 +21,11 @@ import javax.swing.event.HyperlinkListener;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import codechicken.core.asm.*; import codechicken.core.asm.CodeChickenCoreModContainer;
import codechicken.core.asm.DelegatedTransformer;
import codechicken.core.asm.MCPDeobfuscationTransformer;
import codechicken.core.asm.Tags;
import codechicken.core.asm.TweakTransformer;
import codechicken.lib.config.ConfigTag; import codechicken.lib.config.ConfigTag;
import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.versioning.DefaultArtifactVersion; import cpw.mods.fml.common.versioning.DefaultArtifactVersion;
@@ -39,7 +44,7 @@ public class CodeChickenCorePlugin implements IFMLLoadingPlugin, IFMLCallHook {
public static final String mcVersion = "[1.7.10]"; public static final String mcVersion = "[1.7.10]";
@Deprecated @Deprecated
public static final String version = "GRADLETOKEN_VERSION"; public static final String version = Tags.VERSION;
public static File minecraftDir; public static File minecraftDir;
public static String currentMcVersion; public static String currentMcVersion;
@@ -1,35 +1,51 @@
package codechicken.core.launch; package codechicken.core.launch;
import java.awt.*; import java.awt.Desktop;
import java.awt.Dialog.ModalityType; import java.awt.Dialog.ModalityType;
import java.awt.Dimension;
import java.awt.GraphicsEnvironment;
import java.awt.event.WindowAdapter; import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent; import java.awt.event.WindowEvent;
import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener; import java.beans.PropertyChangeListener;
import java.io.*; import java.io.Closeable;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.InterruptedIOException;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
import java.net.URLClassLoader; import java.net.URLClassLoader;
import java.net.URLConnection; import java.net.URLConnection;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.util.*; import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException; import java.util.regex.PatternSyntaxException;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
import java.util.zip.ZipFile; import java.util.zip.ZipFile;
import javax.swing.*; import javax.swing.Box;
import javax.swing.JDialog;
import javax.swing.JEditorPane;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JProgressBar;
import javax.swing.WindowConstants;
import javax.swing.event.HyperlinkEvent; import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener; import javax.swing.event.HyperlinkListener;
import net.minecraft.launchwrapper.LaunchClassLoader; import net.minecraft.launchwrapper.LaunchClassLoader;
import sun.misc.URLClassPath;
import sun.net.util.URLUtil;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.google.gson.JsonParser; import com.google.gson.JsonParser;
@@ -40,6 +56,8 @@ import cpw.mods.fml.relauncher.FMLLaunchHandler;
import cpw.mods.fml.relauncher.IFMLCallHook; import cpw.mods.fml.relauncher.IFMLCallHook;
import cpw.mods.fml.relauncher.IFMLLoadingPlugin; import cpw.mods.fml.relauncher.IFMLLoadingPlugin;
import cpw.mods.fml.relauncher.IFMLLoadingPlugin.MCVersion; import cpw.mods.fml.relauncher.IFMLLoadingPlugin.MCVersion;
import sun.misc.URLClassPath;
import sun.net.util.URLUtil;
/** /**
* For autodownloading stuff. This is really unoriginal, mostly ripped off FML, credits to cpw. * For autodownloading stuff. This is really unoriginal, mostly ripped off FML, credits to cpw.
@@ -1,6 +1,7 @@
package codechicken.obfuscator; package codechicken.obfuscator;
import static org.objectweb.asm.tree.AbstractInsnNode.*; import static org.objectweb.asm.tree.AbstractInsnNode.LDC_INSN;
import static org.objectweb.asm.tree.AbstractInsnNode.METHOD_INSN;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
@@ -7,11 +7,11 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import codechicken.lib.asm.ObfMapping;
import com.google.common.base.Function; import com.google.common.base.Function;
import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ArrayListMultimap;
import codechicken.lib.asm.ObfMapping;
public class ObfuscationMap { public class ObfuscationMap {
public class ObfuscationEntry { public class ObfuscationEntry {