Skip to content
This repository has been archived by the owner on May 13, 2021. It is now read-only.

Commit

Permalink
Update to the TeamChisel version of Chisel
Browse files Browse the repository at this point in the history
Also cleans up a bit of code.

Removed the Steamcraft chisel because the API really isn't very good. Quite hard to work with.
  • Loading branch information
TehNut committed Aug 28, 2015
1 parent 5dbd6b1 commit 854fea9
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 41 deletions.
9 changes: 5 additions & 4 deletions src/main/java/tehnut/morechisels/MoreChisels.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.common.MinecraftForge;
import tehnut.morechisels.compat.*;
import tehnut.morechisels.item.ItemRecipeRegistry;
import tehnut.morechisels.registry.RecipeRegistry;
import tehnut.morechisels.registry.ItemRegistry;
import tehnut.morechisels.proxy.CommonProxy;
import tehnut.morechisels.util.EventHandler;
Expand All @@ -30,16 +30,17 @@ public void preInit(FMLPreInitializationEvent event) {

LogHelper.checkLogger();

MinecraftForge.EVENT_BUS.register(new EventHandler());
FMLCommonHandler.instance().bus().register(new EventHandler());
EventHandler handler = new EventHandler();
MinecraftForge.EVENT_BUS.register(handler);
FMLCommonHandler.instance().bus().register(handler);
}

