Made some Special Items work

This commit is contained in:
Ellpeck 2015-03-29 16:07:43 +02:00
parent 0bfb102ca9
commit c33e11ea5a
10 changed files with 50 additions and 31 deletions

View file

@ -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;
}

View file

@ -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),

View file

@ -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();
}

View file

@ -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;

View file

@ -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";

View file

@ -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;

View file

@ -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;

View file

@ -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;
}

View file

@ -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();
}

View file

@ -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!