mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 01:17:42 +01:00
Configurable mob blindness
Ported from https://github.com/raltsmc/mobblindness
This commit is contained in:
@@ -31,6 +31,24 @@
|
||||
}
|
||||
} else if (this.getAirSupply() < this.getMaxAirSupply()) {
|
||||
this.setAirSupply(this.increaseAirSupply(this.getAirSupply()));
|
||||
@@ -1018,6 +_,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ // Purpur start - Configurable mob blindness
|
||||
+ if (lookingEntity instanceof LivingEntity entityliving) {
|
||||
+ if (entityliving.hasEffect(MobEffects.BLINDNESS)) {
|
||||
+ int amplifier = entityliving.getEffect(MobEffects.BLINDNESS).getAmplifier();
|
||||
+ for (int i = 0; i < amplifier; i++) {
|
||||
+ d *= this.level().purpurConfig.mobsBlindnessMultiplier;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end - Configurable mob blindness
|
||||
+
|
||||
return d;
|
||||
}
|
||||
|
||||
@@ -1372,6 +_,24 @@
|
||||
this.stopSleeping();
|
||||
}
|
||||
|
||||
@@ -130,6 +130,7 @@ public class PurpurWorldConfig {
|
||||
public boolean imposeTeleportRestrictionsOnNetherPortals = false;
|
||||
public boolean imposeTeleportRestrictionsOnEndPortals = false;
|
||||
public boolean tickFluids = true;
|
||||
public double mobsBlindnessMultiplier = 1;
|
||||
private void miscGameplayMechanicsSettings() {
|
||||
useBetterMending = getBoolean("gameplay-mechanics.use-better-mending", useBetterMending);
|
||||
alwaysTameInCreative = getBoolean("gameplay-mechanics.always-tame-in-creative", alwaysTameInCreative);
|
||||
@@ -150,6 +151,7 @@ public class PurpurWorldConfig {
|
||||
imposeTeleportRestrictionsOnNetherPortals = getBoolean("gameplay-mechanics.impose-teleport-restrictions-on-nether-portals", imposeTeleportRestrictionsOnNetherPortals);
|
||||
imposeTeleportRestrictionsOnEndPortals = getBoolean("gameplay-mechanics.impose-teleport-restrictions-on-end-portals", imposeTeleportRestrictionsOnEndPortals);
|
||||
tickFluids = getBoolean("gameplay-mechanics.tick-fluids", tickFluids);
|
||||
mobsBlindnessMultiplier = getDouble("gameplay-mechanics.entity-blindness-multiplier", mobsBlindnessMultiplier);
|
||||
}
|
||||
|
||||
public int daytimeTicks = 12000;
|
||||
|
||||
Reference in New Issue
Block a user