Drop extra file
This commit is contained in:
@@ -1,59 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: peaches94 <peachescu94@gmail.com>
|
||||
Date: Sun, 10 Jul 2022 15:44:38 -0500
|
||||
Subject: [PATCH] Reduce sensor work
|
||||
|
||||
Original code by Bloom-host, licensed under GNU General Public License v3.0
|
||||
You can find the original code on https://github.com/Bloom-host/Petal
|
||||
|
||||
this patch is focused around the sensors used for ai
|
||||
delete the line of sight cache less often and use a faster nearby comparison
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 87655d7c3dfbbd6bf348d693445c71d5601ed9c3..149d3db91b546a8428271e22d91036f8b8f9f639 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -1011,20 +1011,22 @@ public abstract class LivingEntity extends Entity {
|
||||
}
|
||||
|
||||
if (entity != null) {
|
||||
- ItemStack itemstack = this.getItemBySlot(EquipmentSlot.HEAD);
|
||||
+ // petal start - only do itemstack lookup if we need to
|
||||
+ //ItemStack itemstack = this.getItemBySlot(EquipmentSlot.HEAD);
|
||||
EntityType<?> entitytypes = entity.getType();
|
||||
|
||||
// Purpur start
|
||||
- if (entitytypes == EntityType.SKELETON && itemstack.is(Items.SKELETON_SKULL)) {
|
||||
+ if (entitytypes == EntityType.SKELETON && this.getItemBySlot(EquipmentSlot.HEAD).is(Items.SKELETON_SKULL)) {
|
||||
d0 *= entity.level.purpurConfig.skeletonHeadVisibilityPercent;
|
||||
}
|
||||
- else if (entitytypes == EntityType.ZOMBIE && itemstack.is(Items.ZOMBIE_HEAD)) {
|
||||
+ else if (entitytypes == EntityType.ZOMBIE && this.getItemBySlot(EquipmentSlot.HEAD).is(Items.ZOMBIE_HEAD)) {
|
||||
d0 *= entity.level.purpurConfig.zombieHeadVisibilityPercent;
|
||||
}
|
||||
- else if (entitytypes == EntityType.CREEPER && itemstack.is(Items.CREEPER_HEAD)) {
|
||||
+ else if (entitytypes == EntityType.CREEPER && this.getItemBySlot(EquipmentSlot.HEAD).is(Items.CREEPER_HEAD)) {
|
||||
d0 *= entity.level.purpurConfig.creeperHeadVisibilityPercent;
|
||||
}
|
||||
// Purpur end
|
||||
+ // petal end
|
||||
|
||||
// Purpur start
|
||||
if (entity instanceof LivingEntity entityliving) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index d5e3bd662da349fc2ee58c7800d79c60300f33b3..0981873ee37fc839035b8398bac03d15adecb301 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -884,10 +884,10 @@ public abstract class Mob extends LivingEntity {
|
||||
return;
|
||||
}
|
||||
// Paper end
|
||||
+ int i = this.level.getServer().getTickCount() + this.getId(); // petal - move up
|
||||
//this.level.getProfiler().push("sensing"); // Purpur
|
||||
- this.sensing.tick();
|
||||
+ if (i % 10 == 0) this.sensing.tick(); // petal - only refresh line of sight cache every half second
|
||||
//this.level.getProfiler().pop(); // Purpur
|
||||
- int i = this.level.getServer().getTickCount() + this.getId();
|
||||
|
||||
if (i % 2 != 0 && this.tickCount > 1) {
|
||||
//this.level.getProfiler().push("targetSelector"); // Purpur
|
||||
Reference in New Issue
Block a user