From 5f4543654fb57cebe6f65149087782a7bedc5a54 Mon Sep 17 00:00:00 2001 From: TheIcyOne Date: Fri, 17 Mar 2017 22:13:20 +0000 Subject: [PATCH] Update 1.0.1 Balanced clay crafting recipes. --- build.gradle | 6 +-- .../com/headfishindustries/clay/Clay.java | 2 +- .../clay/proxy/CommonProxy.java | 2 +- .../clay/proxy/CraftDerper.java | 37 +++++++++++++++++++ 4 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 src/main/java/com/headfishindustries/clay/proxy/CraftDerper.java diff --git a/build.gradle b/build.gradle index baa9685..8db1863 100644 --- a/build.gradle +++ b/build.gradle @@ -11,9 +11,9 @@ apply plugin: 'net.minecraftforge.gradle.forge' //Only edit below this line, the above code adds and enables the nessasary things for Forge to be setup. -version = "1.0" -group= "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html -archivesBaseName = "modid" +version = "1.0.1" +group= "com.headfishindustries.clay" // http://maven.apache.org/guides/mini/guide-naming-conventions.html +archivesBaseName = "clay" sourceCompatibility = targetCompatibility = "1.6" // Need this here so eclipse task generates correctly. compileJava { diff --git a/src/main/java/com/headfishindustries/clay/Clay.java b/src/main/java/com/headfishindustries/clay/Clay.java index 2fcd759..4c58c1b 100644 --- a/src/main/java/com/headfishindustries/clay/Clay.java +++ b/src/main/java/com/headfishindustries/clay/Clay.java @@ -12,7 +12,7 @@ @Mod(modid = Clay.MODID, version = Clay.VERSION) public class Clay { public static final String MODID = "claymod"; - public static final String VERSION = "1.1"; + public static final String VERSION = "GRADLE:VERSION-" + "GRADLE:BUILD"; @SidedProxy(clientSide="com.headfishindustries.clay.proxy.ClientProxy", serverSide = "com.headfishindustries.clay.proxy.CommonProxy") public static CommonProxy proxy; diff --git a/src/main/java/com/headfishindustries/clay/proxy/CommonProxy.java b/src/main/java/com/headfishindustries/clay/proxy/CommonProxy.java index 3186a7d..06387cf 100644 --- a/src/main/java/com/headfishindustries/clay/proxy/CommonProxy.java +++ b/src/main/java/com/headfishindustries/clay/proxy/CommonProxy.java @@ -21,7 +21,7 @@ public void init (FMLInitializationEvent e) { @EventHandler public void postInit (FMLPostInitializationEvent e) { - + CraftDerper.removeRecipes(); } } diff --git a/src/main/java/com/headfishindustries/clay/proxy/CraftDerper.java b/src/main/java/com/headfishindustries/clay/proxy/CraftDerper.java new file mode 100644 index 0000000..f0dbcdf --- /dev/null +++ b/src/main/java/com/headfishindustries/clay/proxy/CraftDerper.java @@ -0,0 +1,37 @@ +package com.headfishindustries.clay.proxy; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockClay; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; +import net.minecraftforge.fml.common.registry.GameRegistry; + +public class CraftDerper { + @SuppressWarnings({ "unchecked", "rawtypes" }) + public static void removeRecipes(){ + Listrlist = new ArrayList(CraftingManager.getInstance().getRecipeList()); + for (IRecipe r : rlist){ + net.minecraft.item.ItemStack out = r.getRecipeOutput(); + System.out.println(out.toString()); + Item outItem = out.getItem(); + Block outBlock = Block.getBlockFromItem(outItem); + if (outBlock != null && outBlock instanceof BlockClay){ + //if(ItemStack.areItemStacksEqual(out, new ItemStack(outBlock, 2))) + CraftingManager.getInstance().getRecipeList().remove(r); + + } + } + addRecipes(); + } + public static void addRecipes(){ + //Unfortunately, we can't craft with half a dragon egg. Not yet. + GameRegistry.addRecipe(new ItemStack(Blocks.CLAY, 2), "AAA", "ABA", "AAA", 'A', Items.CLAY_BALL, 'B', Blocks.DRAGON_EGG); + } +}