MCPcopy Create free account
hub / github.com/Teneted/Tenet / fromItemStack

Method fromItemStack

src/main/java/org/bukkit/potion/Potion.java:355–361  ·  view source on GitHub ↗
(@NotNull ItemStack item)

Source from the content-addressed store, hash-verified

353 }
354
355 @NotNull
356 public static Potion fromItemStack(@NotNull ItemStack item) {
357 Validate.notNull(item, "item cannot be null");
358 if (item.getType() != Material.POTION)
359 throw new IllegalArgumentException("item is not a potion");
360 return fromDamage(item.getDurability());
361 }
362
363 /**
364 * Returns an instance of {@link PotionBrewer}.

Callers

nothing calls this directly

Calls 3

fromDamageMethod · 0.95
getTypeMethod · 0.65
getDurabilityMethod · 0.45

Tested by

no test coverage detected