mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 15:18:34 +01:00
Added bacon
This commit is contained in:
parent
d4ed31c85f
commit
5bd1926453
4 changed files with 29 additions and 3 deletions
|
@ -16,6 +16,7 @@ import de.ellpeck.actuallyadditions.items.base.ItemFoodBase;
|
||||||
import de.ellpeck.actuallyadditions.items.metalists.TheFoods;
|
import de.ellpeck.actuallyadditions.items.metalists.TheFoods;
|
||||||
import de.ellpeck.actuallyadditions.util.ModUtil;
|
import de.ellpeck.actuallyadditions.util.ModUtil;
|
||||||
import de.ellpeck.actuallyadditions.util.StringUtil;
|
import de.ellpeck.actuallyadditions.util.StringUtil;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
|
@ -34,6 +35,10 @@ public class ItemFoods extends ItemFoodBase{
|
||||||
public static final TheFoods[] allFoods = TheFoods.values();
|
public static final TheFoods[] allFoods = TheFoods.values();
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon[] textures;
|
public IIcon[] textures;
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
private IIcon iconEllspeck;
|
||||||
|
|
||||||
|
private static final String ELLSPECK = "ellspeck";
|
||||||
|
|
||||||
public ItemFoods(String name){
|
public ItemFoods(String name){
|
||||||
super(0, 0.0F, false, name);
|
super(0, 0.0F, false, name);
|
||||||
|
@ -78,10 +83,21 @@ public class ItemFoods extends ItemFoodBase{
|
||||||
return stack.getItemDamage() >= allFoods.length ? 0 : allFoods[stack.getItemDamage()].saturation;
|
return stack.getItemDamage() >= allFoods.length ? 0 : allFoods[stack.getItemDamage()].saturation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IIcon getIcon(ItemStack stack, int pass){
|
||||||
|
return getIconIndex(stack);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getIconFromDamage(int par1){
|
public IIcon getIconIndex(ItemStack stack){
|
||||||
return par1 >= textures.length ? null : textures[par1];
|
int damage = stack.getItemDamage();
|
||||||
|
if(damage == TheFoods.BACON.ordinal() && StringUtil.equalsToLowerCase(stack.getDisplayName(), ELLSPECK)){
|
||||||
|
return this.iconEllspeck;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return damage >= textures.length ? null : textures[damage];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -114,5 +130,14 @@ public class ItemFoods extends ItemFoodBase{
|
||||||
for(int i = 0; i < textures.length; i++){
|
for(int i = 0; i < textures.length; i++){
|
||||||
textures[i] = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getBaseName()+allFoods[i].name);
|
textures[i] = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getBaseName()+allFoods[i].name);
|
||||||
}
|
}
|
||||||
|
this.iconEllspeck = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":itemEllspeck");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool){
|
||||||
|
if(stack.getItemDamage() == TheFoods.BACON.ordinal() && StringUtil.equalsToLowerCase(stack.getDisplayName(), ELLSPECK)){
|
||||||
|
String strg = "Yes, this is an ugly texture of bacon with its legs behind its head. This is an homage to Ellpeck, the mod author, being able to put his legs behind his head. Wasn't my idea, so don't judge me.";
|
||||||
|
list.addAll(Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(strg, 200));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -36,7 +36,8 @@ public enum TheFoods{
|
||||||
RICE("Rice", 2, 1F, false, 10, EnumRarity.uncommon),
|
RICE("Rice", 2, 1F, false, 10, EnumRarity.uncommon),
|
||||||
RICE_BREAD("RiceBread", 8, 3F, false, 25, EnumRarity.uncommon),
|
RICE_BREAD("RiceBread", 8, 3F, false, 25, EnumRarity.uncommon),
|
||||||
DOUGHNUT("Doughnut", 4, 0.5F, false, 10, EnumRarity.epic),
|
DOUGHNUT("Doughnut", 4, 0.5F, false, 10, EnumRarity.epic),
|
||||||
CHOCOLATE_TOAST("ChocolateToast", 8, 1.4F, false, 40, EnumRarity.rare);
|
CHOCOLATE_TOAST("ChocolateToast", 8, 1.4F, false, 40, EnumRarity.rare),
|
||||||
|
BACON("Bacon", 4, 0.5F, false, 30, EnumRarity.common);
|
||||||
|
|
||||||
public final String name;
|
public final String name;
|
||||||
public final int healAmount;
|
public final int healAmount;
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 990 B |
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
Loading…
Reference in a new issue