Files
PlazmaBukkitMC/patches/server/0031-Reduce-Sensor-Work.patch
AlphaKR93 078fbd108c Updated Upstream (Paper)
temporary dropped bump dependencies patches for better patches
2023-09-23 19:12:25 +09:00

39 lines
2.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: IPECTER <ipectert@gmail.com>
Date: Wed, 3 May 2023 16:51:49 +0900
Subject: [PATCH] Reduce Sensor Work
Original: Bloom-host/Petal
Copyright (C) 2023 peaches94
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 49906b4dc8392eee592215d0b4cba85267a875fc..a0759a2f1191cc44a0c441db180ad8bd300ff4a4 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1037,20 +1037,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
if (entity != null) {
- ItemStack itemstack = this.getItemBySlot(EquipmentSlot.HEAD);
+ //ItemStack itemstack = this.getItemBySlot(EquipmentSlot.HEAD); // Plazma
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)) { // Plazma
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)) { // Plazma
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)) { // Plazma
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)) { // Plazma
d0 *= entity.level().purpurConfig.piglinHeadVisibilityPercent;
}
// Purpur end