@Mod.EventHandler
public void init(FMLInitializationEvent event) {
proxy.load();

ItemRegistry.registerItems();
ItemRecipeRegistry.registerRecipes();
RecipeRegistry.registerRecipes();

Utils.registerCompat(CompatibilityAetherII.class, "aether");
Utils.registerCompat(CompatibilityBloodMagic.class, "AWWayofTime");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import net.minecraft.item.Item;
import tehnut.morechisels.item.ChiselType;
import tehnut.morechisels.item.ItemChiselBase;
import tehnut.morechisels.item.ItemRecipeRegistry;
import tehnut.morechisels.registry.RecipeRegistry;
import tehnut.morechisels.registry.ItemRegistry;
import tehnut.morechisels.util.LogHelper;

Expand Down Expand Up @@ -45,9 +45,9 @@ private static void registerRecipes() {
Item zanite = GameRegistry.findItem("aether", "zaniteGemstone");
Block gravitite = GameRegistry.findBlock("aether", "enchantedGravitite");

ItemRecipeRegistry.addConfiguredChiselRecipe(chiselSkyroot, skyroot, chiselSkyrootEnabled);
ItemRecipeRegistry.addConfiguredChiselRecipe(chiselHolystone, holystone, chiselHolystoneEnabled);
ItemRecipeRegistry.addConfiguredChiselRecipe(chiselZanite, zanite, chiselZaniteEnabled);
ItemRecipeRegistry.addConfiguredChiselRecipe(chiselGravitite, gravitite, chiselGravititeEnabled);
RecipeRegistry.addConfiguredChiselRecipe(chiselSkyroot, skyroot, chiselSkyrootEnabled);
RecipeRegistry.addConfiguredChiselRecipe(chiselHolystone, holystone, chiselHolystoneEnabled);
RecipeRegistry.addConfiguredChiselRecipe(chiselZanite, zanite, chiselZaniteEnabled);
RecipeRegistry.addConfiguredChiselRecipe(chiselGravitite, gravitite, chiselGravititeEnabled);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package tehnut.morechisels.compat;

import net.minecraft.item.Item;
import tehnut.morechisels.item.ItemRecipeRegistry;
import tehnut.morechisels.registry.RecipeRegistry;
import tehnut.morechisels.registry.ItemRegistry;
import tehnut.morechisels.item.chisel.ItemChiselElementium;
import tehnut.morechisels.item.chisel.ItemChiselManasteel;
Expand Down Expand Up @@ -31,7 +31,7 @@ private static void registerItems() {

private static void registerRecipes() {

ItemRecipeRegistry.addConfiguredChiselRecipe(chiselManasteel, "ingotManasteel", chiselManasteelEnabled);
ItemRecipeRegistry.addConfiguredChiselRecipe(chiselElementium, "ingotElvenElementium", chiselElementiumEnabled);
RecipeRegistry.addConfiguredChiselRecipe(chiselManasteel, "ingotManasteel", chiselManasteelEnabled);
RecipeRegistry.addConfiguredChiselRecipe(chiselElementium, "ingotElvenElementium", chiselElementiumEnabled);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import net.minecraftforge.oredict.ShapedOreRecipe;
import tehnut.morechisels.item.ChiselType;
import tehnut.morechisels.item.ItemChiselBase;
import tehnut.morechisels.item.ItemRecipeRegistry;
import tehnut.morechisels.registry.RecipeRegistry;
import tehnut.morechisels.registry.ItemRegistry;
import tehnut.morechisels.item.chisel.ItemChiselBedrockium;
import tehnut.morechisels.util.LogHelper;
Expand Down Expand Up @@ -36,7 +36,7 @@ private static void registerItems() {
private static void registerRecipes() {
Item bedrockiumIngot = GameRegistry.findItem("ExtraUtilities", "bedrockiumIngot");

ItemRecipeRegistry.addThemedChiselRecipe(chiselBedrockium, bedrockiumIngot, "ingotUnstable", chiselBedrockiumEnabled);
RecipeRegistry.addThemedChiselRecipe(chiselBedrockium, bedrockiumIngot, "ingotUnstable", chiselBedrockiumEnabled);
if (chiselUnstableEnabled && bedrockiumIngot != null)
GameRegistry.addRecipe(new ShapedOreRecipe(chiselUnstable, "I", "O", 'I', "ingotUnstable", 'O', Blocks.obsidian));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import net.minecraftforge.oredict.ShapedOreRecipe;
import tehnut.morechisels.item.ChiselType;
import tehnut.morechisels.item.ItemChiselBase;
import tehnut.morechisels.item.ItemRecipeRegistry;
import tehnut.morechisels.registry.RecipeRegistry;
import tehnut.morechisels.registry.ItemRegistry;
import tehnut.morechisels.util.LogHelper;

Expand Down Expand Up @@ -37,7 +37,7 @@ private static void registerRecipes() {
Item gcStick = GameRegistry.findItem("GalacticraftMars", "item.null");
int gcStickMeta = 1;

ItemRecipeRegistry.addConfiguredChiselRecipe(chiselCheese, cheese, chiselCheeseEnabled);
RecipeRegistry.addConfiguredChiselRecipe(chiselCheese, cheese, chiselCheeseEnabled);
GameRegistry.addRecipe(new ShapedOreRecipe(chiselDesh, " I", "S ", 'I', "ingotDesh", 'S', new ItemStack(gcStick, 1, gcStickMeta)));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import net.minecraft.item.Item;
import tehnut.morechisels.item.ChiselType;
import tehnut.morechisels.item.ItemChiselBase;
import tehnut.morechisels.item.ItemRecipeRegistry;
import tehnut.morechisels.registry.RecipeRegistry;
import tehnut.morechisels.registry.ItemRegistry;
import tehnut.morechisels.util.LogHelper;

Expand All @@ -25,6 +25,6 @@ private static void registerItems() {
}

private static void registerRecipes() {
ItemRecipeRegistry.addThemedChiselRecipe(chiselSoulium, "ingotSoulium", "ingotIron", chiselSouliumEnabled);
RecipeRegistry.addThemedChiselRecipe(chiselSoulium, "ingotSoulium", "ingotIron", chiselSouliumEnabled);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package tehnut.morechisels.compat;

import net.minecraft.item.Item;
import tehnut.morechisels.item.ItemRecipeRegistry;
import tehnut.morechisels.registry.RecipeRegistry;
import tehnut.morechisels.registry.ItemRegistry;
import tehnut.morechisels.item.chisel.ItemChiselThaumium;
import tehnut.morechisels.item.chisel.ItemChiselVoidmetal;
Expand Down Expand Up @@ -29,7 +29,7 @@ private static void registerItems() {
}

private static void registerRecipes() {
ItemRecipeRegistry.addConfiguredChiselRecipe(chiselThaumium, "ingotThaumium", chiselThaumiumEnabled);
ItemRecipeRegistry.addConfiguredChiselRecipe(chiselVoidmetal, "ingotVoid", chiselVoidmetalEnabled);
RecipeRegistry.addConfiguredChiselRecipe(chiselThaumium, "ingotThaumium", chiselThaumiumEnabled);
RecipeRegistry.addConfiguredChiselRecipe(chiselVoidmetal, "ingotVoid", chiselVoidmetalEnabled);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import net.minecraft.item.Item;
import tehnut.morechisels.item.ChiselType;
import tehnut.morechisels.item.ItemChiselBase;
import tehnut.morechisels.item.ItemRecipeRegistry;
import tehnut.morechisels.registry.RecipeRegistry;
import tehnut.morechisels.registry.ItemRegistry;
import tehnut.morechisels.util.LogHelper;

Expand Down Expand Up @@ -42,9 +42,9 @@ private static void registerRecipes() {
Item knightmetalIngot = GameRegistry.findItem("TwilightForest", "item.knightMetal");
Item fieryIngot = GameRegistry.findItem("TwilightForest", "item.fieryIngot");

ItemRecipeRegistry.addConfiguredChiselRecipe(chiselIronwood, "ironwood", chiselIronwoodEnabled);
ItemRecipeRegistry.addConfiguredChiselRecipe(chiselSteeleaf, "steeleaf", chiselSteeleafEnabled);
ItemRecipeRegistry.addConfiguredChiselRecipe(chiselKnightmetal, knightmetalIngot, chiselKnightmetalEnabled);
ItemRecipeRegistry.addThemedChiselRecipe(chiselFiery, fieryIngot, Items.blaze_rod, chiselFieryEnabled);
RecipeRegistry.addConfiguredChiselRecipe(chiselIronwood, "ironwood", chiselIronwoodEnabled);
RecipeRegistry.addConfiguredChiselRecipe(chiselSteeleaf, "steeleaf", chiselSteeleafEnabled);
RecipeRegistry.addConfiguredChiselRecipe(chiselKnightmetal, knightmetalIngot, chiselKnightmetalEnabled);
RecipeRegistry.addThemedChiselRecipe(chiselFiery, fieryIngot, Items.blaze_rod, chiselFieryEnabled);
}
}
14 changes: 2 additions & 12 deletions src/main/java/tehnut/morechisels/item/chisel/ItemChiselGem.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,7 @@ public String getItemStackDisplayName(ItemStack stack) {
@SideOnly(Side.CLIENT)
@Override
public int getColorFromItemStack(ItemStack stack, int pass) {

if (pass == 1) {
return Color.decode(hexColor).getRGB();
} else {
return super.getColorFromItemStack(stack, pass);
}
return pass == 1 ? Color.decode(hexColor).getRGB() : super.getColorFromItemStack(stack, pass);
}

@Override
Expand All @@ -69,11 +64,6 @@ public boolean requiresMultipleRenderPasses() {

@Override
public IIcon getIcon(ItemStack stack, int pass) {
if (pass == 0) {
return this.itemIcon;
} else if (pass == 1) {
return this.overlayIcon;
}
return getIconFromDamageForRenderPass(stack.getItemDamage(), pass);
return pass == 0 ? this.itemIcon : this.overlayIcon;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tehnut.morechisels.item;
package tehnut.morechisels.registry;

import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;
Expand All @@ -8,9 +8,8 @@
import net.minecraftforge.oredict.ShapedOreRecipe;
import team.chisel.config.Configurations;
import tehnut.morechisels.ConfigHandler;
import tehnut.morechisels.registry.ItemRegistry;

public class ItemRecipeRegistry {
public class RecipeRegistry {

public static void registerRecipes() {
for (int i = 0; i < ItemRegistry.chiselGem.length; i++) {
Expand Down

0 comments on commit 854fea9

Please sign in to comment.