ForgePatch/patches/minecraft/net/minecraft/entity/player/EntityPlayer.java.patch

68 lines
3.2 KiB
Diff
Raw Normal View History

--- a/net/minecraft/entity/player/EntityPlayer.java
+++ b/net/minecraft/entity/player/EntityPlayer.java
@@ -97,6 +97,8 @@
import net.minecraftforge.api.distmarker.OnlyIn;
public abstract class EntityPlayer extends EntityLivingBase {
+ public static final net.minecraft.entity.ai.attributes.IAttribute REACH_DISTANCE = new net.minecraft.entity.ai.attributes.RangedAttribute(null, "generic.reachDistance", 5.0D, 0.0D, 1024.0D).func_111112_a(true);
+
private static final DataParameter<Float> field_184829_a = EntityDataManager.<Float>func_187226_a(EntityPlayer.class, DataSerializers.field_187193_c);
private static final DataParameter<Integer> field_184830_b = EntityDataManager.<Integer>func_187226_a(EntityPlayer.class, DataSerializers.field_187192_b);
protected static final DataParameter<Byte> field_184827_bp = EntityDataManager.<Byte>func_187226_a(EntityPlayer.class, DataSerializers.field_187191_a);
@@ -161,6 +163,7 @@
this.func_110148_a(SharedMonsterAttributes.field_111263_d).func_111128_a((double)0.1F);
this.func_110140_aT().func_111150_b(SharedMonsterAttributes.field_188790_f);
this.func_110140_aT().func_111150_b(SharedMonsterAttributes.field_188792_h);
+ this.func_110140_aT().func_111150_b(REACH_DISTANCE);
}
protected void func_70088_a() {
2018-12-05 09:16:33 +00:00
@@ -433,7 +436,7 @@
this.field_71107_bF = this.field_71109_bG;
this.field_71109_bG = 0.0F;
this.func_71015_k(this.field_70165_t - d0, this.field_70163_u - d1, this.field_70161_v - d2);
- if (this.func_184187_bx() instanceof EntityPig) {
+ if (this.func_184187_bx() instanceof EntityLivingBase && ((EntityLivingBase)this.func_184187_bx()).shouldRiderFaceForward(this)) {
this.field_70125_A = f1;
this.field_70177_z = f;
this.field_70761_aq = ((EntityPig)this.func_184187_bx()).field_70761_aq;
@@ -663,7 +666,12 @@
return p_184816_1_.func_92059_d();
}
+ @Deprecated //Use location sensitive version below
public float func_184813_a(IBlockState p_184813_1_) {
+ return getDigSpeed(p_184813_1_, null);
+ }
+
+ public float getDigSpeed(IBlockState p_184813_1_, @Nullable BlockPos pos) {
float f = this.field_71071_by.func_184438_a(p_184813_1_);
if (f > 1.0F) {
int i = EnchantmentHelper.func_185293_e(this);
@@ -705,6 +713,7 @@
f /= 5.0F;
}
+ f = net.minecraftforge.event.ForgeEventFactory.getBreakSpeed(this, p_184813_1_, f, pos);
return f;
}
2018-12-05 09:16:33 +00:00
@@ -823,7 +832,7 @@
protected void func_190629_c(EntityLivingBase p_190629_1_) {
super.func_190629_c(p_190629_1_);
- if (p_190629_1_.func_184614_ca().func_77973_b() instanceof ItemAxe) {
+ if (p_190629_1_.func_184614_ca().canDisableShield(this.field_184627_bm, this, p_190629_1_)) {
this.func_190777_m(true);
}
@@ -844,7 +853,7 @@
}
protected void func_184590_k(float p_184590_1_) {
- if (p_184590_1_ >= 3.0F && this.field_184627_bm.func_77973_b() == Items.field_185159_cQ) {
+ if (p_184590_1_ >= 3.0F && this.field_184627_bm.isShield(this)) {
int i = 1 + MathHelper.func_76141_d(p_184590_1_);
this.field_184627_bm.func_77972_a(i, this);
if (this.field_184627_bm.func_190926_b()) {