Skip to content

Instantly share code, notes, and snippets.

View Unh0lyTigg's full-sized avatar

Robert Allen Unh0lyTigg

View GitHub Profile
@Unh0lyTigg
Unh0lyTigg / chips.json
Created June 27, 2014 21:36
Proposed simple CircuitBoards chip creation.
[
{
"ic_part":"7400",
"description":"quad 2-input NAND gate",
"pin_count":14,
"pins": [
{
"pin":1,
"name":"1A",
"description":"Input A of gate 1",
@Unh0lyTigg
Unh0lyTigg / CraftingRecipeBuilder.java
Last active August 29, 2015 14:02
CraftingRecipeBuilder
package net.minecraftforge.common;
import java.util.List;
import java.util.Map;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.ShapedRecipes;
@Unh0lyTigg
Unh0lyTigg / Container.java
Created May 21, 2014 09:26
Container.transferStackInSlot(EntityPlayer, int)
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
ItemStack itemstack = null;
Slot slot = (Slot)this.inventorySlots.get(par2);
if (slot != null && slot.getHasStack()) {
ItemStack itemstack1 = slot.getStack();
itemstack = itemstack1.copy();
if (par2 < this.tile.getSizeInventory())
if (!this.mergeItemStack(itemstack1, this.tile.getSizeInventory(), this.inventorySlots.size(), true))
return null;
else if (!this.mergeItemStack(itemstack1, 0, this.tile.getSizeInventory(), false))
@Unh0lyTigg
Unh0lyTigg / ItemTexture.java
Created December 27, 2013 08:58
Centralized item information
import java.util.Map;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.util.Icon;
import com.google.common.collect.Maps;
public class ItemTexture {
public static final ItemTexture INSTANCE = new ItemTexture();
private final Map<Integer, Map<Integer, String>> map;
@Unh0lyTigg
Unh0lyTigg / RectsArea.java
Last active December 23, 2015 14:09
Compute the overall area of some rectangles...
public class RectsArea {
public static long area(java.awt.Rectangle... rects) {
if (rects == null)
return 0;
java.awt.Rectangle massArea = null;
for (java.awt.Rectangle r : rects)
if (massArea == null)
massArea = r;
else
massArea = massArea.union(r);