summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2016-05-28 22:10:59 +1000
committermd_5 <git@md-5.net>2016-05-28 22:10:59 +1000
commit71e5248c8b97a6345a367543bdb8a85477baf81b (patch)
tree970e6d0b73117e88c9b8433ed94ce35a771ed2e5
parent106ced01e0bd24a20633d4f3aa99c2452736be74 (diff)
downloadcraftbukkit-71e5248c8b97a6345a367543bdb8a85477baf81b.tar
craftbukkit-71e5248c8b97a6345a367543bdb8a85477baf81b.tar.gz
craftbukkit-71e5248c8b97a6345a367543bdb8a85477baf81b.tar.lz
craftbukkit-71e5248c8b97a6345a367543bdb8a85477baf81b.tar.xz
craftbukkit-71e5248c8b97a6345a367543bdb8a85477baf81b.zip
SPIGOT-636: Decouple EntityCombustByEntity from damageEntity
-rw-r--r--nms-patches/EntityArrow.patch18
1 files changed, 6 insertions, 12 deletions
diff --git a/nms-patches/EntityArrow.patch b/nms-patches/EntityArrow.patch
index 5299df78..25005044 100644
--- a/nms-patches/EntityArrow.patch
+++ b/nms-patches/EntityArrow.patch
@@ -30,28 +30,22 @@
if (entity != null) {
float f = MathHelper.sqrt(this.motX * this.motX + this.motY * this.motY + this.motZ * this.motZ);
int i = MathHelper.f((double) f * this.damage);
-@@ -246,11 +253,18 @@
- damagesource = DamageSource.arrow(this, this.shooter);
+@@ -247,7 +254,13 @@
}
-+ // CraftBukkit start - Moved damage call
-+ if (movingobjectposition.entity.damageEntity(damagesource, (float) i)) {
if (this.isBurning() && !(entity instanceof EntityEnderman)) {
- entity.setOnFire(5);
++ // CraftBukkit start
+ EntityCombustByEntityEvent combustEvent = new EntityCombustByEntityEvent(this.getBukkitEntity(), entity.getBukkitEntity(), 5);
+ org.bukkit.Bukkit.getPluginManager().callEvent(combustEvent);
+ if (!combustEvent.isCancelled()) {
+ entity.setOnFire(combustEvent.getDuration());
+ }
-+ // CraftBukkit end
++ // CraftBukkit end
}
-- if (entity.damageEntity(damagesource, (float) i)) {
-+ // if (entity.damageEntity(damagesource, (float) i)) { // CraftBukkit - moved up
- if (entity instanceof EntityLiving) {
- EntityLiving entityliving = (EntityLiving) entity;
-
-@@ -397,6 +411,20 @@
+ if (entity.damageEntity(damagesource, (float) i)) {
+@@ -397,6 +410,20 @@
public void d(EntityHuman entityhuman) {
if (!this.world.isClientSide && this.inGround && this.shake <= 0) {
@@ -72,7 +66,7 @@
boolean flag = this.fromPlayer == EntityArrow.PickupStatus.ALLOWED || this.fromPlayer == EntityArrow.PickupStatus.CREATIVE_ONLY && entityhuman.abilities.canInstantlyBuild;
if (this.fromPlayer == EntityArrow.PickupStatus.ALLOWED && !entityhuman.inventory.pickup(this.j())) {
-@@ -455,6 +483,12 @@
+@@ -455,6 +482,12 @@
return (b0 & 1) != 0;
}