43 lines
2.0 KiB
Diff
43 lines
2.0 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: IPECTER <ipectert@gmail.com>
|
|
Date: Wed, 3 May 2023 16:51:49 +0900
|
|
Subject: [PATCH] Configurable Sensor Tick
|
|
|
|
Original: Bloom-host/Petal
|
|
Copyright (C) 2023 peaches94
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
|
index 5dd0c925af627f7159289dc1e3e79bc593c421f2..699b166b6438cbe0cd197547df4d8dc4359e0b34 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
|
@@ -935,10 +935,11 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
|
}
|
|
// Paper end
|
|
//this.level().getProfiler().push("sensing"); // Purpur
|
|
- this.sensing.tick();
|
|
+ //this.sensing.tick(); // Plazma - moved down (configurable sensor tick)
|
|
//this.level().getProfiler().pop(); // Purpur
|
|
int i = this.level().getServer().getTickCount() + this.getId();
|
|
|
|
+ if (i % this.level().plazmaLevelConfiguration().entity.sensor.tick == 0) this.sensing.tick(); // Plazma - Configurable Sensor Tick
|
|
if (i % 2 != 0 && this.tickCount > 1) {
|
|
//this.level().getProfiler().push("targetSelector"); // Purpur
|
|
if (this.targetSelector.inactiveTick(this.activatedPriority, false)) // Pufferfish - use this to alternate ticking
|
|
diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
|
index 61c06213b4ceb8e38e9aa41c3517f152d0d669ad..8dadc3fd21d507bf88f7f75935f7477375f21344 100644
|
|
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
|
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
|
@@ -107,5 +107,12 @@ public class LevelConfigurations extends ConfigurationPart {
|
|
|
|
}
|
|
|
|
+ public Sensor sensor;
|
|
+ public class Sensor extends ConfigurationPart {
|
|
+
|
|
+ public int tick = DO_OPTIMIZE ? 10 : 1;
|
|
+
|
|
+ }
|
|
+
|
|
}
|
|
}
|