36 lines
1.9 KiB
Diff
36 lines
1.9 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: AlphaKR93 <dev@alpha93.kr>
|
|
Date: Fri, 29 Sep 2023 21:12:38 +0900
|
|
Subject: [PATCH] Configurable sensor tick
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
|
index fb5c21ba15995d00da87ee6ef9e4ab8f6678d67f..4710f85197bc80e554cc1b2b84058c8dc8049c1f 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
|
@@ -938,10 +938,10 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
|
}
|
|
// Paper end
|
|
//this.level().getProfiler().push("sensing"); // Purpur
|
|
- this.sensing.tick();
|
|
//this.level().getProfiler().pop(); // Purpur
|
|
int i = this.level().getServer().getTickCount() + this.getId();
|
|
|
|
+ if (i % this.level().plazmaLevelConfiguration().entity.sensorTick == 0) this.sensing.tick(); // Plazma - moved down
|
|
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 bb0f561f0b0d71697de52c834d2ed1798b2022df..6711b3d93eb5292314bcd89280d88f367eada9df 100644
|
|
--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
|
+++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java
|
|
@@ -33,6 +33,8 @@ public class LevelConfigurations extends ConfigurationPart {
|
|
public Entity entity;
|
|
public class Entity extends ConfigurationPart {
|
|
|
|
+ public int sensorTick = DO_OPTIMIZE ? 10 : 1;
|
|
+
|
|
public boolean ignoreUselessPackets = DO_OPTIMIZE;
|
|
|
|
public Player player;
|