Skip to content

Commit

Permalink
Recipes and some name cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jaquadro committed Mar 12, 2015
1 parent 203a5c5 commit a672c69
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 10 deletions.
12 changes: 9 additions & 3 deletions resources/assets/gardenstuff/lang/en_US.lang
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
item.gardenstuff.chainLink.name=Chain Link
item.gardenstuff.chainLink.iron.name=Iron Chain Link
item.gardenstuff.chainLink.gold.name=Gold Chain Link
item.gardenstuff.chainLink.wrought_iron=Wrought Iron Chain Link
item.gardenstuff.ironNugget.name=Iron Nugget
item.gardenstuff.wroughtIronIngot.name=Wrought Iron Ingot
item.gardenstuff.wroughtIronNugget.name=Wrought Iron Nugget
Expand All @@ -9,18 +10,18 @@ tile.gardenstuff.heavyChain.name=Heavy Chain
tile.gardenstuff.heavyChain.iron.name=Heavy Iron Chain
tile.gardenstuff.heavyChain.gold.name=Heavy Gold Chain
tile.gardenstuff.heavyChain.rust.name=Heavy Rusted Chain
tile.gardenstuff.heavyChain.blackoxide.name=Heavy Black Oxide Chain
tile.gardenstuff.heavyChain.wrought_iron.name=Heavy Wrought Iron Chain
tile.gardenstuff.heavyChain.moss.name=Heavy Mossy Chain
tile.gardenstuff.lightChain.name=Light Chain
tile.gardenstuff.lightChain.iron.name=Light Iron Chain
tile.gardenstuff.lightChain.gold.name=Light Gold Chain
tile.gardenstuff.lightChain.rust.name=Light Rusted Chain
tile.gardenstuff.lightChain.blackoxide.name=Light Black Oxide Chain
tile.gardenstuff.lightChain.wrought_iron.name=Light Wrought Iron Chain
tile.gardenstuff.lightChain.moss.name=Light Mossy Chain
tile.gardenstuff.latticeMetal.name=Lattice
tile.gardenstuff.latticeMetal.iron.name=Iron Lattice
tile.gardenstuff.latticeMetal.rust.name=Rusty Lattice
tile.gardenstuff.latticeMetal.blackoxide.name=Black Oxide Lattice
tile.gardenstuff.latticeMetal.wrought_iron.name=Wrought Iron Lattice
tile.gardenstuff.latticeMetal.moss.name=Mossy Lattice
tile.gardenstuff.latticeWood.name=Lattice
tile.gardenstuff.latticeWood.oak.name=Oak Wood Lattice
Expand All @@ -31,6 +32,11 @@ tile.gardenstuff.latticeWood.acacia.name=Acacia Wood Lattice
tile.gardenstuff.latticeWood.big_oak.name=Dark Oak Wood Lattice
tile.gardenstuff.lantern.name=Garden Lantern
tile.gardenstuff.metalBlock.name=Block of Wrought Iron
tile.gardenstuff.fence.name=Wrought Iron Fence
tile.gardenstuff.fence.0.name=Wrought Iron Fence
tile.gardenstuff.fence.1.name=Wrought Iron Fence
tile.gardenstuff.fence.2.name=Wrought Iron Fence
tile.gardenstuff.fence.3.name=Wrought Iron Fence

gardenstuff.lanternSource=Contents
gardenstuff.lanternSource.none=Empty
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

