Merge remote-tracking branch 'origin/master'
This commit is contained in:
parent
62700fa7a8
commit
04c149fa11
2 changed files with 118 additions and 0 deletions
18
patches/common/net/minecraft/src/ItemBucketMilk.java.patch
Normal file
18
patches/common/net/minecraft/src/ItemBucketMilk.java.patch
Normal file
|
@ -0,0 +1,18 @@
|
|||
--- ../src_base/common/net/minecraft/src/ItemBucketMilk.java
|
||||
+++ ../src_work/common/net/minecraft/src/ItemBucketMilk.java
|
||||
@@ -1,4 +1,6 @@
|
||||
package net.minecraft.src;
|
||||
+
|
||||
+import java.util.HashMap;
|
||||
|
||||
public class ItemBucketMilk extends Item
|
||||
{
|
||||
@@ -18,7 +20,7 @@
|
||||
|
||||
if (!par2World.isRemote)
|
||||
{
|
||||
- par3EntityPlayer.clearActivePotions();
|
||||
+ par3EntityPlayer.curePotionEffects(par1ItemStack);
|
||||
}
|
||||
|
||||
return par1ItemStack.stackSize <= 0 ? new ItemStack(Item.bucketEmpty) : par1ItemStack;
|
100
patches/common/net/minecraft/src/PotionEffect.java.patch
Normal file
100
patches/common/net/minecraft/src/PotionEffect.java.patch
Normal file
|
@ -0,0 +1,100 @@
|
|||
--- ../src_base/common/net/minecraft/src/PotionEffect.java
|
||||
+++ ../src_work/common/net/minecraft/src/PotionEffect.java
|
||||
@@ -1,4 +1,7 @@
|
||||
package net.minecraft.src;
|
||||
+
|
||||
+import java.util.ArrayList;
|
||||
+import java.util.List;
|
||||
|
||||
public class PotionEffect
|
||||
{
|
||||
@@ -10,12 +13,17 @@
|
||||
|
||||
/** The amplifier of the potion effect */
|
||||
private int amplifier;
|
||||
+
|
||||
+ /** List of ItemStack that can cure the potion effect **/
|
||||
+ private List<ItemStack> curativeItems;
|
||||
|
||||
public PotionEffect(int par1, int par2, int par3)
|
||||
{
|
||||
this.potionID = par1;
|
||||
this.duration = par2;
|
||||
this.amplifier = par3;
|
||||
+ this.curativeItems = new ArrayList<ItemStack>();
|
||||
+ this.curativeItems.add(new ItemStack(Item.bucketMilk));
|
||||
}
|
||||
|
||||
public PotionEffect(PotionEffect par1PotionEffect)
|
||||
@@ -23,6 +31,7 @@
|
||||
this.potionID = par1PotionEffect.potionID;
|
||||
this.duration = par1PotionEffect.duration;
|
||||
this.amplifier = par1PotionEffect.amplifier;
|
||||
+ this.curativeItems = par1PotionEffect.getCurativeItems();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -63,6 +72,63 @@
|
||||
public int getAmplifier()
|
||||
{
|
||||
return this.amplifier;
|
||||
+ }
|
||||
+
|
||||
+ /***
|
||||
+ * Returns a list of curative items for the potion effect
|
||||
+ * @return The list (ItemStack) of curative items for the potion effect
|
||||
+ */
|
||||
+ public List<ItemStack> getCurativeItems()
|
||||
+ {
|
||||
+ return this.curativeItems;
|
||||
+ }
|
||||
+
|
||||
+ /***
|
||||
+ * Checks the given ItemStack to see if it is in the list of curative items for the potion effect
|
||||
+ * @param stack The ItemStack being checked against the list of curative items for the potion effect
|
||||
+ * @return true if the given ItemStack is in the list of curative items for the potion effect, false otherwise
|
||||
+ */
|
||||
+ public boolean isCurativeItem(ItemStack stack)
|
||||
+ {
|
||||
+ boolean found = false;
|
||||
+ for (ItemStack curativeItem : this.curativeItems)
|
||||
+ {
|
||||
+ if (curativeItem.isItemEqual(stack))
|
||||
+ {
|
||||
+ found = true;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return found;
|
||||
+ }
|
||||
+
|
||||
+ /***
|
||||
+ * Sets the array of curative items for the potion effect
|
||||
+ * @param curativeItems The list of ItemStacks being set to the potion effect
|
||||
+ */
|
||||
+ public void setCurativeItems(List<ItemStack> curativeItems)
|
||||
+ {
|
||||
+ this.curativeItems = curativeItems;
|
||||
+ }
|
||||
+
|
||||
+ /***
|
||||
+ * Adds the given stack to list of curative items for the potion effect
|
||||
+ * @param stack The ItemStack being added to the curative item list
|
||||
+ */
|
||||
+ public void addCurativeItem(ItemStack stack)
|
||||
+ {
|
||||
+ boolean found = false;
|
||||
+ for (ItemStack curativeItem : this.curativeItems)
|
||||
+ {
|
||||
+ if (curativeItem.isItemEqual(stack))
|
||||
+ {
|
||||
+ found = true;
|
||||
+ }
|
||||
+ }
|
||||
+ if (!found)
|
||||
+ {
|
||||
+ this.curativeItems.add(stack);
|
||||
+ }
|
||||
}
|
||||
|
||||
public boolean onUpdate(EntityLiving par1EntityLiving)
|
Loading…
Reference in a new issue