ForgePatch/patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch
2016-11-13 17:09:55 -05:00

109 lines
5.6 KiB
Diff

--- ../src-base/minecraft/net/minecraft/entity/player/EntityPlayerMP.java
+++ ../src-work/minecraft/net/minecraft/entity/player/EntityPlayerMP.java
@@ -142,9 +142,9 @@
super(p_i45285_2_, p_i45285_3_);
p_i45285_4_.field_73090_b = this;
this.field_71134_c = p_i45285_4_;
- BlockPos blockpos = p_i45285_2_.func_175694_M();
+ BlockPos blockpos = p_i45285_2_.field_73011_w.getRandomizedSpawnPoint();
- if (p_i45285_2_.field_73011_w.func_191066_m() && p_i45285_2_.func_72912_H().func_76077_q() != GameType.ADVENTURE)
+ if (false && p_i45285_2_.field_73011_w.func_191066_m() && p_i45285_2_.func_72912_H().func_76077_q() != GameType.ADVENTURE)
{
int i = Math.max(0, p_i45285_1_.func_184108_a(p_i45285_2_));
int j = MathHelper.func_76128_c(p_i45285_2_.func_175723_af().func_177729_b((double)blockpos.func_177958_n(), (double)blockpos.func_177952_p()));
@@ -253,7 +253,7 @@
this.field_71070_bA.func_75142_b();
- if (!this.field_70170_p.field_72995_K && !this.field_71070_bA.func_75145_c(this))
+ if (!this.field_70170_p.field_72995_K && this.field_71070_bA != null && !this.field_71070_bA.func_75145_c(this))
{
this.func_71053_j();
this.field_71070_bA = this.field_71069_bz;
@@ -436,6 +436,7 @@
public void func_70645_a(DamageSource p_70645_1_)
{
+ if (net.minecraftforge.common.ForgeHooks.onLivingDeath(this, p_70645_1_)) return;
boolean flag = this.field_70170_p.func_82736_K().func_82766_b("showDeathMessages");
this.field_71135_a.func_147359_a(new SPacketCombatEvent(this.func_110142_aN(), SPacketCombatEvent.Event.ENTITY_DIED, flag));
@@ -462,8 +463,20 @@
if (!this.field_70170_p.func_82736_K().func_82766_b("keepInventory") && !this.func_175149_v())
{
+ captureDrops = true;
+ capturedDrops.clear();
this.func_190776_cN();
this.field_71071_by.func_70436_m();
+
+ captureDrops = false;
+ net.minecraftforge.event.entity.player.PlayerDropsEvent event = new net.minecraftforge.event.entity.player.PlayerDropsEvent(this, p_70645_1_, capturedDrops, field_70718_bc > 0);
+ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event))
+ {
+ for (net.minecraft.entity.item.EntityItem item : capturedDrops)
+ {
+ this.field_70170_p.func_72838_d(item);
+ }
+ }
}
for (ScoreObjective scoreobjective : this.field_70170_p.func_96441_U().func_96520_a(IScoreCriteria.field_96642_c))
@@ -547,6 +560,7 @@
@Nullable
public Entity func_184204_a(int p_184204_1_)
{
+ if (!net.minecraftforge.common.ForgeHooks.onTravelToDimension(this, p_184204_1_)) return this;
this.field_184851_cj = true;
if (this.field_71093_bK == 1 && p_184204_1_ == 1)
@@ -704,7 +718,7 @@
BlockPos blockpos = new BlockPos(i, j, k);
IBlockState iblockstate = this.field_70170_p.func_180495_p(blockpos);
- if (iblockstate.func_185904_a() == Material.field_151579_a)
+ if (iblockstate.func_177230_c().isAir(iblockstate, this.field_70170_p, blockpos))
{
BlockPos blockpos1 = blockpos.func_177977_b();
IBlockState iblockstate1 = this.field_70170_p.func_180495_p(blockpos1);
@@ -744,6 +758,7 @@
this.field_71070_bA = p_180468_1_.func_174876_a(this.field_71071_by, this);
this.field_71070_bA.field_75152_c = this.field_71139_cq;
this.field_71070_bA.func_75132_a(this);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.PlayerContainerEvent.Open(this, this.field_71070_bA));
}
}
@@ -787,6 +802,7 @@
this.field_71070_bA.field_75152_c = this.field_71139_cq;
this.field_71070_bA.func_75132_a(this);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.PlayerContainerEvent.Open(this, this.field_71070_bA));
}
}
@@ -796,6 +812,7 @@
this.field_71070_bA = new ContainerMerchant(this.field_71071_by, p_180472_1_, this.field_70170_p);
this.field_71070_bA.field_75152_c = this.field_71139_cq;
this.field_71070_bA.func_75132_a(this);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.PlayerContainerEvent.Open(this, this.field_71070_bA));
IInventory iinventory = ((ContainerMerchant)this.field_71070_bA).func_75174_d();
ITextComponent itextcomponent = p_180472_1_.func_145748_c_();
this.field_71135_a.func_147359_a(new SPacketOpenWindow(this.field_71139_cq, "minecraft:villager", itextcomponent, iinventory.func_70302_i_()));
@@ -894,6 +911,7 @@
public void func_71128_l()
{
this.field_71070_bA.func_75134_a(this);
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.PlayerContainerEvent.Close(this, this.field_71070_bA));
this.field_71070_bA = this.field_71069_bz;
}
@@ -925,6 +943,7 @@
{
if (p_71064_1_ != null)
{
+ if (p_71064_1_.func_75967_d() && net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.AchievementEvent(this, (net.minecraft.stats.Achievement) p_71064_1_))) return;
this.field_147103_bO.func_150871_b(this, p_71064_1_, p_71064_2_);
for (ScoreObjective scoreobjective : this.func_96123_co().func_96520_a(p_71064_1_.func_150952_k()))