public class BlockHeavyChain extends Block
{
public static final String[] types = new String[] { "iron", "gold", "rope", "rust", "blackoxide", "moss" };
public static final String[] types = new String[] { "iron", "gold", "rope", "rust", "wrought_iron", "moss" };

@SideOnly(Side.CLIENT)
private static IIcon[] icons;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/
public class BlockLatticeMetal extends BlockLattice
{
public static final String[] subNames = new String[] { "iron", "rust", "blackoxide", "moss" };
public static final String[] subNames = new String[] { "iron", "rust", "wrought_iron", "moss" };

@SideOnly(Side.CLIENT)
private IIcon[] icons;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

public class BlockLightChain extends Block implements IPlantProxy
{
public static final String[] types = new String[] { "iron", "gold", "rope", "rust", "blackoxide", "moss" };
public static final String[] types = new String[] { "iron", "gold", "rope", "rust", "wrought_iron", "moss" };

@SideOnly(Side.CLIENT)
private static IIcon[] icons;
Expand Down
35 changes: 32 additions & 3 deletions src/com/jaquadro/minecraft/gardenstuff/core/ModRecipes.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
package com.jaquadro.minecraft.gardenstuff.core;

import com.jaquadro.minecraft.gardenstuff.item.ItemLantern;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemDye;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;

public class ModRecipes
{
private static String[] paneGlassOreDict = { "paneGlassBlack", "paneGlassRed", "paneGlassGreen", "paneGlassBrown",
"paneGlassBlue", "paneGlassPurple", "paneGlassCyan", "paneGlassLightGray",
"paneGlassGray", "paneGlassPink", "paneGlassLime", "paneGlassYellow",
"paneGlassLightBlue", "paneGlassMagenta", "paneGlassOrange", "paneGlassWhite",
};

public void init () {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.chainLink, 3, 0), "xx ", "x x", " xx", 'x', "nuggetIron"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.chainLink, 3, 1), "xx ", "x x", " xx", 'x', "nuggetGold"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.chainLink, 3, 1), "xx ", "x x", " xx", 'x', "nuggetBrass"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.chainLink, 3, 2), "xx ", "x x", " xx", 'x', "nuggetWroughtIron"));

ItemStack linkIron = new ItemStack(ModItems.chainLink, 1, 0);
ItemStack linkGold = new ItemStack(ModItems.chainLink, 1, 1);
ItemStack linkWroughtIron = new ItemStack(ModItems.chainLink, 1, 2);
ItemStack ironNugget = new ItemStack(ModItems.ironNugget);
ItemStack heavyChainIron = new ItemStack(ModBlocks.heavyChain);
ItemStack lightChainIron = new ItemStack(ModBlocks.lightChain);
Expand All @@ -26,13 +38,16 @@ public void init () {

GameRegistry.addShapedRecipe(new ItemStack(ModBlocks.heavyChain, 1, 0), "xx", "xx", "xx", 'x', linkIron);
GameRegistry.addShapedRecipe(new ItemStack(ModBlocks.heavyChain, 1, 1), "xx", "xx", "xx", 'x', linkGold);
GameRegistry.addShapedRecipe(new ItemStack(ModBlocks.heavyChain, 1, 4), "xx", "xx", "xx", 'x', linkWroughtIron);
GameRegistry.addShapedRecipe(new ItemStack(ModBlocks.heavyChain, 8, 5), "xxx", "xyx", "xxx", 'x', heavyChainIron, 'y', vine);

GameRegistry.addShapedRecipe(new ItemStack(ModBlocks.lightChain, 1, 0), "x", "x", "x", 'x', linkIron);
GameRegistry.addShapedRecipe(new ItemStack(ModBlocks.lightChain, 1, 1), "x", "x", "x", 'x', linkGold);
GameRegistry.addShapedRecipe(new ItemStack(ModBlocks.lightChain, 1, 4), "x", "x", "x", 'x', linkWroughtIron);
GameRegistry.addShapedRecipe(new ItemStack(ModBlocks.lightChain, 8, 5), "xxx", "xyx", "xxx", 'x', lightChainIron, 'y', vine);

GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.latticeMetal, 16, 0), " x ", "xxx", " x ", 'x', "ingotIron"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.latticeMetal, 16, 2), " x ", "xxx", " x ", 'x', "ingotWroughtIron"));
GameRegistry.addShapedRecipe(new ItemStack(ModBlocks.latticeMetal, 8, 3), "xxx", "xyx", "xxx", 'x', latticeIron, 'y', vine);

