Skip to content

Commit 659d41e

Browse files
committed
FIXED: items don't drop after death
1 parent 870ca9e commit 659d41e

1 file changed

Lines changed: 43 additions & 47 deletions

File tree

patches/minecraft/net/minecraft/entity/player/EntityPlayerMP.java.patch

Lines changed: 43 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@
338338
}
339339
catch (Throwable throwable)
340340
{
341-
@@ -475,48 +565,97 @@
341+
@@ -475,48 +565,91 @@
342342

343343
private void func_184849_a(IScoreCriteria p_184849_1_, int p_184849_2_)
344344
{
@@ -428,12 +428,8 @@
428428

429429
if (!this.field_70170_p.func_82736_K().func_82766_b("keepInventory") && !this.func_175149_v())
430430
{
431-
+ captureDrops = true;
432-
+ capturedDrops.clear();
433-
this.func_190776_cN();
434-
this.field_71071_by.func_70436_m();
435-
+
436-
+ captureDrops = false;
431+
- this.func_190776_cN();
432+
- this.field_71071_by.func_70436_m();
437433
+ net.minecraftforge.event.entity.player.PlayerDropsEvent event = new net.minecraftforge.event.entity.player.PlayerDropsEvent(this, p_70645_1_, capturedDrops, field_70718_bc > 0);
438434
+ if (!net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event))
439435
+ {
@@ -457,7 +453,7 @@
457453
score.func_96648_a();
458454
}
459455

460-
@@ -541,30 +680,34 @@
456+
@@ -541,30 +674,34 @@
461457
this.func_110142_aN().func_94549_h();
462458
}
463459

@@ -499,7 +495,7 @@
499495
}
500496

501497
CriteriaTriggers.field_192122_b.func_192211_a(this, p_191956_1_, p_191956_3_);
502-
@@ -602,10 +745,46 @@
498+
@@ -602,10 +739,46 @@
503499
}
504500
}
505501

@@ -550,15 +546,15 @@
550546
public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_)
551547
{
552548
if (this.func_180431_b(p_70097_1_))
553-
@@ -647,7 +826,6 @@
549+
@@ -647,7 +820,6 @@
554550
}
555551
}
556552

557553
- @Override
558554
public boolean func_96122_a(EntityPlayer p_96122_1_)
559555
{
560556
return !this.func_175400_cq() ? false : super.func_96122_a(p_96122_1_);
561-
@@ -655,14 +833,17 @@
557+
@@ -655,14 +827,17 @@
562558

563559
private boolean func_175400_cq()
564560
{
@@ -580,7 +576,7 @@
580576

581577
if (this.field_71093_bK == 0 && p_184204_1_ == -1)
582578
{
583-
@@ -673,8 +854,9 @@
579+
@@ -673,8 +848,9 @@
584580
this.field_193110_cw = null;
585581
}
586582

@@ -591,7 +587,7 @@
591587
this.field_70170_p.func_72900_e(this);
592588

593589
if (!this.field_71136_j)
594-
@@ -693,7 +875,11 @@
590+
@@ -693,7 +869,11 @@
595591
p_184204_1_ = 1;
596592
}
597593

@@ -604,15 +600,15 @@
604600
this.field_71135_a.func_147359_a(new SPacketEffect(1032, BlockPos.field_177992_a, 0, false));
605601
this.field_71144_ck = -1;
606602
this.field_71149_ch = -1.0F;
607-
@@ -702,7 +888,6 @@
603+
@@ -702,7 +882,6 @@
608604
}
609605
}
610606

611607
- @Override
612608
public boolean func_174827_a(EntityPlayerMP p_174827_1_)
613609
{
614610
if (p_174827_1_.func_175149_v())
615-
@@ -728,14 +913,12 @@
611+
@@ -728,14 +907,12 @@
616612
}
617613
}
618614

