mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 18:37:42 +01:00
save stuff here
This commit is contained in:
@@ -5,7 +5,7 @@ Subject: [PATCH] Mob head visibility percent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 1bb1be688326d79c34b589bd859f21c2d43c53b8..576d29c30d089b7cbdae6a3eb9aad0ca23e847eb 100644
|
||||
index 7a35d45f8449a8399cb417357f0f0a6419bfbe3a..39ee6fbc6ce17b61abf88deba69b0adecb294417 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -1042,9 +1042,20 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -16,86 +16,86 @@ index 1bb1be688326d79c34b589bd859f21c2d43c53b8..576d29c30d089b7cbdae6a3eb9aad0ca
|
||||
- d0 *= 0.5D;
|
||||
+ // Purpur start
|
||||
+ if (entitytypes == EntityType.SKELETON && itemstack.is(Items.SKELETON_SKULL)) {
|
||||
+ d0 *= entity.level.purpurConfig.skeletonHeadVisibilityPercent;
|
||||
+ d0 *= entity.level().purpurConfig.skeletonHeadVisibilityPercent;
|
||||
+ }
|
||||
+ else if (entitytypes == EntityType.ZOMBIE && itemstack.is(Items.ZOMBIE_HEAD)) {
|
||||
+ d0 *= entity.level.purpurConfig.zombieHeadVisibilityPercent;
|
||||
+ d0 *= entity.level().purpurConfig.zombieHeadVisibilityPercent;
|
||||
+ }
|
||||
+ else if (entitytypes == EntityType.CREEPER && itemstack.is(Items.CREEPER_HEAD)) {
|
||||
+ d0 *= entity.level.purpurConfig.creeperHeadVisibilityPercent;
|
||||
+ d0 *= entity.level().purpurConfig.creeperHeadVisibilityPercent;
|
||||
}
|
||||
+ else if ((entitytypes == EntityType.PIGLIN || entitytypes == EntityType.PIGLIN_BRUTE) && itemstack.is(Items.PIGLIN_HEAD)) {
|
||||
+ d0 *= entity.level.purpurConfig.piglinHeadVisibilityPercent;
|
||||
+ d0 *= entity.level().purpurConfig.piglinHeadVisibilityPercent;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
|
||||
// Purpur start
|
||||
if (entity instanceof LivingEntity entityliving) {
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index c6d6e863c1626aa3eece4959f64d70bb0f701027..b1c20a1cf47a119bbe6b934d2c54cbaf143073c7 100644
|
||||
index a054dd54797af8190b09d2d9975edbf323496dd8..8ae28ced1d88e3b7ad3656a1389d9e9994992823 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -1199,6 +1199,7 @@ public class PurpurWorldConfig {
|
||||
@@ -1300,6 +1300,7 @@ public class PurpurWorldConfig {
|
||||
public boolean creeperExplodeWhenKilled = false;
|
||||
public boolean creeperHealthRadius = false;
|
||||
public boolean creeperAlwaysDropExp = false;
|
||||
+ public double creeperHeadVisibilityPercent = 0.5D;
|
||||
private void creeperSettings() {
|
||||
if (PurpurConfig.version < 10) {
|
||||
double oldValue = getDouble("mobs.creeper.attributes.max-health", creeperMaxHealth);
|
||||
@@ -1213,6 +1214,7 @@ public class PurpurWorldConfig {
|
||||
creeperRidable = getBoolean("mobs.creeper.ridable", creeperRidable);
|
||||
creeperRidableInWater = getBoolean("mobs.creeper.ridable-in-water", creeperRidableInWater);
|
||||
@@ -1317,6 +1318,7 @@ public class PurpurWorldConfig {
|
||||
creeperExplodeWhenKilled = getBoolean("mobs.creeper.explode-when-killed", creeperExplodeWhenKilled);
|
||||
creeperHealthRadius = getBoolean("mobs.creeper.health-impacts-explosion", creeperHealthRadius);
|
||||
creeperAlwaysDropExp = getBoolean("mobs.creeper.always-drop-exp", creeperAlwaysDropExp);
|
||||
+ creeperHeadVisibilityPercent = getDouble("mobs.creeper.head-visibility-percent", creeperHeadVisibilityPercent);
|
||||
}
|
||||
|
||||
public double dolphinMaxHealth = 10.0D;
|
||||
@@ -1811,6 +1813,7 @@ public class PurpurWorldConfig {
|
||||
public boolean dolphinRidable = false;
|
||||
@@ -2110,6 +2112,7 @@ public class PurpurWorldConfig {
|
||||
public boolean piglinTakeDamageFromWater = false;
|
||||
public int piglinPortalSpawnModifier = 2000;
|
||||
public boolean piglinAlwaysDropExp = false;
|
||||
+ public double piglinHeadVisibilityPercent = 0.5D;
|
||||
private void piglinSettings() {
|
||||
if (PurpurConfig.version < 10) {
|
||||
double oldValue = getDouble("mobs.piglin.attributes.max-health", piglinMaxHealth);
|
||||
@@ -1822,6 +1825,7 @@ public class PurpurWorldConfig {
|
||||
piglinRidable = getBoolean("mobs.piglin.ridable", piglinRidable);
|
||||
piglinRidableInWater = getBoolean("mobs.piglin.ridable-in-water", piglinRidableInWater);
|
||||
@@ -2124,6 +2127,7 @@ public class PurpurWorldConfig {
|
||||
piglinTakeDamageFromWater = getBoolean("mobs.piglin.takes-damage-from-water", piglinTakeDamageFromWater);
|
||||
piglinPortalSpawnModifier = getInt("mobs.piglin.portal-spawn-modifier", piglinPortalSpawnModifier);
|
||||
piglinAlwaysDropExp = getBoolean("mobs.piglin.always-drop-exp", piglinAlwaysDropExp);
|
||||
+ piglinHeadVisibilityPercent = getDouble("mobs.piglin.head-visibility-percent", piglinHeadVisibilityPercent);
|
||||
}
|
||||
|
||||
public double piglinBruteMaxHealth = 50.0D;
|
||||
@@ -2024,6 +2028,7 @@ public class PurpurWorldConfig {
|
||||
public boolean piglinBruteRidable = false;
|
||||
@@ -2385,6 +2389,7 @@ public class PurpurWorldConfig {
|
||||
public double skeletonMaxHealth = 20.0D;
|
||||
public boolean skeletonTakeDamageFromWater = false;
|
||||
public boolean skeletonAlwaysDropExp = false;
|
||||
+ public double skeletonHeadVisibilityPercent = 0.5D;
|
||||
private void skeletonSettings() {
|
||||
if (PurpurConfig.version < 10) {
|
||||
double oldValue = getDouble("mobs.skeleton.attributes.max-health", skeletonMaxHealth);
|
||||
@@ -2033,6 +2038,7 @@ public class PurpurWorldConfig {
|
||||
skeletonRidable = getBoolean("mobs.skeleton.ridable", skeletonRidable);
|
||||
skeletonRidableInWater = getBoolean("mobs.skeleton.ridable-in-water", skeletonRidableInWater);
|
||||
@@ -2397,6 +2402,7 @@ public class PurpurWorldConfig {
|
||||
skeletonMaxHealth = getDouble("mobs.skeleton.attributes.max_health", skeletonMaxHealth);
|
||||
skeletonTakeDamageFromWater = getBoolean("mobs.skeleton.takes-damage-from-water", skeletonTakeDamageFromWater);
|
||||
skeletonAlwaysDropExp = getBoolean("mobs.skeleton.always-drop-exp", skeletonAlwaysDropExp);
|
||||
+ skeletonHeadVisibilityPercent = getDouble("mobs.skeleton.head-visibility-percent", skeletonHeadVisibilityPercent);
|
||||
}
|
||||
|
||||
public double skeletonHorseMaxHealthMin = 15.0D;
|
||||
@@ -2426,6 +2432,7 @@ public class PurpurWorldConfig {
|
||||
public boolean skeletonHorseRidableInWater = true;
|
||||
@@ -2927,6 +2933,7 @@ public class PurpurWorldConfig {
|
||||
public boolean zombieBypassMobGriefing = false;
|
||||
public boolean zombieTakeDamageFromWater = false;
|
||||
public boolean zombieAlwaysDropExp = false;
|
||||
+ public double zombieHeadVisibilityPercent = 0.5D;
|
||||
private void zombieSettings() {
|
||||
if (PurpurConfig.version < 10) {
|
||||
double oldValue = getDouble("mobs.zombie.attributes.max-health", zombieMaxHealth);
|
||||
@@ -2441,6 +2448,7 @@ public class PurpurWorldConfig {
|
||||
zombieRidable = getBoolean("mobs.zombie.ridable", zombieRidable);
|
||||
zombieRidableInWater = getBoolean("mobs.zombie.ridable-in-water", zombieRidableInWater);
|
||||
@@ -2945,6 +2952,7 @@ public class PurpurWorldConfig {
|
||||
zombieBypassMobGriefing = getBoolean("mobs.zombie.bypass-mob-griefing", zombieBypassMobGriefing);
|
||||
zombieTakeDamageFromWater = getBoolean("mobs.zombie.takes-damage-from-water", zombieTakeDamageFromWater);
|
||||
zombieAlwaysDropExp = getBoolean("mobs.zombie.always-drop-exp", zombieAlwaysDropExp);
|
||||
+ zombieHeadVisibilityPercent = getDouble("mobs.zombie.head-visibility-percent", zombieHeadVisibilityPercent);
|
||||
}
|
||||
|
||||
public double zombieHorseMaxHealthMin = 15.0D;
|
||||
public boolean zombieHorseRidableInWater = false;
|
||||
|
||||
Reference in New Issue
Block a user