(ItemStack stack)
| 38 | } |
| 39 | |
| 40 | public List<PotionEffect> getEffects(ItemStack stack) |
| 41 | { |
| 42 | if (stack.hasTagCompound() && stack.getTagCompound().hasKey("CustomPotionEffects", 9)) |
| 43 | { |
| 44 | List<PotionEffect> list1 = Lists.<PotionEffect>newArrayList(); |
| 45 | NBTTagList nbttaglist = stack.getTagCompound().getTagList("CustomPotionEffects", 10); |
| 46 | |
| 47 | for (int i = 0; i < nbttaglist.tagCount(); ++i) |
| 48 | { |
| 49 | NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i); |
| 50 | PotionEffect potioneffect = PotionEffect.readCustomPotionEffectFromNBT(nbttagcompound); |
| 51 | |
| 52 | if (potioneffect != null) |
| 53 | { |
| 54 | list1.add(potioneffect); |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | return list1; |
| 59 | } |
| 60 | else |
| 61 | { |
| 62 | List<PotionEffect> list = this.effectCache.get(stack.getMetadata()); |
| 63 | |
| 64 | if (list == null) |
| 65 | { |
| 66 | list = PotionHelper.getPotionEffects(stack.getMetadata(), false); |
| 67 | this.effectCache.put(stack.getMetadata(), list); |
| 68 | } |
| 69 | |
| 70 | return list; |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | public List<PotionEffect> getEffects(int meta) |
| 75 | { |
no test coverage detected