@@ -627,7 +623,7 @@
627623
public EntityPlayer.SleepResult func_180469_a(BlockPos p_180469_1_)
628624
{
629625
EntityPlayer.SleepResult entityplayer$sleepresult = super.func_180469_a(p_180469_1_);
630-
@@ -753,9 +936,9 @@
626+
@@ -753,9 +930,9 @@
631627
return entityplayer$sleepresult;
632628
}
633629

@@ -638,23 +634,23 @@
638634
if (this.func_70608_bn())
639635
{
640636
this.func_71121_q().func_73039_n().func_151248_b(this, new SPacketAnimation(this, 2));
641-
@@ -769,7 +952,6 @@
637+
@@ -769,7 +946,6 @@
642638
}
643639
}
644640

645641
- @Override
646642
public boolean func_184205_a(Entity p_184205_1_, boolean p_184205_2_)
647643
{
648644
Entity entity = this.func_184187_bx();
649-
@@ -791,7 +973,6 @@
645+
@@ -791,7 +967,6 @@
650646
}
651647
}
652648

653649
- @Override
654650
public void func_184210_p()
655651
{
656652
Entity entity = this.func_184187_bx();
657-
@@ -804,18 +985,15 @@
653+
@@ -804,18 +979,15 @@
658654
}
659655
}
660656

@@ -673,7 +669,7 @@
673669
protected void func_184594_b(BlockPos p_184594_1_)
674670
{
675671
if (!this.func_175149_v())
676-
@@ -827,12 +1005,12 @@
672+
@@ -827,12 +999,12 @@
677673
public void func_71122_b(double p_71122_1_, boolean p_71122_3_)
678674
{
679675
int i = MathHelper.func_76128_c(this.field_70165_t);
@@ -688,7 +684,7 @@
688684
{
689685
BlockPos blockpos1 = blockpos.func_177977_b();
690686
IBlockState iblockstate1 = this.field_70170_p.func_180495_p(blockpos1);
691-
@@ -848,41 +1026,75 @@
687+
@@ -848,41 +1020,75 @@
692688
super.func_184231_a(p_71122_1_, p_71122_3_, iblockstate, blockpos);
693689
}
694690

@@ -771,7 +767,7 @@
771767
}
772768
else
773769
{
774-
@@ -897,14 +1109,9 @@
770+
@@ -897,14 +1103,9 @@
775771

776772
if (ilockablecontainer.func_174893_q_() && !this.func_175146_a(ilockablecontainer.func_174891_i()) && !this.func_175149_v())
777773
{
@@ -789,7 +785,7 @@
789785
return;
790786
}
791787
}
792-
@@ -913,33 +1120,37 @@
788+
@@ -913,33 +1114,37 @@
793789

794790
if (p_71007_1_ instanceof IInteractionObject)
795791
{
@@ -839,7 +835,7 @@
839835
IInventory iinventory = ((ContainerMerchant)this.field_71070_bA).func_75174_d();
840836
ITextComponent itextcomponent = p_180472_1_.func_145748_c_();
841837
this.field_71135_a.func_147359_a(new SPacketOpenWindow(this.field_71139_cq, "minecraft:villager", itextcomponent, iinventory.func_70302_i_()));
842-
@@ -954,25 +1165,28 @@
838+
@@ -954,25 +1159,28 @@
843839
}
844840
}
845841

@@ -875,7 +871,7 @@
875871
public void func_184814_a(ItemStack p_184814_1_, EnumHand p_184814_2_)
876872
{
877873
Item item = p_184814_1_.func_77973_b();
878-
@@ -985,14 +1199,12 @@
874+
@@ -985,14 +1193,12 @@
879875
}
880876
}
881877

@@ -890,7 +886,7 @@
890886
public void func_71111_a(Container p_71111_1_, int p_71111_2_, ItemStack p_71111_3_)
891887
{
892888
if (!(p_71111_1_.func_75139_a(p_71111_2_) instanceof SlotCrafting))
893-
@@ -1014,20 +1226,23 @@
889+
@@ -1014,20 +1220,23 @@
894890
this.func_71110_a(p_71120_1_, p_71120_1_.func_75138_a());
895891
}
896892

