blob: 5f0dfd570650d40a6f3d35b3541fb81aa43ba748 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
package jp.plusplus.fbs.item;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import jp.plusplus.fbs.Registry;
import jp.plusplus.fbs.exprop.FBSEntityProperties;
import jp.plusplus.fbs.exprop.SanityManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import java.util.List;
/**
* Created by pluslus_F on 2015/06/16.
*/
public class ItemPotionSanity extends ItemPotionOblivion {
public ItemPotionSanity(){
setUnlocalizedName("fbs.potSan");
}
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack p_82790_1_, int p_82790_2_) {
return p_82790_2_==0?0x99ff99:0xffffff;
}
public ItemStack onEaten(ItemStack p_77654_1_, World p_77654_2_, EntityPlayer p_77654_3_) {
if (!p_77654_3_.capabilities.isCreativeMode) {
--p_77654_1_.stackSize;
}
if (!p_77654_3_.capabilities.isCreativeMode) {
if (p_77654_1_.stackSize <= 0) {
return new ItemStack(Items.glass_bottle);
}
p_77654_3_.inventory.addItemStackToInventory(new ItemStack(Items.glass_bottle));
}
return p_77654_1_;
}
@Override
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean p_77624_4_) {}
}
|