Skip to content

Instantly share code, notes, and snippets.

View Xyene's full-sized avatar
🦆

Tudor Brindus Xyene

🦆
View GitHub Profile
@Xyene
Xyene / PluginDownloader.java
Last active December 11, 2015 16:58
A cleaner dependency manager for Bukkit plugins.
public class PluginDownloader {
public boolean exists(String path) {
try {
HttpURLConnection urlConn = (HttpURLConnection) new URL(path).openConnection();
urlConn.setConnectTimeout(1000 * 10);
urlConn.connect();
return urlConn.getResponseCode() == HttpURLConnection.HTTP_OK;
} catch (MalformedURLException e) {
System.err.println("The URL given <" + path + "> was not found!");
@Xyene
Xyene / Block.java
Created January 23, 2013 23:52
Deobfuscated NMS.Block.
package net.minecraft.src;
import java.util.List;
import java.util.Random;
public class Block
{
/**
* used as foreach item, if item.tab = current tab, display it on the screen
*/
@Xyene
Xyene / CodeGenerator.java
Created January 23, 2013 22:39
An improvement on the current JBS implementation.
package com.github.Icyene.bytecode.generation;
import com.github.Icyene.bytecode.introspection.internal.Member;
import com.github.Icyene.bytecode.introspection.internal.code.ExceptionPool;
import com.github.Icyene.bytecode.introspection.internal.members.TryCatch;
import com.github.Icyene.bytecode.introspection.internal.members.attributes.Code;
import com.github.Icyene.bytecode.introspection.internal.metadata.readers.SignatureReader;
import com.github.Icyene.bytecode.introspection.util.ByteStream;
import com.github.Icyene.bytecode.introspection.util.Bytes;
@Xyene
Xyene / Crash.log
Created January 20, 2013 20:00
Server Tick Loop Crash
19:55:59 [SEVERE] net.minecraft.server.ReportedException: Ticking entity
19:56:00 [SEVERE] at net.minecraft.server.MinecraftServer.r(MinecraftServer.java:573)
19:56:00 [SEVERE] at net.minecraft.server.DedicatedServer.r(DedicatedServer.java:223)
19:56:00 [SEVERE] at net.minecraft.server.MinecraftServer.q(MinecraftServer.java:482)
19:56:00 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:417)
19:56:00 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:849)
19:56:00 [SEVERE] Caused by: java.lang.NoSuchMethodError: net.minecraft.server.EntityCreeper.aG()Lnet/minecraft/server/EntityLiving;
19:56:00 [SEVERE] at net.minecraft.server.PathfinderGoalSwell.a(SourceFile:18)
19:56:00 [SEVERE] at net.minecraft.server.PathfinderGoalSelector.a(PathfinderGoalSelector.java:66)
19:56:00 [SEVERE] at net.minecraft.server.EntityLiving.bl(EntityLiving.java:1480)
@Xyene
Xyene / MethodDump.log
Created December 5, 2012 00:04
Method dump.
Instrumenting class: com/github/Icyene/BytecodeStudio/disassembler/profiler/Test/Agent$Profile
com/github/Icyene/BytecodeStudio/disassembler/internal/ClassFile <init> start 1354665369937
Instrumenting class: com/github/Icyene/BytecodeStudio/disassembler/util/Bytes
Returning reinstrumented class: com/github/Icyene/BytecodeStudio/disassembler/util/Bytes
com/github/Icyene/BytecodeStudio/disassembler/util/Bytes read start 1354665369968
com/github/Icyene/BytecodeStudio/disassembler/util/Bytes read start 1354665369984
com/github/Icyene/BytecodeStudio/disassembler/util/Bytes read end 1354665369984
com/github/Icyene/BytecodeStudio/disassembler/util/Bytes read end 1354665369984
com/github/Icyene/BytecodeStudio/disassembler/internal/ClassFile <init> start 1354665369984
Instrumenting class: com/github/Icyene/BytecodeStudio/disassembler/util/ByteStream
@Xyene
Xyene / ReflectionHelper.java
Created November 23, 2012 12:54
ReflectionHelper
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
public class ReflectionHelper {
public static <T> FieldContainer<T> field(String name) {
return new FieldContainer<T>(name);
}
@Xyene
Xyene / ReflectCommand.java
Created November 7, 2012 23:13
Dynamic Reflection-Based Command Registrator & Handler
import com.google.common.collect.Sets;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
import org.bukkit.ChatColor;
import org.bukkit.command.*;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.SimplePluginManager;
import java.lang.annotation.ElementType;
@Xyene
Xyene / ReflectConfiguration.java
Created October 23, 2012 22:59
Even easier config files, with comments!
/**
* A class for saving/loading lazy configuration classes/files.
* Based on codename_B's non static config 'offering' :)
* Inspired by md_5's easy config
*
@Xyene
Xyene / ErrorLogger.java
Last active December 1, 2017 17:58
ErrorLogger - Better Error Logging
import net.minecraft.server.v1_4_R1.CrashReport;
import net.minecraft.server.v1_4_R1.MinecraftServer;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_4_R1.CraftServer;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginLogger;
import org.bukkit.plugin.java.JavaPlugin;
import org.json.simple.JSONObject;
import org.json.simple.JSONValue;
@Xyene
Xyene / ErrorLogger.java
Created October 16, 2012 00:20
ErrorLogger
package com.github.StormTeam.Storm;
import net.minecraft.server.MinecraftServer;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginLogger;
import org.bukkit.plugin.java.JavaPlugin;