@@ -917,7 +913,7 @@
917913
public void func_175173_a(Container p_175173_1_, IInventory p_175173_2_)
918914
{
919915
for (int i = 0; i < p_175173_2_.func_174890_g(); ++i)
920-
@@ -1036,9 +1251,9 @@
916+
@@ -1036,9 +1245,9 @@
921917
}
922918
}
923919

@@ -928,31 +924,31 @@
928924
this.field_71135_a.func_147359_a(new SPacketCloseWindow(this.field_71070_bA.field_75152_c));
929925
this.func_71128_l();
930926
}
931-
@@ -1054,6 +1269,7 @@
927+
@@ -1054,6 +1263,7 @@
932928
public void func_71128_l()
933929
{
934930
this.field_71070_bA.func_75134_a(this);
935931
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.player.PlayerContainerEvent.Close(this, this.field_71070_bA));
936932
this.field_71070_bA = this.field_71069_bz;
937933
}
938934

939-
@@ -1076,7 +1292,6 @@
935+
@@ -1076,7 +1286,6 @@
940936
}
941937
}
942938

943939
- @Override
944940
public void func_71064_a(StatBase p_71064_1_, int p_71064_2_)
945941
{
946942
if (p_71064_1_ != null)
947-
@@ -1090,7 +1305,6 @@
943+
@@ -1090,7 +1299,6 @@
948944
}
949945
}
950946

951947
- @Override
952948
public void func_175145_a(StatBase p_175145_1_)
953949
{
954950
if (p_175145_1_ != null)
955-
@@ -1104,26 +1318,27 @@
951+
@@ -1104,26 +1312,27 @@
956952
}
957953
}
958954

@@ -984,7 +980,7 @@
984980
public void func_192022_b(List<IRecipe> p_192022_1_)
985981
{
986982
this.field_192041_cq.func_193834_b(p_192022_1_, this);
987-
@@ -1148,15 +1363,21 @@
983+
@@ -1148,15 +1357,21 @@
988984
public void func_71118_n()
989985
{
990986
this.field_71149_ch = -1.0E8F;
@@ -1010,7 +1006,7 @@
10101006
protected void func_71036_o()
10111007
{
10121008
if (!this.field_184627_bm.func_190926_b() && this.func_184587_cr())
1013-
@@ -1196,15 +1417,31 @@
1009+
@@ -1196,15 +1411,31 @@
10141010
this.field_71144_ck = -1;
10151011
this.field_71149_ch = -1.0F;
10161012
this.field_71146_ci = -1;
@@ -1044,23 +1040,23 @@
10441040
protected void func_70670_a(PotionEffect p_70670_1_)
10451041
{
10461042
super.func_70670_a(p_70670_1_);
1047-
@@ -1219,7 +1456,6 @@
1043+
@@ -1219,7 +1450,6 @@
10481044
CriteriaTriggers.field_193139_z.func_193153_a(this);
10491045
}
10501046

10511047
- @Override
10521048
protected void func_70695_b(PotionEffect p_70695_1_, boolean p_70695_2_)
10531049
{
10541050
super.func_70695_b(p_70695_1_, p_70695_2_);
1055-
@@ -1227,7 +1463,6 @@
1051+
@@ -1227,7 +1457,6 @@
10561052
CriteriaTriggers.field_193139_z.func_193153_a(this);
10571053
}
10581054

10591055
- @Override
10601056
protected void func_70688_c(PotionEffect p_70688_1_)
10611057
{
10621058
super.func_70688_c(p_70688_1_);
1063-
@@ -1241,25 +1476,21 @@
1059+
@@ -1241,25 +1470,21 @@
10641060
CriteriaTriggers.field_193139_z.func_193153_a(this);
10651061
}
10661062

@@ -1086,7 +1082,7 @@
10861082
public void func_71016_p()
10871083
{
10881084
if (this.field_71135_a != null)
1089-
@@ -1274,9 +1505,17 @@
1085+
@@ -1274,9 +1499,17 @@
10901086
return (WorldServer)this.field_70170_p;
10911087
}
10921088

@@ -1105,7 +1101,7 @@
11051101
this.field_71134_c.func_73076_a(p_71033_1_);
11061102
this.field_71135_a.func_147359_a(new SPacketChangeGameState(3, (float)p_71033_1_.func_77148_a()));
11071103

1108-
@@ -1294,44 +1533,41 @@
1104+
@@ -1294,44 +1527,41 @@
11091105
this.func_175136_bO();
11101106
}
11111107

@@ -1157,7 +1153,7 @@
11571153
}
11581154
}
11591155
else
1160-
@@ -1343,22 +1579,40 @@
1156+
@@ -1343,22 +1573,40 @@
11611157
{
11621158
return true;
11631159
}
@@ -1201,7 +1197,7 @@
12011197
}
12021198

