mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 10:17:38 +01:00
9d5bc88891
* Calls the LightningStrikeEvent for summoned lightning * Uses the new COMMAND SpawnReason for other entities By: Julian van den Berkmortel <julianvdberkmortel@outlook.com>
12 lines
873 B
Diff
12 lines
873 B
Diff
--- a/net/minecraft/server/commands/CommandSummon.java
|
|
+++ b/net/minecraft/server/commands/CommandSummon.java
|
|
@@ -64,7 +64,7 @@
|
|
((EntityInsentient) entity).prepare(commandlistenerwrapper.getWorld(), commandlistenerwrapper.getWorld().getDamageScaler(entity.getChunkCoordinates()), EnumMobSpawn.COMMAND, (GroupDataEntity) null, (NBTTagCompound) null);
|
|
}
|
|
|
|
- if (!worldserver.addAllEntitiesSafely(entity)) {
|
|
+ if (!worldserver.addAllEntitiesSafely(entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.COMMAND)) { // CraftBukkit - pass a spawn reason of "COMMAND"
|
|
throw CommandSummon.b.create();
|
|
} else {
|
|
commandlistenerwrapper.sendMessage(new ChatMessage("commands.summon.success", new Object[]{entity.getScoreboardDisplayName()}), true);
|