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: Mon, 6 Nov 2023 11:36:08 +0900
|
|
Subject: [PATCH] Configurable entity 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 274ca06fbda0f54805fc82614d43b6e1a4a5d4a8..688f3c01cb939a6c959efbb3b59ac8ee60db3633 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
|
@@ -995,10 +995,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti
|
|
//ProfilerFiller gameprofilerfiller = this.level().getProfiler(); // Purpur
|
|
|
|
//gameprofilerfiller.push("sensing"); // Purpur
|
|
- this.sensing.tick();
|
|
+ //this.sensing.tick(); // Plazma - Moved down
|
|
//gameprofilerfiller.pop(); // Purpur
|
|
int i = this.tickCount + this.getId();
|
|
|
|
+ if (i % this.level().plazmaConfig().entity.sensorTick == 0) this.sensing.tick(); // Plazma - Configurable entity sensor tick
|
|
if (i % 2 != 0 && this.tickCount > 1) {
|
|
//gameprofilerfiller.push("targetSelector"); // Purpur
|
|
this.targetSelector.tickRunningGoals(false);
|
|
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
|
index c8a3e91d0d6510b519e927027f5a534cddf7d0a3..bc283729cab4df2c596febf1df54241571227564 100644
|
|
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
|
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
|
@@ -30,6 +30,7 @@ public class WorldConfigurations extends ConfigurationPart {
|
|
public class Entity extends ConfigurationPart {
|
|
|
|
public boolean ignoreUselessPackets = OPTIMIZE;
|
|
+ public int sensorTick = 1;
|
|
|
|
public Phantom phantom;
|
|
public class Phantom extends ConfigurationPart {
|