Add NEI "recipes" button to chisel GUI

This commit is contained in:
tterrag1098 committed 2015-01-15 09:20:31 -05:00
1 parent 4bcaa62ca7
commit db91b04387
3 files changed
+16 -8

No files matched your search

@@ -5,12 +5,12 @@ import net.minecraft.item.ItemStack;
public class CarvingUtils {
/**
* The default implementation of {@link ICarvingVariation#compareTo(ICarvingVariation)}
* A simple way to compare two {@link ICarvingVariation} objects based on the {@link ICarvingVariation#getOrder() getOrder()} method.
*
* @param v1
* The first {@link ICarvingVariation variation}. Usually 'this'.
* The first {@link ICarvingVariation variation}.
* @param v2
* The second {@link ICarvingVariation variation}. Usually the parameter to the {@code comapreTo} method.
* The second {@link ICarvingVariation variation}.
* @return A positive integer if the first's order is greater, a negative integer if the second's is greater, and 0 if they are equal.
*/
public static int compare(ICarvingVariation v1, ICarvingVariation v2) {
@@ -1,11 +1,12 @@
package com.cricketcraft.chisel.compat.nei;
import net.minecraft.item.ItemStack;
import com.cricketcraft.chisel.Chisel;
import codechicken.nei.api.API;
import codechicken.nei.api.IConfigureNEI;
import com.cricketcraft.chisel.Chisel;
import com.cricketcraft.chisel.client.gui.GuiChisel;
import cpw.mods.fml.common.registry.GameRegistry;
public class NEIChiselConfig implements IConfigureNEI {
@@ -25,10 +26,10 @@ public class NEIChiselConfig implements IConfigureNEI {
API.hideItem(new ItemStack(GameRegistry.findBlock("chisel", "limestone_slab_top")));
API.hideItem(new ItemStack(GameRegistry.findBlock("chisel", "marble_slab_top")));
API.hideItem(new ItemStack(GameRegistry.findBlock("chisel", "marble_pillar_slab_top")));
RecipeHandlerChisel handler = new RecipeHandlerChisel();
API.registerRecipeHandler(handler);
API.registerUsageHandler(handler);
API.setGuiOffset(GuiChisel.class, -50, 40);
}
}
@@ -5,6 +5,7 @@ import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
@@ -19,6 +20,7 @@ import com.cricketcraft.chisel.api.carving.CarvingUtils;
import com.cricketcraft.chisel.api.carving.ICarvingGroup;
import com.cricketcraft.chisel.api.carving.ICarvingVariation;
import com.cricketcraft.chisel.carving.Carving;
import com.cricketcraft.chisel.client.gui.GuiChisel;
public class RecipeHandlerChisel extends TemplateRecipeHandler {
@@ -82,6 +84,11 @@ public class RecipeHandlerChisel extends TemplateRecipeHandler {
public String getGuiTexture() {
return "Chisel:textures/chiselNEI.png";
}
@Override
public Class<? extends GuiContainer> getGuiClass() {
return GuiChisel.class;
}
@Override
public void drawBackground(int recipeIndex) {