37 lines
1.9 KiB
Diff
37 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 ff9d23aef4658922692b43a859bd83632fe23612..8e5ad4cd6c8f61661b87dc96ba914c0bcd199879 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
|
@@ -949,10 +949,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
|
//ProfilerFiller gameprofilerfiller = Profiler.get(); // 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 4d204a0dc976d96c98764092c8461b0e2b920fc1..33bcfec86f83ce6e0ec17436ad38da8aeced48be 100644
|
|
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
|
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
|
@@ -28,6 +28,8 @@ public class WorldConfigurations extends ConfigurationPart {
|
|
public Entity entity;
|
|
public class Entity extends ConfigurationPart {
|
|
|
|
+ public int sensorTick = 1;
|
|
+
|
|
public Phantom phantom;
|
|
public class Phantom extends ConfigurationPart {
|
|
|