mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 01:17:42 +01:00
Drop Airplane patches
This commit is contained in:
46
patches/server/0206-Implement-Mob-Blindness.patch
Normal file
46
patches/server/0206-Implement-Mob-Blindness.patch
Normal file
@@ -0,0 +1,46 @@
|
||||
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] Implement Mob Blindness
|
||||
|
||||
Ported from https://github.com/raltsmc/mobblindness
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
index 52d2076b3fd222148d307133f5465944ef6c546f..6b739e67c8054846a4569c0fc91b06206683d78c 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
@@ -922,6 +922,18 @@ public abstract class EntityLiving extends Entity {
|
||||
if (entitytypes == EntityTypes.SKELETON && item == Items.SKELETON_SKULL || entitytypes == EntityTypes.ZOMBIE && item == Items.ZOMBIE_HEAD || entitytypes == EntityTypes.CREEPER && item == Items.CREEPER_HEAD) {
|
||||
d0 *= 0.5D;
|
||||
}
|
||||
+
|
||||
+ // Purpur start
|
||||
+ if (entity instanceof EntityLiving) {
|
||||
+ EntityLiving livingEntity = (EntityLiving) entity;
|
||||
+ if (livingEntity.hasEffect(MobEffects.BLINDNESS)) {
|
||||
+ int amplifier = livingEntity.getEffect(MobEffects.BLINDNESS).getAmplifier();
|
||||
+ for (int i = 0; i < amplifier; i++) {
|
||||
+ d0 *= world.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 07c66f9d41e7a74021dde6702d654710e400e93b..b8622f687b4fd70aaee5fa44cc50b8ee38582582 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -542,6 +542,11 @@ public class PurpurWorldConfig {
|
||||
mobsSpawnOnBlueIce = getBoolean("blocks.blue_ice.allow-mob-spawns", mobsSpawnOnBlueIce);
|
||||
}
|
||||
|
||||
+ public double mobsBlindnessMultiplier = 1;
|
||||
+ private void blindnessSettings() {
|
||||
+ mobsBlindnessMultiplier = getDouble("gameplay-mechanics.entity-blindness-multiplier", mobsBlindnessMultiplier);
|
||||
+ }
|
||||
+
|
||||
public boolean chestOpenWithBlockOnTop = false;
|
||||
private void chestSettings() {
|
||||
chestOpenWithBlockOnTop = getBoolean("blocks.chest.open-with-solid-block-on-top", chestOpenWithBlockOnTop);
|
||||
Reference in New Issue
Block a user