MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / getEffects

Method getEffects

src/main/java/net/minecraft/item/ItemPotion.java:40–72  ·  view source on GitHub ↗
(ItemStack stack)

Source from the content-addressed store, hash-verified

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 {

Callers 12

onItemUseFinishMethod · 0.95
isEffectInstantMethod · 0.95
hasEffectMethod · 0.95
getHealingPotionMethod · 0.95
getSpeedPotionMethod · 0.95
isGarbageMethod · 0.95
addInformationMethod · 0.80
canBrewMethod · 0.80
brewPotionsMethod · 0.80
onImpactMethod · 0.80
onLivingUpdateMethod · 0.80

Calls 12

tagCountMethod · 0.95
getCompoundTagAtMethod · 0.95
getPotionEffectsMethod · 0.95
hasTagCompoundMethod · 0.80
hasKeyMethod · 0.80
getTagListMethod · 0.80
getMethod · 0.65
getMetadataMethod · 0.65
putMethod · 0.65
getTagCompoundMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected