mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Pufferfish Changes: pufferfish-gg/Pufferfish@f05b0e9 Updated Upstream (Paper) pufferfish-gg/Pufferfish@9a82b86 Updated Upstream (Paper) pufferfish-gg/Pufferfish@c6ec7a0 Updated Upstream (Paper) pufferfish-gg/Pufferfish@c789f72 Updated Upstream (Paper) pufferfish-gg/Pufferfish@9ddaa1a Updated Upstream (Paper) pufferfish-gg/Pufferfish@3554f78 Updated Upstream (Paper) pufferfish-gg/Pufferfish@a9e9d99 Updated Upstream (Paper) pufferfish-gg/Pufferfish@09a2f81 Updated Upstream (Paper) pufferfish-gg/Pufferfish@63ce67d Updated Upstream (Paper) pufferfish-gg/Pufferfish@8abd47b Updated Upstream (Paper) pufferfish-gg/Pufferfish@3415da0 Updated Upstream (Paper) pufferfish-gg/Pufferfish@cfa3c61 Updated Upstream (Paper) pufferfish-gg/Pufferfish@0a8641d 1.21.3 Update pufferfish-gg/Pufferfish@784d72f Updated Upstream (Paper) pufferfish-gg/Pufferfish@40e1ad0 Updated Upstream (Paper) pufferfish-gg/Pufferfish@95ef348 Make iterator counting in IteratorSafeOrderedReferenceSet thread-safe for async mob spawning (#109) pufferfish-gg/Pufferfish@34c0042 Updated Upstream (Paper)
50 lines
3.1 KiB
Diff
50 lines
3.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Encode42 <me@encode42.dev>
|
|
Date: Tue, 11 May 2021 21:00:53 -0400
|
|
Subject: [PATCH] Configurable mob blindness
|
|
|
|
Ported from https://github.com/raltsmc/mobblindness
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
index 127befc7514ca36b75735b718751fb4cf3f915c4..0b99628d51df2c4df7ddf1c4c9f54e6dc3612533 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
@@ -1078,6 +1078,17 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
|
if (entitytypes == EntityType.SKELETON && itemstack.is(Items.SKELETON_SKULL) || entitytypes == EntityType.ZOMBIE && itemstack.is(Items.ZOMBIE_HEAD) || entitytypes == EntityType.PIGLIN && itemstack.is(Items.PIGLIN_HEAD) || entitytypes == EntityType.PIGLIN_BRUTE && itemstack.is(Items.PIGLIN_HEAD) || entitytypes == EntityType.CREEPER && itemstack.is(Items.CREEPER_HEAD)) {
|
|
d0 *= 0.5D;
|
|
}
|
|
+
|
|
+ // Purpur start
|
|
+ if (entity instanceof LivingEntity entityliving) {
|
|
+ if (entityliving.hasEffect(MobEffects.BLINDNESS)) {
|
|
+ int amplifier = entityliving.getEffect(MobEffects.BLINDNESS).getAmplifier();
|
|
+ for (int i = 0; i < amplifier; i++) {
|
|
+ d0 *= this.level().purpurConfig.mobsBlindnessMultiplier;
|
|
+ }
|
|
+ }
|
|
+ }
|
|
+ // Purpur end
|
|
}
|
|
|
|
return d0;
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
index 990fcb015588651fff7e720594a5d5341b3f9bba..8e86a96cfdb9b8deec4ef0de0dafb2f2635c4f2c 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -138,6 +138,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);
|
|
@@ -158,6 +159,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;
|