Skip to content

Instantly share code, notes, and snippets.

View Forkk's full-sized avatar
📖
Archive all the things!

Forkk Forkk

📖
Archive all the things!
View GitHub Profile
@Forkk
Forkk / CopyFile.java
Created January 7, 2012 18:51
For some reason, this doesn't actually copy any data.
public static void copyFile(File source, File dest, boolean overwrite)
throws IOException
{
if (!overwrite && dest.exists())
throw new IOException("Can't copy " + source + " to " + dest + ". " +
"The file already exists.");
if (source.isDirectory())
throw new IOException("Can't copy directories! Use recursiveCopy() " +
"instead.");
@Forkk
Forkk / Copy.java
Created January 7, 2012 19:08
Copy file
public static void copyFile(File source, File dest, boolean overwrite)
throws IOException
{
if (!overwrite && dest.exists())
throw new IOException("Can't copy " + source + " to " + dest + ". " +
"The file already exists.");
if (source.isDirectory())
throw new IOException("Can't copy directories! Use recursiveCopy() " +
"instead.");
String path = AccessController.doPrivileged(new PrivilegedExceptionAction()
{
public Object run() throws Exception
{
return Util.getWorkingDirectory() + File.separator + "bin" + File.separator;
}
});
public Applet createApplet() throws ClassNotFoundException,
InstantiationException, IllegalAccessException
{
Class<?> appletClass = classLoader
.loadClass("net.minecraft.client.MinecraftApplet");
try
{
Class<?> mcClass = classLoader.loadClass("net.minecraft.client.Minecraft");
Field mcDirField = null;
package net.minecraft.src;
public class ItemCrossbow extends ItemBow
{
private int cooldownTime;
private long lastShotTime;
float powerMult;
java.lang.NoSuchMethodError: lu.<init>(IZ)V
at mod_Arrows.load(mod_Arrows.java:115)
at ModLoader.init(ModLoader.java:824)
at ModLoader.AddAllRenderers(ModLoader.java:189)
at afq.<init>(afq.java:80)
at afq.<clinit>(afq.java:9)
at net.minecraft.client.Minecraft.a(SourceFile:265)
at net.minecraft.client.Minecraft.run(SourceFile:648)
at java.lang.Thread.run(Unknown Source)
// Renderers
HashMap<Class<? extends Entity>, Render> renderMap =
new HashMap<Class<? extends Entity>, Render>();
// Bolt renderer
renderMap.put(EntityBolt.class, new RenderBolt());
// Add the render map
AddRenderer(renderMap);
Setting up macros...
Done
== MCP 5.6 (data: 5.6, client: 1.1, server: 1.1) ==
Setting up macros...
Done
Setting up macros...
Done
== Reobfuscating client ==
> Gathering md5 checksums
> Compacting client bin directory
@Forkk
Forkk / gist:1624468
Created January 17, 2012 03:36
And this is why I love C#
public void Save()
{
string[] line = new string[dict.Count];
for (int i = 0; i < dict.Count; i++)
{
line[i] = dict.Keys[i] + "=" + dict.Values[i];
}
File.WriteAllLines("", line);
@Forkk
Forkk / gist:6082555
Created July 25, 2013 18:41
MCRewind Design Doc

Goals

During patch generation, the script will need to do the following:

  • Generate a JSON file containing a list of versions we have patches for along with some info about those versions and said patches.
  • Generate bsdiff patches for patching from the current version minecraft.jar to each jar file in the jars folder.
  • Automatically download new versions of Minecraft into the folder of old jars, so that the script can generate patches for them in the future.