Honor spigot.yml setting log-villager-deaths (#6057)

cat note: giggity.
This commit is contained in:
BillyGalbreath 2021-07-01 22:28:31 -05:00 committed by GitHub
parent f18dc1e3c7
commit 882039d03e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@ index d414b111386e18dec8992b510b93c19ece8d60dd..2c95b6eddfe46e5d2ad495bfc86ccc24
if (CraftEventFactory.callPigZapEvent(this, lightning, entitypigzombie).isCancelled()) {
return;
diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java
index e61abd923cc1ca469f01249563da7ff31ead7bdd..f7b3b11bd6b395d199e725bc0c0192c28cc3cd86 100644
index c5a8edf426e79b8746c7a5a5a5de3e3df1708740..f030c8d7c28039fde273e6b30c63ea791c8de520 100644
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
@@ -826,9 +826,17 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
@ -38,7 +38,7 @@ index e61abd923cc1ca469f01249563da7ff31ead7bdd..f7b3b11bd6b395d199e725bc0c0192c2
+ }
+ // Paper end
+
+ Villager.LOGGER.info("Villager {} was struck by lightning {}.", this, lightning); // Paper - move log down, event can cancel
+ if (org.spigotmc.SpigotConfig.logVillagerDeaths) Villager.LOGGER.info("Villager {} was struck by lightning {}.", this, lightning); // Paper - move log down, event can cancel
+
entitywitch.moveTo(this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot());
entitywitch.finalizeSpawn(world, world.getCurrentDifficultyAt(entitywitch.blockPosition()), MobSpawnType.CONVERSION, (SpawnGroupData) null, (CompoundTag) null);