GameRegistry.addShapedRecipe(new ItemStack(Items.iron_ingot), "xxx", "xxx", "xxx", 'x', ironNugget);
Expand All @@ -43,13 +58,27 @@ public void init () {
GameRegistry.addShapedRecipe(wroughtIronIngot, "xxx", "xxx", "xxx", 'x', wroughtIronNugget);
GameRegistry.addShapedRecipe(new ItemStack(ModItems.wroughtIronNugget, 9), "x", 'x', wroughtIronIngot);

GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.fence, 16, 0), "xxx", "xxx", 'x', "ingotWroughtIron"));
GameRegistry.addShapedRecipe(new ItemStack(ModBlocks.fence, 1, 1), "x", 'x', new ItemStack(ModBlocks.fence, 1, 0));
GameRegistry.addShapedRecipe(new ItemStack(ModBlocks.fence, 1, 2), "x", 'x', new ItemStack(ModBlocks.fence, 1, 1));
GameRegistry.addShapedRecipe(new ItemStack(ModBlocks.fence, 1, 3), "x", 'x', new ItemStack(ModBlocks.fence, 1, 2));
GameRegistry.addShapedRecipe(new ItemStack(ModBlocks.fence, 1, 0), "x", 'x', new ItemStack(ModBlocks.fence, 1, 3));

GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.lantern, 4, 0), " x ", "y y", "yxy",
'x', "ingotWroughtIron", 'y', new ItemStack(ModBlocks.fence, 1, 0)));
for (int i = 0; i < 16; i++) {
ItemStack target = ((ItemLantern)Item.getItemFromBlock(ModBlocks.lantern)).makeItemStack(4, i, true);
GameRegistry.addRecipe(new ShapedOreRecipe(target, " x ", "yzy", "yxy",
'x', "ingotWroughtIron", 'y', new ItemStack(ModBlocks.fence, 1, 0), 'z', paneGlassOreDict[15 - i]));

target = ((ItemLantern)Item.getItemFromBlock(ModBlocks.lantern)).makeItemStack(1, i, true);
GameRegistry.addRecipe(new ShapelessOreRecipe(target, new ItemStack(ModBlocks.lantern, 1, 0), paneGlassOreDict[15 - i]));
}

for (int i = 0; i < 6; i++) {
GameRegistry.addShapedRecipe(new ItemStack(ModBlocks.latticeWood, 8, i), " x ", "xxx", " x ", 'x', new ItemStack(Blocks.planks, 1, i));
}

GameRegistry.addSmelting(new ItemStack(ModBlocks.heavyChain, 1, 0), new ItemStack(ModBlocks.heavyChain, 1, 4), 0);
GameRegistry.addSmelting(new ItemStack(ModBlocks.lightChain, 1, 0), new ItemStack(ModBlocks.lightChain, 1, 4), 0);
GameRegistry.addSmelting(new ItemStack(ModBlocks.latticeMetal, 1, 0), new ItemStack(ModBlocks.latticeMetal, 1, 2), 0);
GameRegistry.addSmelting(new ItemStack(Items.iron_ingot), wroughtIronIngot, 0);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

public class ItemChainLink extends Item
{
private static final String[] types = { "iron", "gold" };
private static final String[] types = { "iron", "gold", "wrought_iron" };

@SideOnly(Side.CLIENT)
private IIcon[] iconArray;
Expand Down
13 changes: 13 additions & 0 deletions src/com/jaquadro/minecraft/gardenstuff/item/ItemLantern.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemDye;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
Expand Down Expand Up @@ -60,6 +61,18 @@ public void addInformation (ItemStack itemStack, EntityPlayer player, List list,
list.add(contents);
}

public ItemStack makeItemStack (int count, int meta, boolean hasGlass) {
ItemStack stack = new ItemStack(this, count, meta);

if (hasGlass) {
NBTTagCompound tag = new NBTTagCompound();
tag.setBoolean("glass", true);
stack.setTagCompound(tag);
}

return stack;
}

private String getLanternSourceKey (TileEntityLantern.LightSource lightSource) {
switch (lightSource) {
case TORCH: return "torch";
Expand Down

0 comments on commit a672c69

Please sign in to comment.