Class IPotionMirror
java.lang.Object
com.saicone.rtag.item.mirror.IPotionMirror
- All Implemented Interfaces:
ItemMirror
IPotionMirror to convert item potions
across 1.8 and other versions.
Mojang removes potion types inside item damage since 1.9, this class provides a clear conversion.
Mojang removes potion types inside item damage since 1.9, this class provides a clear conversion.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumPotion type enum only with potion names that can be translated to MC 1.8 item damage. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs an IPotionMirror with default options.IPotionMirror(boolean convertDamage) Constructs an IPotionMirror with specified damage conversion option. -
Method Summary
Modifier and TypeMethodDescriptionvoiddowngrade(@NotNull Object compound, @NotNull String id, @NotNull Object components, @NotNull com.saicone.rtag.util.MC from, @NotNull com.saicone.rtag.util.MC to) Downgrade current item tag compound from upper version.intGet corresponding damage to 1.8 item from potion name.@NotNull com.saicone.rtag.util.MCGet the maximum compatible version, exclusive.getPotion(int damage) Get potion name from 1.8 damage.voidupgrade(@NotNull Object compound, @NotNull String id, @NotNull com.saicone.rtag.util.MC from, @NotNull com.saicone.rtag.util.MC to) Upgrade current item tag compound from lower version.voidupgrade(@NotNull Object compound, @NotNull String id, @NotNull Object components, @NotNull com.saicone.rtag.util.MC from, @NotNull com.saicone.rtag.util.MC to) Upgrade current item tag compound from lower version.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ItemMirror
downgrade, downgrade, downgrade, getDeprecationVersion, getMinimumVersion, getMinVersion0, upgrade, upgrade
-
Constructor Details
-
IPotionMirror
public IPotionMirror()Constructs an IPotionMirror with default options. -
IPotionMirror
public IPotionMirror(boolean convertDamage) Constructs an IPotionMirror with specified damage conversion option.- Parameters:
convertDamage- true to convert old potion damage into potion effect.
-
-
Method Details
-
getMaximumVersion
Description copied from interface:ItemMirrorGet the maximum compatible version, exclusive.- Specified by:
getMaximumVersionin interfaceItemMirror- Returns:
- a version.
-
upgrade
public void upgrade(@NotNull @NotNull Object compound, @NotNull @NotNull String id, @NotNull @NotNull Object components, @NotNull @NotNull com.saicone.rtag.util.MC from, @NotNull @NotNull com.saicone.rtag.util.MC to) Description copied from interface:ItemMirrorUpgrade current item tag compound from lower version.- Specified by:
upgradein interfaceItemMirror- Parameters:
compound- the tag compound that represents item data.id- the item material id.components- the item components, on older versions this may be the item tag.from- the initial version of item data.to- the version to upgrade item data.
-
upgrade
public void upgrade(@NotNull @NotNull Object compound, @NotNull @NotNull String id, @NotNull @NotNull com.saicone.rtag.util.MC from, @NotNull @NotNull com.saicone.rtag.util.MC to) Description copied from interface:ItemMirrorUpgrade current item tag compound from lower version.- Specified by:
upgradein interfaceItemMirror- Parameters:
compound- the tag compound that represents item data.id- the item material id.from- the initial version of item data.to- the version to upgrade item data.
-
downgrade
public void downgrade(@NotNull @NotNull Object compound, @NotNull @NotNull String id, @NotNull @NotNull Object components, @NotNull @NotNull com.saicone.rtag.util.MC from, @NotNull @NotNull com.saicone.rtag.util.MC to) Description copied from interface:ItemMirrorDowngrade current item tag compound from upper version.- Specified by:
downgradein interfaceItemMirror- Parameters:
compound- the tag compound that represents item data.id- the item material id.components- the item components, on older versions this may be the item tag.from- the initial version of item data.to- the version to downgrade item data.
-
getPotion
-
getDamage
-