mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 17:07:43 +01:00
Updated Upstream (Paper & Tuinity)
Upstream has released updates that appear to apply and compile correctly Paper Changes:b33b63908eSupport complex components in written book builder (#6337)bfb3d42b44Optimize entity tracker passenger checks (#6361)399710ff79Add reobf mappings patch for MinecraftServer#getLootTables (#6368)25cd8aba9fConfig option for Piglins guarding chests (#4829)80650e8936Added EntityItemDamageEvent (#4928) Tuinity Changes:8e7cc4dc96Do not submit profile lookups to worldgen threads
This commit is contained in:
49
patches/server/0193-Configurable-mob-blindness.patch
Normal file
49
patches/server/0193-Configurable-mob-blindness.patch
Normal file
@@ -0,0 +1,49 @@
|
||||
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 7ec708e19f62c53cc64327affef3111d4841e09d..246d6bdb7c431f9aca2e337dd2d4dfa5f8baf486 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -992,6 +992,17 @@ public abstract class LivingEntity extends Entity {
|
||||
if (entitytypes == EntityType.SKELETON && itemstack.is(Items.SKELETON_SKULL) || entitytypes == EntityType.ZOMBIE && itemstack.is(Items.ZOMBIE_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/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 28ae7a7147fde41fe3742cd5235dc9d7b93f61fd..6cf13cafb904bb273736cc53c69ed9fdc33d23c4 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -447,6 +447,7 @@ public class PurpurWorldConfig {
|
||||
public boolean persistentDroppableEntityDisplayNames = false;
|
||||
public boolean projectilesBypassMobGriefing = false;
|
||||
public boolean tickFluids = true;
|
||||
+ public double mobsBlindnessMultiplier = 1;
|
||||
public double tridentLoyaltyVoidReturnHeight = 0.0D;
|
||||
public double voidDamageHeight = -64.0D;
|
||||
public double voidDamageDealt = 4.0D;
|
||||
@@ -468,6 +469,7 @@ public class PurpurWorldConfig {
|
||||
persistentDroppableEntityDisplayNames = getBoolean("gameplay-mechanics.persistent-droppable-entity-display-names", persistentDroppableEntityDisplayNames);
|
||||
projectilesBypassMobGriefing = getBoolean("gameplay-mechanics.projectiles-bypass-mob-griefing", projectilesBypassMobGriefing);
|
||||
tickFluids = getBoolean("gameplay-mechanics.tick-fluids", tickFluids);
|
||||
+ mobsBlindnessMultiplier = getDouble("gameplay-mechanics.entity-blindness-multiplier", mobsBlindnessMultiplier);
|
||||
tridentLoyaltyVoidReturnHeight = getDouble("gameplay-mechanics.trident-loyalty-void-return-height", tridentLoyaltyVoidReturnHeight);
|
||||
voidDamageHeight = getDouble("gameplay-mechanics.void-damage-height", voidDamageHeight);
|
||||
voidDamageDealt = getDouble("gameplay-mechanics.void-damage-dealt", voidDamageDealt);
|
||||
Reference in New Issue
Block a user