12031199
public EntityPlayer.EnumChatVisibility func_147096_v()
1204-
@@ -1371,10 +1625,9 @@
1200+
@@ -1371,10 +1619,9 @@
12051201
this.field_71135_a.func_147359_a(new SPacketResourcePackSend(p_175397_1_, p_175397_2_));
12061202
}
12071203

@@ -1213,7 +1209,7 @@
12131209
}
12141210

12151211
public void func_143004_u()
1216-
@@ -1396,11 +1649,11 @@
1212+
@@ -1396,11 +1643,11 @@
12171213
{
12181214
if (p_152339_1_ instanceof EntityPlayer)
12191215
{
@@ -1227,15 +1223,15 @@
12271223
}
12281224
}
12291225

1230-
@@ -1409,7 +1662,6 @@
1226+
@@ -1409,7 +1656,6 @@
12311227
this.field_71130_g.remove(Integer.valueOf(p_184848_1_.func_145782_y()));
12321228
}
12331229

12341230
- @Override
12351231
protected void func_175135_B()
12361232
{
12371233
if (this.func_175149_v())
1238-
@@ -1438,11 +1690,10 @@
1234+
@@ -1438,11 +1684,10 @@
12391235
if (entity != this.field_175401_bS)
12401236
{
12411237
this.field_71135_a.func_147359_a(new SPacketCamera(this.field_175401_bS));
@@ -1248,15 +1244,15 @@
12481244
protected void func_184173_H()
12491245
{
12501246
if (this.field_71088_bW > 0 && !this.field_184851_cj)
1251-
@@ -1451,7 +1702,6 @@
1247+
@@ -1451,7 +1696,6 @@
12521248
}
12531249
}
12541250

12551251
- @Override
12561252
public void func_71059_n(Entity p_71059_1_)
12571253
{
12581254
if (this.field_71134_c.func_73081_b() == GameType.SPECTATOR)
1259-
@@ -1472,10 +1722,10 @@
1255+
@@ -1472,10 +1716,10 @@
12601256
@Nullable
12611257
public ITextComponent func_175396_E()
12621258
{
@@ -1269,7 +1265,7 @@
12691265
public void func_184609_a(EnumHand p_184609_1_)
12701266
{
12711267
super.func_184609_a(p_184609_1_);
1272-
@@ -1494,13 +1744,16 @@
1268+
@@ -1494,13 +1738,16 @@
12731269

12741270
public void func_184847_M()
12751271
{
@@ -1289,7 +1285,7 @@
12891285
}
12901286

12911287
public PlayerAdvancements func_192039_O()
1292-
@@ -1512,5 +1765,145 @@
1288+
@@ -1512,5 +1759,145 @@
12931289
public Vec3d func_193106_Q()
12941290
{
12951291
return this.field_193110_cw;

0 commit comments

Comments
 (0)