Add log-villager-deaths option

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2019-12-14 10:26:52 +11:00
parent 9ef9823b3b
commit 76c24a1454
3 changed files with 42 additions and 17 deletions

View File

@@ -24,25 +24,25 @@
}
@Override
@@ -216,7 +224,18 @@
return this.assignProfessionWhenSpawned;
}
@@ -214,7 +222,18 @@
public boolean assignProfessionWhenSpawned() {
return this.assignProfessionWhenSpawned;
+ }
+
+ // Spigot Start
@Override
+ @Override
+ public void inactiveTick() {
+ // SPIGOT-3874, SPIGOT-3894, SPIGOT-3846, SPIGOT-5286 :(
+ if (this.level().spigotConfig.tickInactiveVillagers && this.isEffectiveAi()) {
+ this.customServerAiStep((ServerLevel) this.level());
+ }
+ super.inactiveTick();
+ }
}
+ // Spigot End
+
+ @Override
protected void customServerAiStep(ServerLevel world) {
ProfilerFiller gameprofilerfiller = Profiler.get();
@Override
protected void customServerAiStep(ServerLevel world) {
@@ -235,7 +254,7 @@
this.increaseProfessionLevelOnUpdate = false;
}
@@ -100,6 +100,15 @@
Logger logger = Villager.LOGGER;
Objects.requireNonNull(logger);
@@ -618,7 +649,7 @@
@Override
public void die(DamageSource damageSource) {
- Villager.LOGGER.info("Villager {} died, message: '{}'", this, damageSource.getLocalizedDeathMessage(this).getString());
+ if (org.spigotmc.SpigotConfig.logVillagerDeaths) Villager.LOGGER.info("Villager {} died, message: '{}'", this, damageSource.getLocalizedDeathMessage(this).getString()); // Spigot
Entity entity = damageSource.getEntity();
if (entity != null) {
@@ -808,7 +839,7 @@
entitywitch1.finalizeSpawn(world, world.getCurrentDifficultyAt(entitywitch1.blockPosition()), EntitySpawnReason.CONVERSION, (SpawnGroupData) null);
entitywitch1.setPersistenceRequired();