From c33e11ea5a60a4f8ad2380d118c33b761fc9b825 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 29 Mar 2015 16:07:43 +0200 Subject: [PATCH] Made some Special Items work --- .../blocks/metalists/TheMiscBlocks.java | 2 +- .../crafting/ItemCrafting.java | 11 +++++++ .../actuallyadditions/items/ItemFoods.java | 1 - .../items/ItemLeafBlower.java | 5 --- .../items/ItemSpecialDrop.java | 14 ++++++++ .../items/metalists/TheDusts.java | 2 +- .../items/metalists/TheFoods.java | 32 +++++++++---------- .../items/metalists/TheMiscItems.java | 2 +- .../actuallyadditions/proxy/IProxy.java | 6 ++-- .../assets/actuallyadditions/lang/en_US.lang | 6 ++-- 10 files changed, 50 insertions(+), 31 deletions(-) diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/metalists/TheMiscBlocks.java b/src/main/java/ellpeck/actuallyadditions/blocks/metalists/TheMiscBlocks.java index 13001ca0e..43e4e64a7 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/metalists/TheMiscBlocks.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/metalists/TheMiscBlocks.java @@ -13,7 +13,7 @@ public enum TheMiscBlocks implements IName{ public final String name; public final EnumRarity rarity; - private TheMiscBlocks(String name, EnumRarity rarity){ + TheMiscBlocks(String name, EnumRarity rarity){ this.name = name; this.rarity = rarity; } diff --git a/src/main/java/ellpeck/actuallyadditions/crafting/ItemCrafting.java b/src/main/java/ellpeck/actuallyadditions/crafting/ItemCrafting.java index 26c666b3f..176200aec 100644 --- a/src/main/java/ellpeck/actuallyadditions/crafting/ItemCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/crafting/ItemCrafting.java @@ -7,6 +7,7 @@ import ellpeck.actuallyadditions.config.ConfigValues; import ellpeck.actuallyadditions.items.InitItems; import ellpeck.actuallyadditions.items.metalists.TheDusts; import ellpeck.actuallyadditions.items.metalists.TheMiscItems; +import ellpeck.actuallyadditions.items.metalists.TheSpecialDrops; import ellpeck.actuallyadditions.util.Util; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -27,6 +28,16 @@ public class ItemCrafting{ 'P', new ItemStack(Blocks.piston), 'R', new ItemStack(Items.redstone)); + //Ender Pearl + GameRegistry.addRecipe(new ItemStack(Items.ender_pearl), + "XXX", "XXX", "XXX", + 'X', new ItemStack(InitItems.itemSpecialDrop, 1, TheSpecialDrops.PEARL_SHARD.ordinal())); + + //Emerald + GameRegistry.addRecipe(new ItemStack(Items.emerald), + "XXX", "XXX", "XXX", + 'X', new ItemStack(InitItems.itemSpecialDrop, 1, TheSpecialDrops.EMERALD_SHARD.ordinal())); + //Advanced Leaf Blower if(ConfigValues.enableLeafBlowerAdvancedRecipe) GameRegistry.addRecipe(new ItemStack(InitItems.itemLeafBlowerAdvanced), diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemFoods.java b/src/main/java/ellpeck/actuallyadditions/items/ItemFoods.java index 55b547ec7..86d4f73e2 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemFoods.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemFoods.java @@ -27,7 +27,6 @@ public class ItemFoods extends ItemFood implements IName{ super(0, 0.0F, false); this.setHasSubtypes(true); this.setMaxDamage(0); - this.setAlwaysEdible(); TheFoods.setReturnItems(); } diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemLeafBlower.java b/src/main/java/ellpeck/actuallyadditions/items/ItemLeafBlower.java index 043673120..ca9fe635b 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemLeafBlower.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemLeafBlower.java @@ -113,11 +113,6 @@ public class ItemLeafBlower extends Item implements IName{ else list.add(ItemUtil.shiftForInfo()); } - @Override - public boolean getShareTag(){ - return true; - } - @Override public IIcon getIcon(ItemStack stack, int pass){ return this.itemIcon; diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemSpecialDrop.java b/src/main/java/ellpeck/actuallyadditions/items/ItemSpecialDrop.java index 1a9d7ca0d..3ee14cbe1 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemSpecialDrop.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemSpecialDrop.java @@ -9,14 +9,17 @@ 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.EntityXPOrb; import net.minecraft.entity.player.EntityPlayer; 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; +import java.util.Random; public class ItemSpecialDrop extends Item implements IName{ @@ -27,6 +30,17 @@ public class ItemSpecialDrop extends Item implements IName{ this.setHasSubtypes(true); } + @Override + public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player){ + if(!world.isRemote){ + if(stack.getItemDamage() == TheSpecialDrops.SOLIDIFIED_EXPERIENCE.ordinal()){ + world.spawnEntityInWorld(new EntityXPOrb(world, player.posX+0.5, player.posY+0.5, player.posZ+0.5, 5+new Random().nextInt(6))); + if(!player.capabilities.isCreativeMode) stack.stackSize--; + } + } + return stack; + } + @Override public String getName(){ return "itemSpecial"; diff --git a/src/main/java/ellpeck/actuallyadditions/items/metalists/TheDusts.java b/src/main/java/ellpeck/actuallyadditions/items/metalists/TheDusts.java index 05ade3244..140981ac1 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/metalists/TheDusts.java +++ b/src/main/java/ellpeck/actuallyadditions/items/metalists/TheDusts.java @@ -19,7 +19,7 @@ public enum TheDusts implements IName{ public final int color; public final EnumRarity rarity; - private TheDusts(String name, int color, EnumRarity rarity){ + TheDusts(String name, int color, EnumRarity rarity){ this.name = name; this.color = color; this.rarity = rarity; diff --git a/src/main/java/ellpeck/actuallyadditions/items/metalists/TheFoods.java b/src/main/java/ellpeck/actuallyadditions/items/metalists/TheFoods.java index ee667e412..39f175b28 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/metalists/TheFoods.java +++ b/src/main/java/ellpeck/actuallyadditions/items/metalists/TheFoods.java @@ -8,22 +8,22 @@ import net.minecraft.item.ItemStack; public enum TheFoods implements IName{ - CHEESE("Cheese", 1, 0.1F, false, 3, EnumRarity.common), - PUMPKIN_STEW("PumpkinStew", 10, 0.4F, true, 30, EnumRarity.common), - CARROT_JUICE("CarrotJuice", 6, 0.2F, true, 20, EnumRarity.common), - FISH_N_CHIPS("FishNChips", 20, 1F, false, 40, EnumRarity.uncommon), - FRENCH_FRIES("FrenchFries", 16, 0.7F, false, 32, EnumRarity.common), - FRENCH_FRY("FrenchFry", 3, 0.01F, false, 3, EnumRarity.common), - SPAGHETTI("Spaghetti", 18, 0.8F, false, 38, EnumRarity.common), - NOODLE("Noodle", 1, 0.01F, false, 3, EnumRarity.common), - CHOCOLATE_CAKE("ChocolateCake", 16, 0.45F, false, 45, EnumRarity.uncommon), - CHOCOLATE("Chocolate", 5, 0.05F, false, 15, EnumRarity.common), + CHEESE("Cheese", 1, 0.5F, false, 3, EnumRarity.common), + PUMPKIN_STEW("PumpkinStew", 10, 1F, true, 30, EnumRarity.common), + CARROT_JUICE("CarrotJuice", 6, 0.6F, true, 20, EnumRarity.common), + FISH_N_CHIPS("FishNChips", 20, 5F, false, 40, EnumRarity.uncommon), + FRENCH_FRIES("FrenchFries", 16, 4F, false, 32, EnumRarity.common), + FRENCH_FRY("FrenchFry", 3, 0.5F, false, 3, EnumRarity.common), + SPAGHETTI("Spaghetti", 18, 3F, false, 38, EnumRarity.common), + NOODLE("Noodle", 1, 0.5F, false, 3, EnumRarity.common), + CHOCOLATE_CAKE("ChocolateCake", 16, 2F, false, 45, EnumRarity.uncommon), + CHOCOLATE("Chocolate", 5, 1F, false, 15, EnumRarity.common), TOAST("Toast", 3, 0.4F, false, 25, EnumRarity.common), - SUBMARINE_SANDWICH("SubmarineSandwich", 10, 0.7F, false, 40, EnumRarity.uncommon), - BIG_COOKIE("BigCookie", 6, 0.1F, false, 20, EnumRarity.uncommon), - HAMBURGER("Hamburger", 14, 0.9F, false, 40, EnumRarity.common), - PIZZA("Pizza", 20, 1F, false, 45, EnumRarity.uncommon), - BAGUETTE("Baguette", 7, 0.2F, false, 25, EnumRarity.common); + SUBMARINE_SANDWICH("SubmarineSandwich", 10, 8F, false, 40, EnumRarity.uncommon), + BIG_COOKIE("BigCookie", 6, 1F, false, 20, EnumRarity.uncommon), + HAMBURGER("Hamburger", 14, 6F, false, 40, EnumRarity.common), + PIZZA("Pizza", 20, 10F, false, 45, EnumRarity.uncommon), + BAGUETTE("Baguette", 7, 2F, false, 25, EnumRarity.common); public static void setReturnItems(){ SPAGHETTI.returnItem = new ItemStack(Items.bowl); @@ -41,7 +41,7 @@ public enum TheFoods implements IName{ public ItemStack returnItem; public final EnumRarity rarity; - private TheFoods(String name, int healAmount, float saturation, boolean getsDrunken, int useDuration, EnumRarity rarity){ + TheFoods(String name, int healAmount, float saturation, boolean getsDrunken, int useDuration, EnumRarity rarity){ this.name = name; this.getsDrunken = getsDrunken; this.healAmount = healAmount; diff --git a/src/main/java/ellpeck/actuallyadditions/items/metalists/TheMiscItems.java b/src/main/java/ellpeck/actuallyadditions/items/metalists/TheMiscItems.java index 76324b8da..4ba6712e8 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/metalists/TheMiscItems.java +++ b/src/main/java/ellpeck/actuallyadditions/items/metalists/TheMiscItems.java @@ -15,7 +15,7 @@ public enum TheMiscItems implements IName{ public final String name; public final EnumRarity rarity; - private TheMiscItems(String name, EnumRarity rarity){ + TheMiscItems(String name, EnumRarity rarity){ this.name = name; this.rarity = rarity; } diff --git a/src/main/java/ellpeck/actuallyadditions/proxy/IProxy.java b/src/main/java/ellpeck/actuallyadditions/proxy/IProxy.java index 94d3d4c97..378d4d555 100644 --- a/src/main/java/ellpeck/actuallyadditions/proxy/IProxy.java +++ b/src/main/java/ellpeck/actuallyadditions/proxy/IProxy.java @@ -2,9 +2,9 @@ package ellpeck.actuallyadditions.proxy; public interface IProxy{ - public abstract void preInit(); + void preInit(); - public abstract void init(); + void init(); - public abstract void postInit(); + void postInit(); } diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index bcb91d1a3..9529e45f3 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -153,11 +153,11 @@ tooltip.actuallyadditions.itemFoodPumpkinStew.desc=Like Mushroom Stew or Rabbit tooltip.actuallyadditions.itemFoodCheese.desc=Cheese. tooltip.actuallyadditions.itemSpecialUnknownSubstance.desc=Dropped by Skeletons. BETA INFO: Useless as of yet. -tooltip.actuallyadditions.itemSpecialSolidifiedExperience.desc=Dropped by everyone. BETA INFO: Useless as of yet. +tooltip.actuallyadditions.itemSpecialSolidifiedExperience.desc=Dropped by everyone. Right-Click to get XP. tooltip.actuallyadditions.itemSpecialBloodFragment.desc=Dropped by everyone. BETA INFO: Useless as of yet. tooltip.actuallyadditions.itemSpecialHeartPart.desc=Dropped by everyone. BETA INFO: Useless as of yet. -tooltip.actuallyadditions.itemSpecialPearlShard.desc=Dropped by Endermen. BETA INFO: Useless as of yet. -tooltip.actuallyadditions.itemSpecialEmeraldShard.desc=Dropped by Creepers. BETA INFO: Useless as of yet. +tooltip.actuallyadditions.itemSpecialPearlShard.desc=Dropped by Endermen. 3x3 Crafting to an Ender Pearl +tooltip.actuallyadditions.itemSpecialEmeraldShard.desc=Dropped by Creepers. 3x3 Crafting to an Emerald tooltip.actuallyadditions.itemDustIron.desc=Iron! Crushed in the Crusher! tooltip.actuallyadditions.itemDustGold.desc=Gold! Crushed in the Crusher!