diff --git a/LICENSE b/LICENSE index 0b4f47cb3..4b9ce551c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,3 @@ -ALL RIGHTS RESERVED. -This License doesn't apply for any of the APIs used as they are not mine. +ALL RIGHTS RESERVED. For more Information, check the README.md file. diff --git a/README.md b/README.md index 3010cf57e..43d0c7d31 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,6 @@ For more information, visit the main Minecraft Forum Thread at http://www.minecr ### LICENSE: All Rights Reserved - -This License doesn't apply for any of the APIs used as they are not mine. What that means? I can decide what I want to do with the License myself. diff --git a/build.gradle b/build.gradle index 861847365..49bfb6d5b 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ buildscript { apply plugin: 'forge' -version = "1.7.10-0.0.3.3" +version = "1.7.10-0.0.3.5" group = "ellpeck.actuallyadditions" archivesBaseName = "ActuallyAdditions" diff --git a/src/main/java/ellpeck/actuallyadditions/ActuallyAdditions.java b/src/main/java/ellpeck/actuallyadditions/ActuallyAdditions.java index 85f298dd2..8e05f787c 100644 --- a/src/main/java/ellpeck/actuallyadditions/ActuallyAdditions.java +++ b/src/main/java/ellpeck/actuallyadditions/ActuallyAdditions.java @@ -13,6 +13,7 @@ import ellpeck.actuallyadditions.config.ConfigurationHandler; import ellpeck.actuallyadditions.crafting.GrinderCrafting; import ellpeck.actuallyadditions.crafting.InitCrafting; import ellpeck.actuallyadditions.event.InitEvents; +import ellpeck.actuallyadditions.gen.InitVillager; import ellpeck.actuallyadditions.gen.OreGen; import ellpeck.actuallyadditions.inventory.GuiHandler; import ellpeck.actuallyadditions.items.InitItems; @@ -41,6 +42,7 @@ public class ActuallyAdditions{ InitItemMaterials.init(); InitBlocks.init(); InitItems.init(); + InitVillager.init(); proxy.preInit(); Util.logInfo("PreInitialization Finished."); diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockCompost.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockCompost.java index 946a0854e..8ddffa1be 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockCompost.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockCompost.java @@ -8,7 +8,8 @@ import ellpeck.actuallyadditions.items.ItemFertilizer; import ellpeck.actuallyadditions.items.ItemMisc; import ellpeck.actuallyadditions.items.metalists.TheMiscItems; import ellpeck.actuallyadditions.tile.TileEntityCompost; -import ellpeck.actuallyadditions.util.*; +import ellpeck.actuallyadditions.util.BlockUtil; +import ellpeck.actuallyadditions.util.INameableItem; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -21,7 +22,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; import java.util.List; @@ -152,13 +152,7 @@ public class BlockCompost extends BlockContainerBase implements INameableItem{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - if(KeyUtil.isShiftPressed()){ - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)theBlock).getName() + ".desc.1")); - //TODO Remove second info - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)theBlock).getName() + ".desc.2")); - BlockUtil.addOredictName(theBlock, list); - } - else list.add(ItemUtil.shiftForInfo()); + BlockUtil.addInformation(theBlock, list, 2, ""); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFeeder.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFeeder.java index 4d02d5de8..e135def6d 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFeeder.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFeeder.java @@ -26,10 +26,10 @@ public class BlockFeeder extends BlockContainerBase implements INameableItem{ private IIcon topIcon; public BlockFeeder(){ - super(Material.wood); - this.setHarvestLevel("axe", 0); + super(Material.rock); + this.setHarvestLevel("pickaxe", 0); this.setHardness(1.0F); - this.setStepSound(soundTypeWood); + this.setStepSound(soundTypeStone); } @Override @@ -100,7 +100,7 @@ public class BlockFeeder extends BlockContainerBase implements INameableItem{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - BlockUtil.addStandardInformation(theBlock, list); + BlockUtil.addInformation(theBlock, list, 1, ""); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFishingNet.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFishingNet.java index bde59564c..d6cd5edcd 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFishingNet.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFishingNet.java @@ -96,7 +96,7 @@ public class BlockFishingNet extends BlockContainerBase implements INameableItem @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - BlockUtil.addStandardInformation(theBlock, list); + BlockUtil.addInformation(theBlock, list, 1, ""); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceDouble.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceDouble.java index 5467c2895..0e98ffb15 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceDouble.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceDouble.java @@ -182,7 +182,7 @@ public class BlockFurnaceDouble extends BlockContainerBase implements INameableI @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - BlockUtil.addStandardInformation(theBlock, list); + BlockUtil.addInformation(theBlock, list, 1, ""); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceSolar.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceSolar.java index 9c5aaee2f..3f3e8cf14 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceSolar.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceSolar.java @@ -96,7 +96,7 @@ public class BlockFurnaceSolar extends BlockContainerBase implements INameableIt @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - BlockUtil.addStandardInformation(theBlock, list); + BlockUtil.addInformation(theBlock, list, 1, ""); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockGiantChest.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockGiantChest.java index 9883331f7..509dca6fe 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockGiantChest.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockGiantChest.java @@ -102,7 +102,7 @@ public class BlockGiantChest extends BlockContainerBase implements INameableItem @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - BlockUtil.addStandardInformation(theBlock, list); + BlockUtil.addInformation(theBlock, list, 1, ""); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockGrinder.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockGrinder.java index 11e4cee57..8ffa1f4d1 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockGrinder.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockGrinder.java @@ -5,7 +5,9 @@ import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.ActuallyAdditions; import ellpeck.actuallyadditions.inventory.GuiHandler; import ellpeck.actuallyadditions.tile.TileEntityGrinder; -import ellpeck.actuallyadditions.util.*; +import ellpeck.actuallyadditions.util.BlockUtil; +import ellpeck.actuallyadditions.util.INameableItem; +import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -15,7 +17,6 @@ import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; @@ -132,13 +133,7 @@ public class BlockGrinder extends BlockContainerBase implements INameableItem{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - if(KeyUtil.isShiftPressed()){ - for(int i = 0; i < (((BlockGrinder)theBlock).isDouble ? 3 : 4); i++){ - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)theBlock).getName() + ".desc." + (i+1))); - } - BlockUtil.addOredictName(theBlock, list); - } - else list.add(ItemUtil.shiftForInfo()); + BlockUtil.addInformation(theBlock, list, ((BlockGrinder)theBlock).isDouble ? 3 : 4, ""); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockHeatCollector.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockHeatCollector.java index 9bb0fd9c7..6d12ce546 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockHeatCollector.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockHeatCollector.java @@ -3,7 +3,9 @@ package ellpeck.actuallyadditions.blocks; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.tile.TileEntityHeatCollector; -import ellpeck.actuallyadditions.util.*; +import ellpeck.actuallyadditions.util.BlockUtil; +import ellpeck.actuallyadditions.util.INameableItem; +import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -13,7 +15,6 @@ import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; import java.util.List; @@ -83,13 +84,7 @@ public class BlockHeatCollector extends BlockContainerBase implements INameableI @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - if(KeyUtil.isShiftPressed()){ - for(int i = 0; i < 3; i++){ - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)theBlock).getName() + ".desc." + (i + 1))); - } - BlockUtil.addOredictName(theBlock, list); - } - else list.add(ItemUtil.shiftForInfo()); + BlockUtil.addInformation(theBlock, list, 3, ""); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockInputter.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockInputter.java index 0dc8ed38a..e86589f38 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockInputter.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockInputter.java @@ -125,9 +125,10 @@ public class BlockInputter extends BlockContainerBase implements INameableItem{ list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".blockInputter.desc." + (i + 1))); } if((((BlockInputter)theBlock).isAdvanced)) list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)theBlock).getName() + ".desc")); - BlockUtil.addOredictName(theBlock, list); } else list.add(ItemUtil.shiftForInfo()); + + if(KeyUtil.isControlPressed()) BlockUtil.addOredictName(((INameableItem)theBlock).getOredictName(), list); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockItemRepairer.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockItemRepairer.java index 3dbd210fa..0b41e06d8 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockItemRepairer.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockItemRepairer.java @@ -121,7 +121,7 @@ public class BlockItemRepairer extends BlockContainerBase implements INameableIt @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - BlockUtil.addStandardInformation(theBlock, list); + BlockUtil.addInformation(theBlock, list, 1, ""); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockMisc.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockMisc.java index 99a163c09..5f8c7ac27 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockMisc.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockMisc.java @@ -3,7 +3,9 @@ package ellpeck.actuallyadditions.blocks; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.blocks.metalists.TheMiscBlocks; -import ellpeck.actuallyadditions.util.*; +import ellpeck.actuallyadditions.util.BlockUtil; +import ellpeck.actuallyadditions.util.INameableItem; +import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -14,7 +16,6 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import java.util.List; @@ -25,8 +26,8 @@ public class BlockMisc extends Block implements INameableItem{ public BlockMisc(){ super(Material.rock); - this.setHarvestLevel("pickaxe", 0); - this.setHardness(1.0F); + this.setHardness(1.5F); + this.setHarvestLevel("pickaxe", 1); } @SuppressWarnings("all") @@ -90,11 +91,7 @@ public class BlockMisc extends Block implements INameableItem{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - if(KeyUtil.isShiftPressed()){ - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)theBlock).getName() + allMiscBlocks[stack.getItemDamage()].getName() + ".desc")); - list.add(StringUtil.GRAY + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".oredictName.desc") + ": " + allMiscBlocks[stack.getItemDamage()].getOredictName()); - } - else list.add(ItemUtil.shiftForInfo()); + BlockUtil.addInformation(theBlock, list, 1, allMiscBlocks[stack.getItemDamage()].getName(), allMiscBlocks[stack.getItemDamage()].getOredictName()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/config/ConfigValues.java b/src/main/java/ellpeck/actuallyadditions/config/ConfigValues.java index ee78813af..bc45c35c0 100644 --- a/src/main/java/ellpeck/actuallyadditions/config/ConfigValues.java +++ b/src/main/java/ellpeck/actuallyadditions/config/ConfigValues.java @@ -72,6 +72,9 @@ public class ConfigValues{ public static boolean enablePearlShardDrop; public static boolean enableEmeraldShardDrop; + public static int jamVillagerID; + public static boolean jamVillagerExists; + public static void defineConfigValues(Configuration config){ for(int i = 0; i < enabledFoodRecipes.length; i++){ @@ -84,6 +87,9 @@ public class ConfigValues{ enablePotionRingRecipes[i] = config.getBoolean(ThePotionRings.values()[i].name, ConfigurationHandler.CATEGORY_POTION_RING_CRAFTING, i != ThePotionRings.SATURATION.ordinal(), "If the Crafting Recipe for the Ring of " + ThePotionRings.values()[i].name + " is Enabled"); } + jamVillagerID = config.getInt("Jam Villager: ID", ConfigurationHandler.CATEGORY_WORLD_GEN, 493827, 100, 1000000, "The ID of the Jam Selling Villager"); + jamVillagerExists = config.getBoolean("Jam Villager: Existence", ConfigurationHandler.CATEGORY_WORLD_GEN, true, "If the Jam Villager and his House exist"); + enableLeafBlowerRecipe = config.getBoolean("Leaf Blower", ConfigurationHandler.CATEGORY_ITEMS_CRAFTING, true, "If the Crafting Recipe for the Leaf Blower is Enabled"); enableLeafBlowerAdvancedRecipe = config.getBoolean("Advanced Leaf Blower", ConfigurationHandler.CATEGORY_ITEMS_CRAFTING, true, "If the Crafting Recipe for the Advanced Leaf Blower is Enabled"); leafBlowerDropItems = config.getBoolean("Leaf Blower: Drops Items", ConfigurationHandler.CATEGORY_TOOL_VALUES, true, "If the Leaf Blower lets destroyed Blocks' Drops drop"); diff --git a/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java b/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java index 7d805dfe3..9bc37a535 100644 --- a/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java @@ -19,9 +19,9 @@ public class BlockCrafting{ //Compost if(ConfigValues.enableCompostRecipe) GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockCompost), - "W W", "WFW", "WWW", + "W W", "W W", "WCW", 'W', "plankWood", - 'F', TheMiscItems.MASHED_FOOD.getOredictName())); + 'C', TheMiscBlocks.WOOD_CASING.getOredictName())); //Wood Casing GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.WOOD_CASING.ordinal()), @@ -52,26 +52,31 @@ public class BlockCrafting{ //Repairer if(ConfigValues.enableRepairerRecipe) GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockItemRepairer), - "DID", "DCD", "DID", + "DID", "OCO", "DID", 'D', "gemDiamond", 'I', "ingotIron", - 'C', Blocks.crafting_table)); + 'O', TheMiscItems.COIL.getOredictName(), + 'C', TheMiscBlocks.STONE_CASING.getOredictName())); //Solar Panel if(ConfigValues.enableSolarRecipe) GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockFurnaceSolar), - "IBI", "BDB", "IBI", + "IQI", "CDC", "IBI", 'D', "blockDiamond", 'I', "ingotIron", + 'Q', TheMiscBlocks.STONE_CASING.getOredictName(), + 'C', TheMiscItems.COIL_ADVANCED.getOredictName(), 'B', new ItemStack(Blocks.iron_bars))); //Heat Collector if(ConfigValues.enableHeatCollectorRecipe) GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockHeatCollector), - "BRB", "LDL", "BRB", + "BRB", "CDC", "BQB", 'D', "blockDiamond", 'R', new ItemStack(Items.repeater), + 'Q', TheMiscBlocks.STONE_CASING.getOredictName(), 'L', new ItemStack(Items.lava_bucket), + 'C', TheMiscItems.COIL_ADVANCED.getOredictName(), 'B', new ItemStack(Blocks.iron_bars))); //Quartz Pillar @@ -87,13 +92,14 @@ public class BlockCrafting{ //Inputter if(ConfigValues.enableInputterRecipe){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockInputter), - "WWW", "WHW", "WWW", + "WWW", "CHC", "WWW", 'W', "plankWood", + 'C', TheMiscBlocks.WOOD_CASING.getOredictName(), 'H', new ItemStack(Blocks.hopper))); GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitBlocks.blockInputterAdvanced), ((INameableItem)InitBlocks.blockInputter).getOredictName(), - "gemQuartz", + TheMiscItems.COIL_ADVANCED.getOredictName(), TheMiscItems.QUARTZ.getOredictName(), "dustRedstone")); } @@ -101,40 +107,48 @@ public class BlockCrafting{ //Crusher if(ConfigValues.enableCrusherRecipe) GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockGrinder), - "CFC", "CPC", "CFC", + "CFC", "DQD", "CFC", 'C', "cobblestone", + 'D', TheMiscItems.COIL.getOredictName(), + 'Q', TheMiscBlocks.STONE_CASING.getOredictName(), 'P', new ItemStack(Blocks.piston), 'F', new ItemStack(Items.flint))); //Double Crusher if(ConfigValues.enableCrusherDoubleRecipe) GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockGrinderDouble), - "CCC", "RPR", "CCC", + "CDC", "RFR", "CDC", 'C', "cobblestone", + 'D', TheMiscItems.COIL_ADVANCED.getOredictName(), 'R', ((INameableItem)InitBlocks.blockGrinder).getOredictName(), + 'F', TheMiscBlocks.STONE_CASING.getOredictName(), 'P', new ItemStack(Blocks.piston))); //Double Furnace if(ConfigValues.enableFurnaceDoubleRecipe) GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockFurnaceDouble), - "CCC", "RPR", "CCC", + "CDC", "RFR", "CDC", 'C', "cobblestone", + 'D', TheMiscItems.COIL.getOredictName(), 'R', new ItemStack(Blocks.furnace), + 'F', TheMiscBlocks.STONE_CASING.getOredictName(), 'P', "ingotBrick")); //Feeder if(ConfigValues.enableFeederRecipe) GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockFeeder), - "WCW", "WHW", "WCW", + "WCW", "DHD", "WCW", 'W', "plankWood", + 'D', TheMiscItems.COIL.getOredictName(), 'C', new ItemStack(Items.golden_carrot), - 'H', "cropWheat")); + 'H', TheMiscBlocks.WOOD_CASING.getOredictName())); //Giant Chest if(ConfigValues.enableGiantChestRecipe) GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockGiantChest), - "CWC", "W W", "CWC", + "CWC", "WDW", "CWC", 'C', new ItemStack(Blocks.chest), + 'D', TheMiscBlocks.WOOD_CASING.getOredictName(), 'W', "plankWood")); } diff --git a/src/main/java/ellpeck/actuallyadditions/crafting/ItemCrafting.java b/src/main/java/ellpeck/actuallyadditions/crafting/ItemCrafting.java index c590a74ce..4e9c0b45c 100644 --- a/src/main/java/ellpeck/actuallyadditions/crafting/ItemCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/crafting/ItemCrafting.java @@ -25,11 +25,11 @@ public class ItemCrafting{ //Leaf Blower if(ConfigValues.enableLeafBlowerRecipe) GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemLeafBlower), - " F", "IP", "IR", + " F", "IP", "IC", 'F', new ItemStack(Items.flint), 'I', "ingotIron", 'P', new ItemStack(Blocks.piston), - 'R', "dustRedstone")); + 'C', TheMiscItems.COIL_ADVANCED.getOredictName())); //Coil if(ConfigValues.enabledMiscRecipes[TheMiscItems.COIL.ordinal()]) @@ -58,11 +58,11 @@ public class ItemCrafting{ //Advanced Leaf Blower if(ConfigValues.enableLeafBlowerAdvancedRecipe) GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemLeafBlowerAdvanced), - " F", "DP", "DR", + " F", "DP", "DC", 'F', new ItemStack(Items.flint), 'D', "gemDiamond", 'P', new ItemStack(Blocks.piston), - 'R', "dustRedstone")); + 'C', TheMiscItems.COIL_ADVANCED.getOredictName())); //Quartz if(ConfigValues.enabledMiscRecipes[TheMiscItems.QUARTZ.ordinal()]) diff --git a/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java b/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java index b2ecbf1b7..4ae2c787b 100644 --- a/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java +++ b/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java @@ -65,6 +65,8 @@ public class CreativeTab extends CreativeTabs{ this.addItem(InitItems.itemPotionRing); this.addItem(InitItems.itemPotionRingAdvanced); + + this.addItem(InitItems.itemJams); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/gen/InitVillager.java b/src/main/java/ellpeck/actuallyadditions/gen/InitVillager.java new file mode 100644 index 000000000..9ca8e6c8e --- /dev/null +++ b/src/main/java/ellpeck/actuallyadditions/gen/InitVillager.java @@ -0,0 +1,42 @@ +package ellpeck.actuallyadditions.gen; + +import cpw.mods.fml.common.registry.VillagerRegistry; +import ellpeck.actuallyadditions.config.ConfigValues; +import ellpeck.actuallyadditions.items.InitItems; +import ellpeck.actuallyadditions.items.metalists.TheJams; +import ellpeck.actuallyadditions.util.ModUtil; +import ellpeck.actuallyadditions.util.Util; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.gen.structure.MapGenStructureIO; +import net.minecraftforge.common.ChestGenHooks; + +import java.util.Random; + +public class InitVillager{ + + public static ChestGenHooks jamHouseChest; + + public static void init(){ + Util.logInfo("Initializing Village Addons..."); + + if(ConfigValues.jamVillagerExists){ + + int jamID = ConfigValues.jamVillagerID; + VillagerRegistry.instance().registerVillagerId(jamID); + VillagerRegistry.instance().registerVillageTradeHandler(jamID, new JamVillagerTradeHandler()); + + jamHouseChest = new ChestGenHooks("JamHouse", new WeightedRandomChestContent[0], 5, 20); + for(int i = 0; i < TheJams.values().length; i++){ + jamHouseChest.addItem(new WeightedRandomChestContent(new ItemStack(InitItems.itemJams, new Random().nextInt(5)+1, i), 1, 1, 15)); + } + jamHouseChest.addItem(new WeightedRandomChestContent(new ItemStack(Items.glass_bottle, new Random().nextInt(5)+1), 1, 1, 15)); + jamHouseChest.addItem(new WeightedRandomChestContent(new ItemStack(Items.potionitem, new Random().nextInt(5)+1), 1, 1, 15)); + + VillagerRegistry.instance().registerVillageCreationHandler(new VillageJamHouseHandler()); + MapGenStructureIO.func_143031_a(VillageComponentJamHouse.class, ModUtil.MOD_ID_LOWER + ":jamHouseStructure"); + } + } + +} diff --git a/src/main/java/ellpeck/actuallyadditions/gen/JamVillagerTradeHandler.java b/src/main/java/ellpeck/actuallyadditions/gen/JamVillagerTradeHandler.java new file mode 100644 index 000000000..aa4a3a2cf --- /dev/null +++ b/src/main/java/ellpeck/actuallyadditions/gen/JamVillagerTradeHandler.java @@ -0,0 +1,61 @@ +package ellpeck.actuallyadditions.gen; + +import cpw.mods.fml.common.registry.VillagerRegistry; +import ellpeck.actuallyadditions.items.InitItems; +import ellpeck.actuallyadditions.items.metalists.TheJams; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.village.MerchantRecipe; +import net.minecraft.village.MerchantRecipeList; +import net.minecraftforge.oredict.OreDictionary; + +import java.util.ArrayList; +import java.util.Random; + +public class JamVillagerTradeHandler implements VillagerRegistry.IVillageTradeHandler{ + + private ArrayList villagerWants = new ArrayList(); + + public JamVillagerTradeHandler(){ + this.addWants("ingotGold"); + this.addWants("cropWheat"); + this.addWants("dustRedstone"); + this.addWants(new ItemStack(Items.bucket)); + this.addWants(new ItemStack(Items.glass_bottle)); + this.addWants(new ItemStack(Items.potionitem)); + this.addWants("ingotIron"); + this.addWants("gemDiamond"); + this.addWants("dustGlowstone"); + } + + @Override + @SuppressWarnings("unchecked") + public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random rand){ + for(int i = 0; i < villagerWants.size(); i++){ + ItemStack wantsTwo = null; + ItemStack wantsOne = villagerWants.get(i); + wantsOne.stackSize = rand.nextInt(10)+10; + if(wantsOne.stackSize > wantsOne.getMaxStackSize()) wantsOne.stackSize = wantsOne.getMaxStackSize(); + if(rand.nextInt(10) == 0){ + wantsTwo = villagerWants.get(rand.nextInt(villagerWants.size())); + wantsTwo.stackSize = rand.nextInt(10)+1; + if(wantsTwo.stackSize > wantsTwo.getMaxStackSize()) wantsTwo.stackSize = wantsTwo.getMaxStackSize(); + } + if(wantsOne == wantsTwo) wantsTwo = null; + + for(int j = 0; j < TheJams.values().length; j++){ + recipeList.add(new MerchantRecipe(wantsOne, wantsTwo, new ItemStack(InitItems.itemJams, rand.nextInt(3)+1, j))); + } + } + } + + public void addWants(String oredictName){ + ArrayList stacks = OreDictionary.getOres(oredictName); + villagerWants.addAll(stacks); + } + + public void addWants(ItemStack stack){ + villagerWants.add(stack); + } +} diff --git a/src/main/java/ellpeck/actuallyadditions/gen/VillageComponentJamHouse.java b/src/main/java/ellpeck/actuallyadditions/gen/VillageComponentJamHouse.java new file mode 100644 index 000000000..c889519af --- /dev/null +++ b/src/main/java/ellpeck/actuallyadditions/gen/VillageComponentJamHouse.java @@ -0,0 +1,193 @@ +package ellpeck.actuallyadditions.gen; + +import ellpeck.actuallyadditions.config.ConfigValues; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.gen.structure.StructureComponent; +import net.minecraft.world.gen.structure.StructureVillagePieces; + +import java.util.List; +import java.util.Random; + +public class VillageComponentJamHouse extends StructureVillagePieces.House1{ + + private static final int xSize = 10; + private static final int ySize = 8; + private static final int zSize = 11; + + private int averageGroundLevel = -1; + + @SuppressWarnings("unused") + public VillageComponentJamHouse(){ + + } + + public VillageComponentJamHouse(StructureBoundingBox boundingBox, int par5){ + this.coordBaseMode = par5; + this.boundingBox = boundingBox; + } + + public static VillageComponentJamHouse buildComponent(List pieces, int p1, int p2, int p3, int p4){ + StructureBoundingBox boundingBox = StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, xSize+1, ySize+1, zSize+1, p4); + return canVillageGoDeeper(boundingBox) && StructureComponent.findIntersecting(pieces, boundingBox) == null ? new VillageComponentJamHouse(boundingBox, p4) : null; + } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox sbb){ + if(this.averageGroundLevel < 0){ + this.averageGroundLevel = this.getAverageGroundLevel(world, sbb); + if(this.averageGroundLevel < 0) return true; + this.boundingBox.offset(0, this.averageGroundLevel-this.boundingBox.maxY+ySize, 0); + } + + this.spawnActualHouse(world, rand, sbb); + + for (int i = 0; i < xSize; i++){ + for(int j = 0; j < zSize; j++){ + this.clearCurrentPositionBlocksUpwards(world, j, ySize, i, sbb); + this.func_151554_b(world, Blocks.cobblestone, 0, j, -1, i, sbb); + } + } + + this.spawnVillagers(world, sbb, 3, 1, 3, 1); + + return true; + } + + public void spawnActualHouse(World world, Random rand, StructureBoundingBox sbb){ + //Base + this.fillWithBlocks(world, sbb, 1, 0, 8, 9, 0, 10, Blocks.grass); + this.fillWithBlocks(world, sbb, 0, 0, 0, 1, 0, 7, Blocks.cobblestone); + this.fillWithBlocks(world, sbb, 2, 0, 0, 4, 0, 1, Blocks.cobblestone); + this.fillWithBlocks(world, sbb, 9, 0, 0, 10, 0, 7, Blocks.cobblestone); + this.fillWithBlocks(world, sbb, 6, 0, 0, 8, 0, 1, Blocks.cobblestone); + this.placeBlockAtCurrentPosition(world, Blocks.stone_stairs, this.getMetadataWithOffset(Blocks.stone_stairs, 3), 5, 0, 0, sbb); + this.fillWithBlocks(world, sbb, 2, 0, 7, 3, 0, 7, Blocks.cobblestone); + this.fillWithBlocks(world, sbb, 5, 0, 7, 8, 0, 7, Blocks.cobblestone); + this.fillWithBlocks(world, sbb, 10, 0, 8, 10, 0, 11, Blocks.cobblestone); + this.fillWithBlocks(world, sbb, 0, 0, 8, 0, 0, 11, Blocks.cobblestone); + this.fillWithBlocks(world, sbb, 0, 0, 11, 10, 0, 11, Blocks.cobblestone); + this.fillWithMetadataBlocks(world, sbb, 2, 0, 2, 8, 0, 6, Blocks.planks, 1, Blocks.planks, 1, false); + this.placeBlockAtCurrentPosition(world, Blocks.planks, 1, 5, 0, 1, sbb); + this.placeBlockAtCurrentPosition(world, Blocks.planks, 1, 4, 0, 7, sbb); + + //Garden Fence + this.fillWithBlocks(world, sbb, 0, 1, 8, 0, 1, 11, Blocks.fence); + this.fillWithBlocks(world, sbb, 10, 1, 8, 10, 1, 11, Blocks.fence); + this.fillWithBlocks(world, sbb, 1, 1, 11, 9, 1, 11, Blocks.fence); + + //Side Walls + for(int i = 0; i < 2; i++){ + this.fillWithBlocks(world, sbb, 1+i*8, 1, 1, 1+i*8, 1, 7, Blocks.cobblestone); + this.fillWithBlocks(world, sbb, 1+i*8, 1, 1, 1+i*8, 4, 1, Blocks.cobblestone); + this.fillWithBlocks(world, sbb, 1+i*8, 1, 7, 1+i*8, 4, 7, Blocks.cobblestone); + this.fillWithBlocks(world, sbb, 1+i*8, 4, 2, 1+i*8, 5, 6, Blocks.cobblestone); + this.fillWithBlocks(world, sbb, 1+i*8, 3, 2, 1+i*8, 3, 6, Blocks.planks); + this.placeBlockAtCurrentPosition(world, Blocks.planks, 0, 1+i* 8, 2, 2, sbb); + this.placeBlockAtCurrentPosition(world, Blocks.planks, 0, 1+i*8, 2, 6, sbb); + this.fillWithBlocks(world, sbb, 1+i*8, 2, 3, 1+i*8, 2, 5, Blocks.glass_pane); + } + + //Front Wall + this.fillWithBlocks(world, sbb, 7, 1, 1, 8, 4, 1, Blocks.cobblestone); + this.fillWithBlocks(world, sbb, 2, 1, 1, 3, 4, 1, Blocks.cobblestone); + this.fillWithBlocks(world, sbb, 4, 4, 1, 7, 4, 1, Blocks.cobblestone); + this.fillWithBlocks(world, sbb, 6, 1, 1, 6, 3, 1, Blocks.planks); + this.fillWithBlocks(world, sbb, 4, 1, 1, 4, 3, 1, Blocks.planks); + this.fillWithBlocks(world, sbb, 5, 3, 1, 5, 3, 1, Blocks.planks); + this.placeDoorAtCurrentPosition(world, sbb, rand, 5, 1, 1, this.getMetadataWithOffset(Blocks.wooden_door, 1)); + + //Back Wall + this.fillWithBlocks(world, sbb, 2, 1, 7, 2, 4, 7, Blocks.cobblestone); + this.fillWithBlocks(world, sbb, 3, 1, 7, 3, 3, 7, Blocks.planks); + this.fillWithBlocks(world, sbb, 4, 3, 7, 8, 3, 7, Blocks.planks); + this.fillWithBlocks(world, sbb, 3, 4, 7, 8, 4, 7, Blocks.cobblestone); + this.fillWithBlocks(world, sbb, 5, 1, 7, 5, 2, 7, Blocks.planks); + this.fillWithBlocks(world, sbb, 6, 1, 7, 8, 1, 7, Blocks.cobblestone); + this.fillWithBlocks(world, sbb, 6, 2, 7, 7, 2, 7, Blocks.glass_pane); + this.placeBlockAtCurrentPosition(world, Blocks.planks, 0, 8, 2, 7, sbb); + this.placeDoorAtCurrentPosition(world, sbb, rand, 4, 1, 7, this.getMetadataWithOffset(Blocks.wooden_door, 1)); + + //Fence Supports + this.fillWithBlocks(world, sbb, 0, 1, 8, 0, 3, 8, Blocks.fence); + this.fillWithBlocks(world, sbb, 10, 1, 8, 10, 3, 8, Blocks.fence); + this.fillWithBlocks(world, sbb, 0, 1, 0, 0, 3, 0, Blocks.fence); + this.fillWithBlocks(world, sbb, 10, 1, 0, 10, 3, 0, Blocks.fence); + + //Roof + this.fillWithBlocks(world, sbb, 1, 6, 3, 9, 6, 5, Blocks.planks); + this.fillWithMetadataBlocks(world, sbb, 0, 4, 0, 10, 4, 0, Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 3), Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 3), false); + this.fillWithMetadataBlocks(world, sbb, 0, 5, 1, 10, 5, 1, Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 3), Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 3), false); + this.fillWithMetadataBlocks(world, sbb, 0, 6, 2, 10, 6, 2, Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 3), Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 3), false); + this.fillWithMetadataBlocks(world, sbb, 0, 4, 8, 10, 4, 8, Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 2), Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 2), false); + this.fillWithMetadataBlocks(world, sbb, 0, 5, 7, 10, 5, 7, Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 2), Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 2), false); + this.fillWithMetadataBlocks(world, sbb, 0, 6, 6, 10, 6, 6, Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 2), Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 2), false); + this.fillWithBlocks(world, sbb, 0, 7, 3, 10, 7, 5, Blocks.wooden_slab); + + //Roof Gadgets + this.placeBlockAtCurrentPosition(world, Blocks.planks, 0, 0, 4, 1, sbb); + this.placeBlockAtCurrentPosition(world, Blocks.planks, 0, 0, 5, 2, sbb); + this.placeBlockAtCurrentPosition(world, Blocks.planks, 0, 10, 4, 1, sbb); + this.placeBlockAtCurrentPosition(world, Blocks.planks, 0, 10, 5, 2, sbb); + this.placeBlockAtCurrentPosition(world, Blocks.planks, 0, 0, 4, 7, sbb); + this.placeBlockAtCurrentPosition(world, Blocks.planks, 0, 0, 5, 6, sbb); + this.placeBlockAtCurrentPosition(world, Blocks.planks, 0, 10, 4, 7, sbb); + this.placeBlockAtCurrentPosition(world, Blocks.planks, 0, 10, 5, 6, sbb); + this.fillWithBlocks(world, sbb, 0, 6, 3, 0, 6, 5, Blocks.planks); + this.fillWithBlocks(world, sbb, 10, 6, 3, 10, 6, 5, Blocks.planks); + + //Counter + this.fillWithMetadataBlocks(world, sbb, 6, 3, 2, 6, 3, 4, Blocks.wooden_slab, 8, Blocks.wooden_slab, 8, false); + this.fillWithMetadataBlocks(world, sbb, 5, 3, 4, 5, 3, 6, Blocks.wooden_slab, 8, Blocks.wooden_slab, 8, false); + this.fillWithBlocks(world, sbb, 6, 1, 2, 6, 1, 4, Blocks.planks); + this.fillWithBlocks(world, sbb, 5, 1, 4, 5, 1, 5, Blocks.planks); + this.fillWithBlocks(world, sbb, 6, 4, 2, 6, 5, 2, Blocks.fence); + this.fillWithBlocks(world, sbb, 5, 4, 4, 5, 5, 4, Blocks.fence); + this.fillWithBlocks(world, sbb, 5, 4, 6, 5, 5, 6, Blocks.fence); + + //Decoration + this.placeBlockAtCurrentPosition(world, Blocks.fence, 0, 2, 1, 2, sbb); + this.placeBlockAtCurrentPosition(world, Blocks.leaves, 0, 2, 2, 2, sbb); + this.placeBlockAtCurrentPosition(world, Blocks.fence, 0, 8, 1, 2, sbb); + this.placeBlockAtCurrentPosition(world, Blocks.leaves, 0, 8, 2, 2, sbb); + this.placeBlockAtCurrentPosition(world, Blocks.fence, 0, 2, 1, 6, sbb); + this.placeBlockAtCurrentPosition(world, Blocks.leaves, 0, 2, 2, 6, sbb); + this.fillWithMetadataBlocks(world, sbb, 2, 1, 3, 2, 1, 5, Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 1), Blocks.oak_stairs, this.getMetadataWithOffset(Blocks.oak_stairs, 1), false); + this.fillWithMetadataBlocks(world, sbb, 3, 1, 2, 5, 1, 3, Blocks.carpet, 10, Blocks.carpet, 10, false); + this.fillWithMetadataBlocks(world, sbb, 3, 1, 4, 4, 1, 6, Blocks.carpet, 10, Blocks.carpet, 10, false); + + //Loot Chest + this.placeBlockAtCurrentPosition(world, Blocks.chest, 0, 8, 1, 6, sbb); + int posX = this.getXWithOffset(8, 6); + int posY = this.getYWithOffset(1); + int posZ = this.getZWithOffset(8, 6); + TileEntity chest = world.getTileEntity(posX, posY, posZ); + if(chest != null && chest instanceof TileEntityChest){ + WeightedRandomChestContent.generateChestContents(rand, InitVillager.jamHouseChest.getItems(rand), (TileEntityChest)chest, InitVillager.jamHouseChest.getCount(rand)); + } + + //Torches + this.placeBlockAtCurrentPosition(world, Blocks.torch, 0, 6, 2, 0, sbb); + this.placeBlockAtCurrentPosition(world, Blocks.torch, 0, 4, 2, 0, sbb); + this.placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 2, 8, sbb); + this.placeBlockAtCurrentPosition(world, Blocks.torch, 0, 3, 2, 8, sbb); + this.placeBlockAtCurrentPosition(world, Blocks.torch, 0, 2, 3, 2, sbb); + this.placeBlockAtCurrentPosition(world, Blocks.torch, 0, 2, 3, 6, sbb); + this.placeBlockAtCurrentPosition(world, Blocks.torch, 0, 8, 3, 2, sbb); + this.placeBlockAtCurrentPosition(world, Blocks.torch, 0, 8, 3, 6, sbb); + } + + public void fillWithBlocks(World world, StructureBoundingBox sbb, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, Block block){ + this.fillWithBlocks(world, sbb, minX, minY, minZ, maxX, maxY, maxZ, block, block, false); + } + + @Override + protected int getVillagerType(int par1){ + return ConfigValues.jamVillagerID; + } +} diff --git a/src/main/java/ellpeck/actuallyadditions/gen/VillageJamHouseHandler.java b/src/main/java/ellpeck/actuallyadditions/gen/VillageJamHouseHandler.java new file mode 100644 index 000000000..c080323d6 --- /dev/null +++ b/src/main/java/ellpeck/actuallyadditions/gen/VillageJamHouseHandler.java @@ -0,0 +1,25 @@ +package ellpeck.actuallyadditions.gen; + +import cpw.mods.fml.common.registry.VillagerRegistry; +import net.minecraft.world.gen.structure.StructureVillagePieces; + +import java.util.List; +import java.util.Random; + +public class VillageJamHouseHandler implements VillagerRegistry.IVillageCreationHandler{ + + @Override + public StructureVillagePieces.PieceWeight getVillagePieceWeight(Random random, int i){ + return new StructureVillagePieces.PieceWeight(VillageComponentJamHouse.class, 5, 1); + } + + @Override + public Class getComponentClass(){ + return VillageComponentJamHouse.class; + } + + @Override + public Object buildComponent(StructureVillagePieces.PieceWeight villagePiece, StructureVillagePieces.Start startPiece, List pieces, Random random, int p1, int p2, int p3, int p4, int p5){ + return VillageComponentJamHouse.buildComponent(pieces, p1, p2, p3, p4); + } +} diff --git a/src/main/java/ellpeck/actuallyadditions/items/InitItems.java b/src/main/java/ellpeck/actuallyadditions/items/InitItems.java index 2f96afa88..7a2aecd56 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/InitItems.java +++ b/src/main/java/ellpeck/actuallyadditions/items/InitItems.java @@ -15,6 +15,7 @@ public class InitItems{ public static Item itemFertilizer; public static Item itemMisc; public static Item itemFoods; + public static Item itemJams; public static Item itemKnife; public static Item itemCrafterOnAStick; public static Item itemDust; @@ -49,6 +50,9 @@ public class InitItems{ itemFoods = new ItemFoods(); ItemUtil.register(itemFoods, ItemFoods.allFoods); + itemJams = new ItemJams(); + ItemUtil.register(itemJams, ItemJams.allJams); + itemKnife = new ItemKnife(); ItemUtil.register(itemKnife); diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemCrafterOnAStick.java b/src/main/java/ellpeck/actuallyadditions/items/ItemCrafterOnAStick.java index 1f5bf9f56..04e43ba5d 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemCrafterOnAStick.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemCrafterOnAStick.java @@ -27,7 +27,7 @@ public class ItemCrafterOnAStick extends Item implements INameableItem{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - ItemUtil.addStandardInformation(this, list); + ItemUtil.addInformation(this, list, 1, ""); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemDust.java b/src/main/java/ellpeck/actuallyadditions/items/ItemDust.java index f8920add6..5d439b5e0 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemDust.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemDust.java @@ -3,7 +3,9 @@ package ellpeck.actuallyadditions.items; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.items.metalists.TheDusts; -import ellpeck.actuallyadditions.util.*; +import ellpeck.actuallyadditions.util.INameableItem; +import ellpeck.actuallyadditions.util.ItemUtil; +import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; @@ -11,7 +13,6 @@ import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import java.util.List; @@ -60,11 +61,7 @@ public class ItemDust extends Item implements INameableItem{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ - if(KeyUtil.isShiftPressed()){ - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + allDusts[stack.getItemDamage()].getName() + ".desc")); - list.add(StringUtil.GRAY + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".oredictName.desc") + ": " + allDusts[stack.getItemDamage()].getOredictName()); - } - else list.add(ItemUtil.shiftForInfo()); + ItemUtil.addInformation(this, list, 1, allDusts[stack.getItemDamage()].getName(), allDusts[stack.getItemDamage()].getOredictName()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemFertilizer.java b/src/main/java/ellpeck/actuallyadditions/items/ItemFertilizer.java index f7e3e2208..6d535bc9d 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemFertilizer.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemFertilizer.java @@ -36,7 +36,7 @@ public class ItemFertilizer extends Item implements INameableItem{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - ItemUtil.addStandardInformation(this, list); + ItemUtil.addInformation(this, list, 1, ""); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemFoods.java b/src/main/java/ellpeck/actuallyadditions/items/ItemFoods.java index c8a3483c7..2f88d4c0f 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemFoods.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemFoods.java @@ -3,7 +3,10 @@ package ellpeck.actuallyadditions.items; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.items.metalists.TheFoods; -import ellpeck.actuallyadditions.util.*; +import ellpeck.actuallyadditions.util.INameableItem; +import ellpeck.actuallyadditions.util.ItemUtil; +import ellpeck.actuallyadditions.util.KeyUtil; +import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.item.EntityItem; @@ -99,9 +102,10 @@ public class ItemFoods extends ItemFood implements INameableItem{ list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + allFoods[stack.getItemDamage()].getName() + ".desc")); list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".hunger.desc") + ": " + allFoods[stack.getItemDamage()].healAmount); list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".saturation.desc") + ": " + allFoods[stack.getItemDamage()].saturation); - list.add(StringUtil.GRAY + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".oredictName.desc") + ": " + allFoods[stack.getItemDamage()].getOredictName()); } else list.add(ItemUtil.shiftForInfo()); + + if(KeyUtil.isControlPressed()) ItemUtil.addOredictName(allFoods[stack.getItemDamage()].getOredictName(), list); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemJams.java b/src/main/java/ellpeck/actuallyadditions/items/ItemJams.java new file mode 100644 index 000000000..1f57ab62a --- /dev/null +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemJams.java @@ -0,0 +1,143 @@ +package ellpeck.actuallyadditions.items; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ellpeck.actuallyadditions.items.metalists.TheJams; +import ellpeck.actuallyadditions.util.INameableItem; +import ellpeck.actuallyadditions.util.ItemUtil; +import ellpeck.actuallyadditions.util.KeyUtil; +import ellpeck.actuallyadditions.util.ModUtil; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +import java.util.List; + +public class ItemJams extends ItemFood implements INameableItem{ + + public static final TheJams[] allJams = TheJams.values(); + public IIcon overlayIcon; + + public ItemJams(){ + super(0, 0.0F, false); + this.setHasSubtypes(true); + this.setMaxDamage(0); + } + + @Override + public String getOredictName(){ + return ""; + } + + @Override + public EnumRarity getRarity(ItemStack stack){ + return allJams[stack.getItemDamage()].rarity; + } + + @Override + public int func_150905_g(ItemStack stack){ + return allJams[stack.getItemDamage()].healAmount; + } + + @Override + public float func_150906_h(ItemStack stack){ + return allJams[stack.getItemDamage()].saturation; + } + + @Override + public int getMetadata(int damage){ + return damage; + } + + @SuppressWarnings("all") + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs tab, List list){ + for (int j = 0; j < allJams.length; j++){ + list.add(new ItemStack(this, 1, j)); + } + } + + @Override + public String getUnlocalizedName(ItemStack stack){ + return this.getUnlocalizedName() + allJams[stack.getItemDamage()].getName(); + } + + @Override + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass){ + return pass > 0 ? allJams[stack.getItemDamage()].color : super.getColorFromItemStack(stack, pass); + } + + @Override + public ItemStack onEaten(ItemStack stack, World world, EntityPlayer player){ + ItemStack stackToReturn = super.onEaten(stack, world, player); + + if(!world.isRemote){ + if(allJams[stack.getItemDamage()].firstEffectToGet != 0){ + PotionEffect firstEffectToGet = new PotionEffect(allJams[stack.getItemDamage()].firstEffectToGet, 200); + player.addPotionEffect(firstEffectToGet); + } + if(allJams[stack.getItemDamage()].secondEffectToGet != 0){ + PotionEffect secondEffectToGet = new PotionEffect(allJams[stack.getItemDamage()].secondEffectToGet, 600); + player.addPotionEffect(secondEffectToGet); + } + + ItemStack returnItem = new ItemStack(Items.glass_bottle); + if(!player.inventory.addItemStackToInventory(returnItem.copy())){ + EntityItem entityItem = new EntityItem(player.worldObj, player.posX, player.posY, player.posZ, returnItem.copy()); + entityItem.delayBeforeCanPickup = 0; + player.worldObj.spawnEntityInWorld(entityItem); + } + } + return stackToReturn; + } + + @Override + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ + if(KeyUtil.isShiftPressed()){ + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + ".desc.1")); + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + allJams[stack.getItemDamage()].getName() + ".desc")); + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + ".desc.2")); + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".hunger.desc") + ": " + allJams[stack.getItemDamage()].healAmount); + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".saturation.desc") + ": " + allJams[stack.getItemDamage()].saturation); + } + else list.add(ItemUtil.shiftForInfo()); + + if(KeyUtil.isControlPressed()) ItemUtil.addOredictName(allJams[stack.getItemDamage()].getOredictName(), list); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamageForRenderPass(int damage, int pass){ + return pass > 0 ? this.overlayIcon : super.getIconFromDamageForRenderPass(damage, pass); + } + + @Override + public boolean requiresMultipleRenderPasses(){ + return true; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconReg){ + this.itemIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); + this.overlayIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Overlay"); + } + + @Override + public String getName(){ + return "itemJam"; + } +} \ No newline at end of file diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemKnife.java b/src/main/java/ellpeck/actuallyadditions/items/ItemKnife.java index 1fbe9f335..e1e324382 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemKnife.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemKnife.java @@ -55,10 +55,11 @@ public class ItemKnife extends Item implements INameableItem{ if(KeyUtil.isShiftPressed()){ list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + ".desc")); list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); - ItemUtil.addOredictName(this, list); } else list.add(ItemUtil.shiftForInfo()); + if(KeyUtil.isControlPressed()) ItemUtil.addOredictName(this.getOredictName(), list); + } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemLeafBlower.java b/src/main/java/ellpeck/actuallyadditions/items/ItemLeafBlower.java index 083930f83..afade1b83 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemLeafBlower.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemLeafBlower.java @@ -53,11 +53,6 @@ public class ItemLeafBlower extends Item implements INameableItem{ return this.getName(); } - @Override - public boolean shouldRotateAroundWhenRendering(){ - return false; - } - public void breakStuff(World world, int x, int y, int z){ ArrayList theCoords = new ArrayList(); @@ -119,9 +114,10 @@ public class ItemLeafBlower extends Item implements INameableItem{ list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + ".desc." + 1)); list.add(StringUtil.ITALIC + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".itemLeafBlower.desc.2")); list.add(StringUtil.ITALIC + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".itemLeafBlower.desc.3")); - ItemUtil.addOredictName(this, list); } else list.add(ItemUtil.shiftForInfo()); + + if(KeyUtil.isControlPressed()) ItemUtil.addOredictName(this.getOredictName(), list); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemMisc.java b/src/main/java/ellpeck/actuallyadditions/items/ItemMisc.java index 56789f767..ab9bbc2bc 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemMisc.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemMisc.java @@ -3,7 +3,9 @@ package ellpeck.actuallyadditions.items; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.items.metalists.TheMiscItems; -import ellpeck.actuallyadditions.util.*; +import ellpeck.actuallyadditions.util.INameableItem; +import ellpeck.actuallyadditions.util.ItemUtil; +import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; @@ -11,7 +13,6 @@ import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import java.util.List; @@ -61,11 +62,7 @@ public class ItemMisc extends Item implements INameableItem{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ - if(KeyUtil.isShiftPressed()){ - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + allMiscItems[stack.getItemDamage()].getName() + ".desc")); - list.add(StringUtil.GRAY + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".oredictName.desc") + ": " + allMiscItems[stack.getItemDamage()].getOredictName()); - } - else list.add(ItemUtil.shiftForInfo()); + ItemUtil.addInformation(this, list, 1, allMiscItems[stack.getItemDamage()].getName(), allMiscItems[stack.getItemDamage()].getOredictName()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemPotionRing.java b/src/main/java/ellpeck/actuallyadditions/items/ItemPotionRing.java index 436e14957..4a6323b68 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemPotionRing.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemPotionRing.java @@ -40,18 +40,21 @@ public class ItemPotionRing extends Item implements INameableItem{ public void onUpdate(ItemStack stack, World world, Entity player, int par4, boolean par5){ super.onUpdate(stack, world, player, par4, par5); - if(player instanceof EntityPlayer){ - EntityPlayer thePlayer = (EntityPlayer)player; - ItemStack equippedStack = ((EntityPlayer)player).getCurrentEquippedItem(); + if(!world.isRemote){ + if(player instanceof EntityPlayer){ + EntityPlayer thePlayer = (EntityPlayer)player; + ItemStack equippedStack = ((EntityPlayer)player).getCurrentEquippedItem(); - ThePotionRings effect = ThePotionRings.values()[stack.getItemDamage()]; - if(!effect.needsWaitBeforeActivating || !thePlayer.isPotionActive(effect.effectID)){ - if(!((ItemPotionRing)stack.getItem()).isAdvanced){ - if(equippedStack != null && stack.isItemEqual(equippedStack)){ - thePlayer.addPotionEffect(new PotionEffect(effect.effectID, effect.activeTime, effect.normalAmplifier, true)); + ThePotionRings effect = ThePotionRings.values()[stack.getItemDamage()]; + if(!effect.needsWaitBeforeActivating || !thePlayer.isPotionActive(effect.effectID)){ + if(!((ItemPotionRing)stack.getItem()).isAdvanced){ + if(equippedStack != null && stack.isItemEqual(equippedStack)){ + thePlayer.addPotionEffect(new PotionEffect(effect.effectID, effect.activeTime, effect.normalAmplifier, true)); + } } + else + thePlayer.addPotionEffect(new PotionEffect(effect.effectID, effect.activeTime, effect.advancedAmplifier, true)); } - else thePlayer.addPotionEffect(new PotionEffect(effect.effectID, effect.activeTime, effect.advancedAmplifier, true)); } } } @@ -88,16 +91,14 @@ public class ItemPotionRing extends Item implements INameableItem{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ + ItemUtil.addInformation(this, list, 2, "", allRings[stack.getItemDamage()].getOredictName()); + if(KeyUtil.isShiftPressed()){ - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + ".desc.1")); - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + ".desc.2")); if(stack.getItemDamage() == ThePotionRings.SATURATION.ordinal()){ list.add(StringUtil.RED + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".itemPotionRing.desc.off.1")); list.add(StringUtil.RED + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".itemPotionRing.desc.off.2")); } - list.add(StringUtil.GRAY + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".oredictName.desc") + ": " + allRings[stack.getItemDamage()].getOredictName()); } - else list.add(ItemUtil.shiftForInfo()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemSpecialDrop.java b/src/main/java/ellpeck/actuallyadditions/items/ItemSpecialDrop.java index 69d9ca8e5..b3e2aa817 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemSpecialDrop.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemSpecialDrop.java @@ -3,7 +3,9 @@ package ellpeck.actuallyadditions.items; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.items.metalists.TheSpecialDrops; -import ellpeck.actuallyadditions.util.*; +import ellpeck.actuallyadditions.util.INameableItem; +import ellpeck.actuallyadditions.util.ItemUtil; +import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.item.EntityXPOrb; @@ -12,7 +14,6 @@ import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; import java.util.List; @@ -75,11 +76,7 @@ public class ItemSpecialDrop extends Item implements INameableItem{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ - if(KeyUtil.isShiftPressed()){ - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + allDrops[stack.getItemDamage()].getName() + ".desc")); - list.add(StringUtil.GRAY + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".oredictName.desc") + ": " + allDrops[stack.getItemDamage()].getOredictName()); - } - else list.add(ItemUtil.shiftForInfo()); + ItemUtil.addInformation(this, list, 1, allDrops[stack.getItemDamage()].getName(), allDrops[stack.getItemDamage()].getOredictName()); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/metalists/TheJams.java b/src/main/java/ellpeck/actuallyadditions/items/metalists/TheJams.java new file mode 100644 index 000000000..db7df8ac5 --- /dev/null +++ b/src/main/java/ellpeck/actuallyadditions/items/metalists/TheJams.java @@ -0,0 +1,43 @@ +package ellpeck.actuallyadditions.items.metalists; + +import ellpeck.actuallyadditions.util.INameableItem; +import net.minecraft.item.EnumRarity; + +public enum TheJams implements INameableItem{ + + CU_BA_RA("CuBaRa", 5, 2F, EnumRarity.common, "jamCuBaRa", 5, 12, 12595273), + GRA_KI_BA("GraKiBa", 5, 2F, EnumRarity.common, "jamGraKiBa", 16, 13, 5492820), + PL_AP_LE("PlApLe", 5, 2F, EnumRarity.common, "jamPlApLe", 15, 3, 13226009), + CH_AP_CI("ChApCi", 5, 2F, EnumRarity.common, "jamChApCi", 10, 1, 13189222), + HO_ME_KI("HoMeKi", 5, 2F, EnumRarity.common, "jamHoMeKi", 10, 14, 2031360); + + public final String name; + public final String oredictName; + public final int healAmount; + public final float saturation; + public final EnumRarity rarity; + public final int firstEffectToGet; + public final int secondEffectToGet; + public final int color; + + TheJams(String name, int healAmount, float saturation, EnumRarity rarity, String oredictName, int firstEffectID, int secondEffectID, int color){ + this.name = name; + this.healAmount = healAmount; + this.saturation = saturation; + this.rarity = rarity; + this.oredictName = oredictName; + this.firstEffectToGet = firstEffectID; + this.secondEffectToGet = secondEffectID; + this.color = color; + } + + @Override + public String getName(){ + return this.name; + } + + @Override + public String getOredictName(){ + return this.oredictName; + } +} \ No newline at end of file diff --git a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAxeAA.java b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAxeAA.java index 26babfc5d..3ee50bdbb 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAxeAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAxeAA.java @@ -36,11 +36,12 @@ public class ItemAxeAA extends ItemAxe implements INameableItem{ @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { if(KeyUtil.isShiftPressed()){ - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)this).getName() + ".desc")); + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + ".desc")); list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); - ItemUtil.addOredictName(this, list); } - else ItemUtil.addStandardInformation(this, list); + else list.add(ItemUtil.shiftForInfo()); + + if(KeyUtil.isControlPressed()) ItemUtil.addOredictName(this.getOredictName(), list); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemHoeAA.java b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemHoeAA.java index 28d85967a..9e3fd9f8d 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemHoeAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemHoeAA.java @@ -36,11 +36,12 @@ public class ItemHoeAA extends ItemHoe implements INameableItem{ @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { if(KeyUtil.isShiftPressed()){ - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)this).getName() + ".desc")); + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + ".desc")); list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); - ItemUtil.addOredictName(this, list); } - else ItemUtil.addStandardInformation(this, list); + else list.add(ItemUtil.shiftForInfo()); + + if(KeyUtil.isControlPressed()) ItemUtil.addOredictName(this.getOredictName(), list); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemPickaxeAA.java b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemPickaxeAA.java index a6846a2b5..f2f21159e 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemPickaxeAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemPickaxeAA.java @@ -36,11 +36,12 @@ public class ItemPickaxeAA extends ItemPickaxe implements INameableItem{ @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { if(KeyUtil.isShiftPressed()){ - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)this).getName() + ".desc")); + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + ".desc")); list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); - ItemUtil.addOredictName(this, list); } - else ItemUtil.addStandardInformation(this, list); + else list.add(ItemUtil.shiftForInfo()); + + if(KeyUtil.isControlPressed()) ItemUtil.addOredictName(this.getOredictName(), list); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemShovelAA.java b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemShovelAA.java index b4dd21f8e..56dc2115f 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemShovelAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemShovelAA.java @@ -36,11 +36,12 @@ public class ItemShovelAA extends ItemSpade implements INameableItem{ @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { if(KeyUtil.isShiftPressed()){ - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)this).getName() + ".desc")); + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + ".desc")); list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); - ItemUtil.addOredictName(this, list); } - else ItemUtil.addStandardInformation(this, list); + else list.add(ItemUtil.shiftForInfo()); + + if(KeyUtil.isControlPressed()) ItemUtil.addOredictName(this.getOredictName(), list); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemSwordAA.java b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemSwordAA.java index c2373a4b2..b4c09e7fe 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemSwordAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemSwordAA.java @@ -36,11 +36,12 @@ public class ItemSwordAA extends ItemSword implements INameableItem{ @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { if(KeyUtil.isShiftPressed()){ - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)this).getName() + ".desc")); + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + ".desc")); list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); - ItemUtil.addOredictName(this, list); } - else ItemUtil.addStandardInformation(this, list); + else list.add(ItemUtil.shiftForInfo()); + + if(KeyUtil.isControlPressed()) ItemUtil.addOredictName(this.getOredictName(), list); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/proxy/ClientProxy.java b/src/main/java/ellpeck/actuallyadditions/proxy/ClientProxy.java index f6066a752..9ef01bb93 100644 --- a/src/main/java/ellpeck/actuallyadditions/proxy/ClientProxy.java +++ b/src/main/java/ellpeck/actuallyadditions/proxy/ClientProxy.java @@ -2,14 +2,18 @@ package ellpeck.actuallyadditions.proxy; import cpw.mods.fml.client.registry.ClientRegistry; +import cpw.mods.fml.common.registry.VillagerRegistry; import ellpeck.actuallyadditions.blocks.InitBlocks; import ellpeck.actuallyadditions.blocks.render.*; +import ellpeck.actuallyadditions.config.ConfigValues; import ellpeck.actuallyadditions.event.RenderPlayerEventAA; import ellpeck.actuallyadditions.tile.TileEntityCompost; import ellpeck.actuallyadditions.tile.TileEntityFishingNet; import ellpeck.actuallyadditions.tile.TileEntityFurnaceSolar; +import ellpeck.actuallyadditions.util.ModUtil; import ellpeck.actuallyadditions.util.Util; import net.minecraft.item.Item; +import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.MinecraftForgeClient; @SuppressWarnings("unused") @@ -33,6 +37,8 @@ public class ClientProxy implements IProxy{ ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFurnaceSolar.class, new RenderTileEntity(new ModelFurnaceSolar())); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(InitBlocks.blockFurnaceSolar), new RenderItems(new ModelFurnaceSolar())); + VillagerRegistry.instance().registerVillagerSkin(ConfigValues.jamVillagerID, new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/entity/villager/jamVillager.png")); + Util.registerEvent(new RenderPlayerEventAA()); } diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGrinder.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGrinder.java index 93780d9ff..4ed87a743 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGrinder.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGrinder.java @@ -151,7 +151,8 @@ public class TileEntityGrinder extends TileEntityInventoryBase implements IPower this.isDouble = compound.getBoolean("IsDouble"); this.name = compound.getString("Name"); this.maxCrushTime = isDouble ? ConfigValues.grinderDoubleCrushTime : ConfigValues.grinderCrushTime; - this.initializeSlots(compound.getInteger("Slots")); + int slots = compound.getInteger("Slots"); + this.initializeSlots(slots == 0 ? 4 : slots); super.readFromNBT(compound); } diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInputter.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInputter.java index 5e1103743..f739b83b7 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInputter.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInputter.java @@ -242,7 +242,8 @@ public class TileEntityInputter extends TileEntityInventoryBase{ @Override public void readFromNBT(NBTTagCompound compound){ - this.initializeSlots(compound.getInteger("Slots")); + int slots = compound.getInteger("Slots"); + this.initializeSlots(slots == 0 ? 1 : slots); this.sideToPut = compound.getInteger("SideToPut"); this.slotToPut = compound.getInteger("SlotToPut"); this.sideToPull = compound.getInteger("SideToPull"); diff --git a/src/main/java/ellpeck/actuallyadditions/util/BlockUtil.java b/src/main/java/ellpeck/actuallyadditions/util/BlockUtil.java index cca4cedad..4a6ef88c8 100644 --- a/src/main/java/ellpeck/actuallyadditions/util/BlockUtil.java +++ b/src/main/java/ellpeck/actuallyadditions/util/BlockUtil.java @@ -17,17 +17,26 @@ public class BlockUtil{ } @SuppressWarnings("unchecked") - public static void addStandardInformation(Block block, List list){ + public static void addInformation(Block block, List list, int lines, String extraName, String extraOredictName){ if(KeyUtil.isShiftPressed()){ - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)block).getName() + ".desc")); - addOredictName(block, list); + for(int i = 0; i < lines; i++){ + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)block).getName() + extraName + ".desc" + (lines > 1 ? "." +(i+1) : ""))); + } } else list.add(ItemUtil.shiftForInfo()); + + if(KeyUtil.isControlPressed()){ + addOredictName(extraOredictName, list); + } + } + + public static void addInformation(Block block, List list, int lines, String extraName){ + addInformation(block, list, lines, extraName, ((INameableItem)block).getOredictName()); } @SuppressWarnings("unchecked") - public static void addOredictName(Block block, List list){ - list.add(StringUtil.GRAY + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".oredictName.desc") + ": " + ((INameableItem)block).getOredictName()); + public static void addOredictName(String name, List list){ + list.add(StringUtil.GRAY + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".oredictName.desc") + ": " + name); } public static void register(Block block, Class itemBlock, Enum[] list){ diff --git a/src/main/java/ellpeck/actuallyadditions/util/ItemUtil.java b/src/main/java/ellpeck/actuallyadditions/util/ItemUtil.java index e40efb4c0..07c1f25b1 100644 --- a/src/main/java/ellpeck/actuallyadditions/util/ItemUtil.java +++ b/src/main/java/ellpeck/actuallyadditions/util/ItemUtil.java @@ -11,15 +11,26 @@ import java.util.List; public class ItemUtil{ + public static void addInformation(Item item, List list, int lines, String extraName){ + addInformation(item, list, lines, extraName, ((INameableItem)item).getOredictName()); + } + @SuppressWarnings("unchecked") - public static void addStandardInformation(Item item, List list){ + public static void addInformation(Item item, List list, int lines, String extraName, String extraOredictName){ if(KeyUtil.isShiftPressed()){ - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)item).getName() + ".desc")); - addOredictName(item, list); + for(int i = 0; i < lines; i++){ + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)item).getName() + extraName + ".desc" + (lines > 1 ? "." +(i+1) : ""))); + } } else list.add(shiftForInfo()); + + if(KeyUtil.isControlPressed()){ + addOredictName(extraOredictName, list); + } } + + public static void registerItems(Item[] items){ for(Item item : items){ register(item); @@ -27,8 +38,8 @@ public class ItemUtil{ } @SuppressWarnings("unchecked") - public static void addOredictName(Item item, List list){ - list.add(StringUtil.GRAY + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".oredictName.desc") + ": " + ((INameableItem)item).getOredictName()); + public static void addOredictName(String name, List list){ + list.add(StringUtil.GRAY + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".oredictName.desc") + ": " + name); } public static void register(Item item){ @@ -54,5 +65,4 @@ public class ItemUtil{ public static String shiftForInfo(){ return StringUtil.GREEN + StringUtil.ITALIC + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".shiftForInfo.desc"); } - } diff --git a/src/main/java/ellpeck/actuallyadditions/util/ModUtil.java b/src/main/java/ellpeck/actuallyadditions/util/ModUtil.java index bd96d90b2..061904fd3 100644 --- a/src/main/java/ellpeck/actuallyadditions/util/ModUtil.java +++ b/src/main/java/ellpeck/actuallyadditions/util/ModUtil.java @@ -5,7 +5,7 @@ import org.apache.logging.log4j.Logger; public class ModUtil{ - public static final String VERSION = "1.7.10-0.0.3.3"; + public static final String VERSION = "1.7.10-0.0.3.5"; public static final String MOD_ID = "ActuallyAdditions"; public static final String NAME = "Actually Additions"; diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index 8c2fa533a..4b0ba63fe 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -16,6 +16,9 @@ tile.actuallyadditions.blockFurnaceSolar.name=Solar Panel tile.actuallyadditions.blockHeatCollector.name=Heat Collector tile.actuallyadditions.blockItemRepairer.name=Item Repairer +tile.actuallyadditions.blockMiscWoodCasing.name=Wood Casing +tile.actuallyadditions.blockMiscStoneCasing.name=Stone Casing + tile.actuallyadditions.blockInputter.name=ESD tile.actuallyadditions.blockInputterAdvanced.name=Advanced ESD tile.actuallyadditions.blockInputter.add.0.name=Ellpeck's Slot Device @@ -44,6 +47,12 @@ item.actuallyadditions.itemMiscKnifeHandle.name=Knife Handle item.actuallyadditions.itemMiscBlackQuartz.name=Black Quartz item.actuallyadditions.itemMiscRing.name=Ring +item.actuallyadditions.itemJamCuBaRa.name=CuBaRa-Jam +item.actuallyadditions.itemJamGraKiBa.name=GraKiBa-Jam +item.actuallyadditions.itemJamPlApLe.name=PlApLe-Jam +item.actuallyadditions.itemJamChApCi.name=ChApCi-Jam +item.actuallyadditions.itemJamHoMeKi.name=HoMeKi-Jam + item.actuallyadditions.itemLeafBlower.name=Leaf Blower item.actuallyadditions.itemLeafBlowerAdvanced.name=Advanced Leaf Blower item.actuallyadditions.itemKnife.name=Knife @@ -76,6 +85,9 @@ item.actuallyadditions.itemFoodCarrotJuice.name=Carrot Juice item.actuallyadditions.itemFoodPumpkinStew.name=Pumpkin Stew item.actuallyadditions.itemFoodCheese.name=Cheese +item.actuallyadditions.itemMiscCoil.name=Basic Coil +item.actuallyadditions.itemMiscCoilAdvanced.name=Advanced Coil + item.actuallyadditions.itemPotionRing.name=Ring of item.actuallyadditions.itemPotionRingAdvanced.name=Advanced Ring of @@ -101,6 +113,14 @@ tooltip.actuallyadditions.saturation.desc=Saturation tooltip.actuallyadditions.durability.desc=Durability tooltip.actuallyadditions.oredictName.desc=OreDictionary Name +tooltip.actuallyadditions.itemJam.desc.1=A delicious Jam consisting of +tooltip.actuallyadditions.itemJam.desc.2=Also gives you some Effects! +tooltip.actuallyadditions.itemJamCuBaRa.desc=Currant, Banana and Raspberry +tooltip.actuallyadditions.itemJamGraKiBa.desc=Grape, Kiwi and Banana +tooltip.actuallyadditions.itemJamPlApLe.desc=Plum, Apple and Lemon +tooltip.actuallyadditions.itemJamChApCi.desc=Cherry, Apple and Cinnamon +tooltip.actuallyadditions.itemJamHoMeKi.desc=Honeydew Melon and Kiwi + tooltip.actuallyadditions.blockCompost.desc.1=Used to make Fertilizer with Mashed Food tooltip.actuallyadditions.blockCompost.desc.2=BETA INFO: Will visually contain Compost in the Future! tooltip.actuallyadditions.blockMiscOreBlackQuartz.desc=The darkest form of Quartz. @@ -125,8 +145,8 @@ tooltip.actuallyadditions.blockInputter.desc.5=-Side to Output to and Input from tooltip.actuallyadditions.blockInputter.desc.6=-Slot in the other Inventory to Output to and Input from tooltip.actuallyadditions.blockInputterAdvanced.desc=Has an Input and Output Filter! tooltip.actuallyadditions.blockFishingNet.desc=Catches Fish automatically when placed above Water -tooltip.actuallyadditions.blockFurnaceSolar.desc=Powers Furnaces and Crushers below it in Daylight -tooltip.actuallyadditions.blockHeatCollector.desc.1=Powers Furnaces and Crushers above it +tooltip.actuallyadditions.blockFurnaceSolar.desc=Powers Actually Additions Machines and Vanilla Furnaces below it in Daylight +tooltip.actuallyadditions.blockHeatCollector.desc.1=Powers Actually Additions Machines and Vanilla Furnaces above it tooltip.actuallyadditions.blockHeatCollector.desc.2=Needs a bunch of Lava around it tooltip.actuallyadditions.blockHeatCollector.desc.3=Occasionally steals the Lava. Watch out! tooltip.actuallyadditions.blockItemRepairer.desc=Repairs Tools and Armor automatically @@ -140,11 +160,17 @@ tooltip.actuallyadditions.itemMiscKnifeHandle.desc=Fits comfortably in your hand tooltip.actuallyadditions.itemMiscBlackQuartz.desc=Used in the Quartz Enchanter! tooltip.actuallyadditions.itemMiscRing.desc=Used for crafting Effect Rings +tooltip.actuallyadditions.blockMiscWoodCasing.desc=Not so sturdy Casing, used for Crafting +tooltip.actuallyadditions.blockMiscStoneCasing.desc=Pretty sturdy Casing, used for Crafting + tooltip.actuallyadditions.itemPotionRing.desc.1=Gives Potion Effect of Level 1 tooltip.actuallyadditions.itemPotionRing.desc.2=Needs to be held in Hand tooltip.actuallyadditions.itemPotionRing.desc.off.1=Crafting Recipe of this particular Potion Effect is turned OFF by default tooltip.actuallyadditions.itemPotionRing.desc.off.2=as it is extremely overpowered! Turn it on in the Config File if needed. +tooltip.actuallyadditions.itemMiscCoil.desc=Lower Tier Coil, used for Crafting +tooltip.actuallyadditions.itemMiscCoilAdvanced.desc=Higher Tier Coil, used for Crafting + tooltip.actuallyadditions.itemPotionRingAdvanced.desc.1=Gives Potion Effect of a High Level tooltip.actuallyadditions.itemPotionRingAdvanced.desc.2=Can be anywhere in the Inventory diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index f7dcf1a26..93ec25613 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -3,7 +3,7 @@ "modid": "ActuallyAdditions", "name": "Actually Additions", "description": "Actually Additions is a mod that adds a lot of Random Things and Gadgets to your Minecraft, including better Furnaces, Crushers that double your Ores, Automation, a bunch of food and lots more!", - "version": "0.0.3.3", + "version": "0.0.3.5", "mcversion": "1.7.10", "url": "https://github.com/Ellpeck/ActuallyAdditions", "updateUrl": "",