diff --git a/forge/MLProp.java b/forge/MLProp.java new file mode 100644 index 000000000..29dfae7ff --- /dev/null +++ b/forge/MLProp.java @@ -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; +} \ No newline at end of file diff --git a/forge/patches/minecraft/net/minecraft/src/EntityPlayer.java.patch b/forge/patches/minecraft/net/minecraft/src/EntityPlayer.java.patch index 9235f34df..0a3eff1d8 100644 --- a/forge/patches/minecraft/net/minecraft/src/EntityPlayer.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/EntityPlayer.java.patch @@ -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) { diff --git a/forge/patches/minecraft_server/net/minecraft/src/EntityPlayer.java.patch b/forge/patches/minecraft_server/net/minecraft/src/EntityPlayer.java.patch index b7fb291f7..676a56ec9 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/EntityPlayer.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/EntityPlayer.java.patch @@ -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) {