Add setPotionUseTimeLeft to Witch (#5597)

This commit is contained in:
Owen1212055 2021-05-12 05:45:06 -04:00
parent 7033766d14
commit c0a1161311
2 changed files with 15 additions and 0 deletions

View file

@ -37,6 +37,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ int getPotionUseTimeLeft();
+
+ /**
+ * Set time remaining (in ticks) that the Witch is drinking a potion.
+ * <p>
+ * This only has an effect while the Witch is drinking a potion.
+ *
+ * @param ticks Time in ticks remaining
+ * @see #isDrinkingPotion
+ */
+ void setPotionUseTimeLeft(int ticks);
+
+ /**
+ * Get the potion the Witch is drinking
+ *
+ * @return The potion the witch is drinking

View file

@ -136,6 +136,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return getHandle().getPotionUseTimeLeft();
+ }
+
+ @Override
+ public void setPotionUseTimeLeft(int ticks) {
+ getHandle().setPotionUseTimeLeft(ticks);
+ }
+
+ public ItemStack getDrinkingPotion() {
+ return CraftItemStack.asCraftMirror(getHandle().getItemInMainHand());
+ }