Added MLprop.java that ST forgot when he merged.

Fixed EntityPlayer.getPlayerStrVsBlock metadata function for 1.0.0 changes in Enchantments/Potions.
This commit is contained in:
LexManos 2011-12-01 07:29:06 +00:00
parent 68cc1d315b
commit 5c7978d347
3 changed files with 57 additions and 20 deletions

11
forge/MLProp.java Normal file
View file

@ -0,0 +1,11 @@
package net.minecraft.src;
import java.lang.annotation.*;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface MLProp {
String name() default "";
String info() default "";
double min() default Double.NEGATIVE_INFINITY;
double max() default Double.POSITIVE_INFINITY;
}

View file

@ -20,7 +20,7 @@
public float getCurrentPlayerStrVsBlock(Block block)
{
float f = inventory.getStrVsBlock(block);
@@ -576,6 +582,32 @@
@@ -576,6 +582,45 @@
return f1;
}
@ -29,31 +29,44 @@
+ public float getCurrentPlayerStrVsBlock(Block block, int md)
+ {
+ float f = 1.0F;
+ ItemStack ist=inventory.getCurrentItem();
+ if(ist!=null) f=ist.getItem().getStrVsBlock(ist,block,md);
+ if(isInsideOfMaterial(Material.water))
+ ItemStack ist = inventory.getCurrentItem();
+ if(ist != null)
+ {
+ f /= 5F;
+ f = ist.getItem().getStrVsBlock(ist, block, md);
+ }
+ if(!onGround)
+
+ int i = EnchantmentHelper.getEfficiencyModifier(inventory);
+ if (i > 0 && ForgeHooks.canHarvestBlock(block, this, md))
+ {
+ f /= 5F;
+ f += i * i + 1;
+ }
+
+ if(isPotionActive(Potion.potionDigSpeed))
+ {
+ f *= 1.0F + (float)(getActivePotionEffect(Potion.potionDigSpeed).getAmplifier() + 1) * 0.2F;
+ }
+
+ if(isPotionActive(Potion.potionDigSlow))
+ {
+ f *= 1.0F - (float)(getActivePotionEffect(Potion.potionDigSlow).getAmplifier() + 1) * 0.2F;
+ }
+
+ if(isInsideOfMaterial(Material.water) && !EnchantmentHelper.getAquaAffinityModifier(inventory))
+ {
+ f /= 5F;
+ }
+
+ if(!onGround)
+ {
+ f /= 5F;
+ }
+ return f;
+ }
+
public boolean canHarvestBlock(Block block)
{
return inventory.canHarvestBlock(block);
@@ -774,6 +806,25 @@
@@ -774,6 +819,25 @@
protected void damageEntity(DamageSource damagesource, int i)
{
@ -79,7 +92,7 @@
if(!damagesource.unblockable() && func_35162_ad())
{
i = 1 + i >> 1;
@@ -825,7 +876,9 @@
@@ -825,7 +889,9 @@
public void destroyCurrentEquippedItem()
{
@ -89,7 +102,7 @@
}
public double getYOffset()
@@ -957,6 +1010,10 @@
@@ -957,6 +1023,10 @@
public EnumStatus sleepInBedAt(int i, int j, int k)
{

View file

@ -20,7 +20,7 @@
public float getCurrentPlayerStrVsBlock(Block block)
{
float f = inventory.getStrVsBlock(block);
@@ -521,6 +527,32 @@
@@ -521,6 +527,45 @@
return f1;
}
@ -29,31 +29,44 @@
+ public float getCurrentPlayerStrVsBlock(Block block, int md)
+ {
+ float f = 1.0F;
+ ItemStack ist=inventory.getCurrentItem();
+ if(ist!=null) f=ist.getItem().getStrVsBlock(ist,block,md);
+ if(isInsideOfMaterial(Material.water))
+ ItemStack ist = inventory.getCurrentItem();
+ if(ist != null)
+ {
+ f /= 5F;
+ f = ist.getItem().getStrVsBlock(ist, block, md);
+ }
+ if(!onGround)
+
+ int i = EnchantmentHelper.func_40630_b(inventory);
+ if (i > 0 && ForgeHooks.canHarvestBlock(block, this, md))
+ {
+ f /= 5F;
+ f += i * i + 1;
+ }
+
+ if(func_35184_a(Potion.digSpeed))
+ {
+ f *= 1.0F + (float)(func_35187_b(Potion.digSpeed).getAmplifier() + 1) * 0.2F;
+ }
+
+ if(func_35184_a(Potion.digSlowdown))
+ {
+ f *= 1.0F - (float)(func_35187_b(Potion.digSlowdown).getAmplifier() + 1) * 0.2F;
+ }
+
+ if(isInsideOfMaterial(Material.water) && !EnchantmentHelper.func_40632_g(inventory))
+ {
+ f /= 5F;
+ }
+
+ if(!onGround)
+ {
+ f /= 5F;
+ }
+ return f;
+ }
+
public boolean canHarvestBlock(Block block)
{
return inventory.canHarvestBlock(block);
@@ -718,7 +750,26 @@
@@ -718,7 +763,26 @@
}
protected void damageEntity(DamageSource damagesource, int i)
@ -81,7 +94,7 @@
if(!damagesource.unblockable() && func_35180_G())
{
i = 1 + i >> 1;
@@ -770,7 +821,9 @@
@@ -770,7 +834,9 @@
public void destroyCurrentEquippedItem()
{
@ -91,7 +104,7 @@
}
public double getYOffset()
@@ -896,6 +949,10 @@
@@ -896,6 +962,10 @@
public EnumStatus sleepInBedAt(int i, int j, int k)
{