9
0
mirror of https://github.com/BX-Team/DivineMC.git synced 2025-12-19 14:59:25 +00:00
Files
DivineMC/patches/server/0015-Reduce-sensor-work.patch
Artem Ostrasev 774a111315 [ci-skip] New patches and optimisations (#11)
I'll make some changes now, so skipping build

Changelog:

* add CarpetFixes optimizations

* fix optimizations config

* lithium optimizations

* add Carpet Fixes Sheep Optimization

* add Async Pathfinding; add C2ME opts math

* add 2 vmp patches

* New performance patches; update README and wiki README

* update configuration on wiki

* update wiki main page

* Updated Upstream (Purpur)

* fix conflicts

* make "Don't save Fireworks" patch configurable

* Disable memory reserve allocating

* Fix MC-172801

* resolve conflicts

* add bstats to readme

* dd custom list of forks

* update logo link
2024-02-11 15:04:54 +03:00

38 lines
2.4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Sat, 10 Jun 2023 19:43:52 +0300
Subject: [PATCH] Reduce sensor work
Original project: Bloom-host/Petal
Link: https://github.com/Bloom-host/Petal
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 3b1c09f8afe1a008df4b75b605a796bfb1bf3899..2170ee480cd1498219d2c5d87de7d176524d31a1 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1037,20 +1037,19 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
if (entity != null) {
- 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)) { // DivineMC - Reduce sensor work
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)) { // DivineMC - Reduce sensor work
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)) { // DivineMC - Reduce sensor work
d0 *= entity.level().purpurConfig.creeperHeadVisibilityPercent;
}
- else if ((entitytypes == EntityType.PIGLIN || entitytypes == EntityType.PIGLIN_BRUTE) && itemstack.is(Items.PIGLIN_HEAD)) {
+ else if ((entitytypes == EntityType.PIGLIN || entitytypes == EntityType.PIGLIN_BRUTE) && this.getItemBySlot(EquipmentSlot.HEAD).is(Items.PIGLIN_HEAD)) { // DivineMC - Reduce sensor work
d0 *= entity.level().purpurConfig.piglinHeadVisibilityPercent;
}
// Purpur end