Skip to content

Commit

Permalink
Update 1.0.1
Browse files Browse the repository at this point in the history
Balanced clay crafting recipes.
  • Loading branch information
TheIcyOne committed Mar 17, 2017
1 parent 8a4796d commit 5f45436
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 5 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/headfishindustries/clay/Clay.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void init (FMLInitializationEvent e) {

@EventHandler
public void postInit (FMLPostInitializationEvent e) {

CraftDerper.removeRecipes();
}

}
37 changes: 37 additions & 0 deletions src/main/java/com/headfishindustries/clay/proxy/CraftDerper.java
Original file line number Diff line number Diff line change
@@ -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(){
List<IRecipe>rlist = 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);
}
}

0 comments on commit 5f45436

Please sign in to comment.