diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..360f499 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.gradle/** +build/** +out/** +eclipse/** \ No newline at end of file diff --git a/build.gradle b/build.gradle index d34f80d..02d5516 100644 --- a/build.gradle +++ b/build.gradle @@ -17,13 +17,20 @@ buildscript { apply plugin: 'forge' -version = "2.0.0" -group= "jujuawesomebeans.jujusclothingcraft" // http://maven.apache.org/guides/mini/guide-naming-conventions.html +// Fix IntelliJ IDEA resources +apply plugin: 'idea' +idea { module { inheritOutputDirs = true } } + +version = "2.1.0" +group = "jujuawesomebeans.jujusclothingcraft" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "JujusClothingCraft-1.7.10" minecraft { version = "1.7.10-10.13.4.1558-1.7.10" runDir = "eclipse" + + replaceIn "ClothingCraftInfo.java" + replace "@VERSION@", project.version } dependencies { @@ -31,7 +38,7 @@ dependencies { // or you may define them like so.. //compile "some.group:artifact:version:classifier" //compile "some.group:artifact:version" - + // real examples //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env @@ -39,11 +46,9 @@ dependencies { // for more info... // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/dependency_management.html - } -processResources -{ +processResources { // this will ensure that this task is redone when the versions change. inputs.property "version", project.version inputs.property "mcversion", project.minecraft.version @@ -51,13 +56,13 @@ processResources // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' - + // replace version and mcversion - expand 'version':project.version, 'mcversion':project.minecraft.version + expand 'version': project.version, 'mcversion': project.minecraft.version } - + // copy everything else, thats not the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } -} +} \ No newline at end of file diff --git a/src/main/java/clothingcraft/blocks/BlockCottonBale.java b/src/main/java/clothingcraft/blocks/BlockCottonBale.java index 915dd2c..fc88206 100644 --- a/src/main/java/clothingcraft/blocks/BlockCottonBale.java +++ b/src/main/java/clothingcraft/blocks/BlockCottonBale.java @@ -1,5 +1,5 @@ /** - * + * */ package clothingcraft.blocks; @@ -9,31 +9,30 @@ import net.minecraft.util.IIcon; /** - * * @author JujuAwesomeBeans * @author NinjaSoldier40 * @since 02/07/2017 05:25 AM */ public class BlockCottonBale extends Block { - public IIcon[] icons = new IIcon[6]; - - public BlockCottonBale(Material material) { - super(material); - } - - @Override + public IIcon[] icons = new IIcon[6]; + + public BlockCottonBale(Material material) { + super(material); + } + + @Override public void registerBlockIcons(IIconRegister reg) { - for (int i = 0; i < 6; i ++) { + for (int i = 0; i < 6; i++) { int imgNum = 1; - if (i == 0 || i == 1) { - // only 2 of the sides will show without bale bands. - imgNum = 2; - } - this.icons[i] = reg.registerIcon(this.textureName + "_" + imgNum); + if (i == 0 || i == 1) { + // only 2 of the sides will show without bale bands. + imgNum = 2; + } + this.icons[i] = reg.registerIcon(this.textureName + "_" + imgNum); } } - + @Override public IIcon getIcon(int side, int meta) { return this.icons[side]; diff --git a/src/main/java/clothingcraft/blocks/BlockCottonFabric.java b/src/main/java/clothingcraft/blocks/BlockCottonFabric.java index 4839489..a54e047 100644 --- a/src/main/java/clothingcraft/blocks/BlockCottonFabric.java +++ b/src/main/java/clothingcraft/blocks/BlockCottonFabric.java @@ -1,34 +1,34 @@ /** - * + * */ package clothingcraft.blocks; -import clothingcraft.core.ClothingCraft; +import clothingcraft.client.ClientProxy; import clothingcraft.core.ClothingCraftInfo; import net.minecraft.block.Block; import net.minecraft.block.material.Material; /** * block of material resulting in combining rock salt - * + * * @author JujuAwesomeBeans * @author NinjaSoldier40 * @since 02/11/2017 01:55 PM (-07:00 GMT) */ public class BlockCottonFabric extends Block { - protected BlockCottonFabric(Material mat) { - super(mat); - this.setHardness(1.0F); - this.setResistance(3.0F); - this.setLightLevel(15.0F); - this.setBlockName("cotton_fabric_bundle"); - this.setBlockTextureName(ClothingCraftInfo.MODID + ":cotton_fabric_bundle"); - this.setLightOpacity(225); - this.setStepSound(Block.soundTypeGravel); - this.setCreativeTab(ClothingCraft.tabCore); - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - this.setHarvestLevel("pickaxe", 0); - } + protected BlockCottonFabric(Material mat) { + super(mat); + this.setHardness(1.0F); + this.setResistance(3.0F); + this.setLightLevel(15.0F); + this.setBlockName("cotton_fabric_bundle"); + this.setBlockTextureName(ClothingCraftInfo.MODID + ":cotton_fabric_bundle"); + this.setLightOpacity(225); + this.setStepSound(Block.soundTypeGravel); + this.setCreativeTab(ClientProxy.tabCore); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + this.setHarvestLevel("pickaxe", 0); + } } diff --git a/src/main/java/clothingcraft/blocks/BlockCottonPlant.java b/src/main/java/clothingcraft/blocks/BlockCottonPlant.java index ad008d0..7c474e3 100644 --- a/src/main/java/clothingcraft/blocks/BlockCottonPlant.java +++ b/src/main/java/clothingcraft/blocks/BlockCottonPlant.java @@ -1,12 +1,10 @@ /** - * + * */ package clothingcraft.blocks; -import java.util.Random; - -import clothingcraft.core.ClothingCraft; import clothingcraft.core.ClothingCraftInfo; +import clothingcraft.core.CommonProxy; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; @@ -15,68 +13,63 @@ import net.minecraft.item.Item; import net.minecraft.util.IIcon; +import java.util.Random; + /** - * - * * @author JujuAwesomeBeans * @author NinjaSoldier40 * @since 02/05/2017 09:01 PM - * */ -public class BlockCottonPlant extends RecipeBlockCrops -{ - public BlockCottonPlant() - { - super(8); +public class BlockCottonPlant extends RecipeBlockCrops { + public BlockCottonPlant() { + super(8); } - - /** - * @see clothingcraft.blocks.RecipeBlockCrops#canPlaceBlockOn(net.minecraft.block.Block) - */ - @Override - protected boolean canPlaceBlockOn(Block parBlock) { - return (parBlock == Blocks.farmland); - } - + + /** + * @see clothingcraft.blocks.RecipeBlockCrops#canPlaceBlockOn(net.minecraft.block.Block) + */ + @Override + protected boolean canPlaceBlockOn(Block parBlock) { + return (parBlock == Blocks.farmland); + } + /** * Returns the quantity of items to drop on block destruction. */ @Override - public int quantityDropped(int parMetadata, int parFortune, Random parRand) - { - return (parMetadata/2); + public int quantityDropped(int parMetadata, int parFortune, Random parRand) { + return (parMetadata / 2); } - + /** * @see clothingcraft.blocks.RecipeBlockCrops#getItemDropSeeds() */ public Item getItemDropSeeds() { - return ClothingCraft.cottonSeeds; + return CommonProxy.cottonSeeds; } - + /** * @see clothingcraft.blocks.RecipeBlockCrops#getItemDropProduce() */ public Item getItemDropProduce() { - return ClothingCraft.cotton; + return CommonProxy.cotton; } - + @Override @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister parIIconRegister) - { - iIcon = new IIcon[maxGrowthStage+1]; - // seems that crops like to have 8 growth icons, but okay to repeat actual texture if you want - // to make generic should loop to maxGrowthStage - iIcon[0] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_0"); - iIcon[1] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_1"); - iIcon[2] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_2"); - iIcon[3] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_3"); - iIcon[4] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_4"); - iIcon[5] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_5"); - iIcon[6] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_6"); - iIcon[7] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_7"); - iIcon[8] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_8"); + public void registerBlockIcons(IIconRegister parIIconRegister) { + iIcon = new IIcon[maxGrowthStage + 1]; + // seems that crops like to have 8 growth icons, but okay to repeat actual texture if you want + // to make generic should loop to maxGrowthStage + iIcon[0] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_0"); + iIcon[1] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_1"); + iIcon[2] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_2"); + iIcon[3] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_3"); + iIcon[4] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_4"); + iIcon[5] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_5"); + iIcon[6] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_6"); + iIcon[7] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_7"); + iIcon[8] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonplant_stage_8"); } } \ No newline at end of file diff --git a/src/main/java/clothingcraft/blocks/BlockCottonWildPlant.java b/src/main/java/clothingcraft/blocks/BlockCottonWildPlant.java index 931381f..8c1acc7 100644 --- a/src/main/java/clothingcraft/blocks/BlockCottonWildPlant.java +++ b/src/main/java/clothingcraft/blocks/BlockCottonWildPlant.java @@ -1,9 +1,7 @@ package clothingcraft.blocks; -import java.util.Random; - -import clothingcraft.core.ClothingCraft; import clothingcraft.core.ClothingCraftInfo; +import clothingcraft.core.CommonProxy; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; @@ -18,182 +16,172 @@ import net.minecraftforge.common.EnumPlantType; import net.minecraftforge.common.IPlantable; +import java.util.Random; + /** - * - * * @author JujuAwesomeBeans * @author NinjaSoldier40 * @since 02/05/2017 09:01 PM - * */ -public class BlockCottonWildPlant extends BlockCrops implements IPlantable -{ - protected int maxGrowthStage = 4; - - @SideOnly(Side.CLIENT) - protected IIcon[] iIcon; - - public BlockCottonWildPlant() - { - super(); - // Basic block setup - setTickRandomly(true); - float f = 0.5F; - setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f); - setHardness(0.0F); - setStepSound(soundTypeGrass); - disableStats(); - } - - /** - * @see clothingcraft.blocks.RecipeBlockCrops#canPlaceBlockOn(net.minecraft.block.Block) - * is the block on grass, dirt or farmland? - */ - @Override - protected boolean canPlaceBlockOn(Block parBlock) { - return (parBlock == Blocks.sand - || parBlock == Blocks.dirt - || parBlock == Blocks.grass - || parBlock == Blocks.farmland); - } - - public void incrementGrowStage(World parWorld, Random parRand, int parX, int parY, int parZ) { - int growStage = parWorld.getBlockMetadata(parX, parY, parZ) + MathHelper.getRandomIntegerInRange(parRand, 2, 5); - - if (growStage > maxGrowthStage) { - growStage = maxGrowthStage; - } - - parWorld.setBlockMetadataWithNotify(parX, parY, parZ, growStage, 2); - } - - /** +public class BlockCottonWildPlant extends BlockCrops implements IPlantable { + protected int maxGrowthStage = 4; + + @SideOnly(Side.CLIENT) + protected IIcon[] iIcon; + + public BlockCottonWildPlant() { + super(); + // Basic block setup + setTickRandomly(true); + float f = 0.5F; + setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f); + setHardness(0.0F); + setStepSound(soundTypeGrass); + disableStats(); + } + + /** + * @see clothingcraft.blocks.RecipeBlockCrops#canPlaceBlockOn(net.minecraft.block.Block) + * is the block on grass, dirt or farmland? + */ + @Override + protected boolean canPlaceBlockOn(Block parBlock) { + return (parBlock == Blocks.sand + || parBlock == Blocks.dirt + || parBlock == Blocks.grass + || parBlock == Blocks.farmland); + } + + public void incrementGrowStage(World parWorld, Random parRand, int parX, int parY, int parZ) { + int growStage = parWorld.getBlockMetadata(parX, parY, parZ) + MathHelper.getRandomIntegerInRange(parRand, 2, 5); + + if (growStage > maxGrowthStage) { + growStage = maxGrowthStage; + } + + parWorld.setBlockMetadataWithNotify(parX, parY, parZ, growStage, 2); + } + + /** * Returns the quantity of items to drop on block destruction. */ @Override - public int quantityDropped(int parMetadata, int parFortune, Random parRand) - { - return (parMetadata/2); + public int quantityDropped(int parMetadata, int parFortune, Random parRand) { + return (parMetadata / 2); } - + @Override - protected Item func_149866_i() - { + protected Item func_149866_i() { return getItemDropSeeds(); } - + /** * @see clothingcraft.blocks.RecipeBlockCrops#getItemDropSeeds() */ public Item getItemDropSeeds() { - return ClothingCraft.cottonSeeds; + return CommonProxy.cottonSeeds; } - + @Override - protected Item func_149865_P() - { + protected Item func_149865_P() { return getItemDropProduce(); } - - + + /** * @see clothingcraft.blocks.RecipeBlockCrops#getItemDropProduce() */ public Item getItemDropProduce() { - return ClothingCraft.cotton; + return CommonProxy.cotton; } - + @Override - public Item getItemDropped(int parMetadata, Random parRand, int parFortune) - { - // DEBUG - System.out.println("BlockCottonWildPlant getItemDropped()"); - //return ClothingCraft.cotton; - int randInt = parRand.nextInt(4); - Item result = null; - if (parMetadata == maxGrowthStage) { - // plant fully grown, could be seed or produce - if (randInt < 3) { - result = getItemDropSeeds(); - } else { - result = getItemDropProduce(); - } - } else { - result = getItemDropSeeds(); - } - return result; - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return 1; // Cross like flowers - } - + public Item getItemDropped(int parMetadata, Random parRand, int parFortune) { + // DEBUG + System.out.println("BlockCottonWildPlant getItemDropped()"); + //return ClothingCraft.cotton; + int randInt = parRand.nextInt(4); + Item result = null; + if (parMetadata == maxGrowthStage) { + // plant fully grown, could be seed or produce + if (randInt < 3) { + result = getItemDropSeeds(); + } else { + result = getItemDropProduce(); + } + } else { + result = getItemDropSeeds(); + } + return result; + } + + /** + * The type of render function that is called for this block + */ + @Override + public int getRenderType() { + return 1; // Cross like flowers + } + @Override - public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z) - { + public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z) { return EnumPlantType.Crop; } - + @Override @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister parIIconRegister) - { - iIcon = new IIcon[maxGrowthStage+1]; - // seems that crops like to have 8 growth icons, but okay to repeat actual texture if you want - // to make generic should loop to maxGrowthStage - iIcon[0] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonwildplant_stage_4"); - iIcon[1] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonwildplant_stage_5"); - iIcon[2] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonwildplant_stage_6"); - iIcon[3] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonwildplant_stage_7"); - iIcon[4] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonwildplant_stage_8"); - } - + public void registerBlockIcons(IIconRegister parIIconRegister) { + iIcon = new IIcon[maxGrowthStage + 1]; + // seems that crops like to have 8 growth icons, but okay to repeat actual texture if you want + // to make generic should loop to maxGrowthStage + iIcon[0] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonwildplant_stage_4"); + iIcon[1] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonwildplant_stage_5"); + iIcon[2] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonwildplant_stage_6"); + iIcon[3] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonwildplant_stage_7"); + iIcon[4] = parIIconRegister.registerIcon(ClothingCraftInfo.MODID + ":cottonwildplant_stage_8"); + } + /** - * Gets the block's texture. Args: side, meta - */ - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int parSide, int parGrowthStage) { - if (parGrowthStage < 0 || parGrowthStage > maxGrowthStage) - { - parGrowthStage = maxGrowthStage; + * Gets the block's texture. Args: side, meta + */ + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int parSide, int parGrowthStage) { + if (parGrowthStage < 0 || parGrowthStage > maxGrowthStage) { + parGrowthStage = maxGrowthStage; } - return iIcon[parGrowthStage]; - } + return iIcon[parGrowthStage]; + } /* - * implement the IGrowable interface methods + * implement the IGrowable interface methods */ - /** - * @see net.minecraft.block.IGrowable#func_149851_a(net.minecraft.world.World, - * int, int, int, boolean) - */ - @Override - // checks if finished growing (a grow stage of 8 is final stage) - public boolean func_149851_a(World parWorld, int parX, int parY, int parZ, boolean p_149851_5_) { - return parWorld.getBlockMetadata(parX, parY, parZ) != maxGrowthStage; - } - - /** - * @see net.minecraft.block.IGrowable#func_149852_a(net.minecraft.world.World, - * java.util.Random, int, int, int) - */ - @Override - public boolean func_149852_a(World p_149852_1_, Random parRand, int p_149852_3_, int p_149852_4_, int p_149852_5_) { - return true; - } - - /** - * @see net.minecraft.block.IGrowable#func_149853_b(net.minecraft.world.World, - * java.util.Random, int, int, int) - */ - @Override - public void func_149853_b(World parWorld, Random parRand, int parX, int parY, int parZ) { - incrementGrowStage(parWorld, parRand, parX, parY, parZ); - } + /** + * @see net.minecraft.block.IGrowable#func_149851_a(net.minecraft.world.World, + * int, int, int, boolean) + */ + @Override + // checks if finished growing (a grow stage of 8 is final stage) + public boolean func_149851_a(World parWorld, int parX, int parY, int parZ, boolean p_149851_5_) { + return parWorld.getBlockMetadata(parX, parY, parZ) != maxGrowthStage; + } + + /** + * @see net.minecraft.block.IGrowable#func_149852_a(net.minecraft.world.World, + * java.util.Random, int, int, int) + */ + @Override + public boolean func_149852_a(World p_149852_1_, Random parRand, int p_149852_3_, int p_149852_4_, int p_149852_5_) { + return true; + } + + /** + * @see net.minecraft.block.IGrowable#func_149853_b(net.minecraft.world.World, + * java.util.Random, int, int, int) + */ + @Override + public void func_149853_b(World parWorld, Random parRand, int parX, int parY, int parZ) { + incrementGrowStage(parWorld, parRand, parX, parY, parZ); + } } \ No newline at end of file diff --git a/src/main/java/clothingcraft/blocks/BlockHaliteBlock.java b/src/main/java/clothingcraft/blocks/BlockHaliteBlock.java index 4ca2dbe..c0805d6 100644 --- a/src/main/java/clothingcraft/blocks/BlockHaliteBlock.java +++ b/src/main/java/clothingcraft/blocks/BlockHaliteBlock.java @@ -1,34 +1,34 @@ /** - * + * */ package clothingcraft.blocks; -import clothingcraft.core.ClothingCraft; +import clothingcraft.client.ClientProxy; import clothingcraft.core.ClothingCraftInfo; import net.minecraft.block.Block; import net.minecraft.block.material.Material; /** * block of material resulting in combining rock salt - * + * * @author JujuAwesomeBeans * @author NinjaSoldier40 * @since 02/10/2017 7:33 PM (-07:00 GMT) */ public class BlockHaliteBlock extends Block { - protected BlockHaliteBlock(Material mat) { - super(mat); - this.setHardness(1.0F); - this.setResistance(3.0F); - this.setLightLevel(15.0F); - this.setBlockName("halite_block"); - this.setBlockTextureName(ClothingCraftInfo.MODID + ":halite_block"); - this.setLightOpacity(225); - this.setStepSound(Block.soundTypeGravel); - this.setCreativeTab(ClothingCraft.tabCore); - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - this.setHarvestLevel("pickaxe", 0); - } + protected BlockHaliteBlock(Material mat) { + super(mat); + this.setHardness(1.0F); + this.setResistance(3.0F); + this.setLightLevel(15.0F); + this.setBlockName("halite_block"); + this.setBlockTextureName(ClothingCraftInfo.MODID + ":halite_block"); + this.setLightOpacity(225); + this.setStepSound(Block.soundTypeGravel); + this.setCreativeTab(ClientProxy.tabCore); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + this.setHarvestLevel("pickaxe", 0); + } } diff --git a/src/main/java/clothingcraft/blocks/BlockHaliteOre.java b/src/main/java/clothingcraft/blocks/BlockHaliteOre.java index 9c375c8..0b50365 100644 --- a/src/main/java/clothingcraft/blocks/BlockHaliteOre.java +++ b/src/main/java/clothingcraft/blocks/BlockHaliteOre.java @@ -1,9 +1,6 @@ package clothingcraft.blocks; -import java.util.ArrayList; -import java.util.Random; - -import clothingcraft.core.ClothingCraft; +import clothingcraft.client.ClientProxy; import clothingcraft.core.ClothingCraftInfo; import clothingcraft.items.ClothingCraftHaliteItemList; import net.minecraft.block.Block; @@ -13,56 +10,59 @@ import net.minecraft.item.ItemStack; import net.minecraft.world.World; +import java.util.ArrayList; +import java.util.Random; + public class BlockHaliteOre extends Block { - private Item drop; - private int meta; - private int least_quantity; - private int most_quantity; - - public BlockHaliteOre() { - this("halite_ore", Material.rock, ClothingCraft.tabCore, ClothingCraftHaliteItemList.rockSalt, 2, 2, 4); - } - - protected BlockHaliteOre(String unlocalizedName, Material mat, CreativeTabs tab, Item drop, int meta, int least_quantity, int most_quantity) { - super(mat); - this.drop = drop; - this.meta = meta; - this.least_quantity = least_quantity; - this.most_quantity = most_quantity; - this.setBlockName(unlocalizedName); - this.setBlockTextureName(ClothingCraftInfo.MODID + ":" + unlocalizedName); - this.setCreativeTab(tab); - this.setStepSound(soundTypeStone); - this.setHardness(10.0f); - this.setResistance(20.0f); - this.setHarvestLevel("pickaxe", 1); - this.setLightLevel(10.0F); - this.setLightOpacity(200); - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - } - - @Override - public Item getItemDropped(int meta, Random random, int fortune) { - return this.drop; - } + private Item drop; + private int meta; + private int least_quantity; + private int most_quantity; + + public BlockHaliteOre() { + this("halite_ore", Material.rock, ClientProxy.tabCore, ClothingCraftHaliteItemList.rockSalt, 2, 2, 4); + } + + protected BlockHaliteOre(String unlocalizedName, Material mat, CreativeTabs tab, Item drop, int meta, int least_quantity, int most_quantity) { + super(mat); + this.drop = drop; + this.meta = meta; + this.least_quantity = least_quantity; + this.most_quantity = most_quantity; + this.setBlockName(unlocalizedName); + this.setBlockTextureName(ClothingCraftInfo.MODID + ":" + unlocalizedName); + this.setCreativeTab(tab); + this.setStepSound(soundTypeStone); + this.setHardness(10.0f); + this.setResistance(20.0f); + this.setHarvestLevel("pickaxe", 1); + this.setLightLevel(10.0F); + this.setLightOpacity(200); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + @Override + public Item getItemDropped(int meta, Random random, int fortune) { + return this.drop; + } + + @Override + public int damageDropped(int metadata) { + return this.meta; + } - @Override - public int damageDropped(int metadata) { - return this.meta; - } + @Override + public int quantityDropped(int meta, int fortune, Random random) { + if (this.least_quantity >= this.most_quantity) + return this.least_quantity; + return this.least_quantity + random.nextInt(this.most_quantity - this.least_quantity + fortune + 1); + } - @Override - public int quantityDropped(int meta, int fortune, Random random) { - if (this.least_quantity >= this.most_quantity) - return this.least_quantity; - return this.least_quantity + random.nextInt(this.most_quantity - this.least_quantity + fortune + 1); - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { + @Override + public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { //return super.getDrops(world, x, y, z, metadata, fortune); - + ArrayList drops = new ArrayList(); drops.add(new ItemStack(ClothingCraftHaliteItemList.rockSalt, world.rand.nextInt(3) + 1)); return drops; diff --git a/src/main/java/clothingcraft/blocks/BlockSandCastle.java b/src/main/java/clothingcraft/blocks/BlockSandCastle.java index 8a723c8..cc670d1 100644 --- a/src/main/java/clothingcraft/blocks/BlockSandCastle.java +++ b/src/main/java/clothingcraft/blocks/BlockSandCastle.java @@ -1,8 +1,6 @@ package clothingcraft.blocks; -import java.util.Random; - -import clothingcraft.core.ClothingCraft; +import clothingcraft.client.ClientProxy; import clothingcraft.core.ClothingCraftInfo; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -10,55 +8,57 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import java.util.Random; + public class BlockSandCastle extends Block { - boolean red = false; + boolean red = false; - protected BlockSandCastle() { - super(Material.ground); - this.setBlockName("sandcastle"); - this.setBlockTextureName(ClothingCraftInfo.MODID + ":sandcastle"); - this.setStepSound(Block.soundTypeSand); - this.setCreativeTab(ClothingCraft.tabAccessories); - this.setHarvestLevel("shovel", 0); - this.setBlockBounds( - 0.30000000000000004F, - 0.0F, - 0.30000000000000004F, - 0.7000000000000001F, - 0.7000000000000001F, - 0.7F - ); + protected BlockSandCastle() { + super(Material.ground); + this.setBlockName("sandcastle"); + this.setBlockTextureName(ClothingCraftInfo.MODID + ":sandcastle"); + this.setStepSound(Block.soundTypeSand); + this.setCreativeTab(ClientProxy.tabAccessories); + this.setHarvestLevel("shovel", 0); + this.setBlockBounds( + 0.30000000000000004F, + 0.0F, + 0.30000000000000004F, + 0.7000000000000001F, + 0.7000000000000001F, + 0.7F + ); - } + } - public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { - return red ? 1 : 0; - } + public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { + return red ? 1 : 0; + } - public boolean isOpaqueCube() { - return false; - } + public boolean isOpaqueCube() { + return false; + } - public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k) { - return null; - } + public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k) { + return null; + } - public boolean renderAsNormalBlock() { - return false; - } + public boolean renderAsNormalBlock() { + return false; + } - public int getRenderType() { - return 1; - } + public int getRenderType() { + return 1; + } - @Override - public int tickRate(World world) { - return 10; - } + @Override + public int tickRate(World world) { + return 10; + } - public int quantityDropped(Random par1Random) { - return 1; - } + public int quantityDropped(Random par1Random) { + return 1; + } - } \ No newline at end of file +} \ No newline at end of file diff --git a/src/main/java/clothingcraft/blocks/ClothingCraftCottonBlockList.java b/src/main/java/clothingcraft/blocks/ClothingCraftCottonBlockList.java index 649f76b..62d4cc7 100644 --- a/src/main/java/clothingcraft/blocks/ClothingCraftCottonBlockList.java +++ b/src/main/java/clothingcraft/blocks/ClothingCraftCottonBlockList.java @@ -1,10 +1,11 @@ /** - * + * */ package clothingcraft.blocks; -import clothingcraft.core.ClothingCraft; +import clothingcraft.client.ClientProxy; import clothingcraft.core.ClothingCraftInfo; +import clothingcraft.core.CommonProxy; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -12,66 +13,65 @@ /** * List of blocks and their registrations into the world - * + * * @author JujuAwesomeBeans * @author NinjaSoldier40 * @since 02/10/2017 05:35 AM (-7:00 GMT) */ public class ClothingCraftCottonBlockList { - public static BlockCottonBale cottonBale; // bale of cotton produce - public static BlockCottonPlant cottonPlant; // the IGrowable plant - public static BlockCottonWildPlant cottonWildPlant; // the IGrowable plant that is wild (placed on dirt or grass) - - public static void preInit(){ - // bale of cotton (bound) - cottonBale = (BlockCottonBale) new BlockCottonBale(Material.ground) - .setHardness(0.2F) - .setResistance(0.5F) - .setLightLevel(0.0F) - .setBlockName("cotton_bale") - .setBlockTextureName(ClothingCraftInfo.MODID + ":cotton_bale") - .setLightOpacity(126) - .setStepSound(Block.soundTypeGrass) - .setCreativeTab(ClothingCraft.tabCore); - cottonBale.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - //Block.blockRegistry.addObject(192, "cotton_bale", cottonBale); - cottonBale.setHarvestLevel("pickaxe", 0); - GameRegistry.registerBlock(cottonBale, "cotton_bale"); - - // cotton plant - cottonPlant = (BlockCottonPlant) new BlockCottonPlant() - .setHardness(0.0F) - .setStepSound(Block.soundTypeGrass) - .setResistance(0.0F) - .setBlockName("cottonplant") - //.setCreativeTab(ClothingCraft.tabCore) - .setBlockTextureName(ClothingCraftInfo.MODID + ":cottonplant"); - GameRegistry.registerBlock(cottonPlant, "cottonplant"); - - // wild cotton plant - cottonWildPlant = (BlockCottonWildPlant) new BlockCottonWildPlant() - .setHardness(0.0F) - .setStepSound(Block.soundTypeGrass) - .setResistance(0.0F) - .setBlockName("cottonwildplant") - //.setCreativeTab(ClothingCraft.tabCore) - .setBlockTextureName(ClothingCraftInfo.MODID + ":cottonwildplant"); - GameRegistry.registerBlock(cottonWildPlant, "cottonwildplant"); - } - - public static void init() { - GameRegistry.addRecipe(new ItemStack(cottonBale, 1), - new Object[] { "012", "345", "678", - Character.valueOf('0'), new ItemStack(ClothingCraft.cotton, 1), - Character.valueOf('1'), new ItemStack(ClothingCraft.cotton, 1), - Character.valueOf('2'), new ItemStack(ClothingCraft.cotton, 1), - Character.valueOf('3'), new ItemStack(ClothingCraft.cotton, 1), - Character.valueOf('4'), new ItemStack(ClothingCraft.cotton, 1), - Character.valueOf('5'), new ItemStack(ClothingCraft.cotton, 1), - Character.valueOf('6'), new ItemStack(ClothingCraft.cotton, 1), - Character.valueOf('7'), new ItemStack(ClothingCraft.cotton, 1), - Character.valueOf('8'), new ItemStack(ClothingCraft.cotton, 1), - }); - } + public static BlockCottonBale cottonBale; // bale of cotton produce + public static BlockCottonPlant cottonPlant; // the IGrowable plant + public static BlockCottonWildPlant cottonWildPlant; // the IGrowable plant that is wild (placed on dirt or grass) + + public static void preInit() { + // bale of cotton (bound) + cottonBale = (BlockCottonBale) new BlockCottonBale(Material.ground) + .setHardness(0.2F) + .setResistance(0.5F) + .setLightLevel(0.0F) + .setBlockName("cotton_bale") + .setBlockTextureName(ClothingCraftInfo.MODID + ":cotton_bale") + .setLightOpacity(126) + .setStepSound(Block.soundTypeGrass) + .setCreativeTab(ClientProxy.tabCore); + cottonBale.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + //Block.blockRegistry.addObject(192, "cotton_bale", cottonBale); + cottonBale.setHarvestLevel("pickaxe", 0); + GameRegistry.registerBlock(cottonBale, "cotton_bale"); + + // cotton plant + cottonPlant = (BlockCottonPlant) new BlockCottonPlant() + .setHardness(0.0F) + .setStepSound(Block.soundTypeGrass) + .setResistance(0.0F) + .setBlockName("cottonplant") +// .setCreativeTab(ClientProxy.tabCore) + .setBlockTextureName(ClothingCraftInfo.MODID + ":cottonplant"); + GameRegistry.registerBlock(cottonPlant, "cottonplant"); + + // wild cotton plant + cottonWildPlant = (BlockCottonWildPlant) new BlockCottonWildPlant() + .setHardness(0.0F) + .setStepSound(Block.soundTypeGrass) + .setResistance(0.0F) + .setBlockName("cottonwildplant") +// .setCreativeTab(ClientProxy.tabCore) + .setBlockTextureName(ClothingCraftInfo.MODID + ":cottonwildplant"); + GameRegistry.registerBlock(cottonWildPlant, "cottonwildplant"); + } + + public static void init() { + GameRegistry.addRecipe(new ItemStack(cottonBale, 1), + "012", "345", "678", + '0', new ItemStack(CommonProxy.cotton, 1), + '1', new ItemStack(CommonProxy.cotton, 1), + '2', new ItemStack(CommonProxy.cotton, 1), + '3', new ItemStack(CommonProxy.cotton, 1), + '4', new ItemStack(CommonProxy.cotton, 1), + '5', new ItemStack(CommonProxy.cotton, 1), + '6', new ItemStack(CommonProxy.cotton, 1), + '7', new ItemStack(CommonProxy.cotton, 1), + '8', new ItemStack(CommonProxy.cotton, 1)); + } } diff --git a/src/main/java/clothingcraft/blocks/ClothingCraftHaliteBlockList.java b/src/main/java/clothingcraft/blocks/ClothingCraftHaliteBlockList.java index 2e0c414..75189a5 100644 --- a/src/main/java/clothingcraft/blocks/ClothingCraftHaliteBlockList.java +++ b/src/main/java/clothingcraft/blocks/ClothingCraftHaliteBlockList.java @@ -1,5 +1,5 @@ /** - * + * */ package clothingcraft.blocks; @@ -11,53 +11,53 @@ /** * List of blocks and their registrations into the world - * + * * @author JujuAwesomeBeans * @author NinjaSoldier40 * @since 02/10/2017 05:35 AM (-7:00 GMT) */ public class ClothingCraftHaliteBlockList { - public static Block haliteOre; - public static Block haliteBlock; - public static Block cottonFabricBundle; - public static Block sandCastleBlock; - - public static void preInit(){ - // halite ore - haliteOre = (BlockHaliteOre) new BlockHaliteOre(); - GameRegistry.registerBlock(haliteOre, "halite_ore"); - - haliteBlock = (BlockHaliteBlock) new BlockHaliteBlock(Material.ground); - GameRegistry.registerBlock(haliteBlock, "halite_block"); - - cottonFabricBundle = (BlockCottonFabric) new BlockCottonFabric(Material.cloth); - GameRegistry.registerBlock(cottonFabricBundle, "cotton_fabric_bundle"); - - sandCastleBlock = (BlockSandCastle) new BlockSandCastle(); - GameRegistry.registerBlock(sandCastleBlock, "sandcastle"); - } - - public static void init() { - GameRegistry.addRecipe(new ItemStack(haliteBlock, 1), - new Object[] { "012", "345", "678", - Character.valueOf('0'), new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), - Character.valueOf('1'), new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), - Character.valueOf('2'), new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), - Character.valueOf('3'), new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), - Character.valueOf('4'), new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), - Character.valueOf('5'), new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), - Character.valueOf('6'), new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), - Character.valueOf('7'), new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), - Character.valueOf('8'), new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), - }); - - GameRegistry.addShapelessRecipe(new ItemStack(haliteBlock), - new Object[] { - ClothingCraftHaliteItemList.haliteIngot, - ClothingCraftHaliteItemList.haliteIngot, - ClothingCraftHaliteItemList.haliteIngot, - ClothingCraftHaliteItemList.haliteIngot, - }); - } + public static Block haliteOre; + public static Block haliteBlock; + public static Block cottonFabricBundle; + public static Block sandCastleBlock; + + public static void preInit() { + // halite ore + haliteOre = (BlockHaliteOre) new BlockHaliteOre(); + GameRegistry.registerBlock(haliteOre, "halite_ore"); + + haliteBlock = (BlockHaliteBlock) new BlockHaliteBlock(Material.ground); + GameRegistry.registerBlock(haliteBlock, "halite_block"); + + cottonFabricBundle = (BlockCottonFabric) new BlockCottonFabric(Material.cloth); + GameRegistry.registerBlock(cottonFabricBundle, "cotton_fabric_bundle"); + + sandCastleBlock = (BlockSandCastle) new BlockSandCastle(); + GameRegistry.registerBlock(sandCastleBlock, "sandcastle"); + } + + public static void init() { + GameRegistry.addRecipe(new ItemStack(haliteBlock, 1), + new Object[]{"012", "345", "678", + Character.valueOf('0'), new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), + Character.valueOf('1'), new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), + Character.valueOf('2'), new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), + Character.valueOf('3'), new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), + Character.valueOf('4'), new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), + Character.valueOf('5'), new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), + Character.valueOf('6'), new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), + Character.valueOf('7'), new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), + Character.valueOf('8'), new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), + }); + + GameRegistry.addShapelessRecipe(new ItemStack(haliteBlock), + new Object[]{ + ClothingCraftHaliteItemList.haliteIngot, + ClothingCraftHaliteItemList.haliteIngot, + ClothingCraftHaliteItemList.haliteIngot, + ClothingCraftHaliteItemList.haliteIngot, + }); + } } diff --git a/src/main/java/clothingcraft/blocks/RecipeBlockCrops.java b/src/main/java/clothingcraft/blocks/RecipeBlockCrops.java index 779981d..e1e64c9 100644 --- a/src/main/java/clothingcraft/blocks/RecipeBlockCrops.java +++ b/src/main/java/clothingcraft/blocks/RecipeBlockCrops.java @@ -1,7 +1,5 @@ package clothingcraft.blocks; -import java.util.Random; - import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; @@ -15,152 +13,145 @@ import net.minecraft.world.World; import net.minecraftforge.common.EnumPlantType; +import java.util.Random; + /** - * - * * @author JujuAwesomeBeans * @author NinjaSoldier40 * @since 02/11/2017 10:53 AM - * */ public abstract class RecipeBlockCrops extends BlockCrops implements IGrowable { - protected int maxGrowthStage = 7; - - @SideOnly(Side.CLIENT) - protected IIcon[] iIcon; - - public RecipeBlockCrops(int maxGrowthStage) { - this.maxGrowthStage = maxGrowthStage; - // Basic block setup - setTickRandomly(true); - float f = 0.5F; - setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f); - setHardness(0.0F); - setStepSound(soundTypeGrass); - disableStats(); - } - - /** - * @see clothingcraft.blocks.RecipeBlockCrops#canPlaceBlockOn(net.minecraft.block.Block) - * is the block on farmland? - */ - @Override - protected boolean canPlaceBlockOn(Block parBlock) { - return parBlock == Blocks.farmland; - } - - public void incrementGrowStage(World parWorld, Random parRand, int parX, int parY, int parZ) { - int growStage = parWorld.getBlockMetadata(parX, parY, parZ) + MathHelper.getRandomIntegerInRange(parRand, 2, 5); - - if (growStage > maxGrowthStage) { - growStage = maxGrowthStage; - } - - parWorld.setBlockMetadataWithNotify(parX, parY, parZ, growStage, 2); - } - - /** + protected int maxGrowthStage = 7; + + @SideOnly(Side.CLIENT) + protected IIcon[] iIcon; + + public RecipeBlockCrops(int maxGrowthStage) { + this.maxGrowthStage = maxGrowthStage; + // Basic block setup + setTickRandomly(true); + float f = 0.5F; + setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f); + setHardness(0.0F); + setStepSound(soundTypeGrass); + disableStats(); + } + + /** + * @see clothingcraft.blocks.RecipeBlockCrops#canPlaceBlockOn(net.minecraft.block.Block) + * is the block on farmland? + */ + @Override + protected boolean canPlaceBlockOn(Block parBlock) { + return parBlock == Blocks.farmland; + } + + public void incrementGrowStage(World parWorld, Random parRand, int parX, int parY, int parZ) { + int growStage = parWorld.getBlockMetadata(parX, parY, parZ) + MathHelper.getRandomIntegerInRange(parRand, 2, 5); + + if (growStage > maxGrowthStage) { + growStage = maxGrowthStage; + } + + parWorld.setBlockMetadataWithNotify(parX, parY, parZ, growStage, 2); + } + + /** * Returns the quantity of items to drop on block destruction. */ @Override - public int quantityDropped(int parMetadata, int parFortune, Random parRand) - { - return (parMetadata/2); + public int quantityDropped(int parMetadata, int parFortune, Random parRand) { + return (parMetadata / 2); } - + @Override - protected Item func_149866_i() - { + protected Item func_149866_i() { return getItemDropSeeds(); } - - public abstract Item getItemDropSeeds(); + + public abstract Item getItemDropSeeds(); @Override - protected Item func_149865_P() - { + protected Item func_149865_P() { return getItemDropProduce(); } - + public abstract Item getItemDropProduce(); - + @Override - public Item getItemDropped(int parMetadata, Random parRand, int parFortune) - { - // DEBUG - System.out.println("BlockCottonWildPlant getItemDropped()"); - //return ClothingCraft.cotton; - int randInt = parRand.nextInt(4); - Item result = null; - if (parMetadata == maxGrowthStage) { - // plant fully grown, could be seed or produce - if (randInt > 2) { - result = getItemDropSeeds(); - } else { - result = getItemDropProduce(); - } - } else { - result = getItemDropSeeds(); - } - return result; + public Item getItemDropped(int parMetadata, Random parRand, int parFortune) { + // DEBUG + System.out.println("BlockCottonWildPlant getItemDropped()"); + //return ClothingCraft.cotton; + int randInt = parRand.nextInt(4); + Item result = null; + if (parMetadata == maxGrowthStage) { + // plant fully grown, could be seed or produce + if (randInt > 2) { + result = getItemDropSeeds(); + } else { + result = getItemDropProduce(); + } + } else { + result = getItemDropSeeds(); + } + return result; + } + + /** + * The type of render function that is called for this block + */ + @Override + public int getRenderType() { + return 1; // Cross like flowers } - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return 1; // Cross like flowers - } - @Override - public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z) - { + public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z) { return EnumPlantType.Crop; } - + /** - * Gets the block's texture. Args: side, meta - */ - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int parSide, int parGrowthStage) { - if (parGrowthStage < 0 || parGrowthStage > maxGrowthStage) - { - parGrowthStage = maxGrowthStage; + * Gets the block's texture. Args: side, meta + */ + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int parSide, int parGrowthStage) { + if (parGrowthStage < 0 || parGrowthStage > maxGrowthStage) { + parGrowthStage = maxGrowthStage; } - return iIcon[parGrowthStage]; - } + return iIcon[parGrowthStage]; + } /* - * implement the IGrowable interface methods + * implement the IGrowable interface methods */ - /** - * @see net.minecraft.block.IGrowable#func_149851_a(net.minecraft.world.World, - * int, int, int, boolean) - */ - @Override - // checks if finished growing (a grow stage of 8 is final stage) - public boolean func_149851_a(World parWorld, int parX, int parY, int parZ, boolean p_149851_5_) { - return parWorld.getBlockMetadata(parX, parY, parZ) != maxGrowthStage; - } - - /** - * @see net.minecraft.block.IGrowable#func_149852_a(net.minecraft.world.World, - * java.util.Random, int, int, int) - */ - @Override - public boolean func_149852_a(World p_149852_1_, Random parRand, int p_149852_3_, int p_149852_4_, int p_149852_5_) { - return true; - } - - /** - * @see net.minecraft.block.IGrowable#func_149853_b(net.minecraft.world.World, - * java.util.Random, int, int, int) - */ - @Override - public void func_149853_b(World parWorld, Random parRand, int parX, int parY, int parZ) { - incrementGrowStage(parWorld, parRand, parX, parY, parZ); - } + /** + * @see net.minecraft.block.IGrowable#func_149851_a(net.minecraft.world.World, + * int, int, int, boolean) + */ + @Override + // checks if finished growing (a grow stage of 8 is final stage) + public boolean func_149851_a(World parWorld, int parX, int parY, int parZ, boolean p_149851_5_) { + return parWorld.getBlockMetadata(parX, parY, parZ) != maxGrowthStage; + } + + /** + * @see net.minecraft.block.IGrowable#func_149852_a(net.minecraft.world.World, + * java.util.Random, int, int, int) + */ + @Override + public boolean func_149852_a(World p_149852_1_, Random parRand, int p_149852_3_, int p_149852_4_, int p_149852_5_) { + return true; + } + + /** + * @see net.minecraft.block.IGrowable#func_149853_b(net.minecraft.world.World, + * java.util.Random, int, int, int) + */ + @Override + public void func_149853_b(World parWorld, Random parRand, int parX, int parY, int parZ) { + incrementGrowStage(parWorld, parRand, parX, parY, parZ); + } } \ No newline at end of file diff --git a/src/main/java/clothingcraft/client/ClientProxy.java b/src/main/java/clothingcraft/client/ClientProxy.java index 8cd84ee..911b9fa 100644 --- a/src/main/java/clothingcraft/client/ClientProxy.java +++ b/src/main/java/clothingcraft/client/ClientProxy.java @@ -1,24 +1,61 @@ package clothingcraft.client; import clothingcraft.core.CommonProxy; +import clothingcraft.gui.CreativeTabsClothingCraft; +import clothingcraft.items.ClothingCraftAccessoriesItemList; +import clothingcraft.items.ClothingCraftFabricItemList; +import clothingcraft.items.ClothingCraftToolsItemList; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; public class ClientProxy extends CommonProxy { + public static CreativeTabs tabCore = new CreativeTabsClothingCraft("tabClothingCraftCore") { + public Item getTabIconItem() { + return cotton; + } + }; + public static CreativeTabs tabMaterials = new CreativeTabsClothingCraft("tabClothingCraftMaterials") { + public Item getTabIconItem() { + return ClothingCraftFabricItemList.cottonFabric; + } + }; + public static CreativeTabs tabTools = new CreativeTabsClothingCraft("tabClothingCraftTools") { + public Item getTabIconItem() { + return ClothingCraftToolsItemList.sewingScissors; + } + }; + public static CreativeTabs tabAccessories = new CreativeTabsClothingCraft("tabClothingCraftAccessories") { + public Item getTabIconItem() { + return ClothingCraftAccessoriesItemList.purse; + } + }; + public static CreativeTabs tabWardrobe = new CreativeTabsClothingCraft("tabClothingCraftWardrobe") { + public Item getTabIconItem() { + return ClothingCraftToolsItemList.needleAndThread; + } + }; - @Override - public void preInit(FMLPreInitializationEvent e) { - super.preInit(e); - } + @Override + public void preInit(FMLPreInitializationEvent e) { + super.preInit(e); + } - @Override + @Override public void init(FMLInitializationEvent e) { - super.init(e); + super.init(e); + + // place armor pieces into core tab + cottonArmorHelmet.setCreativeTab(ClientProxy.tabCore); + cottonArmorChestPlate.setCreativeTab(ClientProxy.tabCore); + cottonArmorLeggings.setCreativeTab(ClientProxy.tabCore); + cottonArmorBoots.setCreativeTab(ClientProxy.tabCore); } - @Override + @Override public void postInit(FMLPostInitializationEvent e) { - super.postInit(e); + super.postInit(e); } } diff --git a/src/main/java/clothingcraft/core/ClothingCraft.java b/src/main/java/clothingcraft/core/ClothingCraft.java index b48a853..21514f1 100644 --- a/src/main/java/clothingcraft/core/ClothingCraft.java +++ b/src/main/java/clothingcraft/core/ClothingCraft.java @@ -1,306 +1,32 @@ package clothingcraft.core; -import clothingcraft.blocks.ClothingCraftCottonBlockList; -import clothingcraft.blocks.ClothingCraftHaliteBlockList; -import clothingcraft.generation.ClothingCraftWorldGen; -import clothingcraft.gui.CreativeTabsClothingCraft; -import clothingcraft.items.ClothingCraftAccessoriesItemList; -import clothingcraft.items.ClothingCraftFabricItemList; -import clothingcraft.items.ClothingCraftHaliteItemList; -import clothingcraft.items.ClothingCraftPatternItemList; -import clothingcraft.items.ClothingCraftToolsItemList; -import clothingcraft.items.ClothingCraftWardrobeItemList; -import clothingcraft.items.ItemCotton; -import clothingcraft.items.ItemCottonArmor; -import clothingcraft.items.ItemCottonSeeds; -import cpw.mods.fml.common.IFuelHandler; import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemArmor.ArmorMaterial; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.EnumHelper; -@Mod(modid=ClothingCraftInfo.MODID, name=ClothingCraftInfo.NAME, version=ClothingCraftInfo.VERSION) -public class ClothingCraft implements IFuelHandler { +@Mod(modid = ClothingCraftInfo.MODID, name = ClothingCraftInfo.NAME, version = ClothingCraftInfo.VERSION) +public class ClothingCraft { - @SidedProxy( - clientSide="clothingcraft.client.ClientProxy", - serverSide="clothingcraft.core.CommonProxy" - ) + @SidedProxy( + clientSide = "clothingcraft.client.ClientProxy", + serverSide = "clothingcraft.core.CommonProxy" + ) public static CommonProxy proxy; - - @Instance(ClothingCraftInfo.MODID) - public static ClothingCraft instance; - - public static CreativeTabs tabCore; - public static CreativeTabs tabMaterials; - public static CreativeTabs tabTools; - public static CreativeTabs tabAccessories; - public static CreativeTabs tabWardrobe; - - - public static ItemCottonSeeds cottonSeeds; // the seeds from the plant - public static ClothingCraftWorldGen clothingCraftWorldGen; // generation of cotton plants in the world - - public static Item cotton; // the harvested product from the plant - - public static ArmorMaterial ARMOR = EnumHelper.addArmorMaterial( - "cotton_armor", 16, new int[] { 3, 8, 6, 3 }, 30); - public static Item cottonArmorHelmet; // cotton armor helmet - public static Item cottonArmorChestPlate; // cotton armor chest plate - public static Item cottonArmorLeggings; // cotton armor leggings - public static Item cottonArmorBoots; // cotton armor boots - - @Mod.EventHandler - public void preInit(FMLPreInitializationEvent event) { - proxy.preInit(event); - - tabCore = new CreativeTabsClothingCraft("tabClothingCraftCore") { - @SideOnly(Side.CLIENT) - public Item getTabIconItem() { - return ClothingCraft.cotton; - } - }; - tabMaterials = new CreativeTabsClothingCraft("tabClothingCraftMaterials") { - @SideOnly(Side.CLIENT) - public Item getTabIconItem() { - return ClothingCraftFabricItemList.cottonFabric; - } - }; - tabTools = new CreativeTabsClothingCraft("tabClothingCraftTools") { - @SideOnly(Side.CLIENT) - public Item getTabIconItem() { - return ClothingCraftToolsItemList.sewingScissors; - } - }; - tabAccessories = new CreativeTabsClothingCraft("tabClothingCraftAccessories"){ - @SideOnly(Side.CLIENT) - public Item getTabIconItem() { - return ClothingCraftAccessoriesItemList.purse; - } - }; - tabWardrobe = new CreativeTabsClothingCraft("tabClothingCraftWardrobe") { - @SideOnly(Side.CLIENT) - public Item getTabIconItem() { - return ClothingCraftToolsItemList.needleAndThread; - } - }; - - /* - * blocks - */ - - // cotton blocks - ClothingCraftCottonBlockList.preInit(); - // halite ore and block - ClothingCraftHaliteBlockList.preInit(); - - - /* - * items - */ - - // cotton plant produce (harvested) - cotton = (Item) new ItemCotton() - .setMaxStackSize(64) - .setUnlocalizedName("cotton_harvested") - .setCreativeTab(ClothingCraft.tabCore) - .setTextureName(ClothingCraftInfo.MODID + ":cotton_harvested"); - GameRegistry.registerItem(cotton, "cotton_harvested"); - - // cotton seeds - cottonSeeds = (ItemCottonSeeds)(new ItemCottonSeeds( ClothingCraftCottonBlockList.cottonPlant, Blocks.farmland) - .setMaxStackSize(64) - .setUnlocalizedName("cotton_seeds") - .setCreativeTab(ClothingCraft.tabCore) - .setTextureName(ClothingCraftInfo.MODID + ":cotton_seeds")); - GameRegistry.registerItem(cottonSeeds , "cotton_seeds"); - // generate cotton seeds when grass is harvested - MinecraftForge.addGrassSeed(new ItemStack(cottonSeeds), 5); - - // halite, rock salt... - ClothingCraftHaliteItemList.preInit(); - - // cotton fabric, including all other colors - ClothingCraftFabricItemList.preInit(); - - // tools: scissors, measuring tape, ... - ClothingCraftToolsItemList.preInit(); - - // tools > patterns ... - ClothingCraftPatternItemList.preInit(); - - // accessory items - ClothingCraftAccessoriesItemList.preInit(); - - // wardrobe items (armor) - ClothingCraftWardrobeItemList.preInit(); - - GameRegistry.registerItem(cottonArmorHelmet = new ItemCottonArmor( - "cottonArmorHelmet", // unlocalizedName - "cotton_armor_helmet", // itemTextureName - ARMOR, // armor material - "cottonarmor_layer", // armorTextureName - 0 // armor type 0 = helmet - ), "cottonArmorHelmet"); // name key for en_US.lang file - GameRegistry.registerItem(cottonArmorChestPlate = new ItemCottonArmor( - "cottonArmorChestPlate", // unlocalizedName - "cotton_armor_chestplate", // itemTextureName - ARMOR, // armor material - "cottonarmor_layer", // armorTextureName - 1 // armor type 1 = chest plate - ), "cottonArmorChestPlate"); // name key for en_US.lang file - GameRegistry.registerItem(cottonArmorLeggings = new ItemCottonArmor( - "cottonArmorLeggings", // unlocalizedName - "cotton_armor_leggings", // itemTextureName - ARMOR, // armor material - "cottonarmor_layer", // armorTextureName - 2 // armor type 2 = leggings - ), "cottonArmorLeggings"); // name key for en_US.lang file - GameRegistry.registerItem(cottonArmorBoots = new ItemCottonArmor( - "cottonArmorBoots", // unlocalizedName - "cotton_armor_boots", // itemTextureName - ARMOR, // armor material - "cottonarmor_layer", // armorTextureName - 3 // armor type 3 = boots - ), "cottonArmorBoots"); // name key for en_US.lang file - } - @Mod.EventHandler - public void init(FMLInitializationEvent event) { - proxy.init(event); - - /* - * world generator creates: - * - wild cotton plants (used in Overworld) - * - halite ore underground (used in Overworld) - */ - clothingCraftWorldGen = new ClothingCraftWorldGen(); - // register generator for world - GameRegistry.registerWorldGenerator(clothingCraftWorldGen, 10); - - - GameRegistry.registerFuelHandler(this); - - - GameRegistry.addRecipe(new ItemStack(cottonSeeds, 1), - new Object[] { "0XX", "XXX", "XXX", - Character.valueOf('0'), new ItemStack(cotton, 1), }); - - - - GameRegistry.addRecipe(new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - new Object[] { "012", "345", "XXX", - Character.valueOf('0'), new ItemStack(cotton, 1), - Character.valueOf('1'), new ItemStack(cotton, 1), - Character.valueOf('2'), new ItemStack(cotton, 1), - Character.valueOf('3'), new ItemStack(cotton, 1), - Character.valueOf('4'), new ItemStack(cotton, 1), - Character.valueOf('5'), new ItemStack(cotton, 1), - }); - - GameRegistry.addRecipe(new ItemStack(ClothingCraftHaliteBlockList.cottonFabricBundle, 1), - new Object[] { "012", "345", "678", - Character.valueOf('0'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - Character.valueOf('1'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - Character.valueOf('2'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - Character.valueOf('3'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - Character.valueOf('4'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - Character.valueOf('5'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - Character.valueOf('6'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - Character.valueOf('7'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - Character.valueOf('8'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - }); - - // cotton armor recipes - GameRegistry.addRecipe(new ItemStack(cottonArmorHelmet, 1), - new Object[] { "012", "3X5", "XXX", - Character.valueOf('0'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - Character.valueOf('1'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - Character.valueOf('2'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - Character.valueOf('3'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - Character.valueOf('5'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - }); - GameRegistry.addRecipe(new ItemStack(cottonArmorChestPlate, 1), - new Object[] { "0X2", "345", "678", - Character.valueOf('0'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - Character.valueOf('2'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - Character.valueOf('3'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - Character.valueOf('4'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - Character.valueOf('5'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - Character.valueOf('6'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - Character.valueOf('7'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - Character.valueOf('8'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - }); - GameRegistry.addRecipe(new ItemStack(cottonArmorLeggings, 1), - new Object[] { "012", "3X5", "6X8", - Character.valueOf('0'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - Character.valueOf('1'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - Character.valueOf('2'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - Character.valueOf('3'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - Character.valueOf('5'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - Character.valueOf('6'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - Character.valueOf('8'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - }); - GameRegistry.addRecipe(new ItemStack(cottonArmorBoots, 1), - new Object[] { "0X2", "3X5", "XXX", - Character.valueOf('0'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - Character.valueOf('2'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - Character.valueOf('3'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - Character.valueOf('5'), new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), - }); - - // place armor pieces into core tab - cottonArmorHelmet.setCreativeTab(ClothingCraft.tabCore); - cottonArmorChestPlate.setCreativeTab(ClothingCraft.tabCore); - cottonArmorLeggings.setCreativeTab(ClothingCraft.tabCore); - cottonArmorBoots.setCreativeTab(ClothingCraft.tabCore); - - // register recipes for halite, rock salt... - ClothingCraftHaliteItemList.init(); - - // register recipes for cotton fabric, including all other colors - ClothingCraftFabricItemList.init(); - - // register recipes for tools: sewing scissors, measuring tape, ... - ClothingCraftToolsItemList.init(); - - // register recipes for tools: patterns by category (beach, career, casual, costume, formal, sleep) - ClothingCraftPatternItemList.init(); - - // register recipes for accessory items - ClothingCraftAccessoriesItemList.init(); - - // register recipes for wardrobe items - ClothingCraftWardrobeItemList.init(); + public void preInit(FMLPreInitializationEvent event) { + proxy.preInit(event); } @Mod.EventHandler - public void postInit(FMLPostInitializationEvent event) { - proxy.postInit(event); + public void init(FMLInitializationEvent event) { + proxy.init(event); } - /** - * @see cpw.mods.fml.common.IFuelHandler#getBurnTime(net.minecraft.item.ItemStack) - */ - @Override - public int getBurnTime(ItemStack fuel) { - // TODO Auto-generated method stub - return 0; - } - - - + @Mod.EventHandler + public void postInit(FMLPostInitializationEvent event) { + proxy.postInit(event); + } } diff --git a/src/main/java/clothingcraft/core/ClothingCraftInfo.java b/src/main/java/clothingcraft/core/ClothingCraftInfo.java index 2e0630a..3c44e71 100644 --- a/src/main/java/clothingcraft/core/ClothingCraftInfo.java +++ b/src/main/java/clothingcraft/core/ClothingCraftInfo.java @@ -1,7 +1,7 @@ package clothingcraft.core; public class ClothingCraftInfo { - public static final String MODID = "clothingcraft"; - public static final String NAME = "ClothingCraft"; - public static final String VERSION = "@VERSION@"; + public static final String MODID = "clothingcraft"; + public static final String NAME = "ClothingCraft"; + public static final String VERSION = "@VERSION@"; } diff --git a/src/main/java/clothingcraft/core/CommonProxy.java b/src/main/java/clothingcraft/core/CommonProxy.java index f03f8f1..473f69b 100644 --- a/src/main/java/clothingcraft/core/CommonProxy.java +++ b/src/main/java/clothingcraft/core/CommonProxy.java @@ -1,17 +1,193 @@ package clothingcraft.core; +import clothingcraft.blocks.ClothingCraftCottonBlockList; +import clothingcraft.blocks.ClothingCraftHaliteBlockList; +import clothingcraft.client.ClientProxy; +import clothingcraft.generation.ClothingCraftWorldGen; +import clothingcraft.items.*; +import cpw.mods.fml.common.IFuelHandler; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.EnumHelper; -public class CommonProxy { - - public void preInit(FMLPreInitializationEvent e) { +public class CommonProxy implements IFuelHandler { + public static ClothingCraftWorldGen clothingCraftWorldGen; // generation of cotton plants in the world + + public static Item cotton; // the harvested product from the plant + public static Item cottonSeeds; // the seeds from the plant + public static Item cottonArmorHelmet; // cotton armor helmet + public static Item cottonArmorChestPlate; // cotton armor chest plate + public static Item cottonArmorLeggings; // cotton armor leggings + public static Item cottonArmorBoots; // cotton armor boots + + + public void preInit(FMLPreInitializationEvent e) { + /* + * blocks + */ + + ClothingCraftCottonBlockList.preInit(); + ClothingCraftHaliteBlockList.preInit(); + + /* + * items + */ + + // cotton plant produce (harvested) + cotton = new ItemCotton() + .setMaxStackSize(64) + .setUnlocalizedName("cotton_harvested") + .setCreativeTab(ClientProxy.tabCore) + .setTextureName(ClothingCraftInfo.MODID + ":cotton_harvested"); + GameRegistry.registerItem(cotton, "cotton_harvested"); + + // cotton seeds + cottonSeeds = new ItemCottonSeeds(ClothingCraftCottonBlockList.cottonPlant, Blocks.farmland) + .setMaxStackSize(64) + .setUnlocalizedName("cotton_seeds") + .setCreativeTab(ClientProxy.tabCore) + .setTextureName(ClothingCraftInfo.MODID + ":cotton_seeds"); + GameRegistry.registerItem(cottonSeeds, "cotton_seeds"); + + // generate cotton seeds when grass is harvested + MinecraftForge.addGrassSeed(new ItemStack(cottonSeeds), 5); + + ClothingCraftHaliteItemList.preInit(); // halite, rock salt... + ClothingCraftFabricItemList.preInit(); // cotton fabric, including all other colors + ClothingCraftToolsItemList.preInit(); // tools: scissors, measuring tape, ... + ClothingCraftPatternItemList.preInit(); // tools > patterns ... + ClothingCraftAccessoriesItemList.preInit(); // accessory items + ClothingCraftWardrobeItemList.preInit(); // wardrobe items (armor) + + ItemArmor.ArmorMaterial CottonArmorMaterial = EnumHelper.addArmorMaterial( + "cotton_armor", 16, new int[]{3, 8, 6, 3}, 30); + + GameRegistry.registerItem(cottonArmorHelmet = new ItemCottonArmor( + "cottonArmorHelmet", // unlocalizedName + "cotton_armor_helmet", // itemTextureName + CottonArmorMaterial, // armor material + "cottonarmor_layer", // armorTextureName + 0 // armor type 0 = helmet + ), "cottonArmorHelmet"); // name key for en_US.lang file + GameRegistry.registerItem(cottonArmorChestPlate = new ItemCottonArmor( + "cottonArmorChestPlate", // unlocalizedName + "cotton_armor_chestplate", // itemTextureName + CottonArmorMaterial, // armor material + "cottonarmor_layer", // armorTextureName + 1 // armor type 1 = chest plate + ), "cottonArmorChestPlate"); // name key for en_US.lang file + GameRegistry.registerItem(cottonArmorLeggings = new ItemCottonArmor( + "cottonArmorLeggings", // unlocalizedName + "cotton_armor_leggings", // itemTextureName + CottonArmorMaterial, // armor material + "cottonarmor_layer", // armorTextureName + 2 // armor type 2 = leggings + ), "cottonArmorLeggings"); // name key for en_US.lang file + GameRegistry.registerItem(cottonArmorBoots = new ItemCottonArmor( + "cottonArmorBoots", // unlocalizedName + "cotton_armor_boots", // itemTextureName + CottonArmorMaterial, // armor material + "cottonarmor_layer", // armorTextureName + 3 // armor type 3 = boots + ), "cottonArmorBoots"); // name key for en_US.lang file } public void init(FMLInitializationEvent e) { + /* + * world generator creates: + * - wild cotton plants (used in Overworld) + * - halite ore underground (used in Overworld) + */ + clothingCraftWorldGen = new ClothingCraftWorldGen(); + + // register generator for world + GameRegistry.registerWorldGenerator(clothingCraftWorldGen, 10); + GameRegistry.registerFuelHandler(this); + + GameRegistry.addRecipe(new ItemStack(cottonSeeds, 1), + "0XX", "XXX", "XXX", + '0', new ItemStack(cotton, 1)); + + GameRegistry.addRecipe(new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), + "012", "345", "XXX", + '0', new ItemStack(cotton, 1), + '1', new ItemStack(cotton, 1), + '2', new ItemStack(cotton, 1), + '3', new ItemStack(cotton, 1), + '4', new ItemStack(cotton, 1), + '5', new ItemStack(cotton, 1)); + + GameRegistry.addRecipe(new ItemStack(ClothingCraftHaliteBlockList.cottonFabricBundle, 1), + "012", "345", "678", + '0', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), + '1', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), + '2', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), + '3', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), + '4', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), + '5', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), + '6', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), + '7', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), + '8', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1)); + + // cotton armor recipes + GameRegistry.addRecipe(new ItemStack(cottonArmorHelmet, 1), + "012", "3X5", "XXX", + '0', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), + '1', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), + '2', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), + '3', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), + '5', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1)); + GameRegistry.addRecipe(new ItemStack(cottonArmorChestPlate, 1), + "0X2", "345", "678", + '0', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), + '2', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), + '3', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), + '4', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), + '5', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), + '6', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), + '7', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), + '8', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1)); + GameRegistry.addRecipe(new ItemStack(cottonArmorLeggings, 1), + "012", "3X5", "6X8", + '0', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), + '1', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), + '2', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), + '3', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), + '5', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), + '6', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), + '8', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1)); + GameRegistry.addRecipe(new ItemStack(cottonArmorBoots, 1), + "0X2", "3X5", "XXX", + '0', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), + '2', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), + '3', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1), + '5', new ItemStack(ClothingCraftFabricItemList.cottonFabric, 1)); + + + ClothingCraftHaliteItemList.init(); // register recipes for halite, rock salt... + ClothingCraftFabricItemList.init(); // register recipes for cotton fabric, including all other colors + ClothingCraftToolsItemList.init(); // register recipes for tools: sewing scissors, measuring tape, ... + ClothingCraftPatternItemList.init(); // register recipes for tools: patterns by category (beach, career, casual, costume, formal, sleep) + ClothingCraftAccessoriesItemList.init(); // register recipes for accessory items + ClothingCraftWardrobeItemList.init(); // register recipes for wardrobe items } public void postInit(FMLPostInitializationEvent e) { } + + /** + * @see cpw.mods.fml.common.IFuelHandler#getBurnTime(net.minecraft.item.ItemStack) + */ + @Override + public int getBurnTime(ItemStack fuel) { + // TODO Auto-generated method stub + return 0; + } } diff --git a/src/main/java/clothingcraft/generation/ClothingCraftWorldGen.java b/src/main/java/clothingcraft/generation/ClothingCraftWorldGen.java index b661deb..e19761c 100644 --- a/src/main/java/clothingcraft/generation/ClothingCraftWorldGen.java +++ b/src/main/java/clothingcraft/generation/ClothingCraftWorldGen.java @@ -1,7 +1,5 @@ package clothingcraft.generation; -import java.util.Random; - import clothingcraft.blocks.ClothingCraftCottonBlockList; import clothingcraft.blocks.ClothingCraftHaliteBlockList; import cpw.mods.fml.common.IWorldGenerator; @@ -10,58 +8,57 @@ import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraft.world.gen.feature.WorldGenerator; +import java.util.Random; + public class ClothingCraftWorldGen implements IWorldGenerator { - - private WorldGenerator generatorHaliteOre; //Generates Halite Ore (used in Overworld) - private PlantGenerator generatorCottonWildPlant; // Generates Cotton Plants (used in Overworld) - - public ClothingCraftWorldGen() { - this.generatorHaliteOre = new WorldGenMinable(ClothingCraftHaliteBlockList.haliteOre, 3); - this.generatorCottonWildPlant = new PlantGenerator(ClothingCraftCottonBlockList.cottonWildPlant, 3); - - } + private WorldGenerator generatorHaliteOre; //Generates Halite Ore (used in Overworld) + private PlantGenerator generatorCottonWildPlant; // Generates Cotton Plants (used in Overworld) + + public ClothingCraftWorldGen() { + this.generatorHaliteOre = new WorldGenMinable(ClothingCraftHaliteBlockList.haliteOre, 3); + this.generatorCottonWildPlant = new PlantGenerator(ClothingCraftCottonBlockList.cottonWildPlant, 3); - @Override - public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, - IChunkProvider chunkProvider) { - switch (world.provider.dimensionId) { - case 0: //Overworld - runOreGenerator(generatorHaliteOre, world, random, chunkX, chunkZ, - 2, // chancesToSpawn - 2, // minHeight - 64 // maxHeight - ); - runPlantGenerator(generatorCottonWildPlant, world, random, chunkX, chunkZ); - break; - case -1: //Nether + } + + @Override + public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, + IChunkProvider chunkProvider) { + switch (world.provider.dimensionId) { + case 0: //Overworld + runOreGenerator(generatorHaliteOre, world, random, chunkX, chunkZ, + 2, // chancesToSpawn + 2, // minHeight + 64 // maxHeight + ); + runPlantGenerator(generatorCottonWildPlant, world, random, chunkX, chunkZ); + break; + case -1: //Nether + break; + case 1: //End + break; + } + } - break; - case 1: //End + private void runOreGenerator(WorldGenerator generator, World world, Random random, int chunk_X, int chunk_Z, int chancesToSpawn, int minHeight, int maxHeight) { + if (minHeight < 0 || maxHeight > 256 || minHeight > maxHeight) + throw new IllegalArgumentException("Illegal Height Arguments for WorldGenerator"); + + int heightDiff = maxHeight - minHeight + 1; + for (int i = 0; i < chancesToSpawn; i++) { + int x = chunk_X * 16 + random.nextInt(16); + int y = minHeight + random.nextInt(heightDiff); + int z = chunk_Z * 16 + random.nextInt(16); + generator.generate(world, random, x, y, z); + } + } - break; - } - } - - private void runOreGenerator(WorldGenerator generator, World world, Random random, int chunk_X, int chunk_Z, int chancesToSpawn, int minHeight, int maxHeight) { - if (minHeight < 0 || maxHeight > 256 || minHeight > maxHeight) - throw new IllegalArgumentException("Illegal Height Arguments for WorldGenerator"); + private boolean runPlantGenerator(PlantGenerator generator, World world, Random random, int chunkX, int chunkZ) { + // calculate the y coordinate find first dirt or grass 1 sky above it. + int x = (chunkX << 4) + random.nextInt(16) + 8; + int y = random.nextInt(128); + int z = (chunkZ << 4) + random.nextInt(16) + 8; - int heightDiff = maxHeight - minHeight + 1; - for (int i = 0; i < chancesToSpawn; i ++) { - int x = chunk_X * 16 + random.nextInt(16); - int y = minHeight + random.nextInt(heightDiff); - int z = chunk_Z * 16 + random.nextInt(16); - generator.generate(world, random, x, y, z); - } - } - - private boolean runPlantGenerator(PlantGenerator generator, World world, Random random, int chunkX, int chunkZ) { - // calculate the y coordinate find first dirt or grass 1 sky above it. - int x = (chunkX << 4) + random.nextInt(16) + 8; - int y = random.nextInt(128); - int z = (chunkZ << 4) + random.nextInt(16) + 8; - - return generator.generate(world, random, x, y, z); + return generator.generate(world, random, x, y, z); } } \ No newline at end of file diff --git a/src/main/java/clothingcraft/generation/PlantGenerator.java b/src/main/java/clothingcraft/generation/PlantGenerator.java index 59a8b3c..5453cae 100644 --- a/src/main/java/clothingcraft/generation/PlantGenerator.java +++ b/src/main/java/clothingcraft/generation/PlantGenerator.java @@ -1,45 +1,45 @@ package clothingcraft.generation; -import java.util.Random; - import net.minecraft.block.Block; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenFlowers; +import java.util.Random; + public class PlantGenerator extends WorldGenFlowers { - private Block plantBlock; - private int plantBlockMeta; + private Block plantBlock; + private int plantBlockMeta; + + public PlantGenerator(Block block, int meta) { + super(block); + this.plantBlock = block; + this.plantBlockMeta = meta; + } - public PlantGenerator(Block block, int meta){ - super(block); - this.plantBlock = block; - this.plantBlockMeta = meta; - } - - public Block getPlantBlock() { - return plantBlock; - } + public Block getPlantBlock() { + return plantBlock; + } - public int getPlantBlockMeta() { - return plantBlockMeta; - } + public int getPlantBlockMeta() { + return plantBlockMeta; + } - @Override - public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5){ + @Override + public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { - for (int l = 0; l < 64; ++l){ - int i1 = par3 + par2Random.nextInt(8) - par2Random.nextInt(8); - int j1 = par4 + par2Random.nextInt(4) - par2Random.nextInt(4); - int k1 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8); + for (int l = 0; l < 64; ++l) { + int i1 = par3 + par2Random.nextInt(8) - par2Random.nextInt(8); + int j1 = par4 + par2Random.nextInt(4) - par2Random.nextInt(4); + int k1 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8); - if (par1World.isAirBlock(i1, j1, k1) && (!par1World.provider.hasNoSky || j1 < 255) && this.plantBlock.canBlockStay(par1World, i1, j1, k1)){ - par1World.setBlock(i1, j1, k1, this.plantBlock, this.plantBlockMeta, 2); - } - } + if (par1World.isAirBlock(i1, j1, k1) && (!par1World.provider.hasNoSky || j1 < 255) && this.plantBlock.canBlockStay(par1World, i1, j1, k1)) { + par1World.setBlock(i1, j1, k1, this.plantBlock, this.plantBlockMeta, 2); + } + } - return true; - } + return true; + } } \ No newline at end of file diff --git a/src/main/java/clothingcraft/gui/CreativeTabsClothingCraft.java b/src/main/java/clothingcraft/gui/CreativeTabsClothingCraft.java index f64b0dc..339803c 100644 --- a/src/main/java/clothingcraft/gui/CreativeTabsClothingCraft.java +++ b/src/main/java/clothingcraft/gui/CreativeTabsClothingCraft.java @@ -1,12 +1,5 @@ -/** - * - */ package clothingcraft.gui; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; - import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.creativetab.CreativeTabs; @@ -14,53 +7,53 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + /** - * Contains all creative tabs for the mod that + * Contains all creative tabs for the mod that * show up on the Graphical User Interface (GUI) - * + *

* 0 = Core [ - * Halite (ore, block, ingot, dust, tools, sword, armor), - * Cotton (plant, seeds, bale) - * ] + * Halite (ore, block, ingot, dust, tools, sword, armor), + * Cotton (plant, seeds, bale) + * ] * 1 = Materials [Dyes, Fabric] * 2 = Accessories [Sand-castle, Ring, Clipboard, et al] * 3 = Tools [ - * Needle and Thread, - * Scissors, Knitting Needles, - * Measuring Tape, Pin-cushion, - * Patterns - * ] - * 4 = Wardrobe [Outfits, Head-gear, et al] - * + * Needle and Thread, + * Scissors, Knitting Needles, + * Measuring Tape, Pin-cushion, + * Patterns + * ] + * 4 = Wardrobe [Outfits, Head-gear, et al] + * * @author JujuAwesomeBeans * @author NinjaSoldier40 * @since 02/05/2017 10:42 AM - * */ -public class CreativeTabsClothingCraft extends CreativeTabs -{ - /* src: https://gist.github.com/Choonster/42602d38a94b915fc0b2 */ - private Comparator itemSorter = new ItemOreSorter(); - - public CreativeTabsClothingCraft(String index) - { - super(index); - } +public class CreativeTabsClothingCraft extends CreativeTabs { + /* src: https://gist.github.com/Choonster/42602d38a94b915fc0b2 */ + private Comparator itemSorter = new ItemOreSorter(); - @Override - @SideOnly(Side.CLIENT) - public Item getTabIconItem() - { - return Item.getItemFromBlock(Blocks.sapling); - } - - @Override - public void displayAllReleventItems(List items) { - super.displayAllReleventItems(items); + public CreativeTabsClothingCraft(String index) { + super(index); + } - // Sort the item list using the ItemSorter instance - Collections.sort(items, itemSorter); - } + @Override + @SideOnly(Side.CLIENT) + public Item getTabIconItem() { + return Item.getItemFromBlock(Blocks.sapling); + } + + @Override + public void displayAllReleventItems(List items) { + super.displayAllReleventItems(items); + + // Sort the item list using the ItemSorter instance + Collections.sort(items, itemSorter); + } // /* // * TABS @@ -110,5 +103,5 @@ public void displayAllReleventItems(List items) { // return ClothingCraft.bollsCotton; // } // }; - + } diff --git a/src/main/java/clothingcraft/gui/ItemOreSorter.java b/src/main/java/clothingcraft/gui/ItemOreSorter.java index 45773d9..e90cb6a 100644 --- a/src/main/java/clothingcraft/gui/ItemOreSorter.java +++ b/src/main/java/clothingcraft/gui/ItemOreSorter.java @@ -1,6 +1,3 @@ -/** - * - */ package clothingcraft.gui; import net.minecraft.item.ItemStack; @@ -11,63 +8,63 @@ import java.util.Map; /** - * Sorting comparator for displayed Items in a custom creative tab - * - * @see https://gist.github.com/Choonster/42602d38a94b915fc0b2 - * + * Sorting comparator for displayed Items in a custom creative tab + * * @author NinjaSoldier40 + * @see https://gist.github.com/Choonster/42602d38a94b915fc0b2 * @since 02/12/2017 12:23 PM (-07:00 GMT) - * */ public class ItemOreSorter implements Comparator { - public enum OreDictionaryPriority { - ORE, - INGOT, - DUST, - NONE - }; - - private Map oreDictPriorityCache = new HashMap(); + private Map oreDictPriorityCache = new HashMap(); + + ; + + private OreDictionaryPriority getOreDictionaryPriority(ItemStack itemStack) { + OreDictionaryPriority priority = oreDictPriorityCache.get(itemStack); + if (priority != null) { + return priority; + } - private OreDictionaryPriority getOreDictionaryPriority(ItemStack itemStack) { - OreDictionaryPriority priority = oreDictPriorityCache.get(itemStack); - if (priority != null) { - return priority; - } + priority = OreDictionaryPriority.NONE; - priority = OreDictionaryPriority.NONE; + for (int oreID : OreDictionary.getOreIDs(itemStack)) { + String oreName = OreDictionary.getOreName(oreID); - for (int oreID : OreDictionary.getOreIDs(itemStack)) { - String oreName = OreDictionary.getOreName(oreID); + if (oreName.startsWith("ore")) { + priority = OreDictionaryPriority.ORE; + break; + } else if (oreName.startsWith("ingot")) { + priority = OreDictionaryPriority.INGOT; + break; + } else if (oreName.startsWith("dust")) { + priority = OreDictionaryPriority.DUST; + break; + } + } - if (oreName.startsWith("ore")) { - priority = OreDictionaryPriority.ORE; - break; - } else if (oreName.startsWith("ingot")) { - priority = OreDictionaryPriority.INGOT; - break; - } else if (oreName.startsWith("dust")) { - priority = OreDictionaryPriority.DUST; - break; - } - } + oreDictPriorityCache.put(itemStack, priority); - oreDictPriorityCache.put(itemStack, priority); + return priority; + } - return priority; - } + @Override + public int compare(ItemStack stack1, ItemStack stack2) { + OreDictionaryPriority priority1 = getOreDictionaryPriority(stack1), priority2 = getOreDictionaryPriority(stack2); - @Override - public int compare(ItemStack stack1, ItemStack stack2) { - OreDictionaryPriority priority1 = getOreDictionaryPriority(stack1), priority2 = getOreDictionaryPriority(stack2); + if (priority1 == priority2) { // Both stacks have the same priority, order them by their display names + String displayName1 = stack1.getDisplayName(); + String displayName2 = stack2.getDisplayName(); - if (priority1 == priority2) { // Both stacks have the same priority, order them by their display names - String displayName1 = stack1.getDisplayName(); - String displayName2 = stack2.getDisplayName(); + return displayName1.compareToIgnoreCase(displayName2); + } else { // Stacks have different priorities, order them by priority instead + return priority1.compareTo(priority2); + } + } - return displayName1.compareToIgnoreCase(displayName2); - } else { // Stacks have different priorities, order them by priority instead - return priority1.compareTo(priority2); - } - } + public enum OreDictionaryPriority { + ORE, + INGOT, + DUST, + NONE + } } \ No newline at end of file diff --git a/src/main/java/clothingcraft/items/ClothingCraftAccessoriesItemList.java b/src/main/java/clothingcraft/items/ClothingCraftAccessoriesItemList.java index ccbb783..55c5a19 100644 --- a/src/main/java/clothingcraft/items/ClothingCraftAccessoriesItemList.java +++ b/src/main/java/clothingcraft/items/ClothingCraftAccessoriesItemList.java @@ -1,175 +1,179 @@ /** - * + * */ package clothingcraft.items; -import java.util.LinkedHashMap; - -import clothingcraft.core.ClothingCraft; +import clothingcraft.client.ClientProxy; import clothingcraft.core.ClothingCraftInfo; -import clothingcraft.items.ClothingCraftFabricItemList.COLORS; -import clothingcraft.items.ClothingCraftPatternItemList.CATEGORY; -import clothingcraft.items.ClothingCraftPatternItemList.PURPOSE; +import clothingcraft.items.ClothingCraftFabricItemList.Colors; +import clothingcraft.items.ClothingCraftPatternItemList.Category; +import clothingcraft.items.ClothingCraftPatternItemList.Purpose; import clothingcraft.util.RecipeUtil; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; + +import java.util.LinkedHashMap; + /** * List of wardrobe items and their registrations into the world. - * + * * @author JujuAwesomeBeans * @author NinjaSoldier40 * @since 02/12/2017 07:39 PM (-7:00 GMT) */ public class ClothingCraftAccessoriesItemList { - - // accessoryItemMap, key to Item map - public static LinkedHashMap accessoryItemMap = - new LinkedHashMap(); - - public static Item purse; - - public static void preInit() { - registerItemByKey("bouquetroses"); - registerItemByKey("purse"); - purse = getAccessoryItem("purse"); - registerItemByKey("satchelplaid"); - registerItemByKey("briefcase"); - registerItemByKey("smartphone"); - registerItemByKey("laptopcomputer"); - registerItemByKey("clipboard"); - registerItemByKey("pencil"); - registerItemByKey("paintbrush"); - registerItemByKey("paintpalette"); - registerItemByKey("hammer"); - registerItemByKey("wrench"); - registerItemByKey("meatcleaver"); - registerItemByKey("rollingpin"); - registerItemByKey("sushichopsticks"); - registerItemByKey("policebadge"); - registerItemByKey("giftblue"); - registerItemByKey("giftred"); - registerItemByKey("plushbunny"); - registerItemByKey("plushkitty"); - registerItemByKey("plushteddy"); - registerItemByKey("beachball"); - registerItemByKey("sandbucket"); - registerItemByKey("sandshovel"); - registerItemByKey("ukelele"); - registerItemByKey("ringengagement"); - registerItemByKey("ringsetwedding"); - registerItemByKey("fairywand"); - registerItemByKey("violin"); - registerItemByKey("violinbow"); - registerItemByKey("clarinet"); - registerItemByKey("harp"); - } - - public static void init() { - // bouquetroses - // purse - // satchelplaid - // briefcase - // smartphone - // laptopcomputer - // clipboard - // pencil - // paintbrush - // paintpalette - // hammer - // wrench - // meatcleaver - // rollingpin - // sushichopsticks - // policebadge - // giftblue - // giftred - // plushbunny - // plushkitty - // plushteddy - - // beachball - GameRegistry.addRecipe(new ItemStack( - getAccessoryItem("beachball"), 1), - RecipeUtil.createRecipeObject(new Item[]{ - null, getFabric(COLORS.white), null, - getFabric(COLORS.bluedark), Items.slime_ball, getFabric(COLORS.red), - null, getFabric(COLORS.yellow), null - }) - ); - - // sandbucket - // sandshovel - // ukelele - // ringengagement - // ringsetwedding - // fairywand - // violin - // violinbow - // clarinet - // harp - } - - private static void registerItemByKey(String itemKey) { - Item result = (Item) new Item() - .setMaxStackSize(64) - .setUnlocalizedName(ensurePrefix("accessory_",itemKey)) - .setCreativeTab(ClothingCraft.tabAccessories) - .setTextureName(ClothingCraftInfo.MODID + ":" + ensurePrefix("accessory_",itemKey)); - accessoryItemMap.put("accessory_" + itemKey, result); - GameRegistry.registerItem(result, ensurePrefix("accessory_",itemKey)); - } - - /** - * Resolves the stored wardrobe accessory item reference from the map container in this class - * @param accessoryKey String representation of map key: - * REQUIRED, null value will throw an IlleagalArgumentException - * @return associated wardrobe accessory item, null if none exists - */ - public static Item getAccessoryItem(String accessoryKey) { - Item result = null; - if (accessoryKey!=null) { - accessoryKey = ensurePrefix("accessory_", accessoryKey); - result = accessoryItemMap.get(accessoryKey); - } else { - throw new IllegalArgumentException("null argument: accessoryKey"); - } - return result; - } - - /** - * Ensures the inStr starts with the prefix, if not prepends the prefix - * @param prefix value to prepend - * @param inStr value to ensure prefix starts with - * @return String value that starts with prefix - */ - private static String ensurePrefix(String prefix, String inStr) { - String result = inStr; - if (!inStr.startsWith(prefix)) { - result = prefix + inStr; - } - return result; - } - - /** - * Resolves the stored sewing pattern item reference from the map container in this class - * - * @param enumCategory ClothingCraftPatternItemList.CATEGORY enumeration element - * @param enumPurpose ClothingCraftPatternItemList.PURPOSE enumeration element - * @return associated sewing pattern item, null if none exists - */ - public static Item getPattern(CATEGORY enumCategory, PURPOSE enumPurpose) { - return ClothingCraftPatternItemList.patternsItemMap.get(enumCategory).get(enumPurpose); - } - - /** - * Resolves the stored sewing fabric item reference from the map container in this class - * @param enumColor ClothingCraftFabricItemList.COLORS enumeration element - * @return associated sewing fabric item, null if none exists. - */ - public static Item getFabric(COLORS enumColor) { - return ClothingCraftFabricItemList.fabricItemsMap.get(enumColor); - } + + // accessoryItemMap, key to Item map + public static LinkedHashMap accessoryItemMap = + new LinkedHashMap(); + + public static Item purse; + + public static void preInit() { + registerItemByKey("bouquetroses"); + registerItemByKey("purse"); + purse = getAccessoryItem("purse"); + registerItemByKey("satchelplaid"); + registerItemByKey("briefcase"); + registerItemByKey("smartphone"); + registerItemByKey("laptopcomputer"); + registerItemByKey("clipboard"); + registerItemByKey("pencil"); + registerItemByKey("paintbrush"); + registerItemByKey("paintpalette"); + registerItemByKey("hammer"); + registerItemByKey("wrench"); + registerItemByKey("meatcleaver"); + registerItemByKey("rollingpin"); + registerItemByKey("sushichopsticks"); + registerItemByKey("policebadge"); + registerItemByKey("giftblue"); + registerItemByKey("giftred"); + registerItemByKey("plushbunny"); + registerItemByKey("plushkitty"); + registerItemByKey("plushteddy"); + registerItemByKey("beachball"); + registerItemByKey("sandbucket"); + registerItemByKey("sandshovel"); + registerItemByKey("ukelele"); + registerItemByKey("ringengagement"); + registerItemByKey("ringsetwedding"); + registerItemByKey("fairywand"); + registerItemByKey("violin"); + registerItemByKey("violinbow"); + registerItemByKey("clarinet"); + registerItemByKey("harp"); + } + + public static void init() { + // bouquetroses + // purse + // satchelplaid + // briefcase + // smartphone + // laptopcomputer + // clipboard + // pencil + // paintbrush + // paintpalette + // hammer + // wrench + // meatcleaver + // rollingpin + // sushichopsticks + // policebadge + // giftblue + // giftred + // plushbunny + // plushkitty + // plushteddy + + // beachball + GameRegistry.addRecipe(new ItemStack( + getAccessoryItem("beachball"), 1), + RecipeUtil.createRecipeObject(new Item[]{ + null, getFabric(Colors.white), null, + getFabric(Colors.bluedark), Items.slime_ball, getFabric(Colors.red), + null, getFabric(Colors.yellow), null + }) + ); + + // sandbucket + // sandshovel + // ukelele + // ringengagement + // ringsetwedding + // fairywand + // violin + // violinbow + // clarinet + // harp + } + + private static void registerItemByKey(String itemKey) { + Item result = (Item) new Item() + .setMaxStackSize(64) + .setUnlocalizedName(ensurePrefix("accessory_", itemKey)) + .setCreativeTab(ClientProxy.tabAccessories) + .setTextureName(ClothingCraftInfo.MODID + ":" + ensurePrefix("accessory_", itemKey)); + accessoryItemMap.put("accessory_" + itemKey, result); + GameRegistry.registerItem(result, ensurePrefix("accessory_", itemKey)); + } + + /** + * Resolves the stored wardrobe accessory item reference from the map container in this class + * + * @param accessoryKey String representation of map key: + * REQUIRED, null value will throw an IlleagalArgumentException + * @return associated wardrobe accessory item, null if none exists + */ + public static Item getAccessoryItem(String accessoryKey) { + Item result = null; + if (accessoryKey != null) { + accessoryKey = ensurePrefix("accessory_", accessoryKey); + result = accessoryItemMap.get(accessoryKey); + } else { + throw new IllegalArgumentException("null argument: accessoryKey"); + } + return result; + } + + /** + * Ensures the inStr starts with the prefix, if not prepends the prefix + * + * @param prefix value to prepend + * @param inStr value to ensure prefix starts with + * @return String value that starts with prefix + */ + private static String ensurePrefix(String prefix, String inStr) { + String result = inStr; + if (!inStr.startsWith(prefix)) { + result = prefix + inStr; + } + return result; + } + + /** + * Resolves the stored sewing pattern item reference from the map container in this class + * + * @param enumCategory ClothingCraftPatternItemList.CATEGORY enumeration element + * @param enumPurpose ClothingCraftPatternItemList.PURPOSE enumeration element + * @return associated sewing pattern item, null if none exists + */ + public static Item getPattern(Category enumCategory, Purpose enumPurpose) { + return ClothingCraftPatternItemList.patternsItemMap.get(enumCategory).get(enumPurpose); + } + + /** + * Resolves the stored sewing fabric item reference from the map container in this class + * + * @param enumColor ClothingCraftFabricItemList.COLORS enumeration element + * @return associated sewing fabric item, null if none exists. + */ + public static Item getFabric(Colors enumColor) { + return ClothingCraftFabricItemList.fabricItemsMap.get(enumColor); + } } diff --git a/src/main/java/clothingcraft/items/ClothingCraftFabricItemList.java b/src/main/java/clothingcraft/items/ClothingCraftFabricItemList.java index 2e4255c..a76999f 100644 --- a/src/main/java/clothingcraft/items/ClothingCraftFabricItemList.java +++ b/src/main/java/clothingcraft/items/ClothingCraftFabricItemList.java @@ -1,244 +1,240 @@ /** - * + * */ package clothingcraft.items; -import java.util.LinkedHashMap; - -import clothingcraft.core.ClothingCraft; +import clothingcraft.client.ClientProxy; import clothingcraft.core.ClothingCraftInfo; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import java.util.LinkedHashMap; + /** * List of dye and fabric items and their registrations into the world - * + * * @author JujuAwesomeBeans * @author NinjaSoldier40 * @since 02/10/2017 05:58 AM (-7:00 GMT) */ public class ClothingCraftFabricItemList { - public static Item cottonFabric; - - /** - * 0 Ink Sac Black - * 1 Rose Red Red - * 2 Cactus Green Green - * 3 Cocoa Beans Brown - * 4 Lapis Lazuli Blue Dark - * 5 Purple Dye Purple - * 6 Cyan Dye Cyan - * 7 Light Gray Dye Gray Light - * 8 Gray Dye Grey Dark - * 9 Pink Dye Pink - * 10 Lime Dye Lime - * 11 Dandelion Yellow Yellow - * 12 Light Blue Dye Blue Light - * 13 Magenta Dye Magenta - * 14 Orange Dye Orange - * 15 Bone Meal White - * - * special recipes for the following: - * - coral, - * - galaxy, - * - glowstone, - * - lavender, - * - mint, - * - redstone, - * - rainbow, - * - tan, - * - pinklight, - * - * @param enumColor COLORS enum value to key on. - */ - public static enum COLORS { - black, red, green, brown, bluedark, - purple, cyan, graylight, graydark, pink, - lime, yellow, bluelight, magenta, orange, white, - galaxy, glowstone, lavender, mint, coral, rainbow, redstone, tan, pinklight - }; // pinklight removed (no fabric for it). - public static LinkedHashMap dyeItemsMap = new LinkedHashMap(); - public static LinkedHashMap fabricItemsMap = new LinkedHashMap(); - - public static void preInit() { - - buildRecipesByColor(); - - cottonFabric = (Item) new ItemCottonFabric() - .setMaxDamage(0) - .setMaxStackSize(64) - .setUnlocalizedName("cotton_fabric") - .setTextureName(ClothingCraftInfo.MODID + ":cotton_fabric") - .setCreativeTab(ClothingCraft.tabCore); - GameRegistry.registerItem(cottonFabric, "cotton_fabric"); - - for (COLORS enumColor : COLORS.values()) { - dyeItemsMap.put(enumColor, new ItemDye(enumColor.toString())); - GameRegistry.registerItem((dyeItemsMap.get(enumColor)), "dye_" + enumColor.toString()); - - fabricItemsMap.put(enumColor, new ItemDyedFabric(enumColor.toString())); - GameRegistry.registerItem((fabricItemsMap.get(enumColor)), "fabric_" + enumColor.toString()); - } - } - - - public static void init() { - - for (COLORS enumColor : COLORS.values()) { - // register dye recipes - ItemStack stack = new ItemStack(dyeItemsMap.get(enumColor), 1); - GameRegistry.addRecipe(stack, dyeRecipeMap.get(enumColor)); - // register fabric recipes - GameRegistry.addRecipe(new ItemStack(fabricItemsMap.get(enumColor), 1), - new Object[] { "01X", "XXX", "XXX", - Character.valueOf('0'), new ItemStack(cottonFabric, 1), - Character.valueOf('1'), new ItemStack(dyeItemsMap.get(enumColor), 1) - }); - } - } - - public static LinkedHashMap dyeRecipeMap = new LinkedHashMap(); - - /** - * builds the dye specific recipes according to effective color. - * - * @param enumColor COLORS enum value to key on. - */ - public static void buildRecipesByColor() { - int dyeMetaValue = 0; - for (COLORS enumColor : COLORS.values()) { - if (dyeMetaValue < 16) { - dyeRecipeMap.put(enumColor, getTemplateRecipe(dyeMetaValue)); - } else { - switch (enumColor) { - case coral: - dyeRecipeMap.put(enumColor, getCoralRecipe()); - break; - case galaxy: - dyeRecipeMap.put(enumColor, getGalaxyRecipe()); - break; - case glowstone: - dyeRecipeMap.put(enumColor, getGlowstoneRecipe()); - break; - case lavender: - dyeRecipeMap.put(enumColor, getLavenderRecipe()); - break; - case mint: - dyeRecipeMap.put(enumColor, getMintRecipe()); - break; - case redstone: - dyeRecipeMap.put(enumColor, getRedstoneRecipe()); - break; - case rainbow: - dyeRecipeMap.put(enumColor, getRainbowRecipe()); - break; - case tan: - dyeRecipeMap.put(enumColor, getTanRecipe()); - break; - case pinklight: - dyeRecipeMap.put(enumColor, getPinkLightRecipe()); - break; - default: - - } - } - dyeMetaValue++; - } - - - } - - private static Object[] getTemplateRecipe(int dyeMetaValue) { - return new Object[] { "012", "XXX", "XXX", - Character.valueOf('0'), new ItemStack(Items.potionitem, 1), - Character.valueOf('1'), new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), - Character.valueOf('2'), new ItemStack(Items.dye, 1, dyeMetaValue) - }; - } - - private static Object[] getCoralRecipe() { - return new Object[] { "012", "3XX", "XXX", - Character.valueOf('0'), new ItemStack(Items.potionitem, 1), - Character.valueOf('1'), new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), - Character.valueOf('2'), new ItemStack(Items.dye, 1, 9), // pink - Character.valueOf('3'), new ItemStack(Items.dye, 1, 14), // orange - }; - } - - private static Object[] getGalaxyRecipe() { - return new Object[] { "012", "34X", "XXX", - Character.valueOf('0'), new ItemStack(Items.potionitem, 1), - Character.valueOf('1'), new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), - Character.valueOf('2'), new ItemStack(Items.nether_star, 1), // netherstar item - Character.valueOf('3'), new ItemStack(Items.dye, 1, 4), // bluedark - Character.valueOf('4'), new ItemStack(Items.dye, 1, 5), // purple - }; - } - - private static Object[] getGlowstoneRecipe() { - return new Object[] { "012", "XXX", "XXX", - Character.valueOf('0'), new ItemStack(Items.potionitem, 1), - Character.valueOf('1'), new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), - Character.valueOf('2'), new ItemStack(Items.glowstone_dust, 1), // glowstone_dust item - }; - } - - private static Object[] getLavenderRecipe() { - return new Object[] { "012", "3XX", "XXX", - Character.valueOf('0'), new ItemStack(Items.potionitem, 1), - Character.valueOf('1'), new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), - Character.valueOf('2'), new ItemStack(Items.dye, 1, 5), // purple - Character.valueOf('3'), new ItemStack(Items.dye, 1, 15), // white - }; - } - - private static Object[] getMintRecipe() { - return new Object[] { "012", "3XX", "XXX", - Character.valueOf('0'), new ItemStack(Items.potionitem, 1), - Character.valueOf('1'), new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), - Character.valueOf('2'), new ItemStack(Items.dye, 1, 2), // green - Character.valueOf('3'), new ItemStack(Items.dye, 1, 15), // white - }; - } - - private static Object[] getRedstoneRecipe() { - return new Object[] { "012", "XXX", "XXX", - Character.valueOf('0'), new ItemStack(Items.potionitem, 1), - Character.valueOf('1'), new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), - Character.valueOf('2'), new ItemStack(Items.redstone, 1), // redstone item - }; - } - - private static Object[] getRainbowRecipe() { - return new Object[] { "012", "345", "67X", - Character.valueOf('0'), new ItemStack(Items.potionitem, 1), - Character.valueOf('1'), new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), - Character.valueOf('2'), new ItemStack(Items.dye, 1, 1), // red - Character.valueOf('3'), new ItemStack(Items.dye, 1, 14), // orange - Character.valueOf('4'), new ItemStack(Items.dye, 1, 11), // yellow - Character.valueOf('5'), new ItemStack(Items.dye, 1, 2), // green - Character.valueOf('6'), new ItemStack(Items.dye, 1, 4), // bluedark - Character.valueOf('7'), new ItemStack(Items.dye, 1, 5), // purple - }; - } - - private static Object[] getTanRecipe() { - return new Object[] { "012", "3XX", "XXX", - Character.valueOf('0'), new ItemStack(Items.potionitem, 1), - Character.valueOf('1'), new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), - Character.valueOf('2'), new ItemStack(Items.dye, 1, 3), // brown - Character.valueOf('3'), new ItemStack(Items.dye, 1, 15), // white - }; - } - - private static Object[] getPinkLightRecipe() { - return new Object[] { "012", "3XX", "XXX", - Character.valueOf('0'), new ItemStack(Items.potionitem, 1), - Character.valueOf('1'), new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), - Character.valueOf('2'), new ItemStack(Items.dye, 1, 9), // pink - Character.valueOf('3'), new ItemStack(Items.dye, 1, 15), // white - }; - } + public static Item cottonFabric; + public static LinkedHashMap dyeItemsMap = new LinkedHashMap(); + + // pinklight removed (no fabric for it). + public static LinkedHashMap fabricItemsMap = new LinkedHashMap(); + public static LinkedHashMap dyeRecipeMap = new LinkedHashMap(); + + public static void preInit() { + + buildRecipesByColor(); + + cottonFabric = new ItemCottonFabric() + .setMaxDamage(0) + .setMaxStackSize(64) + .setUnlocalizedName("cotton_fabric") + .setTextureName(ClothingCraftInfo.MODID + ":cotton_fabric") + .setCreativeTab(ClientProxy.tabCore); + GameRegistry.registerItem(cottonFabric, "cotton_fabric"); + + for (Colors enumColor : Colors.values()) { + dyeItemsMap.put(enumColor, new ItemDye(enumColor.toString())); + GameRegistry.registerItem((dyeItemsMap.get(enumColor)), "dye_" + enumColor.toString()); + + fabricItemsMap.put(enumColor, new ItemDyedFabric(enumColor.toString())); + GameRegistry.registerItem((fabricItemsMap.get(enumColor)), "fabric_" + enumColor.toString()); + } + } + + + public static void init() { + + for (Colors enumColor : Colors.values()) { + // register dye recipes + ItemStack stack = new ItemStack(dyeItemsMap.get(enumColor), 1); + GameRegistry.addRecipe(stack, dyeRecipeMap.get(enumColor)); + // register fabric recipes + GameRegistry.addRecipe(new ItemStack(fabricItemsMap.get(enumColor), 1), + "01X", "XXX", "XXX", + '0', new ItemStack(cottonFabric, 1), + '1', new ItemStack(dyeItemsMap.get(enumColor), 1)); + } + } + + /** + * builds the dye specific recipes according to effective color. + */ + public static void buildRecipesByColor() { + int dyeMetaValue = 0; + for (Colors enumColor : Colors.values()) { + if (dyeMetaValue < 16) { + dyeRecipeMap.put(enumColor, getTemplateRecipe(dyeMetaValue)); + } else { + switch (enumColor) { + case coral: + dyeRecipeMap.put(enumColor, getCoralRecipe()); + break; + case galaxy: + dyeRecipeMap.put(enumColor, getGalaxyRecipe()); + break; + case glowstone: + dyeRecipeMap.put(enumColor, getGlowstoneRecipe()); + break; + case lavender: + dyeRecipeMap.put(enumColor, getLavenderRecipe()); + break; + case mint: + dyeRecipeMap.put(enumColor, getMintRecipe()); + break; + case redstone: + dyeRecipeMap.put(enumColor, getRedstoneRecipe()); + break; + case rainbow: + dyeRecipeMap.put(enumColor, getRainbowRecipe()); + break; + case tan: + dyeRecipeMap.put(enumColor, getTanRecipe()); + break; + case pinklight: + dyeRecipeMap.put(enumColor, getPinkLightRecipe()); + break; + default: + + } + } + dyeMetaValue++; + } + + + } + + private static Object[] getTemplateRecipe(int dyeMetaValue) { + return new Object[]{"012", "XXX", "XXX", + '0', new ItemStack(Items.potionitem, 1), + '1', new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), + '2', new ItemStack(Items.dye, 1, dyeMetaValue) + }; + } + + private static Object[] getCoralRecipe() { + return new Object[]{"012", "3XX", "XXX", + '0', new ItemStack(Items.potionitem, 1), + '1', new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), + '2', new ItemStack(Items.dye, 1, 9), // pink + '3', new ItemStack(Items.dye, 1, 14), // orange + }; + } + + private static Object[] getGalaxyRecipe() { + return new Object[]{"012", "34X", "XXX", + '0', new ItemStack(Items.potionitem, 1), + '1', new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), + '2', new ItemStack(Items.nether_star, 1), // netherstar item + '3', new ItemStack(Items.dye, 1, 4), // bluedark + '4', new ItemStack(Items.dye, 1, 5), // purple + }; + } + + private static Object[] getGlowstoneRecipe() { + return new Object[]{"012", "XXX", "XXX", + '0', new ItemStack(Items.potionitem, 1), + '1', new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), + '2', new ItemStack(Items.glowstone_dust, 1), // glowstone_dust item + }; + } + + private static Object[] getLavenderRecipe() { + return new Object[]{"012", "3XX", "XXX", + '0', new ItemStack(Items.potionitem, 1), + '1', new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), + '2', new ItemStack(Items.dye, 1, 5), // purple + '3', new ItemStack(Items.dye, 1, 15), // white + }; + } + + private static Object[] getMintRecipe() { + return new Object[]{"012", "3XX", "XXX", + '0', new ItemStack(Items.potionitem, 1), + '1', new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), + '2', new ItemStack(Items.dye, 1, 2), // green + '3', new ItemStack(Items.dye, 1, 15), // white + }; + } + + private static Object[] getRedstoneRecipe() { + return new Object[]{"012", "XXX", "XXX", + '0', new ItemStack(Items.potionitem, 1), + '1', new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), + '2', new ItemStack(Items.redstone, 1), // redstone item + }; + } + + private static Object[] getRainbowRecipe() { + return new Object[]{"012", "345", "67X", + '0', new ItemStack(Items.potionitem, 1), + '1', new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), + '2', new ItemStack(Items.dye, 1, 1), // red + '3', new ItemStack(Items.dye, 1, 14), // orange + '4', new ItemStack(Items.dye, 1, 11), // yellow + '5', new ItemStack(Items.dye, 1, 2), // green + '6', new ItemStack(Items.dye, 1, 4), // bluedark + '7', new ItemStack(Items.dye, 1, 5), // purple + }; + } + + private static Object[] getTanRecipe() { + return new Object[]{"012", "3XX", "XXX", + '0', new ItemStack(Items.potionitem, 1), + '1', new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), + '2', new ItemStack(Items.dye, 1, 3), // brown + '3', new ItemStack(Items.dye, 1, 15), // white + }; + } + + private static Object[] getPinkLightRecipe() { + return new Object[]{"012", "3XX", "XXX", + '0', new ItemStack(Items.potionitem, 1), + '1', new ItemStack(ClothingCraftHaliteItemList.rockSalt, 1), + '2', new ItemStack(Items.dye, 1, 9), // pink + '3', new ItemStack(Items.dye, 1, 15), // white + }; + } + + /** + * 0 Ink Sac Black + * 1 Rose Red Red + * 2 Cactus Green Green + * 3 Cocoa Beans Brown + * 4 Lapis Lazuli Blue Dark + * 5 Purple Dye Purple + * 6 Cyan Dye Cyan + * 7 Light Gray Dye Gray Light + * 8 Gray Dye Grey Dark + * 9 Pink Dye Pink + * 10 Lime Dye Lime + * 11 Dandelion Yellow Yellow + * 12 Light Blue Dye Blue Light + * 13 Magenta Dye Magenta + * 14 Orange Dye Orange + * 15 Bone Meal White + *

+ * special recipes for the following: + * - coral, + * - galaxy, + * - glowstone, + * - lavender, + * - mint, + * - redstone, + * - rainbow, + * - tan, + * - pinklight + */ + public enum Colors { + black, red, green, brown, bluedark, + purple, cyan, graylight, graydark, pink, + lime, yellow, bluelight, magenta, orange, white, + galaxy, glowstone, lavender, mint, coral, rainbow, redstone, tan, pinklight + } } diff --git a/src/main/java/clothingcraft/items/ClothingCraftHaliteItemList.java b/src/main/java/clothingcraft/items/ClothingCraftHaliteItemList.java index f2697c6..8ae53d2 100644 --- a/src/main/java/clothingcraft/items/ClothingCraftHaliteItemList.java +++ b/src/main/java/clothingcraft/items/ClothingCraftHaliteItemList.java @@ -1,5 +1,5 @@ /** - * + * */ package clothingcraft.items; @@ -11,83 +11,79 @@ /** * List of blocks and their registrations into the world - * + * * @author JujuAwesomeBeans * @author NinjaSoldier40 * @since 02/10/2017 05:58 AM (-7:00 GMT) */ public class ClothingCraftHaliteItemList { - public static Item rockSalt; - public static Item haliteIngot; - public static Item haliteSword; - public static Item haliteAxe; - public static Item haliteHoe; - public static Item halitePickaxe; - public static Item haliteShovel; - - public static void preInit() { - rockSalt = (Item) new ItemRockSalt(); - GameRegistry.registerItem(rockSalt, "rock_salt"); - - haliteIngot = (Item) new ItemHaliteIngot(); - GameRegistry.registerItem(haliteIngot, "halite_ingot"); - - haliteSword = (Item) new ItemHaliteSword(); - GameRegistry.registerItem(haliteSword, "halite_sword"); - - haliteAxe = (Item) new ItemHaliteAxe(); - GameRegistry.registerItem(haliteAxe, "halite_axe"); - - haliteHoe = (Item) new ItemHaliteHoe(); - GameRegistry.registerItem(haliteHoe, "halite_hoe"); - - halitePickaxe = (Item) new ItemHalitePickaxe(); - GameRegistry.registerItem(halitePickaxe, "halite_pickaxe"); - - haliteShovel = (Item) new ItemHaliteShovel(); - GameRegistry.registerItem(haliteShovel, "halite_shovel"); - } - - public static void init() { - GameRegistry.addSmelting(rockSalt, new ItemStack(haliteIngot), 1.0f); - - GameRegistry.addRecipe(new ItemStack(haliteSword, 1), - new Object[] { "X1X", "X4X", "X7X", - Character.valueOf('1'), new ItemStack(ClothingCraftHaliteBlockList.haliteBlock, 1), - Character.valueOf('4'), new ItemStack(ClothingCraftHaliteBlockList.haliteBlock, 1), - Character.valueOf('7'), new ItemStack(Items.stick, 1), - }); - - GameRegistry.addRecipe(new ItemStack(haliteAxe, 1), - new Object[] { "01X", "34X", "X7X", - Character.valueOf('0'), new ItemStack(ClothingCraftHaliteBlockList.haliteBlock, 1), - Character.valueOf('1'), new ItemStack(ClothingCraftHaliteBlockList.haliteBlock, 1), - Character.valueOf('3'), new ItemStack(ClothingCraftHaliteBlockList.haliteBlock, 1), - Character.valueOf('4'), new ItemStack(Items.stick, 1), - Character.valueOf('7'), new ItemStack(Items.stick, 1), - }); - - GameRegistry.addRecipe(new ItemStack(halitePickaxe, 1), - new Object[] { "012", "X4X", "X7X", - Character.valueOf('0'), new ItemStack(ClothingCraftHaliteBlockList.haliteBlock, 1), - Character.valueOf('1'), new ItemStack(ClothingCraftHaliteBlockList.haliteBlock, 1), - Character.valueOf('2'), new ItemStack(ClothingCraftHaliteBlockList.haliteBlock, 1), - Character.valueOf('4'), new ItemStack(Items.stick, 1), - Character.valueOf('7'), new ItemStack(Items.stick, 1), - }); - - GameRegistry.addRecipe(new ItemStack(haliteShovel, 1), - new Object[] { "X1X", "X4X", "X7X", - Character.valueOf('1'), new ItemStack(ClothingCraftHaliteBlockList.haliteBlock, 1), - Character.valueOf('4'), new ItemStack(Items.stick, 1), - Character.valueOf('7'), new ItemStack(Items.stick, 1), - }); - - GameRegistry.addRecipe(new ItemStack(haliteHoe, 1), - new Object[] { "01X", "X4X", "X7X", - Character.valueOf('0'), new ItemStack(ClothingCraftHaliteBlockList.haliteBlock, 1), - Character.valueOf('1'), new ItemStack(ClothingCraftHaliteBlockList.haliteBlock, 1), - Character.valueOf('4'), new ItemStack(Items.stick, 1), - Character.valueOf('7'), new ItemStack(Items.stick, 1), }); - } + public static Item rockSalt; + public static Item haliteIngot; + public static Item haliteSword; + public static Item haliteAxe; + public static Item haliteHoe; + public static Item halitePickaxe; + public static Item haliteShovel; + + public static void preInit() { + rockSalt = new ItemRockSalt(); + GameRegistry.registerItem(rockSalt, "rock_salt"); + + haliteIngot = new ItemHaliteIngot(); + GameRegistry.registerItem(haliteIngot, "halite_ingot"); + + haliteSword = new ItemHaliteSword(); + GameRegistry.registerItem(haliteSword, "halite_sword"); + + haliteAxe = new ItemHaliteAxe(); + GameRegistry.registerItem(haliteAxe, "halite_axe"); + + haliteHoe = new ItemHaliteHoe(); + GameRegistry.registerItem(haliteHoe, "halite_hoe"); + + halitePickaxe = new ItemHalitePickaxe(); + GameRegistry.registerItem(halitePickaxe, "halite_pickaxe"); + + haliteShovel = new ItemHaliteShovel(); + GameRegistry.registerItem(haliteShovel, "halite_shovel"); + } + + public static void init() { + GameRegistry.addSmelting(rockSalt, new ItemStack(haliteIngot), 1.0f); + + GameRegistry.addRecipe(new ItemStack(haliteSword, 1), + "X1X", "X4X", "X7X", + '1', new ItemStack(ClothingCraftHaliteBlockList.haliteBlock, 1), + '4', new ItemStack(ClothingCraftHaliteBlockList.haliteBlock, 1), + '7', new ItemStack(Items.stick, 1)); + + GameRegistry.addRecipe(new ItemStack(haliteAxe, 1), + "01X", "34X", "X7X", + '0', new ItemStack(ClothingCraftHaliteBlockList.haliteBlock, 1), + '1', new ItemStack(ClothingCraftHaliteBlockList.haliteBlock, 1), + '3', new ItemStack(ClothingCraftHaliteBlockList.haliteBlock, 1), + '4', new ItemStack(Items.stick, 1), + '7', new ItemStack(Items.stick, 1)); + + GameRegistry.addRecipe(new ItemStack(halitePickaxe, 1), + "012", "X4X", "X7X", + '0', new ItemStack(ClothingCraftHaliteBlockList.haliteBlock, 1), + '1', new ItemStack(ClothingCraftHaliteBlockList.haliteBlock, 1), + '2', new ItemStack(ClothingCraftHaliteBlockList.haliteBlock, 1), + '4', new ItemStack(Items.stick, 1), + '7', new ItemStack(Items.stick, 1)); + + GameRegistry.addRecipe(new ItemStack(haliteShovel, 1), + "X1X", "X4X", "X7X", + '1', new ItemStack(ClothingCraftHaliteBlockList.haliteBlock, 1), + '4', new ItemStack(Items.stick, 1), + '7', new ItemStack(Items.stick, 1)); + + GameRegistry.addRecipe(new ItemStack(haliteHoe, 1), + "01X", "X4X", "X7X", + '0', new ItemStack(ClothingCraftHaliteBlockList.haliteBlock, 1), + '1', new ItemStack(ClothingCraftHaliteBlockList.haliteBlock, 1), + '4', new ItemStack(Items.stick, 1), + '7', new ItemStack(Items.stick, 1)); + } } diff --git a/src/main/java/clothingcraft/items/ClothingCraftPatternItemList.java b/src/main/java/clothingcraft/items/ClothingCraftPatternItemList.java index 28f3a75..21133ed 100644 --- a/src/main/java/clothingcraft/items/ClothingCraftPatternItemList.java +++ b/src/main/java/clothingcraft/items/ClothingCraftPatternItemList.java @@ -1,20 +1,20 @@ /** - * + * */ package clothingcraft.items; -import java.util.LinkedHashMap; - 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.ItemStack; +import java.util.LinkedHashMap; + /** - * List of sewing pattern items (helm, chest, pants, boots) + * List of sewing pattern items (helm, chest, pants, boots) * and their registrations into the world. - * + *

* These are comprised of 6 different categories: * - Casual wear * - Career wear @@ -22,137 +22,140 @@ * - Beach wear * - Sleep wear * - Costume wear - * + *

* These are further broken down into 4 body purpose sub-types: - * - Helm (head) + * - Helm (head) * - Chest (top) * - Pants (leggings) * - Boots (shoes) - * + * * @author JujuAwesomeBeans * @author NinjaSoldier40 * @since 02/12/2017 11:00 AM (-7:00 GMT) */ public class ClothingCraftPatternItemList { - - public static enum CATEGORY {beach, career, casual, costume, formal, sleep}; - public static enum PURPOSE {helm, chest, pants, boots}; - - /** - * Linked Map containing all patterns by category and purpose. - * The contents are accessed using (example): - *

-	 * Item patternCasualHelm = patternsItemMap.get(CATEGORY.casual).get(PURPOSE.helm);
-	 * 
- * - */ - public static LinkedHashMap> patternsItemMap = - new LinkedHashMap>(); - - - public static void preInit() { - for (CATEGORY enumCategory : CATEGORY.values()) { - for (PURPOSE enumPurpose : PURPOSE.values()) { - String unlocalizedName = "pattern_" + enumCategory.name() + "_" + enumPurpose.name(); - Item patternItem = (Item) new ItemPattern(unlocalizedName); - GameRegistry.registerItem(patternItem, unlocalizedName); - // populate the patternsItemMap - if (patternsItemMap.get(enumCategory)==null) { - patternsItemMap.put(enumCategory, new LinkedHashMap()); - } - patternsItemMap.get(enumCategory).put(enumPurpose, patternItem); - } - } - } - - public static void init() { - for (CATEGORY enumCategory : CATEGORY.values()) { - for (PURPOSE enumPurpose : PURPOSE.values()) { - Item item = patternsItemMap.get(enumCategory).get(enumPurpose); - // boots recipe - ItemStack stack = new ItemStack(item, 1); - GameRegistry.addRecipe(stack, getRecipe(enumCategory, enumPurpose)); - } - } - } - - /** - * category > special ingredient: - * -------- ------------------ - * beach > Blocks.sand - * career > Items.stone_pickaxe - * casual > Blocks.grass - * costume > Blocks.pumpkin - * formal > Items.diamond - * sleep > Items.bed - * - * @param enumCategory - * @param enumPurpose - * @return - */ - public static Object[] getRecipe(CATEGORY enumCategory, PURPOSE enumPurpose) { - Object[] result = null; - - ItemStack specialIngredient = null; - switch (enumCategory) { - case beach: - specialIngredient = new ItemStack(Blocks.sand, 1); - break; - case career: - specialIngredient = new ItemStack(Items.stone_pickaxe, 1); - break; - case casual: - specialIngredient = new ItemStack(Blocks.grass, 1); - break; - case costume: - specialIngredient = new ItemStack(Blocks.pumpkin, 1); - break; - case formal: - specialIngredient = new ItemStack(Items.diamond, 1); - break; - case sleep: - specialIngredient = new ItemStack(Items.bed, 1); - break; - default: - - } - - switch (enumPurpose) { - case helm: - result = new Object[] { "012", "3XX", "XXX", - Character.valueOf('0'), new ItemStack(Items.paper, 1), - Character.valueOf('1'), new ItemStack(Items.leather_helmet, 1), - Character.valueOf('2'), new ItemStack(ClothingCraftToolsItemList.sewingScissors, 1), - Character.valueOf('3'), specialIngredient, - }; - break; - case chest: - result = new Object[] { "012", "3XX", "XXX", - Character.valueOf('0'), new ItemStack(Items.paper, 1), - Character.valueOf('1'), new ItemStack(Items.leather_chestplate, 1), - Character.valueOf('2'), new ItemStack(ClothingCraftToolsItemList.sewingScissors, 1), - Character.valueOf('3'), specialIngredient, - }; - break; - case pants: - result = new Object[] { "012", "3XX", "XXX", - Character.valueOf('0'), new ItemStack(Items.paper, 1), - Character.valueOf('1'), new ItemStack(Items.leather_leggings, 1), - Character.valueOf('2'), new ItemStack(ClothingCraftToolsItemList.sewingScissors, 1), - Character.valueOf('3'), specialIngredient, - }; - break; - case boots: - result = new Object[] { "012", "3XX", "XXX", - Character.valueOf('0'), new ItemStack(Items.paper, 1), - Character.valueOf('1'), new ItemStack(Items.leather_boots, 1), - Character.valueOf('2'), new ItemStack(ClothingCraftToolsItemList.sewingScissors, 1), - Character.valueOf('3'), specialIngredient, - }; - break; - default: - - } - return result; - } + + /** + * Linked Map containing all patterns by category and purpose. + * The contents are accessed using (example): + *
+     * Item patternCasualHelm = patternsItemMap.get(CATEGORY.casual).get(PURPOSE.helm);
+     * 
+ */ + public static LinkedHashMap> patternsItemMap = + new LinkedHashMap>(); + + ; + + public static void preInit() { + for (Category enumCategory : Category.values()) { + for (Purpose enumPurpose : Purpose.values()) { + String unlocalizedName = "pattern_" + enumCategory.name() + "_" + enumPurpose.name(); + Item patternItem = (Item) new ItemPattern(unlocalizedName); + GameRegistry.registerItem(patternItem, unlocalizedName); + // populate the patternsItemMap + if (patternsItemMap.get(enumCategory) == null) { + patternsItemMap.put(enumCategory, new LinkedHashMap()); + } + patternsItemMap.get(enumCategory).put(enumPurpose, patternItem); + } + } + } + + ; + + public static void init() { + for (Category enumCategory : Category.values()) { + for (Purpose enumPurpose : Purpose.values()) { + Item item = patternsItemMap.get(enumCategory).get(enumPurpose); + // boots recipe + ItemStack stack = new ItemStack(item, 1); + GameRegistry.addRecipe(stack, getRecipe(enumCategory, enumPurpose)); + } + } + } + + /** + * category > special ingredient: + * -------- ------------------ + * beach > Blocks.sand + * career > Items.stone_pickaxe + * casual > Blocks.grass + * costume > Blocks.pumpkin + * formal > Items.diamond + * sleep > Items.bed + * + * @param enumCategory + * @param enumPurpose + * @return + */ + public static Object[] getRecipe(Category enumCategory, Purpose enumPurpose) { + Object[] result = null; + + ItemStack specialIngredient = null; + switch (enumCategory) { + case beach: + specialIngredient = new ItemStack(Blocks.sand, 1); + break; + case career: + specialIngredient = new ItemStack(Items.stone_pickaxe, 1); + break; + case casual: + specialIngredient = new ItemStack(Blocks.grass, 1); + break; + case costume: + specialIngredient = new ItemStack(Blocks.pumpkin, 1); + break; + case formal: + specialIngredient = new ItemStack(Items.diamond, 1); + break; + case sleep: + specialIngredient = new ItemStack(Items.bed, 1); + break; + default: + + } + + switch (enumPurpose) { + case helm: + result = new Object[]{"012", "3XX", "XXX", + '0', new ItemStack(Items.paper, 1), + '1', new ItemStack(Items.leather_helmet, 1), + '2', new ItemStack(ClothingCraftToolsItemList.sewingScissors, 1), + '3', specialIngredient, + }; + break; + case chest: + result = new Object[]{"012", "3XX", "XXX", + '0', new ItemStack(Items.paper, 1), + '1', new ItemStack(Items.leather_chestplate, 1), + '2', new ItemStack(ClothingCraftToolsItemList.sewingScissors, 1), + '3', specialIngredient, + }; + break; + case pants: + result = new Object[]{"012", "3XX", "XXX", + '0', new ItemStack(Items.paper, 1), + '1', new ItemStack(Items.leather_leggings, 1), + '2', new ItemStack(ClothingCraftToolsItemList.sewingScissors, 1), + '3', specialIngredient, + }; + break; + case boots: + result = new Object[]{"012", "3XX", "XXX", + '0', new ItemStack(Items.paper, 1), + '1', new ItemStack(Items.leather_boots, 1), + '2', new ItemStack(ClothingCraftToolsItemList.sewingScissors, 1), + '3', specialIngredient, + }; + break; + default: + + } + return result; + } + + public enum Category {beach, career, casual, costume, formal, sleep} + + public enum Purpose {helm, chest, pants, boots} } diff --git a/src/main/java/clothingcraft/items/ClothingCraftToolsItemList.java b/src/main/java/clothingcraft/items/ClothingCraftToolsItemList.java index b2ed140..0440a71 100644 --- a/src/main/java/clothingcraft/items/ClothingCraftToolsItemList.java +++ b/src/main/java/clothingcraft/items/ClothingCraftToolsItemList.java @@ -1,9 +1,9 @@ /** - * + * */ package clothingcraft.items; -import clothingcraft.core.ClothingCraft; +import clothingcraft.core.CommonProxy; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -12,104 +12,99 @@ /** * List of blocks and their registrations into the world - * + * * @author JujuAwesomeBeans * @author NinjaSoldier40 * @since 02/12/2017 01:34 AM (-7:00 GMT) */ public class ClothingCraftToolsItemList { - public static Item sewingScissors; - public static Item needleAndThread; - public static Item measuringTape; - public static Item pinCushion; - public static Item knittingNeedles; - - public static void preInit() { - sewingScissors = (Item) new ItemToolScissors(); - GameRegistry.registerItem(sewingScissors, "tools_scissors"); - - needleAndThread = (Item) new ItemToolNeedleAndThread(); - GameRegistry.registerItem(needleAndThread, "tools_needle_thread"); - - measuringTape = (Item) new ItemToolMeasuringTape(); - GameRegistry.registerItem(measuringTape, "tools_measuring_tape"); - - pinCushion = (Item) new ItemToolPincushion(); - GameRegistry.registerItem(pinCushion, "tools_pincushion"); - - knittingNeedles = (Item) new ItemToolKnittingNeedles(); - GameRegistry.registerItem(knittingNeedles, "tools_knitting_needles"); - } - - public static void init() { - ItemStack stack = new ItemStack(sewingScissors, 1); - GameRegistry.addRecipe(stack, - new Object[] { "012", "345", "678", - Character.valueOf('0'), new ItemStack(ClothingCraft.cotton, 1), - Character.valueOf('1'), new ItemStack(ClothingCraft.cotton, 1), - Character.valueOf('2'), new ItemStack(ClothingCraft.cotton, 1), - Character.valueOf('3'), new ItemStack(ClothingCraft.cotton, 1), - Character.valueOf('4'), new ItemStack(Items.shears, 1), - Character.valueOf('5'), new ItemStack(ClothingCraft.cotton, 1), - Character.valueOf('6'), new ItemStack(ClothingCraft.cotton, 1), - Character.valueOf('7'), new ItemStack(ClothingCraft.cotton, 1), - Character.valueOf('8'), new ItemStack(ClothingCraft.cotton, 1), - }); - - stack = new ItemStack(needleAndThread, 1); - GameRegistry.addRecipe(stack, - new Object[] { "012", "345", "678", - Character.valueOf('0'), new ItemStack(ClothingCraft.cotton, 1), - Character.valueOf('1'), new ItemStack(Items.string, 1), - Character.valueOf('2'), new ItemStack(ClothingCraft.cotton, 1), - Character.valueOf('3'), new ItemStack(Items.string, 1), - Character.valueOf('4'), new ItemStack(Items.stick, 1), - Character.valueOf('5'), new ItemStack(Items.string, 1), - Character.valueOf('6'), new ItemStack(ClothingCraft.cotton, 1), - Character.valueOf('7'), new ItemStack(Items.string, 1), - Character.valueOf('8'), new ItemStack(ClothingCraft.cotton, 1), - }); - - stack = new ItemStack(measuringTape, 1); - GameRegistry.addRecipe(stack, - new Object[] { "012", "345", "678", - Character.valueOf('0'), new ItemStack(ClothingCraft.cotton, 1), - Character.valueOf('1'), new ItemStack(Items.string, 1), - Character.valueOf('2'), new ItemStack(ClothingCraft.cotton, 1), - Character.valueOf('3'), new ItemStack(Items.string, 1), - Character.valueOf('4'), new ItemStack(Items.dye, 1, 11), // yellow - Character.valueOf('5'), new ItemStack(Items.string, 1), - Character.valueOf('6'), new ItemStack(ClothingCraft.cotton, 1), - Character.valueOf('7'), new ItemStack(Items.string, 1), - Character.valueOf('8'), new ItemStack(ClothingCraft.cotton, 1), - }); - - stack = new ItemStack(pinCushion, 1); - GameRegistry.addRecipe(stack, - new Object[] { "012", "345", "678", - Character.valueOf('0'), new ItemStack(ClothingCraft.cotton, 1), - Character.valueOf('1'), new ItemStack(Items.stick, 1), - Character.valueOf('2'), new ItemStack(ClothingCraft.cotton, 1), - Character.valueOf('3'), new ItemStack(Items.stick, 1), - Character.valueOf('4'), new ItemStack(Items.apple, 1), - Character.valueOf('5'), new ItemStack(Items.stick, 1), - Character.valueOf('6'), new ItemStack(ClothingCraft.cotton, 1), - Character.valueOf('7'), new ItemStack(Items.stick, 1), - Character.valueOf('8'), new ItemStack(ClothingCraft.cotton, 1), - }); - - stack = new ItemStack(knittingNeedles, 1); - GameRegistry.addRecipe(stack, - new Object[] { "012", "345", "678", - Character.valueOf('0'), new ItemStack(ClothingCraft.cotton, 1), - Character.valueOf('1'), new ItemStack(Items.stick, 1), - Character.valueOf('2'), new ItemStack(ClothingCraft.cotton, 1), - Character.valueOf('3'), new ItemStack(Items.stick, 1), - Character.valueOf('4'), new ItemStack(Blocks.wool, 1, 2), - Character.valueOf('5'), new ItemStack(Items.stick, 1), - Character.valueOf('6'), new ItemStack(ClothingCraft.cotton, 1), - Character.valueOf('7'), new ItemStack(Items.stick, 1), - Character.valueOf('8'), new ItemStack(ClothingCraft.cotton, 1), - }); - } + public static Item sewingScissors; + public static Item needleAndThread; + public static Item measuringTape; + public static Item pinCushion; + public static Item knittingNeedles; + + public static void preInit() { + sewingScissors = new ItemToolScissors(); + GameRegistry.registerItem(sewingScissors, "tools_scissors"); + + needleAndThread = new ItemToolNeedleAndThread(); + GameRegistry.registerItem(needleAndThread, "tools_needle_thread"); + + measuringTape = new ItemToolMeasuringTape(); + GameRegistry.registerItem(measuringTape, "tools_measuring_tape"); + + pinCushion = new ItemToolPincushion(); + GameRegistry.registerItem(pinCushion, "tools_pincushion"); + + knittingNeedles = new ItemToolKnittingNeedles(); + GameRegistry.registerItem(knittingNeedles, "tools_knitting_needles"); + } + + public static void init() { + ItemStack stack = new ItemStack(sewingScissors, 1); + GameRegistry.addRecipe(stack, + "012", "345", "678", + '0', new ItemStack(CommonProxy.cotton, 1), + '1', new ItemStack(CommonProxy.cotton, 1), + '2', new ItemStack(CommonProxy.cotton, 1), + '3', new ItemStack(CommonProxy.cotton, 1), + '4', new ItemStack(Items.shears, 1), + '5', new ItemStack(CommonProxy.cotton, 1), + '6', new ItemStack(CommonProxy.cotton, 1), + '7', new ItemStack(CommonProxy.cotton, 1), + '8', new ItemStack(CommonProxy.cotton, 1)); + + stack = new ItemStack(needleAndThread, 1); + GameRegistry.addRecipe(stack, + "012", "345", "678", + '0', new ItemStack(CommonProxy.cotton, 1), + '1', new ItemStack(Items.string, 1), + '2', new ItemStack(CommonProxy.cotton, 1), + '3', new ItemStack(Items.string, 1), + '4', new ItemStack(Items.stick, 1), + '5', new ItemStack(Items.string, 1), + '6', new ItemStack(CommonProxy.cotton, 1), + '7', new ItemStack(Items.string, 1), + '8', new ItemStack(CommonProxy.cotton, 1)); + + stack = new ItemStack(measuringTape, 1); + GameRegistry.addRecipe(stack, + "012", "345", "678", + '0', new ItemStack(CommonProxy.cotton, 1), + '1', new ItemStack(Items.string, 1), + '2', new ItemStack(CommonProxy.cotton, 1), + '3', new ItemStack(Items.string, 1), + '4', new ItemStack(Items.dye, 1, 11), // yellow + '5', new ItemStack(Items.string, 1), + '6', new ItemStack(CommonProxy.cotton, 1), + '7', new ItemStack(Items.string, 1), + '8', new ItemStack(CommonProxy.cotton, 1)); + + stack = new ItemStack(pinCushion, 1); + GameRegistry.addRecipe(stack, + "012", "345", "678", + '0', new ItemStack(CommonProxy.cotton, 1), + '1', new ItemStack(Items.stick, 1), + '2', new ItemStack(CommonProxy.cotton, 1), + '3', new ItemStack(Items.stick, 1), + '4', new ItemStack(Items.apple, 1), + '5', new ItemStack(Items.stick, 1), + '6', new ItemStack(CommonProxy.cotton, 1), + '7', new ItemStack(Items.stick, 1), + '8', new ItemStack(CommonProxy.cotton, 1)); + + stack = new ItemStack(knittingNeedles, 1); + GameRegistry.addRecipe(stack, + "012", "345", "678", + '0', new ItemStack(CommonProxy.cotton, 1), + '1', new ItemStack(Items.stick, 1), + '2', new ItemStack(CommonProxy.cotton, 1), + '3', new ItemStack(Items.stick, 1), + '4', new ItemStack(Blocks.wool, 1, 2), + '5', new ItemStack(Items.stick, 1), + '6', new ItemStack(CommonProxy.cotton, 1), + '7', new ItemStack(Items.stick, 1), + '8', new ItemStack(CommonProxy.cotton, 1)); + } } diff --git a/src/main/java/clothingcraft/items/ClothingCraftWardrobeItemList.java b/src/main/java/clothingcraft/items/ClothingCraftWardrobeItemList.java index 4a944bb..5abdf76 100644 --- a/src/main/java/clothingcraft/items/ClothingCraftWardrobeItemList.java +++ b/src/main/java/clothingcraft/items/ClothingCraftWardrobeItemList.java @@ -1,19 +1,12 @@ /** - * + * */ package clothingcraft.items; -import static clothingcraft.items.ItemWardrobeArmor.BODY; -import static clothingcraft.items.ItemWardrobeArmor.FEET; -import static clothingcraft.items.ItemWardrobeArmor.HEAD; -import static clothingcraft.items.ItemWardrobeArmor.LEGS; - -import java.util.LinkedHashMap; - -import clothingcraft.items.ClothingCraftFabricItemList.COLORS; -import clothingcraft.items.ClothingCraftPatternItemList.CATEGORY; -import clothingcraft.items.ClothingCraftPatternItemList.PURPOSE; +import clothingcraft.items.ClothingCraftFabricItemList.Colors; +import clothingcraft.items.ClothingCraftPatternItemList.Category; +import clothingcraft.items.ClothingCraftPatternItemList.Purpose; import clothingcraft.util.RecipeUtil; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.FMLCommonHandler; @@ -25,463 +18,471 @@ import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.EnumHelper; + +import java.util.LinkedHashMap; + +import static clothingcraft.items.ItemWardrobeArmor.*; + /** * List of wardrobe items and their registrations into the world. - * + * * @author JujuAwesomeBeans * @author NinjaSoldier40 - * @since 02/12/2017 07:39 PM (-7:00 GMT) + * @since 2/12/217 7:39 PM (-7:0 GMT) */ public class ClothingCraftWardrobeItemList { - - public static LinkedHashMap armorMaterialMap = - new LinkedHashMap(); - // armorPrefix map - public static LinkedHashMap armorPrefixMap = - new LinkedHashMap(); - // outfitKey to armorType to Item map - public static LinkedHashMap> outfitPurposeItemMap = - new LinkedHashMap>(); - - - public static void preInit() { - registerArmorMaterialAndPrefix("apronbrown", 01, new int[] { 0, 0, 1, 0 }, 9); // recipe done - registerArmorMaterialAndPrefix("apronbutcher", 01, new int[] { 0, 0, 1, 0 }, 9); // recipe done - registerArmorMaterialAndPrefix("aprongreen", 01, new int[] { 0, 0, 1, 0 }, 9); // recipe done - registerArmorMaterialAndPrefix("apronwhite", 01, new int[] { 0, 0, 1, 0 }, 9); // recipe done - registerArmorMaterialAndPrefix("angelwings", 04, new int[] { 0, 4, 0, 0 }, 9); // recipe done - registerArmorMaterialAndPrefix("artist", 10, new int[] { 2, 7, 5, 0 }, 9); // recipe done - registerArmorMaterialAndPrefix("ballcapblack", 01, new int[] { 1, 0, 0, 0 }, 9); - registerArmorMaterialAndPrefix("ballcapblue", 01, new int[] { 1, 0, 0, 0 }, 9); - registerArmorMaterialAndPrefix("ballcappurple",01, new int[] { 1, 0, 0, 0 }, 9); - registerArmorMaterialAndPrefix("ballcapred", 01, new int[] { 1, 0, 0, 0 }, 9); - registerArmorMaterialAndPrefix("businesssuit", 10, new int[] { 0, 7, 5, 0 }, 9); - registerArmorMaterialAndPrefix("construction", 10, new int[] { 2, 7, 5, 0 }, 9); - registerArmorMaterialAndPrefix("costumechicken",10, new int[] { 2, 7, 0, 1 }, 9); - registerArmorMaterialAndPrefix("costumecreeper",10, new int[] { 2, 7, 5, 0 }, 9); - registerArmorMaterialAndPrefix("costumedinocyan", 10, new int[] { 2, 7, 5, 0 }, 9); - registerArmorMaterialAndPrefix("costumedinomagenta", 10, new int[] { 2, 7, 5, 0 }, 9); - registerArmorMaterialAndPrefix("costumedinored", 10, new int[] { 2, 7, 5, 0 }, 9); - registerArmorMaterialAndPrefix("costumehotdog",10, new int[] { 2, 7, 5, 0 }, 9); - registerArmorMaterialAndPrefix("costumenyancat",10, new int[] { 2, 7, 5, 0 }, 9); - registerArmorMaterialAndPrefix("dresscoral", 04, new int[] { 0, 0, 3, 0 }, 9); - registerArmorMaterialAndPrefix("dressgalaxy", 12, new int[] { 4, 8, 6, 0 }, 9); - registerArmorMaterialAndPrefix("dressglowstone",12, new int[] { 3, 7, 5, 0 }, 9); - registerArmorMaterialAndPrefix("dresslavendar",04, new int[] { 0, 0, 3, 0 }, 9); - registerArmorMaterialAndPrefix("dressmint", 04, new int[] { 0, 0, 3, 0 }, 9); - registerArmorMaterialAndPrefix("dresswedding", 10, new int[] { 2, 7, 5, 0 }, 9); - registerArmorMaterialAndPrefix("earmuffslavendar" , 01, new int[] { 1, 0, 0, 0 }, 9); - registerArmorMaterialAndPrefix("fairywings", 04, new int[] { 0, 4, 0, 0 }, 9); - registerArmorMaterialAndPrefix("farmer", 10, new int[] { 2, 7, 5, 0 }, 9); - registerArmorMaterialAndPrefix("glassesblack", 01, new int[] { 1, 0, 0, 0 }, 9); - registerArmorMaterialAndPrefix("glassesred", 01, new int[] { 1, 0, 0, 0 }, 9); - registerArmorMaterialAndPrefix("hairbowcoral", 01, new int[] { 1, 0, 0, 0 }, 9); - registerArmorMaterialAndPrefix("hairbowlavendar", 01, new int[] { 1, 0, 0, 0 }, 9); - registerArmorMaterialAndPrefix("hairbowmint", 01, new int[] { 1, 0, 0, 0 }, 9); - registerArmorMaterialAndPrefix("hairpiecerainbow" , 01, new int[] { 1, 0, 0, 0 }, 9); - registerArmorMaterialAndPrefix("hairpiecedaisychain", 01, new int[] { 1, 0, 0, 0 }, 9); - registerArmorMaterialAndPrefix("hathalo", 01, new int[] { 1, 0, 0, 0 }, 9); - registerArmorMaterialAndPrefix("hatmushroom", 01, new int[] { 1, 0, 0, 0 }, 9); - registerArmorMaterialAndPrefix("hatpig", 01, new int[] { 2, 0, 0, 0 }, 9); - registerArmorMaterialAndPrefix("hatsheep", 01, new int[] { 2, 0, 0, 0 }, 9); - registerArmorMaterialAndPrefix("headphones", 01, new int[] { 3, 0, 0, 0 }, 9); - registerArmorMaterialAndPrefix("longsleevegalaxy", 10, new int[] { 0, 2, 0, 0 }, 9); - registerArmorMaterialAndPrefix("lumberjack", 10, new int[] { 2, 7, 5, 0 }, 9); - registerArmorMaterialAndPrefix("king", 25, new int[] { 2, 7, 5, 0 }, 9); - registerArmorMaterialAndPrefix("mage", 10, new int[] { 2, 7, 5, 0 }, 9); - registerArmorMaterialAndPrefix("pajamasblack", 02, new int[] { 0, 3, 2, 0 }, 9); - registerArmorMaterialAndPrefix("pajamasblue", 02, new int[] { 0, 3, 2, 0 }, 9); - registerArmorMaterialAndPrefix("pajamasgreen", 02, new int[] { 0, 3, 2, 0 }, 9); - registerArmorMaterialAndPrefix("pajamasmint-w-flowers", 02, new int[] { 0, 0, 2, 0 }, 9); - registerArmorMaterialAndPrefix("pajamasred", 02, new int[] { 0, 3, 2, 0 }, 9); - registerArmorMaterialAndPrefix("pajamasyellow-w-orangedots", 02, new int[] { 0, 0, 2, 0 }, 9); - registerArmorMaterialAndPrefix("policeofficer",10, new int[] { 2, 7, 5, 0 }, 9); - registerArmorMaterialAndPrefix("pantsjeans", 03, new int[] { 0, 0, 3, 0 }, 9); - registerArmorMaterialAndPrefix("pantskhaki", 03, new int[] { 0, 0, 3, 0 }, 9); - registerArmorMaterialAndPrefix("queen", 25, new int[] { 2, 7, 5, 0 }, 9); - registerArmorMaterialAndPrefix("scrubs", 10, new int[] { 2, 3, 2, 2 }, 9); - registerArmorMaterialAndPrefix("shirt-w-bowtie",02, new int[] { 0, 3, 0, 0 }, 9); - registerArmorMaterialAndPrefix("slippersbunny",02, new int[] { 0, 0, 0, 1 }, 9); - registerArmorMaterialAndPrefix("slipperskitty",02, new int[] { 0, 0, 0, 1 }, 9); - registerArmorMaterialAndPrefix("slippersteddy",02, new int[] { 0, 0, 0, 1 }, 9); - registerArmorMaterialAndPrefix("sushichef", 10, new int[] { 2, 7, 5, 0 }, 9); - registerArmorMaterialAndPrefix("sweatercyan", 03, new int[] { 0, 3, 0, 0 }, 9); - registerArmorMaterialAndPrefix("sweaterlavendar",03, new int[] { 0, 3, 0, 0 }, 9); - registerArmorMaterialAndPrefix("sweaterteddy", 03, new int[] { 0, 3, 0, 0 }, 9); - registerArmorMaterialAndPrefix("swimsuiteblue", 1, new int[] { 0, 0, 2, 0 }, 9); - registerArmorMaterialAndPrefix("swimsuitemagenta", 1, new int[] { 0, 0, 2, 0 }, 9); - registerArmorMaterialAndPrefix("tanktopwhite", 10, new int[] { 0, 2, 0, 0 }, 9); - registerArmorMaterialAndPrefix("tanktoporange",10, new int[] { 0, 2, 0, 0 }, 9); - registerArmorMaterialAndPrefix("tanktoporange2",10, new int[] { 0, 2, 0, 0 }, 9); - registerArmorMaterialAndPrefix("tanktoppink", 10, new int[] { 0, 2, 0, 0 }, 9); - registerArmorMaterialAndPrefix("tanktopheart", 10, new int[] { 0, 2, 0, 0 }, 9); - registerArmorMaterialAndPrefix("teecookie", 10, new int[] { 0, 2, 0, 0 }, 9); - registerArmorMaterialAndPrefix("teecreeper", 10, new int[] { 0, 2, 0, 0 }, 9); - registerArmorMaterialAndPrefix("teecupcake", 10, new int[] { 0, 2, 0, 0 }, 9); - registerArmorMaterialAndPrefix("teediamond", 10, new int[] { 0, 2, 0, 0 }, 9); - registerArmorMaterialAndPrefix("teegrass", 10, new int[] { 0, 2, 0, 0 }, 9); - registerArmorMaterialAndPrefix("teemushroom", 10, new int[] { 0, 2, 0, 0 }, 9); - registerArmorMaterialAndPrefix("teetiedye", 10, new int[] { 0, 2, 0, 0 }, 9); - registerArmorMaterialAndPrefix("tuxedoblack", 10, new int[] { 0, 7, 5, 0 }, 9); - registerArmorMaterialAndPrefix("tuxedoglow", 12, new int[] { 0, 7, 5, 0 }, 9); - registerArmorMaterialAndPrefix("workboots", 02, new int[] { 0, 0, 0, 1 }, 9); - registerArmorMaterialAndPrefix("scientist", 10, new int[] { 2, 7, 5, 0 }, 9); - registerArmorMaterialAndPrefix("shoesblack", 02, new int[] { 0, 0, 0, 1 }, 9); - registerArmorMaterialAndPrefix("shoesblue", 02, new int[] { 0, 0, 0, 1 }, 9); - registerArmorMaterialAndPrefix("shoeslime", 02, new int[] { 0, 0, 0, 1 }, 9); - registerArmorMaterialAndPrefix("shoesmagenta", 02, new int[] { 0, 0, 0, 1 }, 9); - registerArmorMaterialAndPrefix("shoesorange", 02, new int[] { 0, 0, 0, 1 }, 9); - registerArmorMaterialAndPrefix("shoespink", 02, new int[] { 0, 0, 0, 1 }, 9); - registerArmorMaterialAndPrefix("shoespurple", 02, new int[] { 0, 0, 0, 1 }, 9); - registerArmorMaterialAndPrefix("shoesred", 02, new int[] { 0, 0, 0, 1 }, 9); - registerArmorMaterialAndPrefix("shoesruby", 02, new int[] { 0, 0, 0, 1 }, 9); - registerArmorMaterialAndPrefix("shoeswhite", 02, new int[] { 0, 0, 0, 1 }, 9); - registerArmorMaterialAndPrefix("shoesyellow", 02, new int[] { 0, 0, 0, 1 }, 9); - registerArmorMaterialAndPrefix("shortsblue-w-flowers",01, new int[] { 0, 0, 2, 0 }, 9); - registerArmorMaterialAndPrefix("shortsblue-w-whitestripes",01, new int[] { 0, 0, 2, 0 }, 9); - registerArmorMaterialAndPrefix("shortsred-w-whitestripe",01, new int[] { 0, 0, 2, 0 }, 9); - registerArmorMaterialAndPrefix("shortswhite-w-reddots",01, new int[] { 0, 0, 2, 0 }, 9); - registerArmorMaterialAndPrefix("skirtgray", 03, new int[] { 0, 0, 3, 0 }, 9); - registerArmorMaterialAndPrefix("skirtruffled", 03, new int[] { 0, 0, 3, 0 }, 9); - } - - public static void init() { - // angelwings", 04, new int[] { 0, 4, 0, 0 }, 9); - GameRegistry.addRecipe(new ItemStack( - getOutfitItem("angelwings", getPurposeByArmorType(BODY)), 1), - RecipeUtil.createRecipeObject(new Item[]{ - getPattern(CATEGORY.costume, PURPOSE.chest), - getFabric(COLORS.bluelight), - ClothingCraftToolsItemList.needleAndThread, - Items.feather, Items.string, Items.feather - }) - ); - - // construction", 10, new int[] { 2, 7, 5, 0 }, 9); - GameRegistry.addRecipe(new ItemStack( - getOutfitItem("construction", getPurposeByArmorType(HEAD)), 1), - RecipeUtil.createRecipeObject(new Item[]{ - getPattern(CATEGORY.career, PURPOSE.helm), - getFabric(COLORS.yellow), - ClothingCraftToolsItemList.measuringTape, - Items.iron_helmet - }) - ); - GameRegistry.addRecipe(new ItemStack( - getOutfitItem("construction", getPurposeByArmorType(BODY)), 1), - RecipeUtil.createRecipeObject(new Item[]{ - getPattern(CATEGORY.career, PURPOSE.chest), - getFabric(COLORS.yellow), - getFabric(COLORS.orange), - ClothingCraftToolsItemList.needleAndThread, - Items.iron_pickaxe - }) - ); - GameRegistry.addRecipe(new ItemStack( - getOutfitItem("construction", getPurposeByArmorType(LEGS)), 1), - RecipeUtil.createRecipeObject(new Item[]{ - getPattern(CATEGORY.career, PURPOSE.pants), - getFabric(COLORS.bluedark), - ClothingCraftToolsItemList.needleAndThread, - Items.iron_pickaxe - }) - ); - GameRegistry.addRecipe(new ItemStack( - getOutfitItem("construction", getPurposeByArmorType(FEET)), 1), - RecipeUtil.createRecipeObject(new Item[]{ - getPattern(CATEGORY.career, PURPOSE.boots), - getFabric(COLORS.brown), - ClothingCraftToolsItemList.needleAndThread, - Items.leather - }) - ); - // apronbrown", 01, new int[] { 0, 1, 0, 0 }, 9); - GameRegistry.addRecipe(new ItemStack( - getOutfitItem("apronbrown", getPurposeByArmorType(LEGS)), 1), - RecipeUtil.createRecipeObject(new Item[]{ - getPattern(CATEGORY.career, PURPOSE.pants), - getFabric(COLORS.brown), - ClothingCraftToolsItemList.needleAndThread, - Items.string - }) - ); - - // apronbutcher", 01, new int[] { 0, 1, 0, 0 }, 9); - GameRegistry.addRecipe(new ItemStack( - getOutfitItem("apronbutcher", getPurposeByArmorType(LEGS)), 1), - RecipeUtil.createRecipeObject(new Item[]{ - getPattern(CATEGORY.career, PURPOSE.pants), - getFabric(COLORS.white), - ClothingCraftToolsItemList.needleAndThread, - Items.string, - Items.cooked_porkchop - }) - ); - - // aprongreen", 01, new int[] { 0, 1, 0, 0 }, 9); - GameRegistry.addRecipe(new ItemStack( - getOutfitItem("aprongreen", getPurposeByArmorType(LEGS)), 1), - RecipeUtil.createRecipeObject(new Item[]{ - getPattern(CATEGORY.career, PURPOSE.pants), - getFabric(COLORS.green), - ClothingCraftToolsItemList.needleAndThread, - Items.string, - Items.cooked_porkchop - }) - ); - - // apronwhite", 01, new int[] { 0, 1, 0, 0 }, 9); - GameRegistry.addRecipe(new ItemStack( - getOutfitItem("apronwhite", getPurposeByArmorType(LEGS)), 1), - RecipeUtil.createRecipeObject(new Item[]{ - getPattern(CATEGORY.career, PURPOSE.pants), - getFabric(COLORS.white), - ClothingCraftToolsItemList.needleAndThread, - Items.string - }) - ); - - // artist", 10, new int[] { 2, 7, 5, 0 }, 9); - GameRegistry.addRecipe(new ItemStack( - getOutfitItem("construction", getPurposeByArmorType(HEAD)), 1), - RecipeUtil.createRecipeObject(new Item[]{ - getPattern(CATEGORY.career, PURPOSE.helm), - getFabric(COLORS.black), - ClothingCraftToolsItemList.measuringTape - }) - ); - GameRegistry.addRecipe(new ItemStack( - getOutfitItem("construction", getPurposeByArmorType(BODY)), 1), - RecipeUtil.createRecipeObject(new Item[]{ - getPattern(CATEGORY.career, PURPOSE.chest), - getFabric(COLORS.white), - ClothingCraftToolsItemList.needleAndThread - }) - ); - GameRegistry.addRecipe(new ItemStack( - getOutfitItem("construction", getPurposeByArmorType(LEGS)), 1), - RecipeUtil.createRecipeObject(new Item[]{ - getPattern(CATEGORY.career, PURPOSE.pants), - getFabric(COLORS.bluedark), - ClothingCraftToolsItemList.needleAndThread - }) - ); - - // ballcapblack", 01, new int[] { 1, 0, 0, 0 }, 9); - GameRegistry.addRecipe(new ItemStack( - getOutfitItem("ballcapblack", getPurposeByArmorType(HEAD)), 1), - RecipeUtil.createRecipeObject(new Item[]{ - getPattern(CATEGORY.casual, PURPOSE.helm), - getFabric(COLORS.black), - ClothingCraftToolsItemList.measuringTape - }) - ); - // ballcapblue", 01, new int[] { 1, 0, 0, 0 }, 9); - GameRegistry.addRecipe(new ItemStack( - getOutfitItem("ballcapblue", getPurposeByArmorType(HEAD)), 1), - RecipeUtil.createRecipeObject(new Item[]{ - getPattern(CATEGORY.casual, PURPOSE.helm), - getFabric(COLORS.bluedark), - ClothingCraftToolsItemList.measuringTape - }) - ); - // ballcappurple",01, new int[] { 1, 0, 0, 0 }, 9); - GameRegistry.addRecipe(new ItemStack( - getOutfitItem("ballcappurple", getPurposeByArmorType(HEAD)), 1), - RecipeUtil.createRecipeObject(new Item[]{ - getPattern(CATEGORY.casual, PURPOSE.helm), - getFabric(COLORS.purple), - ClothingCraftToolsItemList.measuringTape - }) - ); - // ballcapred", 01, new int[] { 1, 0, 0, 0 }, 9); - GameRegistry.addRecipe(new ItemStack( - getOutfitItem("ballcapred", getPurposeByArmorType(HEAD)), 1), - RecipeUtil.createRecipeObject(new Item[]{ - getPattern(CATEGORY.casual, PURPOSE.helm), - getFabric(COLORS.red), - ClothingCraftToolsItemList.measuringTape - }) - ); - // businesssuit", 10, new int[] { 0, 7, 5, 0 }, 9); - // costumecreeper",10, new int[] { 2, 7, 5, 0 }, 9); - // dresscoral", 04, new int[] { 0, 0, 3, 0 }, 9); - // dresslavendar",04, new int[] { 0, 0, 3, 0 }, 9); - // dressmint", 04, new int[] { 0, 0, 3, 0 }, 9); - // earmuffslavendar" , 01, new int[] { 1, 0, 0, 0 }, 9); - // farmer", 10, new int[] { 2, 7, 5, 0 }, 9); - // glassesblack", 01, new int[] { 1, 0, 0, 0 }, 9); - GameRegistry.addRecipe(new ItemStack( - getOutfitItem("ballcapred", getPurposeByArmorType(HEAD)), 1), - RecipeUtil.createRecipeObject(new Item[]{ - null, getPattern(CATEGORY.career, PURPOSE.helm), null, - Items.glass_bottle, getFabric(COLORS.black), Items.glass_bottle - }) - ); - - // glassesred", 01, new int[] { 1, 0, 0, 0 }, 9); - // hairbowcoral", 01, new int[] { 1, 0, 0, 0 }, 9); - // hairbowlavendar", 01, new int[] { 1, 0, 0, 0 }, 9); - // hairbowmint", 01, new int[] { 1, 0, 0, 0 }, 9); - // hairpiecerainbow" , 01, new int[] { 1, 0, 0, 0 }, 9); - // longsleevegalaxy", 10, new int[] { 0, 2, 0, 0 }, 9); - // lumberjack", 10, new int[] { 2, 7, 5, 0 }, 9); - // mage", 10, new int[] { 2, 7, 5, 0 }, 9); - // pajamasblack", 02, new int[] { 0, 3, 2, 0 }, 9); - // pajamasblue", 02, new int[] { 0, 3, 2, 0 }, 9); - // pajamasgreen", 02, new int[] { 0, 3, 2, 0 }, 9); - // pajamasred", 02, new int[] { 0, 3, 2, 0 }, 9); - // policeofficer",10, new int[] { 2, 7, 5, 0 }, 9); - // scrubs", 10, new int[] { 2, 3, 2, 2 }, 9); - // slippersbunny",02, new int[] { 0, 0, 0, 1 }, 9); - // slipperskitty",02, new int[] { 0, 0, 0, 1 }, 9); - // slippersteddy",02, new int[] { 0, 0, 0, 1 }, 9); - // sushichef", 10, new int[] { 2, 7, 5, 0 }, 9); - // tanktopwhite", 10, new int[] { 0, 2, 0, 0 }, 9); - // tanktoporange",10, new int[] { 0, 2, 0, 0 }, 9); - // tanktoppink", 10, new int[] { 0, 2, 0, 0 }, 9); - // tanktopheart", 10, new int[] { 0, 2, 0, 0 }, 9); - // teecookie", 10, new int[] { 0, 2, 0, 0 }, 9); - // teecreeper", 10, new int[] { 0, 2, 0, 0 }, 9); - // teecupcake", 10, new int[] { 0, 2, 0, 0 }, 9); - // teediamond", 10, new int[] { 0, 2, 0, 0 }, 9); - // teegrass", 10, new int[] { 0, 2, 0, 0 }, 9); - // teemushroom", 10, new int[] { 0, 2, 0, 0 }, 9); - // tuxedoblack", 10, new int[] { 0, 7, 5, 0 }, 9); - // tuxedoglow", 12, new int[] { 0, 7, 5, 0 }, 9); - // workboots", 02, new int[] { 0, 0, 0, 1 }, 9); - // shoesblack", 02, new int[] { 0, 0, 0, 1 }, 9); - // shoesblue", 02, new int[] { 0, 0, 0, 1 }, 9); - // shoeslime", 02, new int[] { 0, 0, 0, 1 }, 9); - // shoesmagenta", 02, new int[] { 0, 0, 0, 1 }, 9); - // shoesorange", 02, new int[] { 0, 0, 0, 1 }, 9); - // shoespink", 02, new int[] { 0, 0, 0, 1 }, 9); - // shoespurple", 02, new int[] { 0, 0, 0, 1 }, 9); - // shoesred", 02, new int[] { 0, 0, 0, 1 }, 9); - // shoesruby", 02, new int[] { 0, 0, 0, 1 }, 9); - // shoeswhite", 02, new int[] { 0, 0, 0, 1 }, 9); - // shoesyellow", 02, new int[] { 0, 0, 0, 1 }, 9); - } - - private static void registerArmorMaterialAndPrefix(String outfitKey, int durability, int[] reductions, int enchatability) { - ArmorMaterial enumArmorMaterial = - EnumHelper.addArmorMaterial(outfitKey.toString().toUpperCase(), durability, reductions, enchatability); - armorMaterialMap.put(outfitKey, enumArmorMaterial); - int armorPrefix = 0; - if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) - armorPrefix = RenderingRegistry.addNewArmourRendererPrefix("angelwings"); - armorPrefixMap.put(outfitKey, new Integer(armorPrefix)); - - int armorType = 0; - for (int reductionValue : reductions) { - if (reductionValue > 0) { - createRegisterWardrobeArmorItem(outfitKey, armorType); - } - armorType++; - } - - - } - - private static void createRegisterWardrobeArmorItem(String outfitKey, int armorType) { - - Item outfitItem = new ItemWardrobeArmor( - outfitKey, - /* - * outfitKey populates the following within the ItemWardrobeArmor class + public static LinkedHashMap armorMaterialMap = + new LinkedHashMap(); + // armorPrefix map + public static LinkedHashMap armorPrefixMap = + new LinkedHashMap(); + // outfitKey to armorType to Item map + public static LinkedHashMap> outfitPurposeItemMap = + new LinkedHashMap>(); + + + public static void preInit() { + registerArmorMaterialAndPrefix("apronbrown", 1, new int[]{0, 0, 1, 0}, 9); // recipe done + registerArmorMaterialAndPrefix("apronbutcher", 1, new int[]{0, 0, 1, 0}, 9); // recipe done + registerArmorMaterialAndPrefix("aprongreen", 1, new int[]{0, 0, 1, 0}, 9); // recipe done + registerArmorMaterialAndPrefix("apronwhite", 1, new int[]{0, 0, 1, 0}, 9); // recipe done + registerArmorMaterialAndPrefix("angelwings", 4, new int[]{0, 4, 0, 0}, 9); // recipe done + registerArmorMaterialAndPrefix("artist", 10, new int[]{2, 7, 5, 0}, 9); // recipe done + registerArmorMaterialAndPrefix("ballcapblack", 1, new int[]{1, 0, 0, 0}, 9); + registerArmorMaterialAndPrefix("ballcapblue", 1, new int[]{1, 0, 0, 0}, 9); + registerArmorMaterialAndPrefix("ballcappurple", 1, new int[]{1, 0, 0, 0}, 9); + registerArmorMaterialAndPrefix("ballcapred", 1, new int[]{1, 0, 0, 0}, 9); + registerArmorMaterialAndPrefix("businesssuit", 10, new int[]{0, 7, 5, 0}, 9); + registerArmorMaterialAndPrefix("construction", 10, new int[]{2, 7, 5, 0}, 9); + registerArmorMaterialAndPrefix("costumechicken", 10, new int[]{2, 7, 0, 1}, 9); + registerArmorMaterialAndPrefix("costumecreeper", 10, new int[]{2, 7, 5, 0}, 9); + registerArmorMaterialAndPrefix("costumedinocyan", 10, new int[]{2, 7, 5, 0}, 9); + registerArmorMaterialAndPrefix("costumedinomagenta", 10, new int[]{2, 7, 5, 0}, 9); + registerArmorMaterialAndPrefix("costumedinored", 10, new int[]{2, 7, 5, 0}, 9); + registerArmorMaterialAndPrefix("costumehotdog", 10, new int[]{2, 7, 5, 0}, 9); + registerArmorMaterialAndPrefix("costumenyancat", 10, new int[]{2, 7, 5, 0}, 9); + registerArmorMaterialAndPrefix("dresscoral", 4, new int[]{0, 0, 3, 0}, 9); + registerArmorMaterialAndPrefix("dressgalaxy", 12, new int[]{4, 8, 6, 0}, 9); + registerArmorMaterialAndPrefix("dressglowstone", 12, new int[]{3, 7, 5, 0}, 9); + registerArmorMaterialAndPrefix("dresslavendar", 4, new int[]{0, 0, 3, 0}, 9); + registerArmorMaterialAndPrefix("dressmint", 4, new int[]{0, 0, 3, 0}, 9); + registerArmorMaterialAndPrefix("dresswedding", 10, new int[]{2, 7, 5, 0}, 9); + registerArmorMaterialAndPrefix("earmuffslavendar", 1, new int[]{1, 0, 0, 0}, 9); + registerArmorMaterialAndPrefix("fairywings", 4, new int[]{0, 4, 0, 0}, 9); + registerArmorMaterialAndPrefix("farmer", 10, new int[]{2, 7, 5, 0}, 9); + registerArmorMaterialAndPrefix("glassesblack", 1, new int[]{1, 0, 0, 0}, 9); + registerArmorMaterialAndPrefix("glassesred", 1, new int[]{1, 0, 0, 0}, 9); + registerArmorMaterialAndPrefix("hairbowcoral", 1, new int[]{1, 0, 0, 0}, 9); + registerArmorMaterialAndPrefix("hairbowlavendar", 1, new int[]{1, 0, 0, 0}, 9); + registerArmorMaterialAndPrefix("hairbowmint", 1, new int[]{1, 0, 0, 0}, 9); + registerArmorMaterialAndPrefix("hairpiecerainbow", 1, new int[]{1, 0, 0, 0}, 9); + registerArmorMaterialAndPrefix("hairpiecedaisychain", 1, new int[]{1, 0, 0, 0}, 9); + registerArmorMaterialAndPrefix("hathalo", 1, new int[]{1, 0, 0, 0}, 9); + registerArmorMaterialAndPrefix("hatmushroom", 1, new int[]{1, 0, 0, 0}, 9); + registerArmorMaterialAndPrefix("hatpig", 1, new int[]{2, 0, 0, 0}, 9); + registerArmorMaterialAndPrefix("hatsheep", 1, new int[]{2, 0, 0, 0}, 9); + registerArmorMaterialAndPrefix("headphones", 1, new int[]{3, 0, 0, 0}, 9); + registerArmorMaterialAndPrefix("longsleevegalaxy", 10, new int[]{0, 2, 0, 0}, 9); + registerArmorMaterialAndPrefix("lumberjack", 10, new int[]{2, 7, 5, 0}, 9); + registerArmorMaterialAndPrefix("king", 25, new int[]{2, 7, 5, 0}, 9); + registerArmorMaterialAndPrefix("mage", 10, new int[]{2, 7, 5, 0}, 9); + registerArmorMaterialAndPrefix("pajamasblack", 2, new int[]{0, 3, 2, 0}, 9); + registerArmorMaterialAndPrefix("pajamasblue", 2, new int[]{0, 3, 2, 0}, 9); + registerArmorMaterialAndPrefix("pajamasgreen", 2, new int[]{0, 3, 2, 0}, 9); + registerArmorMaterialAndPrefix("pajamasmint-w-flowers", 2, new int[]{0, 0, 2, 0}, 9); + registerArmorMaterialAndPrefix("pajamasred", 2, new int[]{0, 3, 2, 0}, 9); + registerArmorMaterialAndPrefix("pajamasyellow-w-orangedots", 2, new int[]{0, 0, 2, 0}, 9); + registerArmorMaterialAndPrefix("policeofficer", 10, new int[]{2, 7, 5, 0}, 9); + registerArmorMaterialAndPrefix("pantsjeans", 3, new int[]{0, 0, 3, 0}, 9); + registerArmorMaterialAndPrefix("pantskhaki", 3, new int[]{0, 0, 3, 0}, 9); + registerArmorMaterialAndPrefix("queen", 25, new int[]{2, 7, 5, 0}, 9); + registerArmorMaterialAndPrefix("scrubs", 10, new int[]{2, 3, 2, 2}, 9); + registerArmorMaterialAndPrefix("shirt-w-bowtie", 2, new int[]{0, 3, 0, 0}, 9); + registerArmorMaterialAndPrefix("slippersbunny", 2, new int[]{0, 0, 0, 1}, 9); + registerArmorMaterialAndPrefix("slipperskitty", 2, new int[]{0, 0, 0, 1}, 9); + registerArmorMaterialAndPrefix("slippersteddy", 2, new int[]{0, 0, 0, 1}, 9); + registerArmorMaterialAndPrefix("sushichef", 10, new int[]{2, 7, 5, 0}, 9); + registerArmorMaterialAndPrefix("sweatercyan", 3, new int[]{0, 3, 0, 0}, 9); + registerArmorMaterialAndPrefix("sweaterlavendar", 3, new int[]{0, 3, 0, 0}, 9); + registerArmorMaterialAndPrefix("sweaterteddy", 3, new int[]{0, 3, 0, 0}, 9); + registerArmorMaterialAndPrefix("swimsuiteblue", 1, new int[]{0, 0, 2, 0}, 9); + registerArmorMaterialAndPrefix("swimsuitemagenta", 1, new int[]{0, 0, 2, 0}, 9); + registerArmorMaterialAndPrefix("tanktopwhite", 10, new int[]{0, 2, 0, 0}, 9); + registerArmorMaterialAndPrefix("tanktoporange", 10, new int[]{0, 2, 0, 0}, 9); + registerArmorMaterialAndPrefix("tanktoporange2", 10, new int[]{0, 2, 0, 0}, 9); + registerArmorMaterialAndPrefix("tanktoppink", 10, new int[]{0, 2, 0, 0}, 9); + registerArmorMaterialAndPrefix("tanktopheart", 10, new int[]{0, 2, 0, 0}, 9); + registerArmorMaterialAndPrefix("teecookie", 10, new int[]{0, 2, 0, 0}, 9); + registerArmorMaterialAndPrefix("teecreeper", 10, new int[]{0, 2, 0, 0}, 9); + registerArmorMaterialAndPrefix("teecupcake", 10, new int[]{0, 2, 0, 0}, 9); + registerArmorMaterialAndPrefix("teediamond", 10, new int[]{0, 2, 0, 0}, 9); + registerArmorMaterialAndPrefix("teegrass", 10, new int[]{0, 2, 0, 0}, 9); + registerArmorMaterialAndPrefix("teemushroom", 10, new int[]{0, 2, 0, 0}, 9); + registerArmorMaterialAndPrefix("teetiedye", 10, new int[]{0, 2, 0, 0}, 9); + registerArmorMaterialAndPrefix("tuxedoblack", 10, new int[]{0, 7, 5, 0}, 9); + registerArmorMaterialAndPrefix("tuxedoglow", 12, new int[]{0, 7, 5, 0}, 9); + registerArmorMaterialAndPrefix("workboots", 2, new int[]{0, 0, 0, 1}, 9); + registerArmorMaterialAndPrefix("scientist", 10, new int[]{2, 7, 5, 0}, 9); + registerArmorMaterialAndPrefix("shoesblack", 2, new int[]{0, 0, 0, 1}, 9); + registerArmorMaterialAndPrefix("shoesblue", 2, new int[]{0, 0, 0, 1}, 9); + registerArmorMaterialAndPrefix("shoeslime", 2, new int[]{0, 0, 0, 1}, 9); + registerArmorMaterialAndPrefix("shoesmagenta", 2, new int[]{0, 0, 0, 1}, 9); + registerArmorMaterialAndPrefix("shoesorange", 2, new int[]{0, 0, 0, 1}, 9); + registerArmorMaterialAndPrefix("shoespink", 2, new int[]{0, 0, 0, 1}, 9); + registerArmorMaterialAndPrefix("shoespurple", 2, new int[]{0, 0, 0, 1}, 9); + registerArmorMaterialAndPrefix("shoesred", 2, new int[]{0, 0, 0, 1}, 9); + registerArmorMaterialAndPrefix("shoesruby", 2, new int[]{0, 0, 0, 1}, 9); + registerArmorMaterialAndPrefix("shoeswhite", 2, new int[]{0, 0, 0, 1}, 9); + registerArmorMaterialAndPrefix("shoesyellow", 2, new int[]{0, 0, 0, 1}, 9); + registerArmorMaterialAndPrefix("shortsblue-w-flowers", 1, new int[]{0, 0, 2, 0}, 9); + registerArmorMaterialAndPrefix("shortsblue-w-whitestripes", 1, new int[]{0, 0, 2, 0}, 9); + registerArmorMaterialAndPrefix("shortsred-w-whitestripe", 1, new int[]{0, 0, 2, 0}, 9); + registerArmorMaterialAndPrefix("shortswhite-w-reddots", 1, new int[]{0, 0, 2, 0}, 9); + registerArmorMaterialAndPrefix("skirtgray", 3, new int[]{0, 0, 3, 0}, 9); + registerArmorMaterialAndPrefix("skirtruffled", 3, new int[]{0, 0, 3, 0}, 9); + } + + public static void init() { + // angelwings", 4, new int[] { 0, 4, 0, 0 }, 9); + GameRegistry.addRecipe(new ItemStack( + getOutfitItem("angelwings", getPurposeByArmorType(BODY)), 1), + RecipeUtil.createRecipeObject(new Item[]{ + getPattern(Category.costume, Purpose.chest), + getFabric(Colors.bluelight), + ClothingCraftToolsItemList.needleAndThread, + Items.feather, Items.string, Items.feather + }) + ); + + // construction", 10, new int[] { 2, 7, 5, 0 }, 9); + GameRegistry.addRecipe(new ItemStack( + getOutfitItem("construction", getPurposeByArmorType(HEAD)), 1), + RecipeUtil.createRecipeObject(new Item[]{ + getPattern(Category.career, Purpose.helm), + getFabric(Colors.yellow), + ClothingCraftToolsItemList.measuringTape, + Items.iron_helmet + }) + ); + GameRegistry.addRecipe(new ItemStack( + getOutfitItem("construction", getPurposeByArmorType(BODY)), 1), + RecipeUtil.createRecipeObject(new Item[]{ + getPattern(Category.career, Purpose.chest), + getFabric(Colors.yellow), + getFabric(Colors.orange), + ClothingCraftToolsItemList.needleAndThread, + Items.iron_pickaxe + }) + ); + GameRegistry.addRecipe(new ItemStack( + getOutfitItem("construction", getPurposeByArmorType(LEGS)), 1), + RecipeUtil.createRecipeObject(new Item[]{ + getPattern(Category.career, Purpose.pants), + getFabric(Colors.bluedark), + ClothingCraftToolsItemList.needleAndThread, + Items.iron_pickaxe + }) + ); + GameRegistry.addRecipe(new ItemStack( + getOutfitItem("construction", getPurposeByArmorType(FEET)), 1), + RecipeUtil.createRecipeObject(new Item[]{ + getPattern(Category.career, Purpose.boots), + getFabric(Colors.brown), + ClothingCraftToolsItemList.needleAndThread, + Items.leather + }) + ); + + // apronbrown", 1, new int[] { 0, 1, 0, 0 }, 9); + GameRegistry.addRecipe(new ItemStack( + getOutfitItem("apronbrown", getPurposeByArmorType(LEGS)), 1), + RecipeUtil.createRecipeObject(new Item[]{ + getPattern(Category.career, Purpose.pants), + getFabric(Colors.brown), + ClothingCraftToolsItemList.needleAndThread, + Items.string + }) + ); + + // apronbutcher", 1, new int[] { 0, 1, 0, 0 }, 9); + GameRegistry.addRecipe(new ItemStack( + getOutfitItem("apronbutcher", getPurposeByArmorType(LEGS)), 1), + RecipeUtil.createRecipeObject(new Item[]{ + getPattern(Category.career, Purpose.pants), + getFabric(Colors.white), + ClothingCraftToolsItemList.needleAndThread, + Items.string, + Items.cooked_porkchop + }) + ); + + // aprongreen", 1, new int[] { 0, 1, 0, 0 }, 9); + GameRegistry.addRecipe(new ItemStack( + getOutfitItem("aprongreen", getPurposeByArmorType(LEGS)), 1), + RecipeUtil.createRecipeObject(new Item[]{ + getPattern(Category.career, Purpose.pants), + getFabric(Colors.green), + ClothingCraftToolsItemList.needleAndThread, + Items.string, + Items.cooked_porkchop + }) + ); + + // apronwhite", 1, new int[] { 0, 1, 0, 0 }, 9); + GameRegistry.addRecipe(new ItemStack( + getOutfitItem("apronwhite", getPurposeByArmorType(LEGS)), 1), + RecipeUtil.createRecipeObject(new Item[]{ + getPattern(Category.career, Purpose.pants), + getFabric(Colors.white), + ClothingCraftToolsItemList.needleAndThread, + Items.string + }) + ); + + // artist", 10, new int[] { 2, 7, 5, 0 }, 9); + GameRegistry.addRecipe(new ItemStack( + getOutfitItem("construction", getPurposeByArmorType(HEAD)), 1), + RecipeUtil.createRecipeObject(new Item[]{ + getPattern(Category.career, Purpose.helm), + getFabric(Colors.black), + ClothingCraftToolsItemList.measuringTape + }) + ); + GameRegistry.addRecipe(new ItemStack( + getOutfitItem("construction", getPurposeByArmorType(BODY)), 1), + RecipeUtil.createRecipeObject(new Item[]{ + getPattern(Category.career, Purpose.chest), + getFabric(Colors.white), + ClothingCraftToolsItemList.needleAndThread + }) + ); + GameRegistry.addRecipe(new ItemStack( + getOutfitItem("construction", getPurposeByArmorType(LEGS)), 1), + RecipeUtil.createRecipeObject(new Item[]{ + getPattern(Category.career, Purpose.pants), + getFabric(Colors.bluedark), + ClothingCraftToolsItemList.needleAndThread + }) + ); + + // ballcapblack", 1, new int[] { 1, 0, 0, 0 }, 9); + GameRegistry.addRecipe(new ItemStack( + getOutfitItem("ballcapblack", getPurposeByArmorType(HEAD)), 1), + RecipeUtil.createRecipeObject(new Item[]{ + getPattern(Category.casual, Purpose.helm), + getFabric(Colors.black), + ClothingCraftToolsItemList.measuringTape + }) + ); + // ballcapblue", 1, new int[] { 1, 0, 0, 0 }, 9); + GameRegistry.addRecipe(new ItemStack( + getOutfitItem("ballcapblue", getPurposeByArmorType(HEAD)), 1), + RecipeUtil.createRecipeObject(new Item[]{ + getPattern(Category.casual, Purpose.helm), + getFabric(Colors.bluedark), + ClothingCraftToolsItemList.measuringTape + }) + ); + // ballcappurple",1, new int[] { 1, 0, 0, 0 }, 9); + GameRegistry.addRecipe(new ItemStack( + getOutfitItem("ballcappurple", getPurposeByArmorType(HEAD)), 1), + RecipeUtil.createRecipeObject(new Item[]{ + getPattern(Category.casual, Purpose.helm), + getFabric(Colors.purple), + ClothingCraftToolsItemList.measuringTape + }) + ); + // ballcapred", 1, new int[] { 1, 0, 0, 0 }, 9); + GameRegistry.addRecipe(new ItemStack( + getOutfitItem("ballcapred", getPurposeByArmorType(HEAD)), 1), + RecipeUtil.createRecipeObject(new Item[]{ + getPattern(Category.casual, Purpose.helm), + getFabric(Colors.red), + ClothingCraftToolsItemList.measuringTape + }) + ); + // businesssuit", 10, new int[] { 0, 7, 5, 0 }, 9); + // costumecreeper",10, new int[] { 2, 7, 5, 0 }, 9); + // dresscoral", 4, new int[] { 0, 0, 3, 0 }, 9); + // dresslavendar",4, new int[] { 0, 0, 3, 0 }, 9); + // dressmint", 4, new int[] { 0, 0, 3, 0 }, 9); + // earmuffslavendar" , 1, new int[] { 1, 0, 0, 0 }, 9); + // farmer", 10, new int[] { 2, 7, 5, 0 }, 9); + // glassesblack", 1, new int[] { 1, 0, 0, 0 }, 9); + GameRegistry.addRecipe(new ItemStack( + getOutfitItem("ballcapred", getPurposeByArmorType(HEAD)), 1), + RecipeUtil.createRecipeObject(new Item[]{ + null, getPattern(Category.career, Purpose.helm), null, + Items.glass_bottle, getFabric(Colors.black), Items.glass_bottle + }) + ); + + // glassesred", 1, new int[] { 1, 0, 0, 0 }, 9); + // hairbowcoral", 1, new int[] { 1, 0, 0, 0 }, 9); + // hairbowlavendar", 1, new int[] { 1, 0, 0, 0 }, 9); + // hairbowmint", 1, new int[] { 1, 0, 0, 0 }, 9); + // hairpiecerainbow" , 1, new int[] { 1, 0, 0, 0 }, 9); + // longsleevegalaxy", 10, new int[] { 0, 2, 0, 0 }, 9); + // lumberjack", 10, new int[] { 2, 7, 5, 0 }, 9); + // mage", 10, new int[] { 2, 7, 5, 0 }, 9); + // pajamasblack", 2, new int[] { 0, 3, 2, 0 }, 9); + // pajamasblue", 2, new int[] { 0, 3, 2, 0 }, 9); + // pajamasgreen", 2, new int[] { 0, 3, 2, 0 }, 9); + // pajamasred", 2, new int[] { 0, 3, 2, 0 }, 9); + // policeofficer",10, new int[] { 2, 7, 5, 0 }, 9); + // scrubs", 10, new int[] { 2, 3, 2, 2 }, 9); + // slippersbunny",2, new int[] { 0, 0, 0, 1 }, 9); + // slipperskitty",2, new int[] { 0, 0, 0, 1 }, 9); + // slippersteddy",2, new int[] { 0, 0, 0, 1 }, 9); + // sushichef", 10, new int[] { 2, 7, 5, 0 }, 9); + // tanktopwhite", 10, new int[] { 0, 2, 0, 0 }, 9); + // tanktoporange",10, new int[] { 0, 2, 0, 0 }, 9); + // tanktoppink", 10, new int[] { 0, 2, 0, 0 }, 9); + // tanktopheart", 10, new int[] { 0, 2, 0, 0 }, 9); + // teecookie", 10, new int[] { 0, 2, 0, 0 }, 9); + // teecreeper", 10, new int[] { 0, 2, 0, 0 }, 9); + // teecupcake", 10, new int[] { 0, 2, 0, 0 }, 9); + // teediamond", 10, new int[] { 0, 2, 0, 0 }, 9); + // teegrass", 10, new int[] { 0, 2, 0, 0 }, 9); + // teemushroom", 10, new int[] { 0, 2, 0, 0 }, 9); + // tuxedoblack", 10, new int[] { 0, 7, 5, 0 }, 9); + // tuxedoglow", 12, new int[] { 0, 7, 5, 0 }, 9); + // workboots", 2, new int[] { 0, 0, 0, 1 }, 9); + // shoesblack", 2, new int[] { 0, 0, 0, 1 }, 9); + // shoesblue", 2, new int[] { 0, 0, 0, 1 }, 9); + // shoeslime", 2, new int[] { 0, 0, 0, 1 }, 9); + // shoesmagenta", 2, new int[] { 0, 0, 0, 1 }, 9); + // shoesorange", 2, new int[] { 0, 0, 0, 1 }, 9); + // shoespink", 2, new int[] { 0, 0, 0, 1 }, 9); + // shoespurple", 2, new int[] { 0, 0, 0, 1 }, 9); + // shoesred", 2, new int[] { 0, 0, 0, 1 }, 9); + // shoesruby", 2, new int[] { 0, 0, 0, 1 }, 9); + // shoeswhite", 2, new int[] { 0, 0, 0, 1 }, 9); + // shoesyellow", 2, new int[] { 0, 0, 0, 1 }, 9); + } + + private static void registerArmorMaterialAndPrefix(String outfitKey, int durability, int[] reductions, int enchatability) { + ArmorMaterial enumArmorMaterial = + EnumHelper.addArmorMaterial(outfitKey.toUpperCase(), durability, reductions, enchatability); + armorMaterialMap.put(outfitKey, enumArmorMaterial); + int armorPrefix = 0; + if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) + armorPrefix = RenderingRegistry.addNewArmourRendererPrefix("angelwings"); + armorPrefixMap.put(outfitKey, armorPrefix); + + int armorType = 0; + for (int reductionValue : reductions) { + if (reductionValue > 0) { + createRegisterWardrobeArmorItem(outfitKey, armorType); + } + armorType++; + } + + + } + + private static void createRegisterWardrobeArmorItem(String outfitKey, int armorType) { + + Item outfitItem = new ItemWardrobeArmor( + outfitKey, + /* + * outfitKey populates the following within the ItemWardrobeArmor class * unlocalizedName = item.[unlocalizedName].name=[displayedItemName] * itemTextureName = ClothingCraftInfo.MODID + ":textures/items/[imageName]" * armorTextureName textures/models/wardrobe/..._layer_[1 or 2] */ - armorMaterialMap.get(outfitKey), - armorPrefixMap.get(outfitKey).intValue(), // renderIndex: 0 = cloth, 1 = chain, 2 = iron, 3 = diamond, 4 = gold - armorType // armorType: 0=helmet, 1=chestplate, 2=leggings, 3=boots - ); - // load the outfitKey to armorType to Item map - if (outfitPurposeItemMap.get(outfitKey)==null) { - outfitPurposeItemMap.put(outfitKey, new LinkedHashMap()); - } - outfitPurposeItemMap.get(outfitKey).put(getPurposeByArmorType(armorType), outfitItem); - // register item with game environment - String registerItemKey = "wardrobe_" + - outfitKey.toString().toLowerCase() + - ItemWardrobeArmor.getTextureSuffix(armorType); - GameRegistry.registerItem(outfitItem, registerItemKey); - - } - - /** - * Resolves the stored sewing pattern item reference from the map container in this class - * - * @param enumCategory ClothingCraftPatternItemList.CATEGORY enumeration element - * @param enumPurpose ClothingCraftPatternItemList.PURPOSE enumeration element - * @return associated sewing pattern item, null if none exists - */ - public static Item getPattern(CATEGORY enumCategory, PURPOSE enumPurpose) { - return ClothingCraftPatternItemList.patternsItemMap.get(enumCategory).get(enumPurpose); - } - - /** - * Resolves the stored sewing fabric item reference from the map container in this class - * @param enumColor ClothingCraftFabricItemList.COLORS enumeration element - * @return associated sewing fabric item, null if none exists. - */ - public static Item getFabric(COLORS enumColor) { - return ClothingCraftFabricItemList.fabricItemsMap.get(enumColor); - } - - /** - * Resolves the stored wardrobe (outfit) item reference from the map container in this class - * @param outfitKey String representation of map key: - * REQUIRED, null value will throw an IlleagalArgumentException - * @param purpose ClothingCraftPatternItemList.PURPOSE enumeration element: - * REQUIRED, null value will throw an IlleagalArgumentException - * @return associated wardrobe (outfit) item, null if none exists - */ - public static Item getOutfitItem(String outfitKey, PURPOSE purpose) { - Item result = null; - LinkedHashMap outfitMap = outfitPurposeItemMap.get(outfitKey); - if (outfitMap!=null && purpose!=null) { - result = outfitMap.get(purpose); - } else { - if (outfitMap == null) - throw new IllegalArgumentException("null argument: outfitKey"); - if (purpose == null) - throw new IllegalArgumentException("null argument: purpose"); - } - return result; - } - - /** - * Resolves an input integer (0-3) to an associated PURPOSE enumeration - * @param armorType 0 = HEAD, 1 = BODY, 2 = LEGS, 3 = FEET, default resolves to null value - * @return ClothingCraftPatternItemList.PURPOSE enumeration element
- *
    - *
  • HEAD (0) = PURPOSE.helm
  • - *
  • BODY (1) = PURPOSE.chest
  • - *
  • LEGS (2) = PURPOSE.pants
  • - *
  • FEET (3) = PURPOSE.boots
  • - *
- */ - public static PURPOSE getPurposeByArmorType(int armorType) { - PURPOSE result = null; - switch (armorType) { - case 0: - result = PURPOSE.helm; - break; - case 1: - result = PURPOSE.chest; - break; - case 2: - result = PURPOSE.pants; - break; - case 3: - result = PURPOSE.boots; - break; - default: - } - return result; - } - + armorMaterialMap.get(outfitKey), + armorPrefixMap.get(outfitKey), // renderIndex: 0 = cloth, 1 = chain, 2 = iron, 3 = diamond, 4 = gold + armorType // armorType: 0=helmet, 1=chestplate, 2=leggings, 3=boots + ); + // load the outfitKey to armorType to Item map + if (outfitPurposeItemMap.get(outfitKey) == null) { + outfitPurposeItemMap.put(outfitKey, new LinkedHashMap()); + } + outfitPurposeItemMap.get(outfitKey).put(getPurposeByArmorType(armorType), outfitItem); + // register item with game environment + String registerItemKey = "wardrobe_" + + outfitKey.toLowerCase() + + ItemWardrobeArmor.getTextureSuffix(armorType); + GameRegistry.registerItem(outfitItem, registerItemKey); + + } + + /** + * Resolves the stored sewing pattern item reference from the map container in this class + * + * @param enumCategory ClothingCraftPatternItemList.CATEGORY enumeration element + * @param enumPurpose ClothingCraftPatternItemList.PURPOSE enumeration element + * @return associated sewing pattern item, null if none exists + */ + public static Item getPattern(Category enumCategory, Purpose enumPurpose) { + return ClothingCraftPatternItemList.patternsItemMap.get(enumCategory).get(enumPurpose); + } + + /** + * Resolves the stored sewing fabric item reference from the map container in this class + * + * @param enumColor ClothingCraftFabricItemList.COLORS enumeration element + * @return associated sewing fabric item, null if none exists. + */ + public static Item getFabric(Colors enumColor) { + return ClothingCraftFabricItemList.fabricItemsMap.get(enumColor); + } + + /** + * Resolves the stored wardrobe (outfit) item reference from the map container in this class + * + * @param outfitKey String representation of map key: + * REQUIRED, null value will throw an IlleagalArgumentException + * @param purpose ClothingCraftPatternItemList.PURPOSE enumeration element: + * REQUIRED, null value will throw an IlleagalArgumentException + * @return associated wardrobe (outfit) item, null if none exists + */ + public static Item getOutfitItem(String outfitKey, Purpose purpose) { + Item result = null; + LinkedHashMap outfitMap = outfitPurposeItemMap.get(outfitKey); + if (outfitMap != null && purpose != null) { + result = outfitMap.get(purpose); + } else { + if (outfitMap == null) + throw new IllegalArgumentException("null argument: outfitKey"); + if (purpose == null) + throw new IllegalArgumentException("null argument: purpose"); + } + return result; + } + + /** + * Resolves an input integer (0-3) to an associated PURPOSE enumeration + * + * @param armorType 0 = HEAD, 1 = BODY, 2 = LEGS, 3 = FEET, default resolves to null value + * @return ClothingCraftPatternItemList.PURPOSE enumeration element
+ *
    + *
  • HEAD (0) = PURPOSE.helm
  • + *
  • BODY (1) = PURPOSE.chest
  • + *
  • LEGS (2) = PURPOSE.pants
  • + *
  • FEET (3) = PURPOSE.boots
  • + *
+ */ + public static Purpose getPurposeByArmorType(int armorType) { + Purpose result = null; + switch (armorType) { + case 0: + result = Purpose.helm; + break; + case 1: + result = Purpose.chest; + break; + case 2: + result = Purpose.pants; + break; + case 3: + result = Purpose.boots; + break; + default: + } + return result; + } + } diff --git a/src/main/java/clothingcraft/items/ItemCotton.java b/src/main/java/clothingcraft/items/ItemCotton.java index da32195..f3b3c08 100644 --- a/src/main/java/clothingcraft/items/ItemCotton.java +++ b/src/main/java/clothingcraft/items/ItemCotton.java @@ -1,19 +1,18 @@ /** - * + * */ package clothingcraft.items; import net.minecraft.item.Item; /** - * * @author JujuAwesomeBeans * @author NinjaSoldier40 * @since 02/05/2017 09:01 PM */ public class ItemCotton extends Item { - public ItemCotton() { - super(); - } + public ItemCotton() { + super(); + } } \ No newline at end of file diff --git a/src/main/java/clothingcraft/items/ItemCottonArmor.java b/src/main/java/clothingcraft/items/ItemCottonArmor.java index 1b33db7..b82a68a 100644 --- a/src/main/java/clothingcraft/items/ItemCottonArmor.java +++ b/src/main/java/clothingcraft/items/ItemCottonArmor.java @@ -1,10 +1,10 @@ /** - * + * */ package clothingcraft.items; -import clothingcraft.core.ClothingCraft; import clothingcraft.core.ClothingCraftInfo; +import clothingcraft.core.CommonProxy; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; @@ -18,40 +18,38 @@ /** * armor made of cotton - * + * * @author JujuAwesomeBeans * @author NinjaSoldier40 * @since 02/07/2017 07:06 PM (-07:00 GMT) */ public class ItemCottonArmor extends ItemArmor { - private String textureName; - private String itemTextureName; - - public ItemCottonArmor(String unlocalizedName, String itemTextureName, ArmorMaterial material, String armorTextureName, int type) { - super(material, 0, type); - this.textureName = armorTextureName; - this.itemTextureName = itemTextureName; - this.setUnlocalizedName(unlocalizedName); - } - - @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) - { - return ClothingCraftInfo.MODID + ":textures/models/armor/" + this.textureName + "_" + (this.armorType == 2 ? "2" : "1") + ".png"; - } - - @Override - public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) { - if (player.getCurrentArmor(1) != null && player.getCurrentArmor(1).getItem().equals(ClothingCraft.cottonArmorBoots)) - { - player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 40)); - } - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister){ - this.itemIcon = iconRegister.registerIcon(String.format("%s%s", ClothingCraftInfo.MODID + ":", this.itemTextureName)); - } + private String textureName; + private String itemTextureName; + + public ItemCottonArmor(String unlocalizedName, String itemTextureName, ArmorMaterial material, String armorTextureName, int type) { + super(material, 0, type); + this.textureName = armorTextureName; + this.itemTextureName = itemTextureName; + this.setUnlocalizedName(unlocalizedName); + } + + @Override + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { + return ClothingCraftInfo.MODID + ":textures/models/armor/" + this.textureName + "_" + (this.armorType == 2 ? "2" : "1") + ".png"; + } + + @Override + public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) { + if (player.getCurrentArmor(1) != null && player.getCurrentArmor(1).getItem() == CommonProxy.cottonArmorBoots) { + player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 40)); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon(String.format("%s%s", ClothingCraftInfo.MODID + ":", this.itemTextureName)); + } } diff --git a/src/main/java/clothingcraft/items/ItemCottonFabric.java b/src/main/java/clothingcraft/items/ItemCottonFabric.java index dd95f49..9d6a7c4 100644 --- a/src/main/java/clothingcraft/items/ItemCottonFabric.java +++ b/src/main/java/clothingcraft/items/ItemCottonFabric.java @@ -1,5 +1,5 @@ /** - * + * */ package clothingcraft.items; @@ -7,16 +7,16 @@ /** * piece of cloth made of cotton - * + * * @author JujuAwesomeBeans * @author NinjaSoldier40 * @since 02/07/2017 07:06 PM (-07:00 GMT) */ public class ItemCottonFabric extends Item { - public ItemCottonFabric() { - super(); - setMaxStackSize(64); - } + public ItemCottonFabric() { + super(); + setMaxStackSize(64); + } } diff --git a/src/main/java/clothingcraft/items/ItemCottonSeeds.java b/src/main/java/clothingcraft/items/ItemCottonSeeds.java index d5e2a48..cbf2421 100644 --- a/src/main/java/clothingcraft/items/ItemCottonSeeds.java +++ b/src/main/java/clothingcraft/items/ItemCottonSeeds.java @@ -1,24 +1,21 @@ package clothingcraft.items; import clothingcraft.blocks.BlockCottonPlant; -import clothingcraft.core.ClothingCraft; +import clothingcraft.client.ClientProxy; import clothingcraft.core.ClothingCraftInfo; import net.minecraft.block.Block; /** - * * @author JujuAwesomeBeans * @author NinjaSoldier40 * @since 02/05/2017 09:01 PM */ -public class ItemCottonSeeds extends RecipeItemSeeds -{ +public class ItemCottonSeeds extends RecipeItemSeeds { - public ItemCottonSeeds(BlockCottonPlant cottonPlant, Block farmland) - { + public ItemCottonSeeds(BlockCottonPlant cottonPlant, Block farmland) { super(cottonPlant, farmland); setUnlocalizedName("cotton_harvested"); setTextureName(ClothingCraftInfo.MODID + ":cotton_harvested"); - setCreativeTab(ClothingCraft.tabCore); + setCreativeTab(ClientProxy.tabCore); } } \ No newline at end of file diff --git a/src/main/java/clothingcraft/items/ItemDye.java b/src/main/java/clothingcraft/items/ItemDye.java index 651d1a7..f80d103 100644 --- a/src/main/java/clothingcraft/items/ItemDye.java +++ b/src/main/java/clothingcraft/items/ItemDye.java @@ -1,9 +1,9 @@ /** - * + * */ package clothingcraft.items; -import clothingcraft.core.ClothingCraft; +import clothingcraft.client.ClientProxy; import clothingcraft.core.ClothingCraftInfo; import net.minecraft.block.Block; import net.minecraft.entity.EntityLivingBase; @@ -14,82 +14,79 @@ /** * Generic Dye class to be utilized by all the different colors - * + * * @author JujuAwesomeBeans * @author NinjaSoldier40 * @since 02/11/2017 02:28 PM - * */ public class ItemDye extends Item { - - private Block[] blocksEffectiveAgainst = new Block[]{}; - - // harvest level - int harvest = 1; - protected float efficiencyOnProperMaterial; + protected float efficiencyOnProperMaterial; + // harvest level + int harvest = 1; + private Block[] blocksEffectiveAgainst = new Block[]{}; - protected ItemDye(String unlocalizedName) { - efficiencyOnProperMaterial = 4; - //Item.ToolMaterial enumr = - EnumHelper.addToolMaterial("DYE_" + unlocalizedName.toUpperCase(), 1, 12, 4F, 5, 2); - setUnlocalizedName("dye_" + unlocalizedName); - setTextureName(ClothingCraftInfo.MODID + ":dye_" + unlocalizedName.toLowerCase()); - setCreativeTab(ClothingCraft.tabMaterials); - setMaxDamage(12); - setMaxStackSize(1); - } + protected ItemDye(String unlocalizedName) { + efficiencyOnProperMaterial = 4; + //Item.ToolMaterial enumr = + EnumHelper.addToolMaterial("DYE_" + unlocalizedName.toUpperCase(), 1, 12, 4F, 5, 2); + setUnlocalizedName("dye_" + unlocalizedName); + setTextureName(ClothingCraftInfo.MODID + ":dye_" + unlocalizedName.toLowerCase()); + setCreativeTab(ClientProxy.tabMaterials); + setMaxDamage(12); + setMaxStackSize(1); + } - /** - * Returns the strength of the stack against a given block. 1.0F base, - * (Quality+1)*2 if correct block type, 1.5F if sword - */ - public float func_150893_a(ItemStack par1ItemStack, Block par2Block) { - for (int i = 0; i < blocksEffectiveAgainst.length; i++) { - if (blocksEffectiveAgainst[i] == par2Block) { - return efficiencyOnProperMaterial; - } - } + /** + * Returns the strength of the stack against a given block. 1.0F base, + * (Quality+1)*2 if correct block type, 1.5F if sword + */ + public float func_150893_a(ItemStack par1ItemStack, Block par2Block) { + for (int i = 0; i < blocksEffectiveAgainst.length; i++) { + if (blocksEffectiveAgainst[i] == par2Block) { + return efficiencyOnProperMaterial; + } + } - return 0.0F; - } + return 0.0F; + } - /** - * Current implementations of this method in child classes do not use - * the entry argument. They just raise the damage on the stack. - */ - public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLiving, - EntityLivingBase par3EntityLiving) { - par1ItemStack.damageItem(2, par3EntityLiving); - return true; - } + /** + * Current implementations of this method in child classes do not use + * the entry argument. They just raise the damage on the stack. + */ + public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLiving, + EntityLivingBase par3EntityLiving) { + par1ItemStack.damageItem(2, par3EntityLiving); + return true; + } - /** - * @see net.minecraft.item.Item#onBlockDestroyed( - * net.minecraft.item.ItemStack, - * net.minecraft.world.World, - * net.minecraft.block.Block, - * int, int, int, - * net.minecraft.entity.EntityLivingBase) - */ - public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3, int par4, int par5, - int par6, EntityLivingBase par7EntityLiving) { - par1ItemStack.damageItem(1, par7EntityLiving); - return true; - } + /** + * @see net.minecraft.item.Item#onBlockDestroyed( + *net.minecraft.item.ItemStack, + * net.minecraft.world.World, + * net.minecraft.block.Block, + * int, int, int, + * net.minecraft.entity.EntityLivingBase) + */ + public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3, int par4, int par5, + int par6, EntityLivingBase par7EntityLiving) { + par1ItemStack.damageItem(1, par7EntityLiving); + return true; + } - /** - * Returns True is the item is renderer in full 3D when hold. - */ - public boolean isFull3D() { - return true; - } + /** + * Returns True is the item is renderer in full 3D when hold. + */ + public boolean isFull3D() { + return true; + } - /** - * Return the enchant-able factor of the item, most of the time is based on material. - */ - public int getItemEnchantability() { - return 2; - } + /** + * Return the enchant-able factor of the item, most of the time is based on material. + */ + public int getItemEnchantability() { + return 2; + } } diff --git a/src/main/java/clothingcraft/items/ItemDyedFabric.java b/src/main/java/clothingcraft/items/ItemDyedFabric.java index 78f4fc0..0086b61 100644 --- a/src/main/java/clothingcraft/items/ItemDyedFabric.java +++ b/src/main/java/clothingcraft/items/ItemDyedFabric.java @@ -1,6 +1,6 @@ package clothingcraft.items; -import clothingcraft.core.ClothingCraft; +import clothingcraft.client.ClientProxy; import clothingcraft.core.ClothingCraftInfo; import net.minecraft.block.Block; import net.minecraft.item.Item; @@ -8,25 +8,25 @@ public class ItemDyedFabric extends Item { - public ItemDyedFabric(String unlocalizedName) { - super(); - setMaxDamage(0); - setMaxStackSize(64); - setUnlocalizedName("fabric_" + unlocalizedName); - setTextureName(ClothingCraftInfo.MODID + ":fabric_" + unlocalizedName); - setCreativeTab(ClothingCraft.tabMaterials); - } + public ItemDyedFabric(String unlocalizedName) { + super(); + setMaxDamage(0); + setMaxStackSize(64); + setUnlocalizedName("fabric_" + unlocalizedName); + setTextureName(ClothingCraftInfo.MODID + ":fabric_" + unlocalizedName); + setCreativeTab(ClientProxy.tabMaterials); + } - public int getItemEnchantability() { - return 0; - } + public int getItemEnchantability() { + return 0; + } - public int getMaxItemUseDuration(ItemStack par1ItemStack) { - return 0; - } + public int getMaxItemUseDuration(ItemStack par1ItemStack) { + return 0; + } - public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) { - return 1.0F; - } + public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) { + return 1.0F; + } - } \ No newline at end of file +} \ No newline at end of file diff --git a/src/main/java/clothingcraft/items/ItemHaliteAxe.java b/src/main/java/clothingcraft/items/ItemHaliteAxe.java index db4a6bd..2cd4056 100644 --- a/src/main/java/clothingcraft/items/ItemHaliteAxe.java +++ b/src/main/java/clothingcraft/items/ItemHaliteAxe.java @@ -1,31 +1,31 @@ /** - * + * */ package clothingcraft.items; -import clothingcraft.core.ClothingCraft; +import clothingcraft.client.ClientProxy; import clothingcraft.core.ClothingCraftInfo; import net.minecraft.item.ItemAxe; /** * Item sword made of Halite Blocks - * + * * @author JujuAwesomeBeans * @author NinjaSoldier40 * @since 02/10/2017 08:05 PM (-7:00 GMT) */ public class ItemHaliteAxe extends ItemAxe { - /** - * Creates a new instance of Rock Salt - */ - public ItemHaliteAxe() { - super(ToolMaterial.STONE); - setMaxDamage(2); - setMaxStackSize(1); - setUnlocalizedName("halite_axe"); - setTextureName(ClothingCraftInfo.MODID + ":halite_axe"); - setCreativeTab(ClothingCraft.tabCore); - } + /** + * Creates a new instance of Rock Salt + */ + public ItemHaliteAxe() { + super(ToolMaterial.STONE); + setMaxDamage(2); + setMaxStackSize(1); + setUnlocalizedName("halite_axe"); + setTextureName(ClothingCraftInfo.MODID + ":halite_axe"); + setCreativeTab(ClientProxy.tabCore); + } } diff --git a/src/main/java/clothingcraft/items/ItemHaliteHoe.java b/src/main/java/clothingcraft/items/ItemHaliteHoe.java index 3de8009..e7779ce 100644 --- a/src/main/java/clothingcraft/items/ItemHaliteHoe.java +++ b/src/main/java/clothingcraft/items/ItemHaliteHoe.java @@ -1,31 +1,31 @@ /** - * + * */ package clothingcraft.items; -import clothingcraft.core.ClothingCraft; +import clothingcraft.client.ClientProxy; import clothingcraft.core.ClothingCraftInfo; import net.minecraft.item.ItemHoe; /** * Item sword made of Halite Blocks - * + * * @author JujuAwesomeBeans * @author NinjaSoldier40 * @since 02/10/2017 10:15 PM (-7:00 GMT) */ public class ItemHaliteHoe extends ItemHoe { - /** - * Creates a new instance of Rock Salt - */ - public ItemHaliteHoe() { - super(ToolMaterial.STONE); - setMaxDamage(2); - setMaxStackSize(1); - setUnlocalizedName("halite_hoe"); - setTextureName(ClothingCraftInfo.MODID + ":halite_hoe"); - setCreativeTab(ClothingCraft.tabCore); - } + /** + * Creates a new instance of Rock Salt + */ + public ItemHaliteHoe() { + super(ToolMaterial.STONE); + setMaxDamage(2); + setMaxStackSize(1); + setUnlocalizedName("halite_hoe"); + setTextureName(ClothingCraftInfo.MODID + ":halite_hoe"); + setCreativeTab(ClientProxy.tabCore); + } } diff --git a/src/main/java/clothingcraft/items/ItemHaliteIngot.java b/src/main/java/clothingcraft/items/ItemHaliteIngot.java index cb2d950..db5b692 100644 --- a/src/main/java/clothingcraft/items/ItemHaliteIngot.java +++ b/src/main/java/clothingcraft/items/ItemHaliteIngot.java @@ -1,30 +1,30 @@ /** - * + * */ package clothingcraft.items; -import clothingcraft.core.ClothingCraft; +import clothingcraft.client.ClientProxy; import clothingcraft.core.ClothingCraftInfo; import net.minecraft.item.Item; /** * List of blocks and their registrations into the world - * + * * @author JujuAwesomeBeans * @author NinjaSoldier40 * @since 02/17/2017 02:47 AM (-7:00 GMT) */ public class ItemHaliteIngot extends Item { - /** - * Creates a new instance of Rock Salt - */ - public ItemHaliteIngot() { - super(); - this.setMaxStackSize(64); - this.setUnlocalizedName("halite_ingot"); - this.setCreativeTab(ClothingCraft.tabCore); - this.setTextureName(ClothingCraftInfo.MODID + ":halite_ingot"); - } + /** + * Creates a new instance of Rock Salt + */ + public ItemHaliteIngot() { + super(); + this.setMaxStackSize(64); + this.setUnlocalizedName("halite_ingot"); + this.setCreativeTab(ClientProxy.tabCore); + this.setTextureName(ClothingCraftInfo.MODID + ":halite_ingot"); + } } diff --git a/src/main/java/clothingcraft/items/ItemHalitePickaxe.java b/src/main/java/clothingcraft/items/ItemHalitePickaxe.java index 5fc17d8..7dc6bbc 100644 --- a/src/main/java/clothingcraft/items/ItemHalitePickaxe.java +++ b/src/main/java/clothingcraft/items/ItemHalitePickaxe.java @@ -1,31 +1,31 @@ /** - * + * */ package clothingcraft.items; -import clothingcraft.core.ClothingCraft; +import clothingcraft.client.ClientProxy; import clothingcraft.core.ClothingCraftInfo; import net.minecraft.item.ItemPickaxe; /** * Item sword made of Halite Blocks - * + * * @author JujuAwesomeBeans * @author NinjaSoldier40 * @since 02/10/2017 08:05 PM (-7:00 GMT) */ public class ItemHalitePickaxe extends ItemPickaxe { - /** - * Creates a new instance of Rock Salt - */ - public ItemHalitePickaxe() { - super(ToolMaterial.STONE); - setMaxDamage(2); - setMaxStackSize(1); - setUnlocalizedName("halite_pickaxe"); - setTextureName(ClothingCraftInfo.MODID + ":halite_pickaxe"); - setCreativeTab(ClothingCraft.tabCore); - } + /** + * Creates a new instance of Rock Salt + */ + public ItemHalitePickaxe() { + super(ToolMaterial.STONE); + setMaxDamage(2); + setMaxStackSize(1); + setUnlocalizedName("halite_pickaxe"); + setTextureName(ClothingCraftInfo.MODID + ":halite_pickaxe"); + setCreativeTab(ClientProxy.tabCore); + } } diff --git a/src/main/java/clothingcraft/items/ItemHaliteShovel.java b/src/main/java/clothingcraft/items/ItemHaliteShovel.java index 9b6c0b6..be64c9f 100644 --- a/src/main/java/clothingcraft/items/ItemHaliteShovel.java +++ b/src/main/java/clothingcraft/items/ItemHaliteShovel.java @@ -1,31 +1,31 @@ /** - * + * */ package clothingcraft.items; -import clothingcraft.core.ClothingCraft; +import clothingcraft.client.ClientProxy; import clothingcraft.core.ClothingCraftInfo; import net.minecraft.item.ItemSpade; /** * Item shovel made of Halite Blocks - * + * * @author JujuAwesomeBeans * @author NinjaSoldier40 * @since 02/10/2017 10:02 PM (-7:00 GMT) */ public class ItemHaliteShovel extends ItemSpade { - /** - * Creates a new instance of Rock Salt - */ - public ItemHaliteShovel() { - super(ToolMaterial.STONE); - setMaxDamage(2); - setMaxStackSize(1); - setUnlocalizedName("halite_shovel"); - setTextureName(ClothingCraftInfo.MODID + ":halite_shovel"); - setCreativeTab(ClothingCraft.tabCore); - } + /** + * Creates a new instance of Rock Salt + */ + public ItemHaliteShovel() { + super(ToolMaterial.STONE); + setMaxDamage(2); + setMaxStackSize(1); + setUnlocalizedName("halite_shovel"); + setTextureName(ClothingCraftInfo.MODID + ":halite_shovel"); + setCreativeTab(ClientProxy.tabCore); + } } diff --git a/src/main/java/clothingcraft/items/ItemHaliteSword.java b/src/main/java/clothingcraft/items/ItemHaliteSword.java index feb5316..32ed95b 100644 --- a/src/main/java/clothingcraft/items/ItemHaliteSword.java +++ b/src/main/java/clothingcraft/items/ItemHaliteSword.java @@ -1,31 +1,31 @@ /** - * + * */ package clothingcraft.items; -import clothingcraft.core.ClothingCraft; +import clothingcraft.client.ClientProxy; import clothingcraft.core.ClothingCraftInfo; import net.minecraft.item.ItemSword; /** * Item sword made of Halite Blocks - * + * * @author JujuAwesomeBeans * @author NinjaSoldier40 * @since 02/10/2017 08:05 PM (-7:00 GMT) */ public class ItemHaliteSword extends ItemSword { - /** - * Creates a new instance of Rock Salt - */ - public ItemHaliteSword() { - super(ToolMaterial.STONE); - setMaxDamage(2); - setMaxStackSize(1); - setUnlocalizedName("halite_sword"); - setTextureName(ClothingCraftInfo.MODID + ":halite_sword"); - setCreativeTab(ClothingCraft.tabCore); - } + /** + * Creates a new instance of Rock Salt + */ + public ItemHaliteSword() { + super(ToolMaterial.STONE); + setMaxDamage(2); + setMaxStackSize(1); + setUnlocalizedName("halite_sword"); + setTextureName(ClothingCraftInfo.MODID + ":halite_sword"); + setCreativeTab(ClientProxy.tabCore); + } } diff --git a/src/main/java/clothingcraft/items/ItemPattern.java b/src/main/java/clothingcraft/items/ItemPattern.java index 55fdb7d..3d11b8f 100644 --- a/src/main/java/clothingcraft/items/ItemPattern.java +++ b/src/main/java/clothingcraft/items/ItemPattern.java @@ -1,6 +1,6 @@ package clothingcraft.items; -import clothingcraft.core.ClothingCraft; +import clothingcraft.client.ClientProxy; import clothingcraft.core.ClothingCraftInfo; import net.minecraft.block.Block; import net.minecraft.entity.EntityLivingBase; @@ -9,68 +9,66 @@ import net.minecraft.world.World; public class ItemPattern extends Item { - private Block[] blocksEffectiveAgainst = new Block[] { + protected float efficiencyOnProperMaterial; + // harvest level + int harvest = 1; + private Block[] blocksEffectiveAgainst = new Block[]{ - }; + }; - // harvest level - int harvest = 1; + protected ItemPattern(String unlocalizedName) { + efficiencyOnProperMaterial = 4; + setMaxDamage(100); + setMaxStackSize(1); + setUnlocalizedName(unlocalizedName); + setTextureName(ClothingCraftInfo.MODID + ":" + unlocalizedName); + setCreativeTab(ClientProxy.tabTools); + } - protected float efficiencyOnProperMaterial; + /** + * Returns the strength of the stack against a given block. 1.0F base, + * (Quality+1)*2 if correct blocktype, 1.5F if sword + */ + public float func_150893_a(ItemStack par1ItemStack, Block par2Block) { + for (int i = 0; i < blocksEffectiveAgainst.length; i++) { + if (blocksEffectiveAgainst[i] == par2Block) { + return efficiencyOnProperMaterial; + } + } - protected ItemPattern(String unlocalizedName) { - efficiencyOnProperMaterial = 4; - setMaxDamage(100); - setMaxStackSize(1); - setUnlocalizedName(unlocalizedName); - setTextureName(ClothingCraftInfo.MODID + ":" + unlocalizedName); - setCreativeTab(ClothingCraft.tabTools); - } + return 0.0F; + } - /** - * Returns the strength of the stack against a given block. 1.0F base, - * (Quality+1)*2 if correct blocktype, 1.5F if sword - */ - public float func_150893_a(ItemStack par1ItemStack, Block par2Block) { - for (int i = 0; i < blocksEffectiveAgainst.length; i++) { - if (blocksEffectiveAgainst[i] == par2Block) { - return efficiencyOnProperMaterial; - } - } + /** + * Current implementations of this method in child classes do not use + * the entry argument beside ev. They just raise the damage on the + * stack. + */ + public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLiving, + EntityLivingBase par3EntityLiving) { + par1ItemStack.damageItem(2, par3EntityLiving); + return true; + } - return 0.0F; - } + public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3, int par4, int par5, + int par6, EntityLivingBase par7EntityLiving) { + par1ItemStack.damageItem(1, par7EntityLiving); + return true; + } - /** - * Current implementations of this method in child classes do not use - * the entry argument beside ev. They just raise the damage on the - * stack. - */ - public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLiving, - EntityLivingBase par3EntityLiving) { - par1ItemStack.damageItem(2, par3EntityLiving); - return true; - } + /** + * Returns True is the item is renderer in full 3D when hold. + */ + public boolean isFull3D() { + return true; + } - public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3, int par4, int par5, - int par6, EntityLivingBase par7EntityLiving) { - par1ItemStack.damageItem(1, par7EntityLiving); - return true; - } + /** + * Return the enchantability factor of the item, most of the time is + * based on material. + */ + public int getItemEnchantability() { + return 2; + } - /** - * Returns True is the item is renderer in full 3D when hold. - */ - public boolean isFull3D() { - return true; - } - - /** - * Return the enchantability factor of the item, most of the time is - * based on material. - */ - public int getItemEnchantability() { - return 2; - } - - } \ No newline at end of file +} \ No newline at end of file diff --git a/src/main/java/clothingcraft/items/ItemRockSalt.java b/src/main/java/clothingcraft/items/ItemRockSalt.java index 05535f6..18637b6 100644 --- a/src/main/java/clothingcraft/items/ItemRockSalt.java +++ b/src/main/java/clothingcraft/items/ItemRockSalt.java @@ -1,30 +1,30 @@ /** - * + * */ package clothingcraft.items; -import clothingcraft.core.ClothingCraft; +import clothingcraft.client.ClientProxy; import clothingcraft.core.ClothingCraftInfo; import net.minecraft.item.Item; /** * List of blocks and their registrations into the world - * + * * @author JujuAwesomeBeans * @author NinjaSoldier40 * @since 02/10/2017 06:05 AM (-7:00 GMT) */ public class ItemRockSalt extends Item { - /** - * Creates a new instance of Rock Salt - */ - public ItemRockSalt() { - super(); - this.setMaxStackSize(64); - this.setUnlocalizedName("rock_salt"); - this.setCreativeTab(ClothingCraft.tabCore); - this.setTextureName(ClothingCraftInfo.MODID + ":rock_salt"); - } + /** + * Creates a new instance of Rock Salt + */ + public ItemRockSalt() { + super(); + this.setMaxStackSize(64); + this.setUnlocalizedName("rock_salt"); + this.setCreativeTab(ClientProxy.tabCore); + this.setTextureName(ClothingCraftInfo.MODID + ":rock_salt"); + } } diff --git a/src/main/java/clothingcraft/items/ItemToolKnittingNeedles.java b/src/main/java/clothingcraft/items/ItemToolKnittingNeedles.java index 4925a4e..64094ed 100644 --- a/src/main/java/clothingcraft/items/ItemToolKnittingNeedles.java +++ b/src/main/java/clothingcraft/items/ItemToolKnittingNeedles.java @@ -1,6 +1,6 @@ package clothingcraft.items; -import clothingcraft.core.ClothingCraft; +import clothingcraft.client.ClientProxy; import clothingcraft.core.ClothingCraftInfo; import net.minecraft.block.Block; import net.minecraft.entity.EntityLivingBase; @@ -9,66 +9,64 @@ import net.minecraft.world.World; public class ItemToolKnittingNeedles extends Item { - private Block[] blocksEffectiveAgainst = new Block[] { + protected float efficiencyOnProperMaterial; + // harvest level + int harvest = 1; + private Block[] blocksEffectiveAgainst = new Block[]{ - }; + }; - // harvest level - int harvest = 1; + protected ItemToolKnittingNeedles() { + efficiencyOnProperMaterial = 6; + setMaxDamage(100); + setMaxStackSize(1); + setUnlocalizedName("tools_knitting_needles"); + setTextureName(ClothingCraftInfo.MODID + ":tools_knitting_needles"); + setCreativeTab(ClientProxy.tabTools); + } - protected float efficiencyOnProperMaterial; + /** + * Returns the strength of the stack against a given block. 1.0F base, + * (Quality+1)*2 if correct blocktype, 1.5F if sword + */ + public float func_150893_a(ItemStack par1ItemStack, Block par2Block) { + for (int i = 0; i < blocksEffectiveAgainst.length; i++) { + if (blocksEffectiveAgainst[i] == par2Block) { + return efficiencyOnProperMaterial; + } + } - protected ItemToolKnittingNeedles() { - efficiencyOnProperMaterial = 6; - setMaxDamage(100); - setMaxStackSize(1); - setUnlocalizedName("tools_knitting_needles"); - setTextureName(ClothingCraftInfo.MODID + ":tools_knitting_needles"); - setCreativeTab(ClothingCraft.tabTools); - } + return 0.0F; + } - /** - * Returns the strength of the stack against a given block. 1.0F base, - * (Quality+1)*2 if correct blocktype, 1.5F if sword - */ - public float func_150893_a(ItemStack par1ItemStack, Block par2Block) { - for (int i = 0; i < blocksEffectiveAgainst.length; i++) { - if (blocksEffectiveAgainst[i] == par2Block) { - return efficiencyOnProperMaterial; - } - } + /** + * Current implementations of this method in child classes do not use the + * entry argument beside ev. They just raise the damage on the stack. + */ + public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLiving, + EntityLivingBase par3EntityLiving) { + par1ItemStack.damageItem(2, par3EntityLiving); + return true; + } - return 0.0F; - } + public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3, int par4, int par5, int par6, + EntityLivingBase par7EntityLiving) { + par1ItemStack.damageItem(1, par7EntityLiving); + return true; + } - /** - * Current implementations of this method in child classes do not use the - * entry argument beside ev. They just raise the damage on the stack. - */ - public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLiving, - EntityLivingBase par3EntityLiving) { - par1ItemStack.damageItem(2, par3EntityLiving); - return true; - } + /** + * Returns True is the item is renderer in full 3D when hold. + */ + public boolean isFull3D() { + return true; + } - public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3, int par4, int par5, int par6, - EntityLivingBase par7EntityLiving) { - par1ItemStack.damageItem(1, par7EntityLiving); - return true; - } - - /** - * Returns True is the item is renderer in full 3D when hold. - */ - public boolean isFull3D() { - return true; - } - - /** - * Return the enchantability factor of the item, most of the time is based - * on material. - */ - public int getItemEnchantability() { - return 2; - } + /** + * Return the enchantability factor of the item, most of the time is based + * on material. + */ + public int getItemEnchantability() { + return 2; + } } \ No newline at end of file diff --git a/src/main/java/clothingcraft/items/ItemToolMeasuringTape.java b/src/main/java/clothingcraft/items/ItemToolMeasuringTape.java index 5308a34..d05667a 100644 --- a/src/main/java/clothingcraft/items/ItemToolMeasuringTape.java +++ b/src/main/java/clothingcraft/items/ItemToolMeasuringTape.java @@ -1,6 +1,6 @@ package clothingcraft.items; -import clothingcraft.core.ClothingCraft; +import clothingcraft.client.ClientProxy; import clothingcraft.core.ClothingCraftInfo; import net.minecraft.block.Block; import net.minecraft.entity.EntityLivingBase; @@ -9,66 +9,64 @@ import net.minecraft.world.World; public class ItemToolMeasuringTape extends Item { - private Block[] blocksEffectiveAgainst = new Block[] { + protected float efficiencyOnProperMaterial; + // harvest level + int harvest = 1; + private Block[] blocksEffectiveAgainst = new Block[]{ - }; + }; - // harvest level - int harvest = 1; + protected ItemToolMeasuringTape() { + efficiencyOnProperMaterial = 6; + setMaxDamage(100); + setMaxStackSize(1); + setUnlocalizedName("tools_measuring_tape"); + setTextureName(ClothingCraftInfo.MODID + ":tools_measuring_tape"); + setCreativeTab(ClientProxy.tabTools); + } - protected float efficiencyOnProperMaterial; + /** + * Returns the strength of the stack against a given block. 1.0F base, + * (Quality+1)*2 if correct blocktype, 1.5F if sword + */ + public float func_150893_a(ItemStack par1ItemStack, Block par2Block) { + for (int i = 0; i < blocksEffectiveAgainst.length; i++) { + if (blocksEffectiveAgainst[i] == par2Block) { + return efficiencyOnProperMaterial; + } + } - protected ItemToolMeasuringTape() { - efficiencyOnProperMaterial = 6; - setMaxDamage(100); - setMaxStackSize(1); - setUnlocalizedName("tools_measuring_tape"); - setTextureName(ClothingCraftInfo.MODID + ":tools_measuring_tape"); - setCreativeTab(ClothingCraft.tabTools); - } + return 0.0F; + } - /** - * Returns the strength of the stack against a given block. 1.0F base, - * (Quality+1)*2 if correct blocktype, 1.5F if sword - */ - public float func_150893_a(ItemStack par1ItemStack, Block par2Block) { - for (int i = 0; i < blocksEffectiveAgainst.length; i++) { - if (blocksEffectiveAgainst[i] == par2Block) { - return efficiencyOnProperMaterial; - } - } + /** + * Current implementations of this method in child classes do not use the + * entry argument beside ev. They just raise the damage on the stack. + */ + public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLiving, + EntityLivingBase par3EntityLiving) { + par1ItemStack.damageItem(2, par3EntityLiving); + return true; + } - return 0.0F; - } + public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3, int par4, int par5, int par6, + EntityLivingBase par7EntityLiving) { + par1ItemStack.damageItem(1, par7EntityLiving); + return true; + } - /** - * Current implementations of this method in child classes do not use the - * entry argument beside ev. They just raise the damage on the stack. - */ - public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLiving, - EntityLivingBase par3EntityLiving) { - par1ItemStack.damageItem(2, par3EntityLiving); - return true; - } + /** + * Returns True is the item is renderer in full 3D when hold. + */ + public boolean isFull3D() { + return true; + } - public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3, int par4, int par5, int par6, - EntityLivingBase par7EntityLiving) { - par1ItemStack.damageItem(1, par7EntityLiving); - return true; - } - - /** - * Returns True is the item is renderer in full 3D when hold. - */ - public boolean isFull3D() { - return true; - } - - /** - * Return the enchantability factor of the item, most of the time is based - * on material. - */ - public int getItemEnchantability() { - return 2; - } + /** + * Return the enchantability factor of the item, most of the time is based + * on material. + */ + public int getItemEnchantability() { + return 2; + } } \ No newline at end of file diff --git a/src/main/java/clothingcraft/items/ItemToolNeedleAndThread.java b/src/main/java/clothingcraft/items/ItemToolNeedleAndThread.java index 6b8a1b0..ec4bc50 100644 --- a/src/main/java/clothingcraft/items/ItemToolNeedleAndThread.java +++ b/src/main/java/clothingcraft/items/ItemToolNeedleAndThread.java @@ -1,6 +1,6 @@ package clothingcraft.items; -import clothingcraft.core.ClothingCraft; +import clothingcraft.client.ClientProxy; import clothingcraft.core.ClothingCraftInfo; import net.minecraft.block.Block; import net.minecraft.entity.EntityLivingBase; @@ -9,66 +9,64 @@ import net.minecraft.world.World; public class ItemToolNeedleAndThread extends Item { - private Block[] blocksEffectiveAgainst = new Block[] { + protected float efficiencyOnProperMaterial; + // harvest level + int harvest = 1; + private Block[] blocksEffectiveAgainst = new Block[]{ - }; + }; - // harvest level - int harvest = 1; + protected ItemToolNeedleAndThread() { + efficiencyOnProperMaterial = 6; + setMaxDamage(100); + setMaxStackSize(1); + setUnlocalizedName("tools_needle_thread"); + setTextureName(ClothingCraftInfo.MODID + ":tools_needle_thread"); + setCreativeTab(ClientProxy.tabTools); + } - protected float efficiencyOnProperMaterial; + /** + * Returns the strength of the stack against a given block. 1.0F base, + * (Quality+1)*2 if correct blocktype, 1.5F if sword + */ + public float func_150893_a(ItemStack par1ItemStack, Block par2Block) { + for (int i = 0; i < blocksEffectiveAgainst.length; i++) { + if (blocksEffectiveAgainst[i] == par2Block) { + return efficiencyOnProperMaterial; + } + } - protected ItemToolNeedleAndThread() { - efficiencyOnProperMaterial = 6; - setMaxDamage(100); - setMaxStackSize(1); - setUnlocalizedName("tools_needle_thread"); - setTextureName(ClothingCraftInfo.MODID + ":tools_needle_thread"); - setCreativeTab(ClothingCraft.tabTools); - } + return 0.0F; + } - /** - * Returns the strength of the stack against a given block. 1.0F base, - * (Quality+1)*2 if correct blocktype, 1.5F if sword - */ - public float func_150893_a(ItemStack par1ItemStack, Block par2Block) { - for (int i = 0; i < blocksEffectiveAgainst.length; i++) { - if (blocksEffectiveAgainst[i] == par2Block) { - return efficiencyOnProperMaterial; - } - } + /** + * Current implementations of this method in child classes do not use the + * entry argument beside ev. They just raise the damage on the stack. + */ + public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLiving, + EntityLivingBase par3EntityLiving) { + par1ItemStack.damageItem(2, par3EntityLiving); + return true; + } - return 0.0F; - } + public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3, int par4, int par5, int par6, + EntityLivingBase par7EntityLiving) { + par1ItemStack.damageItem(1, par7EntityLiving); + return true; + } - /** - * Current implementations of this method in child classes do not use the - * entry argument beside ev. They just raise the damage on the stack. - */ - public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLiving, - EntityLivingBase par3EntityLiving) { - par1ItemStack.damageItem(2, par3EntityLiving); - return true; - } + /** + * Returns True is the item is renderer in full 3D when hold. + */ + public boolean isFull3D() { + return true; + } - public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3, int par4, int par5, int par6, - EntityLivingBase par7EntityLiving) { - par1ItemStack.damageItem(1, par7EntityLiving); - return true; - } - - /** - * Returns True is the item is renderer in full 3D when hold. - */ - public boolean isFull3D() { - return true; - } - - /** - * Return the enchantability factor of the item, most of the time is based - * on material. - */ - public int getItemEnchantability() { - return 2; - } + /** + * Return the enchantability factor of the item, most of the time is based + * on material. + */ + public int getItemEnchantability() { + return 2; + } } \ No newline at end of file diff --git a/src/main/java/clothingcraft/items/ItemToolPincushion.java b/src/main/java/clothingcraft/items/ItemToolPincushion.java index df17b68..7c62c1a 100644 --- a/src/main/java/clothingcraft/items/ItemToolPincushion.java +++ b/src/main/java/clothingcraft/items/ItemToolPincushion.java @@ -1,6 +1,6 @@ package clothingcraft.items; -import clothingcraft.core.ClothingCraft; +import clothingcraft.client.ClientProxy; import clothingcraft.core.ClothingCraftInfo; import net.minecraft.block.Block; import net.minecraft.entity.EntityLivingBase; @@ -9,66 +9,64 @@ import net.minecraft.world.World; public class ItemToolPincushion extends Item { - private Block[] blocksEffectiveAgainst = new Block[] { + protected float efficiencyOnProperMaterial; + // harvest level + int harvest = 1; + private Block[] blocksEffectiveAgainst = new Block[]{ - }; + }; - // harvest level - int harvest = 1; + protected ItemToolPincushion() { + efficiencyOnProperMaterial = 6; + setMaxDamage(100); + setMaxStackSize(1); + setUnlocalizedName("tools_pincushion"); + setTextureName(ClothingCraftInfo.MODID + ":tools_pincushion"); + setCreativeTab(ClientProxy.tabTools); + } - protected float efficiencyOnProperMaterial; + /** + * Returns the strength of the stack against a given block. 1.0F base, + * (Quality+1)*2 if correct blocktype, 1.5F if sword + */ + public float func_150893_a(ItemStack par1ItemStack, Block par2Block) { + for (int i = 0; i < blocksEffectiveAgainst.length; i++) { + if (blocksEffectiveAgainst[i] == par2Block) { + return efficiencyOnProperMaterial; + } + } - protected ItemToolPincushion() { - efficiencyOnProperMaterial = 6; - setMaxDamage(100); - setMaxStackSize(1); - setUnlocalizedName("tools_pincushion"); - setTextureName(ClothingCraftInfo.MODID + ":tools_pincushion"); - setCreativeTab(ClothingCraft.tabTools); - } + return 0.0F; + } - /** - * Returns the strength of the stack against a given block. 1.0F base, - * (Quality+1)*2 if correct blocktype, 1.5F if sword - */ - public float func_150893_a(ItemStack par1ItemStack, Block par2Block) { - for (int i = 0; i < blocksEffectiveAgainst.length; i++) { - if (blocksEffectiveAgainst[i] == par2Block) { - return efficiencyOnProperMaterial; - } - } + /** + * Current implementations of this method in child classes do not use the + * entry argument beside ev. They just raise the damage on the stack. + */ + public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLiving, + EntityLivingBase par3EntityLiving) { + par1ItemStack.damageItem(2, par3EntityLiving); + return true; + } - return 0.0F; - } + public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3, int par4, int par5, int par6, + EntityLivingBase par7EntityLiving) { + par1ItemStack.damageItem(1, par7EntityLiving); + return true; + } - /** - * Current implementations of this method in child classes do not use the - * entry argument beside ev. They just raise the damage on the stack. - */ - public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLiving, - EntityLivingBase par3EntityLiving) { - par1ItemStack.damageItem(2, par3EntityLiving); - return true; - } + /** + * Returns True is the item is renderer in full 3D when hold. + */ + public boolean isFull3D() { + return true; + } - public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3, int par4, int par5, int par6, - EntityLivingBase par7EntityLiving) { - par1ItemStack.damageItem(1, par7EntityLiving); - return true; - } - - /** - * Returns True is the item is renderer in full 3D when hold. - */ - public boolean isFull3D() { - return true; - } - - /** - * Return the enchantability factor of the item, most of the time is based - * on material. - */ - public int getItemEnchantability() { - return 2; - } + /** + * Return the enchantability factor of the item, most of the time is based + * on material. + */ + public int getItemEnchantability() { + return 2; + } } \ No newline at end of file diff --git a/src/main/java/clothingcraft/items/ItemToolScissors.java b/src/main/java/clothingcraft/items/ItemToolScissors.java index eccea28..6417c38 100644 --- a/src/main/java/clothingcraft/items/ItemToolScissors.java +++ b/src/main/java/clothingcraft/items/ItemToolScissors.java @@ -1,6 +1,6 @@ package clothingcraft.items; -import clothingcraft.core.ClothingCraft; +import clothingcraft.client.ClientProxy; import clothingcraft.core.ClothingCraftInfo; import net.minecraft.block.Block; import net.minecraft.entity.EntityLivingBase; @@ -9,66 +9,64 @@ import net.minecraft.world.World; public class ItemToolScissors extends ItemShears { - private Block[] blocksEffectiveAgainst = new Block[] { + protected float efficiencyOnProperMaterial; + // harvest level + int harvest = 1; + private Block[] blocksEffectiveAgainst = new Block[]{ - }; + }; - // harvest level - int harvest = 1; + protected ItemToolScissors() { + efficiencyOnProperMaterial = 6; + setMaxDamage(100); + setMaxStackSize(1); + setUnlocalizedName("tools_scissors"); + setTextureName(ClothingCraftInfo.MODID + ":tools_scissors"); + setCreativeTab(ClientProxy.tabTools); + } - protected float efficiencyOnProperMaterial; + /** + * Returns the strength of the stack against a given block. 1.0F base, + * (Quality+1)*2 if correct blocktype, 1.5F if sword + */ + public float func_150893_a(ItemStack par1ItemStack, Block par2Block) { + for (int i = 0; i < blocksEffectiveAgainst.length; i++) { + if (blocksEffectiveAgainst[i] == par2Block) { + return efficiencyOnProperMaterial; + } + } - protected ItemToolScissors() { - efficiencyOnProperMaterial = 6; - setMaxDamage(100); - setMaxStackSize(1); - setUnlocalizedName("tools_scissors"); - setTextureName(ClothingCraftInfo.MODID + ":tools_scissors"); - setCreativeTab(ClothingCraft.tabTools); - } + return 0.0F; + } - /** - * Returns the strength of the stack against a given block. 1.0F base, - * (Quality+1)*2 if correct blocktype, 1.5F if sword - */ - public float func_150893_a(ItemStack par1ItemStack, Block par2Block) { - for (int i = 0; i < blocksEffectiveAgainst.length; i++) { - if (blocksEffectiveAgainst[i] == par2Block) { - return efficiencyOnProperMaterial; - } - } + /** + * Current implementations of this method in child classes do not use the + * entry argument beside ev. They just raise the damage on the stack. + */ + public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLiving, + EntityLivingBase par3EntityLiving) { + par1ItemStack.damageItem(2, par3EntityLiving); + return true; + } - return 0.0F; - } + public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3, int par4, int par5, int par6, + EntityLivingBase par7EntityLiving) { + par1ItemStack.damageItem(1, par7EntityLiving); + return true; + } - /** - * Current implementations of this method in child classes do not use the - * entry argument beside ev. They just raise the damage on the stack. - */ - public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLiving, - EntityLivingBase par3EntityLiving) { - par1ItemStack.damageItem(2, par3EntityLiving); - return true; - } + /** + * Returns True is the item is renderer in full 3D when hold. + */ + public boolean isFull3D() { + return true; + } - public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3, int par4, int par5, int par6, - EntityLivingBase par7EntityLiving) { - par1ItemStack.damageItem(1, par7EntityLiving); - return true; - } - - /** - * Returns True is the item is renderer in full 3D when hold. - */ - public boolean isFull3D() { - return true; - } - - /** - * Return the enchantability factor of the item, most of the time is based - * on material. - */ - public int getItemEnchantability() { - return 2; - } + /** + * Return the enchantability factor of the item, most of the time is based + * on material. + */ + public int getItemEnchantability() { + return 2; + } } \ No newline at end of file diff --git a/src/main/java/clothingcraft/items/ItemWardrobeArmor.java b/src/main/java/clothingcraft/items/ItemWardrobeArmor.java index 94796b4..c06383b 100644 --- a/src/main/java/clothingcraft/items/ItemWardrobeArmor.java +++ b/src/main/java/clothingcraft/items/ItemWardrobeArmor.java @@ -1,6 +1,6 @@ package clothingcraft.items; -import clothingcraft.core.ClothingCraft; +import clothingcraft.client.ClientProxy; import clothingcraft.core.ClothingCraftInfo; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -10,78 +10,75 @@ import net.minecraft.item.ItemStack; /** - * - * * @author JujuAwesomeBeans * @author NinjaSoldier40 * @since 02/12/2017 08:58 PM (-07:00 GMT) */ public class ItemWardrobeArmor extends ItemArmor { - - public static final int HEAD = 0; - public static final int BODY = 1; - public static final int LEGS = 2; - public static final int FEET = 3; - - private String textureName; - private String itemTextureName; - - /** - * Convenience method that calls more complex on with simpler arguments set. - * @param unlocalizedName - * @param material - * @param renderIndex - * @param armorType - */ - public ItemWardrobeArmor(String unlocalizedName, ArmorMaterial material, int renderIndex, int armorType) { - this(unlocalizedName, unlocalizedName, unlocalizedName, material, renderIndex, armorType); - } - - /** - * - * @param unlocalizedName - * @param itemTextureName - * @param armorTextureName - * @param material - * @param renderIndex 0 = cloth, 1 = chain, 2 = iron, 3 = diamond, 4 = gold, [new ItemArmor.ArmorMaterial] - * @param armorType - */ - public ItemWardrobeArmor( - String unlocalizedName, String itemTextureName, String armorTextureName, - ArmorMaterial material, int renderIndex, int armorType - ) { - super(material, renderIndex, armorType); - this.textureName = armorTextureName; - this.itemTextureName = itemTextureName; - this.setUnlocalizedName("wardrobe_" + unlocalizedName + getTextureSuffix(armorType)); - this.setCreativeTab(ClothingCraft.tabWardrobe); - } - - @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) - { - return ClothingCraftInfo.MODID + ":textures/models/wardrobe/" + this.textureName + "_layer_" + (this.armorType == 2 ? "2" : "1") + ".png"; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister){ - this.itemIcon = iconRegister.registerIcon(String.format("%s%s", ClothingCraftInfo.MODID + ":wardrobe_", this.itemTextureName + getTextureSuffix(armorType))); - } - - public static String getTextureSuffix(int armorType) { - switch (armorType) { - case HEAD: - return "_helm"; - case BODY: - return "_body"; - case LEGS: - return "_pants"; - case FEET: - return "_shoes"; - default: - return ""; - } - } + + public static final int HEAD = 0; + public static final int BODY = 1; + public static final int LEGS = 2; + public static final int FEET = 3; + + private String textureName; + private String itemTextureName; + + /** + * Convenience method that calls more complex on with simpler arguments set. + * + * @param unlocalizedName + * @param material + * @param renderIndex + * @param armorType + */ + public ItemWardrobeArmor(String unlocalizedName, ArmorMaterial material, int renderIndex, int armorType) { + this(unlocalizedName, unlocalizedName, unlocalizedName, material, renderIndex, armorType); + } + + /** + * @param unlocalizedName + * @param itemTextureName + * @param armorTextureName + * @param material + * @param renderIndex 0 = cloth, 1 = chain, 2 = iron, 3 = diamond, 4 = gold, [new ItemArmor.ArmorMaterial] + * @param armorType + */ + public ItemWardrobeArmor( + String unlocalizedName, String itemTextureName, String armorTextureName, + ArmorMaterial material, int renderIndex, int armorType + ) { + super(material, renderIndex, armorType); + this.textureName = armorTextureName; + this.itemTextureName = itemTextureName; + this.setUnlocalizedName("wardrobe_" + unlocalizedName + getTextureSuffix(armorType)); + this.setCreativeTab(ClientProxy.tabWardrobe); + } + + public static String getTextureSuffix(int armorType) { + switch (armorType) { + case HEAD: + return "_helm"; + case BODY: + return "_body"; + case LEGS: + return "_pants"; + case FEET: + return "_shoes"; + default: + return ""; + } + } + + @Override + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { + return ClothingCraftInfo.MODID + ":textures/models/wardrobe/" + this.textureName + "_layer_" + (this.armorType == 2 ? "2" : "1") + ".png"; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconRegister) { + this.itemIcon = iconRegister.registerIcon(String.format("%s%s", ClothingCraftInfo.MODID + ":wardrobe_", this.itemTextureName + getTextureSuffix(armorType))); + } } diff --git a/src/main/java/clothingcraft/items/RecipeItemSeeds.java b/src/main/java/clothingcraft/items/RecipeItemSeeds.java index 56bc331..9f6e96b 100644 --- a/src/main/java/clothingcraft/items/RecipeItemSeeds.java +++ b/src/main/java/clothingcraft/items/RecipeItemSeeds.java @@ -10,79 +10,65 @@ import net.minecraftforge.common.IPlantable; import net.minecraftforge.common.util.ForgeDirection; -public class RecipeItemSeeds extends ItemSeeds implements IPlantable -{ +public class RecipeItemSeeds extends ItemSeeds implements IPlantable { private final Block theBlockPlant; - + /** * Block ID of the soil this seed should be planted on. */ private final Block soilId; - public RecipeItemSeeds( - Block parBlockPlant, Block parSoilBlock) - { + public RecipeItemSeeds( + Block parBlockPlant, Block parSoilBlock) { super(parBlockPlant, parSoilBlock); theBlockPlant = parBlockPlant; soilId = parSoilBlock; } @Override - public boolean onItemUse(ItemStack parItemStack, EntityPlayer parPlayer, - World parWorld, int parX, int parY, int parZ, int par7, float par8, - float par9, float par10) - { - // not sure what this parameter does, copied it from potato - if (par7 != 1) - { + public boolean onItemUse(ItemStack parItemStack, EntityPlayer parPlayer, + World parWorld, int parX, int parY, int parZ, int par7, float par8, + float par9, float par10) { + // not sure what this parameter does, copied it from potato + if (par7 != 1) { return false; } // check if player has capability to edit - else if (parPlayer.canPlayerEdit(parX, parY+1, parZ, par7, parItemStack)) - { + else if (parPlayer.canPlayerEdit(parX, parY + 1, parZ, par7, parItemStack)) { // check that the soil block can sustain the plant // and that block above is air so there is room for plant to grow - if (parWorld.getBlock(parX, parY, parZ).canSustainPlant(parWorld, - parX, parY, parZ, ForgeDirection.UP, this) && parWorld - .isAirBlock(parX, parY+1, parZ)) - { - // place the plant block - parWorld.setBlock(parX, parY+1, parZ, theBlockPlant); + if (parWorld.getBlock(parX, parY, parZ).canSustainPlant(parWorld, + parX, parY, parZ, ForgeDirection.UP, this) && parWorld + .isAirBlock(parX, parY + 1, parZ)) { + // place the plant block + parWorld.setBlock(parX, parY + 1, parZ, theBlockPlant); // decrement the stack of seed items --parItemStack.stackSize; return true; - } - else - { + } else { return false; } - } - else - { + } else { return false; } } @Override - public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z) - { + public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z) { return EnumPlantType.Crop; } @Override - public Block getPlant(IBlockAccess world, int x, int y, int z) - { + public Block getPlant(IBlockAccess world, int x, int y, int z) { return theBlockPlant; } @Override - public int getPlantMetadata(IBlockAccess world, int x, int y, int z) - { + public int getPlantMetadata(IBlockAccess world, int x, int y, int z) { return 0; } - public Block getSoilId() - { + public Block getSoilId() { return soilId; } } \ No newline at end of file diff --git a/src/main/java/clothingcraft/server/ServerProxy.java b/src/main/java/clothingcraft/server/ServerProxy.java deleted file mode 100644 index 13e4b59..0000000 --- a/src/main/java/clothingcraft/server/ServerProxy.java +++ /dev/null @@ -1,25 +0,0 @@ -package clothingcraft.server; - -import clothingcraft.core.CommonProxy; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; - -public class ServerProxy extends CommonProxy { - - @Override - public void preInit(FMLPreInitializationEvent e) { - super.preInit(e); - } - - @Override - public void init(FMLInitializationEvent e) { - super.init(e); - } - - @Override - public void postInit(FMLPostInitializationEvent e) { - super.postInit(e); - } - -} \ No newline at end of file diff --git a/src/main/java/clothingcraft/util/RecipeUtil.java b/src/main/java/clothingcraft/util/RecipeUtil.java index 2fa4166..19f53a0 100644 --- a/src/main/java/clothingcraft/util/RecipeUtil.java +++ b/src/main/java/clothingcraft/util/RecipeUtil.java @@ -1,82 +1,80 @@ -/** - * - */ package clothingcraft.util; +import net.minecraft.item.Item; + import java.util.ArrayList; import java.util.Arrays; -import net.minecraft.item.Item; - /** * Makes creating and registering recipes easier for Minecraft Forge mods - * + * * @author NinjaSoldier40 * @since 02/17/2017 12:34 PM (-07:00 GMT) - * */ public class RecipeUtil { - /** - * Creates the Object[] array needed by Minecraft item/block recipes - * - * @param items array of Items needed for the standard recipe - * @return the object array properly formatted for a Minecraft recipe - */ - public static Object[] createRecipeObject(Item[] items) { - Object[] result = null; - if (items != null && items.length > 0 && items.length < 10) { - String row1 = "XXX", row2 = "XXX", row3 = "XXX"; - result = new Object[]{row1,row2,row3}; - - int iidx = 0; - for (Item item : items) { - if (item != null) { - if (iidx > -1 && iidx < 3) { - result[0] = replaceCharAt((String)result[0], iidx, Character.toChars((iidx + 48))[0]); - } else if (iidx > 2 && iidx < 6) { - result[1] = replaceCharAt((String)result[1], iidx - 3, Character.toChars((iidx + 48))[0]); - } else if (iidx > 5 && iidx < 9) { - result[2] = replaceCharAt((String)result[2], iidx - 6, Character.toChars((iidx + 48))[0]); - } - result = appendValue(result, Character.toChars((iidx + 48))[0]); - result = appendValue(result, item); - } - iidx++; - } - } - - return result; - } - - /** - * Replaces a Character at the index with the newChar value - * @param inStr String value to be changed - * @param index position of the character to be replaced - * @param newChar new character to replace at the index position - * @return the updated string with the newly replaced character - */ - private static String replaceCharAt(String inStr, int index, char newChar) { - StringBuilder newStr = new StringBuilder(inStr); - newStr.setCharAt(index, newChar); - inStr = newStr.toString(); - - return inStr; - } - - - /** - * Appends the newObj to the objArray. - * @param objArray array that object is to be added to - * @param newObj object to be added - * @return new Object array with original elements, with newObj as last element - */ - private static Object[] appendValue(Object[] objArray, Object newObj) { + /** + * Creates the Object[] array needed by Minecraft item/block recipes + * + * @param items array of Items needed for the standard recipe + * @return the object array properly formatted for a Minecraft recipe + */ + public static Object[] createRecipeObject(Item[] items) { + Object[] result = null; + if (items != null && items.length > 0 && items.length < 10) { + String row1 = "XXX", row2 = "XXX", row3 = "XXX"; + result = new Object[]{row1, row2, row3}; + + int iidx = 0; + for (Item item : items) { + if (item != null) { + if (iidx > -1 && iidx < 3) { + result[0] = replaceCharAt((String) result[0], iidx, Character.toChars((iidx + 48))[0]); + } else if (iidx > 2 && iidx < 6) { + result[1] = replaceCharAt((String) result[1], iidx - 3, Character.toChars((iidx + 48))[0]); + } else if (iidx > 5 && iidx < 9) { + result[2] = replaceCharAt((String) result[2], iidx - 6, Character.toChars((iidx + 48))[0]); + } + result = appendValue(result, Character.toChars((iidx + 48))[0]); + result = appendValue(result, item); + } + iidx++; + } + } + + return result; + } + + /** + * Replaces a Character at the index with the newChar value + * + * @param inStr String value to be changed + * @param index position of the character to be replaced + * @param newChar new character to replace at the index position + * @return the updated string with the newly replaced character + */ + private static String replaceCharAt(String inStr, int index, char newChar) { + StringBuilder newStr = new StringBuilder(inStr); + newStr.setCharAt(index, newChar); + inStr = newStr.toString(); + + return inStr; + } + + + /** + * Appends the newObj to the objArray. + * + * @param objArray array that object is to be added to + * @param newObj object to be added + * @return new Object array with original elements, with newObj as last element + */ + private static Object[] appendValue(Object[] objArray, Object newObj) { - ArrayList temp = new ArrayList(Arrays.asList(objArray)); - temp.add(newObj); - return temp.toArray(); + ArrayList temp = new ArrayList(Arrays.asList(objArray)); + temp.add(newObj); + return temp.toArray(); - } + } } diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 466172e..3d86f30 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -3,13 +3,13 @@ "modid": "ClothingCraft", "name": "JujusClothingCraft", "description": "", - "version": "2.0.0", + "version": "2.1.0", "credits": "Originally created by mod maker MCreator by JujuAwesomeBeans, then re-written for use on servers by NinjaSoldier40", "logoFile": "/logo.png", "mcversion": "1.7.10", "url": "", "updateUrl": "", - "authors": [ "JujuAwesomeBeans" , "NinjaSoldier40" ], + "authors": [ "JujuAwesomeBeans" , "NinjaSoldier40", "msifeed" ], "parent": "", "screenshots": [], "dependencies": []