SPIGOT-7300, #1180: Add new DamageSource API providing enhanced information about entity damage

By: Doc <nachito94@msn.com>
This commit is contained in:
CraftBukkit/Spigot
2024-02-11 09:54:25 +11:00
parent db4af65c2e
commit 49b5ee78bb
29 changed files with 640 additions and 310 deletions

View File

@@ -43,13 +43,3 @@
if (this.level().setBlock(blockposition, this.blockState, 3)) {
((WorldServer) this.level()).getChunkSource().chunkMap.broadcast(this, new PacketPlayOutBlockChange(blockposition, this.level().getBlockState(blockposition)));
this.discard();
@@ -255,7 +272,9 @@
float f2 = (float) Math.min(MathHelper.floor((float) i * this.fallDamagePerDistance), this.fallDamageMax);
this.level().getEntities((Entity) this, this.getBoundingBox(), predicate).forEach((entity) -> {
+ CraftEventFactory.entityDamage = this; // CraftBukkit
entity.hurt(damagesource2, f2);
+ CraftEventFactory.entityDamage = null; // CraftBukkit
});
boolean flag = this.blockState.is(TagsBlock.ANVIL);