mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 18:37:42 +01:00
Mob head visibility percent
This commit is contained in:
@@ -31,10 +31,34 @@
|
||||
}
|
||||
} else if (this.getAirSupply() < this.getMaxAirSupply()) {
|
||||
this.setAirSupply(this.increaseAirSupply(this.getAirSupply()));
|
||||
@@ -1018,6 +_,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1009,14 +_,32 @@
|
||||
if (lookingEntity != null) {
|
||||
ItemStack itemBySlot = this.getItemBySlot(EquipmentSlot.HEAD);
|
||||
EntityType<?> type = lookingEntity.getType();
|
||||
- if (type == EntityType.SKELETON && itemBySlot.is(Items.SKELETON_SKULL)
|
||||
- || type == EntityType.ZOMBIE && itemBySlot.is(Items.ZOMBIE_HEAD)
|
||||
- || type == EntityType.PIGLIN && itemBySlot.is(Items.PIGLIN_HEAD)
|
||||
- || type == EntityType.PIGLIN_BRUTE && itemBySlot.is(Items.PIGLIN_HEAD)
|
||||
- || type == EntityType.CREEPER && itemBySlot.is(Items.CREEPER_HEAD)) {
|
||||
- d *= 0.5;
|
||||
- }
|
||||
- }
|
||||
+ // Purpur start - Mob head visibility percent
|
||||
+ if (type == EntityType.SKELETON && itemBySlot.is(Items.SKELETON_SKULL)) {
|
||||
+ d *= lookingEntity.level().purpurConfig.skeletonHeadVisibilityPercent;
|
||||
+ }
|
||||
+ else if (type == EntityType.ZOMBIE && itemBySlot.is(Items.ZOMBIE_HEAD)) {
|
||||
+ d *= lookingEntity.level().purpurConfig.zombieHeadVisibilityPercent;
|
||||
+ }
|
||||
+ else if ((type == EntityType.PIGLIN || type == EntityType.PIGLIN_BRUTE) && itemBySlot.is(Items.PIGLIN_HEAD)) {
|
||||
+ d *= lookingEntity.level().purpurConfig.piglinHeadVisibilityPercent;
|
||||
+ }
|
||||
+ else if (type == EntityType.CREEPER && itemBySlot.is(Items.CREEPER_HEAD)) {
|
||||
+ d *= lookingEntity.level().purpurConfig.creeperHeadVisibilityPercent;
|
||||
+ }
|
||||
+ // Purpur end - Mob head visibility percent
|
||||
+ }
|
||||
+
|
||||
+ // Purpur start - Configurable mob blindness
|
||||
+ if (lookingEntity instanceof LivingEntity entityliving) {
|
||||
+ if (entityliving.hasEffect(MobEffects.BLINDNESS)) {
|
||||
@@ -45,10 +69,9 @@
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end - Configurable mob blindness
|
||||
+
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
@@ -1372,6 +_,24 @@
|
||||
this.stopSleeping();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user