Skip to content

Instantly share code, notes, and snippets.

View Unh0lyTigg's full-sized avatar

Robert Allen Unh0lyTigg

View GitHub Profile
import java.lang.reflect.Type;
import net.minecraft.nbt.JsonToNBT;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTException;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.TypeAdapter;
public class DeVoid {
@AutoSubscribe
public static DeVoid INSTANCE = new DeVoid();
@SubscribeEvent
public void worldLoad(WorldEvent.Load event) {
if (!event.world.getGameRules().hasRule("doesVoidKillPlayer")) {
event.world.getGameRules().addGameRule("doesVoidKillPlayer", "true", ValueType.BOOLEAN_VALUE);
TiggCore.LOGGER.info("Added doesVoidKillPlayer gamerule to " + event.world.getSaveHandler().getWorldDirectoryName() + "\\" + event.world.provider.getDimensionName());
}
@EventHandler
public void pre(FMLPreInitializationEvent event) {
SimpleNetworkWrapper n = NetworkRegistry.INSTANCE.newSimpleChannel("test");
n.registerMessage(PacketHandlerSA.class, SAPacket.class, 0, Side.CLIENT);
}
public static class MessageSendAchievements<T> implements IMessage {
public void fromBytes(ByteBuf buf) {}
public void toBytes(ByteBuf buf) {}
}
import static org.lwjgl.opengl.GL11.*;
import static org.lwjgl.system.MemoryUtil.NULL;
import static org.lwjgl.system.glfw.GLFW.*;
import java.awt.Dimension;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Point;
import java.nio.ByteBuffer;
public static Field SetArmorModel_stack;
public static void setStack(SetArmorModel event, ItemStack stack) {
if (SetArmorModel_stack == null) {
SetArmorModel_stack = SetArmorModel.class.getField("stack");
SetArmorModel_stack.setAccessible(true);
}
SetArmorModel_stack.set(event, stack);
}
def findNativeName() {
final String osNameStr = System.properties['os.name']
return [
'linux': {
osNameStr ==~ /(?i)linux.*/
},
'windows': {
osNameStr ==~ /(?i)windows.*/
},
'osx': {
package org.unh0lytigg.circuitboards.base;
import java.lang.annotation.Annotation;
import java.util.Set;
import cpw.mods.fml.common.discovery.ASMDataTable;
import cpw.mods.fml.common.discovery.ASMDataTable.ASMData;
public class ASMUser {
private static ASMDataTable table;
configurations {
attachSource
}
def loadSourcePaths() {
def result = new HashMap<String, String>()
configurations.attachSource.each {
def depFile = file(it)
def filename = depFile.getName()
@Unh0lyTigg
Unh0lyTigg / Grid.java
Created October 2, 2014 23:12
Word Search
package org.unh0lytigg.wordsearch;
import java.util.List;
import java.util.Map;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
public class Grid {
package org.utlauncher;
import java.util.List;
import org.utlauncher.data.Package;
import com.google.common.collect.Lists;
public enum PackageManager {
INSTANCE;