Skip to content

Instantly share code, notes, and snippets.

View Unh0lyTigg's full-sized avatar

Robert Allen Unh0lyTigg

View GitHub Profile
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);
}
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;
@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) {}
}
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());
}
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;
package org.unh0lytigg.core.modules;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import net.minecraft.block.BlockCocoa;
import net.minecraft.block.BlockCrops;
import net.minecraft.block.BlockNetherWart;
import net.minecraft.block.properties.IProperty;
package org.unh0lytigg.core.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@interface ASContainer {
@Unh0lyTigg
Unh0lyTigg / 74ls00.json
Last active August 29, 2015 14:24
Prototype basic logic gate chip description json.
{
"chipname": "74LS00",
"quickdesc": "Quad 2-Input NAND Gate",
"pincount": 14,
"pins": [
{ "type": "logic-input", "name": "A1" },
{ "type": "logic-input", "name": "B1" },
{ "type": "logic-output", "name": "Y1" },
{ "type": "logic-input", "name": "A2" },
{ "type": "logic-input", "name": "B2" },
@Unh0lyTigg
Unh0lyTigg / ClassFinderSorter.java
Created July 21, 2015 05:22
ClassFinderSorter segment
public int compare(ClassFinder cf1, ClassFinder cf2) {
String targetClass1 = cf1.getTargetClass();
String targetClass2 = cf2.getTargetClass();
List<String> prereq1 = cf1.classesThatNeedFindingFirst();
List<String> prereq2 = cf2.classesThatNeedFindingFirst();
if (prereq1.isEmpty() && !prereq2.isEmpty())
return -1;
if (prereq2.isEmpty() && !prereq1.isEmpty())
return 1;
if (prereq1.isEmpty() && prereq2.isEmpty())
Running class finders against 15w31c.jar
Finished. 13 finders ran successfully, 0 finders failed, out of 13.
MCP: net.minecraft.client.main.GameConfiguration.GameInformation | MC: bcm.c
MCP: net.minecraft.client.main.GameConfiguration.UserInformation | MC: bcm.e
MCP: net.minecraft.client.main.GameConfiguration.FolderInformation | MC: bcm.b
MCP: net.minecraft.util.Session | MC: axl
MCP: net.minecraft.profiler.IPlayerUsage | MC: oy
MCP: net.minecraft.client.main.GameConfiguration.ServerInformation | MC: bcm.d
MCP: net.minecraft.client.main.GameConfiguration.DisplayInformation | MC: bcm.a
MCP: net.minecraft.client.main.GameConfiguration | MC: bcm