37 lines
2.0 KiB
Diff
37 lines
2.0 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 4b4bdaf8c43e15ba953c160a003a719aaf730318..35f150d348c3bd27416c60840988d381b85f9ccf 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
|
@@ -953,10 +953,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
|
//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
|
|
if (this.targetSelector.inactiveTick(this.activatedPriority, false)) // Pufferfish - use this to alternate ticking
|
|
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
|
index b83a1058484e3d4d46f91d659f795f59d7087b72..480f9948265bdb0742ebc4181bba564644809bff 100644
|
|
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
|
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
|
|
@@ -29,6 +29,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 {
|
|
|