Remove redundant patches
This commit is contained in:
@@ -1,49 +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 license: GPLv3
|
||||
Original project: 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 0bc9eeef8dba308cf75c05def4de30de4475c030..b621253d69d4379faaf11ef39e9e000ed615e85f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -998,12 +998,14 @@ 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();
|
||||
|
||||
- if (entitytypes == EntityType.SKELETON && itemstack.is(Items.SKELETON_SKULL) || entitytypes == EntityType.ZOMBIE && itemstack.is(Items.ZOMBIE_HEAD) || entitytypes == EntityType.CREEPER && itemstack.is(Items.CREEPER_HEAD)) {
|
||||
+ if (entitytypes == EntityType.SKELETON && this.getItemBySlot(EquipmentSlot.HEAD).is(Items.SKELETON_SKULL) || entitytypes == EntityType.ZOMBIE && this.getItemBySlot(EquipmentSlot.HEAD).is(Items.ZOMBIE_HEAD) || entitytypes == EntityType.CREEPER && this.getItemBySlot(EquipmentSlot.HEAD).is(Items.CREEPER_HEAD)) {
|
||||
d0 *= 0.5D;
|
||||
}
|
||||
+ // petal end
|
||||
}
|
||||
|
||||
return d0;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index a60cca663da4200d482c19d0b41a9514825a1e9b..c39ceda8e9314dd8338ade29d92baa0c8173d2c9 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -849,10 +849,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");
|
||||
- this.sensing.tick();
|
||||
+ if (i % 10 == 0) this.sensing.tick(); // petal - only refresh line of sight cache every half second
|
||||
this.level.getProfiler().pop();
|
||||
- int i = this.level.getServer().getTickCount() + this.getId();
|
||||
|
||||
if (i % 2 != 0 && this.tickCount > 1) {
|
||||
this.level.getProfiler().push("targetSelector");
|
||||
Reference in New Issue
Block a user