Upstream has released updates that appear to apply and compile correctly PaperMC/Paper@42a9c37 Move Adventure patch up PaperMC/Paper@1d7a6a0 Add missing glow_item_frame walkers PaperMC/Paper@f9b05cc Expose furnace minecart push property. (#7548) PaperMC/Paper@9351513 Fix handling message in PlayerHandshakeEvent (#7542) PaperMC/Paper@6564f70 Fix cancelling ProjectileHitEvent for piercing arrows (#7492) PaperMC/Paper@196271d Fix save problems on shutdown PaperMC/Paper@1e12cf8 Add more to the save fixes PaperMC/Paper@a36d7f6 Updated Upstream (CraftBukkit) PaperMC/Paper@7b9c30f Fix scoreboard objective name length limit PaperMC/Paper@d9bf5e7 Add method to set noclip on arrows (#7263) PaperMC/Paper@c34fb09 Add ghast api (#7554) PaperMC/Paper@e0b3f3f Adventure 4.10.1 PaperMC/Paper@718fab1 Add CPU name and JVM vendor info in timings (#7490) PaperMC/Paper@7a21333 Fix setting the view distance to 32 (#7503) PaperMC/Paper@4423e12 Update docs link in paper.yml (#7562) PaperMC/Paper@b55ba19 Update README for new docs (#7561) PaperMC/Paper@657d163 Prevent despawned navigators being readded (#7574) PaperMC/Paper@d714682 Add more entity api (#7564) PaperMC/Paper@1790528 More projectile API (#5731) PaperMC/Paper@ea1efef Remove Patches (#7541) PaperMC/Paper@aab1f8a Fix swamp hut cat generation deadlock PaperMC/Paper@dc96bba Ensure the item sent isn't air (#7584) PaperMC/Paper@bfa33d9 Various improvements to console color formatting (#7560) PaperMC/Paper@87927e1 Fix CreativeCategory API (#7586) PaperMC/Paper@ab03538 Fix colors in some console messages PaperMC/Paper@1358d1e Updated Upstream (CraftBukkit/Spigot) (#7580) PaperMC/Paper@b65b48f [ci skip] Update gradle wrapper PaperMC/Paper@1ce3555 [ci-skip] Fix typo in feature request issue template (#7593) PaperMC/Paper@c8e49cc Add get/set wait time for fish hooks. (#5595) PaperMC/Paper@a5be178 Use correct toX/Y/Z in player move packet handling PaperMC/Paper@0ca80c7 Add getComputedBiome API (#5668) PaperMC/Paper@2d3e8f7 Properly lookup random-ticked precipitation blocks (#7606) PaperMC/Paper@f35a0ce Remove Java version check once and for all (#7612) PaperMC/Paper@1c5f8b0 Updated Upstream (Bukkit/CraftBukkit) (#7604) PaperMC/Paper@f0d0078 Add debug for invalid GameProfiles on skull blocks/items (#7512) PaperMC/Paper@8788bf7 fix datapacks not being able to modify nether/end (#7588) PaperMC/Paper@b8c90d2 Added method to check snapshot state of TileStates (#7325) PaperMC/Paper@8897cea Add enchantWithLevels API (#7615) PaperMC/Paper@2eeca6f Fix world saving in unloadWorld PaperMC/Paper@319d5fa Fix state locking for getTopMRUProfiles & getProfileIfCached PaperMC/Paper@bc68ee0 Remove redundant GameProfileCache diff PaperMC/Paper@855637f Updated Upstream (CraftBukkit) (#7624) PaperMC/Paper@5eb61dd Buffer OOB setBlock calls PaperMC/Paper@7b46444 Properly create profiles with custom name/uuid (#7558) PaperMC/Paper@a686ff5 Add more missing entity API (#7592) PaperMC/Paper@993f828 Add TameableDeathMessageEvent (#5392) PaperMC/Paper@a939d6e Fix generator settings string for flat-type worlds (#7568) PaperMC/Paper@ab666a4 Deprecating remaining blockkey methods (#7638) PaperMC/Paper@e7d928a Fix EntityChangeBlockEvent#getBlockData for when sheep eats grass block (#7646) PaperMC/Paper@e2f743d Fix PalettedContainer synchronization (#7663) PaperMC/Paper@7fa8870 Updated Upstream (Bukkit/CraftBukkit) (#7672) PaperMC/Paper@fa68bb1 Fix entity position desync for hanging entities (#7659) PaperMC/Paper@d3c1023 fix player loottables running when mob loot gamerule is false (#7651) PaperMC/Paper@7f47b9b Remove KeyedObject interface (#7680) PaperMC/Paper@7bf9446 Add per player chunk loading limits PaperMC/Paper@04c7b16 Undeprecate Material#isLegacy (#7679) PaperMC/Paper@443c506 Fix Nullability Annotations for PrepareItemEnchantEvent (#7681) PaperMC/Paper@ea2c81e Fix lectern quick move PaperMC/Paper@87e11bf Cache resource keys instead of trying to create them (#7643) PaperMC/Paper@820e9ca Update decompiler & param mappings PaperMC/Paper@92426e3 Update Gradle wrapper PaperMC/Paper@62dcff3 Update actions PaperMC/Paper@2914457 Allow seting custom podium location for ender dragon (#7695) PaperMC/Paper@11e0dcd Fix NBT pieces overriding a block entity during worldgen deadlock (#7692) PaperMC/Paper@2f16393 Updated Upstream (CraftBukkit) PaperMC/Paper@4322c05 Use patched spigot decompiler (#7706) PaperMC/Paper@f8e8d6c Strip enderpearl owners when they are no longer ticked (#7559) PaperMC/Paper@e42d683 Fix StructureGrowEvent species for RED_MUSHROOM PaperMC/Paper@a9ee104 Prevent tile entity copies loading chunks PaperMC/Paper@d4a712d [CI-SKIP] Remove unused import from last patch PaperMC/Paper@a9f252e Replace third party repos with Paper repo (#7733) PaperMC/Paper@b8fa41e [ci skip] Remove Mojang repo from test-plugin PaperMC/Paper@c6e631a Use username instead of display name in PlayerList#getPlayerStats (#7740) PaperMC/Paper@1cfd363 Updated Upstream (Bukkit/CraftBukkit/Spigot) PaperMC/Paper@af94364 Fix slime spawners not spawning outside slime chunks (#7741) PaperMC/Paper@6b9f7a0 Don't fire worldborder events for virtual borders (#7749) PaperMC/Paper@8bfb1d2 Pass ServerLevel for gamerule callbacks (#7668) PaperMC/Paper@c66b0f9 Add pre-unbreaking amount to PlayerItemDamageEvent (#7724) PaperMC/Paper@86fb3d2 Don't send itemmeta for books with the hide option enabled (#7734) PaperMC/Paper@c642d25 Improve update folder behavior (#7687) PaperMC/Paper@c7d4c01 Ignore invalid jars inside of the updates folder (Fixes #7751) PaperMC/Paper@4ecc338 WorldCreator#keepSpawnLoaded (#7673) PaperMC/Paper@873bfa6 Remove World#refreshChunk deprecation (#7684) PaperMC/Paper@76ed156 Grant temporary immunity from EAR to moving entities (Fixes #7637) (#7644) PaperMC/Paper@567fce6 Don't apply previous potion when item is potion (fixes #7756) (#7757) PaperMC/Paper@c449f6a Build updates PaperMC/Paper@ef6a1a5 Revert to old createProfile(UUID, String) logic (#7723) PaperMC/Paper@0f8aa4e Fix NPE for BlockDataMeta#getBlockData (#7670) PaperMC/Paper@16f224a Trigger bee_nest_destroyed trigger in the correct place (#7436) PaperMC/Paper@caf4a6f Remove or replace a few dumb deprecations (#7760) PaperMC/Paper@47f43da Add missing javadoc deprecation msgs for PlayerProfile (#7688) PaperMC/Paper@fbbc03a Add EntityDyeEvent and CollarColorable interface (#7625) PaperMC/Paper@5b85ee3 Fire CauldronLevelChange on initial fill (#7678) PaperMC/Paper@4dc78ae Fix some team color docs and added hasColor (#7602) PaperMC/Paper@0bf7c95 Fix opening inv in PlayerRecipeBookClickEvent handler (#7552) PaperMC/Paper@d70ac03 fix powder snow cauldrons not turning to water (#7229) PaperMC/Paper@ce059b4 Fix V1451 dataconverter stat types PaperMC/Paper@6f5e6c6 Use setMessage instead of arraycopy PaperMC/Paper@608482d cleanup filtered sign text (#7777) PaperMC/Paper@4166632 Updated Upstream (Bukkit/CraftBukkit) (#7776) PaperMC/Paper@e564110 Couple fixes/improvements to PlayerSetSpawnEvent (#6754) PaperMC/Paper@e5da93a Deprecate duplicate SoundGroup API (#7509) PaperMC/Paper@2ab0258 Use mojang item ids for alternative item despawn rate (#6997) PaperMC/Paper@f6a69de Undeprecate getOfflinePlayer (#7773) PaperMC/Paper@a117da6 Add PlayerStopUsingItemEvent (#7787) PaperMC/Paper@f3a8a0b FallingBlock auto expire setting (#7037) PaperMC/Paper@4219389 Don't tick markers (#7299) PaperMC/Paper@2515bc4 Improve configurable door difficulty (#6985) PaperMC/Paper@8c9d98e Clean unused field for Configurable door breaking difficulty (#7793) PaperMC/Paper@b831784 Only log for passenger / vehicle world mismatch PaperMC/Paper@7a6163b Add Alternate Current's redstone implementation as an alternative to Vanilla and Eigencraft's. (#7701) PaperMC/Paper@1a17a83 Move redstone config changes to Eigencraft patch PaperMC/Paper@87d2eb2 Fix door breaking difficulty defaults for vindicator (#7795) PaperMC/Paper@e399754 Do not accept invalid client settings PaperMC/Paper@268476b Fix whitespace error in Alternate Current patch PaperMC/Paper@18f0f8d Updated Upstream (Bukkit/CraftBukkit/Spigot) PaperMC/Paper@5928327 Remove unneeded patch (#7806) PaperMC/Paper@9fd870d Fix cancelling PlayerItemFrameChangeEvent (#7761) PaperMC/Paper@8d1de8d deprecate old MaterialData api (#7585) PaperMC/Paper@0116751 List world on tile entity placement exception (#7709) PaperMC/Paper@73bd35d Updated Upstream (Bukkit/CraftBukkit) PaperMC/Paper@7045f18 Change link to screamingsandals PaperMC/Paper@ca62386 Hide ores with deepslate at Y=4 and below (#7792) PaperMC/Paper@9b492cf Deprecate set/doesBounce from Projectile (#7800) PaperMC/Paper@ed4e916 [ci-skip] Update repository and API urls (#7835) PaperMC/Paper@fc1752f Fix more upstream javadocs (#7837) PaperMC/Paper@123cad5 Remove incorrect parent perm from debugstick.always (#7846) PaperMC/Paper@d8108b5 team color parameter may be null, causing NPE PaperMC/Paper@31ccc57 Add support for Proxy Protocol (#7710) PaperMC/Paper@a90092e Updated Upstream (CraftBukkit/Spigot) (#7848) PaperMC/Paper@79e07f3 Fix addPassenger for Marker (#7762) PaperMC/Paper@182a609 Fix duplicate world keys via createWorld (#7614) PaperMC/Paper@b6a6544 Provide ComponentSerializer services (#7527) PaperMC/Paper@3f7fbe3 Fix cb's janky level name in WorldCreator (#7851) PaperMC/Paper@af3b377 Update ForgeFlower (#7857) PaperMC/Paper@9667181 Fix OfflinePlayer#getBedSpawnLocation (#7861) PaperMC/Paper@c123915 Fix FurnaceInventory for smokers and blast furnaces (#7249) PaperMC/Paper@f7382f5 Remove unneeded UOE when copying biome sources (#7629) PaperMC/Paper@6b035fd Update default vanilla command perms (#7386) PaperMC/Paper@f210f67 Update the rewriteForIde for new cb package version (#7242) PaperMC/Paper@3f7111d Fix EntityEquipment and related javadocs (#7380) PaperMC/Paper@78e6431 Add default kick msg component (#6886) PaperMC/Paper@04e1b07 Check HAProxyMessage type is PROXY (#7864) PaperMC/Paper@00c6ae8 Implement Translatable on CreativeCategory (#7587) PaperMC/Paper@7602dd2 Sanitize Sent BlockEntity NBT (#7010) PaperMC/Paper@2d17a50 Add translation keys to GameMode enum (#7081) PaperMC/Paper@c5caee3 Prevent entity loading causing async lookups (#7553) PaperMC/Paper@71fe3c6 Add numeric string completion suggestions as int suggestions (#6360) PaperMC/Paper@b1ac25f Respect x-ray permission in World#refreshChunk (#7214) PaperMC/Paper@1d08ce8 Disable book selector resolving by default PaperMC/Paper@80d5e71 Updated Upstream (Bukkit) PaperMC/Paper@2033dba Updated Upstream (CraftBukkit) PaperMC/Paper@a3ad720 Remove ChatColor usages (#7543) PaperMC/Paper@8fc0999 Fix some nullability things (#7275) PaperMC/Paper@fd069dd Remove incorrect throws javadoc in Team (#7869) PaperMC/Paper@bed5cb2 Limit resolved selectors when enabled PaperMC/Paper@4d83ed0 [ci skip] Changing the order of the rebase with autosquash command in the contributing.md (#6974) PaperMC/Paper@071a4a2 throw exception if worlds are created while being ticked (#7653) PaperMC/Paper@5b6397a Make leave messages for kicks the same as for quitting (#7874) PaperMC/Paper@5befb55 Updated Upstream (Bukkit/CraftBukkit) (#7875) PaperMC/Paper@b3deb25 Move some methods to RegionAccessor (#7635) PaperMC/Paper@d8ef841 [DataConverter] Fix generator options parsing PaperMC/Paper@4b27254 Fix treasure maps discovered settings (#7627) PaperMC/Paper@276d830 Fix campfire walker in V1920 PaperMC/Paper@3925a53 Make timings link clickable (#7944)
183 lines
11 KiB
Diff
183 lines
11 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: lexikiq <noellekiq@gmail.com>
|
|
Date: Fri, 18 Jun 2021 14:04:39 -0400
|
|
Subject: [PATCH] Add origin location to EntityDamageByBlockEvent
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/damagesource/BadRespawnPointDamage.java b/src/main/java/net/minecraft/world/damagesource/BadRespawnPointDamage.java
|
|
index f5a18fb39eb69b2a9842d3f96aa1cd6a8dff6d9b..456d93305f524da6142bad320edb817b27c6c1e6 100644
|
|
--- a/src/main/java/net/minecraft/world/damagesource/BadRespawnPointDamage.java
|
|
+++ b/src/main/java/net/minecraft/world/damagesource/BadRespawnPointDamage.java
|
|
@@ -9,12 +9,20 @@ import net.minecraft.network.chat.TranslatableComponent;
|
|
import net.minecraft.world.entity.LivingEntity;
|
|
|
|
public class BadRespawnPointDamage extends DamageSource {
|
|
+ @Deprecated // Parchment
|
|
protected BadRespawnPointDamage() {
|
|
super("badRespawnPoint");
|
|
this.setScalesWithDifficulty();
|
|
this.setExplosion();
|
|
}
|
|
|
|
+ // Parchment start
|
|
+ protected BadRespawnPointDamage(org.bukkit.Location location) {
|
|
+ this();
|
|
+ location(location);
|
|
+ }
|
|
+ // Parchment end
|
|
+
|
|
@Override
|
|
public Component getLocalizedDeathMessage(LivingEntity entity) {
|
|
Component component = ComponentUtils.wrapInSquareBrackets(new TranslatableComponent("death.attack.badRespawnPoint.link")).withStyle((style) -> {
|
|
diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSource.java b/src/main/java/net/minecraft/world/damagesource/DamageSource.java
|
|
index a828cad27fcd39f8bfbaefa97052a2a3b6650ee7..52cce7422c2a99e3de37f87ac704151682578718 100644
|
|
--- a/src/main/java/net/minecraft/world/damagesource/DamageSource.java
|
|
+++ b/src/main/java/net/minecraft/world/damagesource/DamageSource.java
|
|
@@ -77,6 +77,18 @@ public class DamageSource {
|
|
return this;
|
|
}
|
|
// Paper end
|
|
+ // Parchment start
|
|
+ private @Nullable org.bukkit.Location location;
|
|
+
|
|
+ public @Nullable org.bukkit.Location getLocation() {
|
|
+ return location;
|
|
+ }
|
|
+
|
|
+ public DamageSource location(@Nullable org.bukkit.Location location) {
|
|
+ this.location = location;
|
|
+ return this;
|
|
+ }
|
|
+ // Parchment end
|
|
|
|
public static DamageSource sting(LivingEntity attacker) {
|
|
return new EntityDamageSource("sting", attacker);
|
|
@@ -127,17 +139,24 @@ public class DamageSource {
|
|
}
|
|
|
|
public static DamageSource explosion(@Nullable Explosion explosion) {
|
|
- return DamageSource.explosion(explosion != null ? explosion.getSourceMob() : null);
|
|
+ return DamageSource.explosion(explosion != null ? explosion.getSourceMob() : null).location(explosion != null ? explosion.getBukkitLocation() : null); // Parchment
|
|
}
|
|
|
|
public static DamageSource explosion(@Nullable LivingEntity attacker) {
|
|
return attacker != null ? (new EntityDamageSource("explosion.player", attacker)).setScalesWithDifficulty().setExplosion() : (new DamageSource("explosion")).setScalesWithDifficulty().setExplosion();
|
|
}
|
|
|
|
+ @Deprecated // Parchment
|
|
public static DamageSource badRespawnPointExplosion() {
|
|
return new BadRespawnPointDamage();
|
|
}
|
|
|
|
+ // Parchment start
|
|
+ public static DamageSource badRespawnPointExplosion(org.bukkit.Location location) {
|
|
+ return new BadRespawnPointDamage(location);
|
|
+ }
|
|
+ // Parchment end
|
|
+
|
|
public String toString() {
|
|
return "DamageSource (" + this.msgId + ")";
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
|
index 8c4db2f0e5158872879da52a96bc592145e52e13..2b25f719205bccd697e8b57e942005d0524728b1 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
|
@@ -99,7 +99,7 @@ public class EnderDragon extends Mob implements Enemy {
|
|
private final Node[] nodes = new Node[24];
|
|
private final int[] nodeAdjacency = new int[24];
|
|
private final BinaryHeap openSet = new BinaryHeap();
|
|
- private Explosion explosionSource = new Explosion(null, this, null, null, Double.NaN, Double.NaN, Double.NaN, Float.NaN, true, Explosion.BlockInteraction.DESTROY); // CraftBukkit - reusable source for CraftTNTPrimed.getSource()
|
|
+ private Explosion explosionSource;// = new Explosion(null, this, null, null, Double.NaN, Double.NaN, Double.NaN, Float.NaN, true, Explosion.BlockInteraction.DESTROY); // CraftBukkit - reusable source for CraftTNTPrimed.getSource() // Parchment - moved into constructor to fix null world
|
|
// Paper start - add var for save custom podium
|
|
@Nullable
|
|
private BlockPos podium;
|
|
@@ -107,6 +107,7 @@ public class EnderDragon extends Mob implements Enemy {
|
|
|
|
public EnderDragon(EntityType<? extends EnderDragon> entitytypes, Level world) {
|
|
super(EntityType.ENDER_DRAGON, world);
|
|
+ explosionSource = new Explosion(world, this, null, null, Double.NaN, Double.NaN, Double.NaN, Float.NaN, true, Explosion.BlockInteraction.DESTROY); // Parchment - fix null world
|
|
this.subEntities = new EnderDragonPart[]{this.head, this.neck, this.body, this.tail1, this.tail2, this.tail3, this.wing1, this.wing2};
|
|
this.setHealth(this.getMaxHealth());
|
|
this.noPhysics = true;
|
|
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
|
index 29f6c10e2c2626a9726d295acf12efea2b463cd3..370bde9e458a11c504a52356524fd289569612f1 100644
|
|
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
|
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
|
@@ -471,6 +471,13 @@ public class Explosion {
|
|
return this.toBlow;
|
|
}
|
|
|
|
+ // Parchment start
|
|
+ public @Nullable Location getBukkitLocation() {
|
|
+ if (this.level == null) return null;
|
|
+ return new Location(level.getWorld(), x, y, z);
|
|
+ }
|
|
+ // Parchment end
|
|
+
|
|
public static enum BlockInteraction {
|
|
|
|
NONE, BREAK, DESTROY;
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/BedBlock.java b/src/main/java/net/minecraft/world/level/block/BedBlock.java
|
|
index 20c0030d566012146021613325c6a979f392740e..a0a052095815ed63f06837155b48b0d84f404240 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/BedBlock.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/BedBlock.java
|
|
@@ -145,7 +145,10 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
|
|
world.removeBlock(blockposition1, false);
|
|
}
|
|
|
|
- world.explode((Entity) null, DamageSource.badRespawnPointExplosion(), (ExplosionDamageCalculator) null, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, 5.0F, true, Explosion.BlockInteraction.DESTROY);
|
|
+ // Parchment start
|
|
+ org.bukkit.Location location = new org.bukkit.Location(world.getWorld(), blockposition.getX() + 0.5D, blockposition.getY() + 0.5D, blockposition.getZ() + 0.5D);
|
|
+ world.explode((Entity) null, DamageSource.badRespawnPointExplosion(location), (ExplosionDamageCalculator) null, location.getX(), location.getY(), location.getZ(), 5.0F, true, Explosion.BlockInteraction.DESTROY);
|
|
+ // Parchment end
|
|
return InteractionResult.SUCCESS;
|
|
}
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
|
index 7d33dae2617991bce244ad906df7053c22e3f515..797a583f0e3516b4a1bfec4c122eff438d174776 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
|
@@ -148,7 +148,10 @@ public class RespawnAnchorBlock extends Block {
|
|
return pos.equals(explodedPos) && bl2 ? Optional.of(Blocks.WATER.getExplosionResistance()) : super.getBlockExplosionResistance(explosion, world, pos, blockState, fluidState);
|
|
}
|
|
};
|
|
- world.explode((Entity)null, DamageSource.badRespawnPointExplosion(), explosionDamageCalculator, (double)explodedPos.getX() + 0.5D, (double)explodedPos.getY() + 0.5D, (double)explodedPos.getZ() + 0.5D, 5.0F, true, Explosion.BlockInteraction.DESTROY);
|
|
+ // Parchment start
|
|
+ org.bukkit.Location location = new org.bukkit.Location(world.getWorld(), explodedPos.getX() + 0.5D, explodedPos.getY() + 0.5D, explodedPos.getZ() + 0.5D);
|
|
+ world.explode((Entity)null, DamageSource.badRespawnPointExplosion(location), explosionDamageCalculator, location.getX(), location.getY(), location.getZ(), 5.0F, true, Explosion.BlockInteraction.DESTROY);
|
|
+ // Parchment end
|
|
}
|
|
|
|
public static boolean canSetSpawn(Level world) {
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
index 70d445429fec455f8188341ffd401e83f6bdab1c..7df4e2bab4d0773d8246011368c8e1c82c8e49d4 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
@@ -969,7 +969,7 @@ public class CraftEventFactory {
|
|
CraftEventFactory.entityDamage = null;
|
|
EntityDamageEvent event;
|
|
if (damager == null) {
|
|
- event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.BLOCK_EXPLOSION, modifiers, modifierFunctions);
|
|
+ event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.BLOCK_EXPLOSION, source.getLocation(), modifiers, modifierFunctions); // Parchment - add location
|
|
} else if (entity instanceof EnderDragon && /*PAIL FIXME ((EntityEnderDragon) entity).target == damager*/ false) {
|
|
event = new EntityDamageEvent(entity.getBukkitEntity(), DamageCause.ENTITY_EXPLOSION, modifiers, modifierFunctions);
|
|
} else {
|
|
@@ -1007,7 +1007,7 @@ public class CraftEventFactory {
|
|
|
|
return CraftEventFactory.callEntityDamageEvent(damager, entity, cause, modifiers, modifierFunctions, cancelled, source.isCritical()); // Paper - add critical damage API
|
|
} else if (source == DamageSource.OUT_OF_WORLD) {
|
|
- EntityDamageEvent event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.VOID, modifiers, modifierFunctions);
|
|
+ EntityDamageEvent event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.VOID, entity.getBukkitEntity().getLocation(), modifiers, modifierFunctions); // Parchment - add location
|
|
event.setCancelled(cancelled);
|
|
CraftEventFactory.callEvent(event);
|
|
if (!event.isCancelled()) {
|
|
@@ -1017,7 +1017,7 @@ public class CraftEventFactory {
|
|
}
|
|
return event;
|
|
} else if (source == DamageSource.LAVA) {
|
|
- EntityDamageEvent event = (new EntityDamageByBlockEvent(CraftEventFactory.blockDamage, entity.getBukkitEntity(), DamageCause.LAVA, modifiers, modifierFunctions));
|
|
+ EntityDamageEvent event = (new EntityDamageByBlockEvent(CraftEventFactory.blockDamage, entity.getBukkitEntity(), DamageCause.LAVA, entity.getBukkitEntity().getLocation().toBlockLocation(), modifiers, modifierFunctions)); // Parchment - add location
|
|
event.setCancelled(cancelled);
|
|
|
|
Block damager = CraftEventFactory.blockDamage;
|