Drop entity experience on death

This commit is contained in:
Shane Freeder 2019-12-13 15:21:58 +00:00
parent d413dca4ee
commit ae68db1f0e
No known key found for this signature in database
GPG key ID: A3F61EA5A085289C
5 changed files with 25 additions and 25 deletions

View file

@ -1,4 +1,4 @@
From 00491dfb737b8cf317f106ffebb314b64ff922cf Mon Sep 17 00:00:00 2001
From fa128e7c426f23d5895d0fbe65280a461599d94a Mon Sep 17 00:00:00 2001
From: Phoenix616 <mail@moep.tv>
Date: Tue, 21 Aug 2018 01:39:35 +0100
Subject: [PATCH] Improve death events
@ -119,7 +119,7 @@ index 80717ad9a..53aac5bcc 100644
public void b(NBTTagCompound nbttagcompound) {
super.b(nbttagcompound);
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 1592a705f..5fcf3e49a 100644
index 1592a705f..b59b39d41 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -89,7 +89,7 @@ public abstract class EntityLiving extends Entity {
@ -227,7 +227,7 @@ index 1592a705f..5fcf3e49a 100644
Entity entity = damagesource.getEntity();
int i;
@@ -1343,22 +1370,25 @@ public abstract class EntityLiving extends Entity {
@@ -1343,22 +1370,26 @@ public abstract class EntityLiving extends Entity {
boolean flag = this.lastDamageByPlayerTime > 0;
this.dropInventory(); // CraftBukkit - from below
@ -248,7 +248,7 @@ index 1592a705f..5fcf3e49a 100644
+ this.drops = new ArrayList<>(); // Paper
// this.dropInventory();// CraftBukkit - moved up
- this.dropExperience();
this.dropExperience();
+ return deathEvent; // Paper
}
@ -257,7 +257,7 @@ index 1592a705f..5fcf3e49a 100644
// CraftBukkit start
public int getExpReward() {
@@ -1437,6 +1467,7 @@ public abstract class EntityLiving extends Entity {
@@ -1437,6 +1468,7 @@ public abstract class EntityLiving extends Entity {
return SoundEffects.ENTITY_GENERIC_HURT;
}
@ -265,7 +265,7 @@ index 1592a705f..5fcf3e49a 100644
@Nullable
protected SoundEffect getSoundDeath() {
return SoundEffects.ENTITY_GENERIC_DEATH;
@@ -1919,10 +1950,12 @@ public abstract class EntityLiving extends Entity {
@@ -1919,10 +1951,12 @@ public abstract class EntityLiving extends Entity {
}
@ -279,7 +279,7 @@ index 1592a705f..5fcf3e49a 100644
return this.isBaby() ? (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.5F : (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F;
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 850c7cc1b..51b3acadb 100644
index 1e552b1a1..4c7692721 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -75,6 +75,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -357,7 +357,7 @@ index 90fdf89c8..b761a41dc 100644
this.minecraftKey = minecraftKey;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index c6c392676..05f380023 100644
index 609e274a3..73a7cc7fd 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1704,7 +1704,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -447,5 +447,5 @@ index 844781f4e..4fb1092ce 100644
* Server methods
*/
--
2.24.0
2.24.1

View file

@ -1,4 +1,4 @@
From 62b0d0ae1bef673ce8fc4c925dea50a12b56701c Mon Sep 17 00:00:00 2001
From a0ddf16dbdd0b8368556bc9be5cf01669975da09 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Thu, 15 Nov 2018 13:38:37 +0000
Subject: [PATCH] force entity dismount during teleportation
@ -91,10 +91,10 @@ index 78e48f478..4bb24de9d 100644
}
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index c6bd68919..317321395 100644
index b59b39d41..a63edeeb9 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -2732,11 +2732,13 @@ public abstract class EntityLiving extends Entity {
@@ -2733,11 +2733,13 @@ public abstract class EntityLiving extends Entity {
return ((Byte) this.datawatcher.get(EntityLiving.ao) & 4) != 0;
}
@ -112,7 +112,7 @@ index c6bd68919..317321395 100644
this.a(entity);
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index c15543a5c..f41fd576d 100644
index 8eb20424f..635be7ccc 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -985,11 +985,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -133,5 +133,5 @@ index c15543a5c..f41fd576d 100644
if (entity1 != entity && this.playerConnection != null) {
--
2.17.1
2.24.1

View file

@ -1,4 +1,4 @@
From 2739e42d97f124c9d29111cdb5a4f71fb7531336 Mon Sep 17 00:00:00 2001
From fda262dd9b992959add9d37072e8ca5b23c75f9a Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Sat, 22 Sep 2018 00:33:08 -0500
Subject: [PATCH] Add LivingEntity#getTargetEntity
@ -66,10 +66,10 @@ index 0f2480521..2e8aedf5f 100644
return 0.0F;
}
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 317321395..1b5acf77e 100644
index a63edeeb9..43b8a722d 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -3304,6 +3304,37 @@ public abstract class EntityLiving extends Entity {
@@ -3305,6 +3305,37 @@ public abstract class EntityLiving extends Entity {
return world.rayTrace(raytrace);
}

View file

@ -1,14 +1,14 @@
From cb90df7c7d0d0a81be49f2aea7ef317d2408ef3b Mon Sep 17 00:00:00 2001
From 7c80dba0d3a274a5f604ad236f1f12aa13449e31 Mon Sep 17 00:00:00 2001
From: kickash32 <kickash32@gmail.com>
Date: Mon, 19 Aug 2019 19:42:35 +0500
Subject: [PATCH] Prevent consuming the wrong itemstack
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index aa0118a7c..4690ef840 100644
index 43b8a722d..e3c562a63 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -2890,10 +2890,13 @@ public abstract class EntityLiving extends Entity {
@@ -2891,10 +2891,13 @@ public abstract class EntityLiving extends Entity {
this.datawatcher.set(EntityLiving.ao, (byte) j);
}
@ -24,7 +24,7 @@ index aa0118a7c..4690ef840 100644
this.activeItem = itemstack;
this.bl = itemstack.k();
if (!this.world.isClientSide) {
@@ -2969,6 +2972,7 @@ public abstract class EntityLiving extends Entity {
@@ -2970,6 +2973,7 @@ public abstract class EntityLiving extends Entity {
this.clearActiveItem();
} else {
if (!this.activeItem.isEmpty() && this.isHandRaised()) {
@ -32,7 +32,7 @@ index aa0118a7c..4690ef840 100644
this.b(this.activeItem, 16);
// CraftBukkit start - fire PlayerItemConsumeEvent
ItemStack itemstack;
@@ -2999,8 +3003,8 @@ public abstract class EntityLiving extends Entity {
@@ -3000,8 +3004,8 @@ public abstract class EntityLiving extends Entity {
this.a(this.getRaisedHand(), itemstack);
// CraftBukkit end
this.dH();

View file

@ -1,4 +1,4 @@
From 642eba593e0020c47db91ab5c26bed1659c9c596 Mon Sep 17 00:00:00 2001
From 5857af2aa8c422db22152f0324220fda65d63092 Mon Sep 17 00:00:00 2001
From: Lukasz Derlatka <toranktto@gmail.com>
Date: Mon, 11 Nov 2019 16:08:13 +0100
Subject: [PATCH] Fix AssertionError when player hand set to empty type
@ -7,10 +7,10 @@ Fixes an AssertionError when setting the player's item in hand to null or a new
Fixes GH-2718
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 4690ef840..90fc7febe 100644
index e3c562a63..80219f2df 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -1885,6 +1885,7 @@ public abstract class EntityLiving extends Entity {
@@ -1886,6 +1886,7 @@ public abstract class EntityLiving extends Entity {
return this.getEquipment(EnumItemSlot.OFFHAND);
}