mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
47 lines
2.5 KiB
Diff
47 lines
2.5 KiB
Diff
From 87ba5377e08f10cf3874e4acecbd7ead49386c53 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
Date: Sat, 18 May 2019 16:59:52 -0500
|
|
Subject: [PATCH] Phantoms do not spawn on creative players
|
|
|
|
---
|
|
src/main/java/net/minecraft/server/MobSpawnerPhantom.java | 2 +-
|
|
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
|
|
2 files changed, 3 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/MobSpawnerPhantom.java b/src/main/java/net/minecraft/server/MobSpawnerPhantom.java
|
|
index f488c22ed6..748983da29 100644
|
|
--- a/src/main/java/net/minecraft/server/MobSpawnerPhantom.java
|
|
+++ b/src/main/java/net/minecraft/server/MobSpawnerPhantom.java
|
|
@@ -31,7 +31,7 @@ public class MobSpawnerPhantom {
|
|
while (iterator.hasNext()) {
|
|
EntityHuman entityhuman = (EntityHuman) iterator.next();
|
|
|
|
- if (!entityhuman.isSpectator()) {
|
|
+ if (!entityhuman.isSpectator() && (!worldserver.purpurConfig.phantomIgnoreCreative || !entityhuman.isCreative())) { // Purpur
|
|
BlockPosition blockposition = new BlockPosition(entityhuman);
|
|
|
|
if (!worldserver.worldProvider.f() || blockposition.getY() >= worldserver.getSeaLevel() && worldserver.f(blockposition)) {
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index 85692500b4..451cc18b9a 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -402,6 +402,7 @@ public class PurpurWorldConfig {
|
|
public double phantomMaxY = 256D;
|
|
public float phantomFlameDamage = 1.0F;
|
|
public int phantomFlameFireTime = 8;
|
|
+ public boolean phantomIgnoreCreative = false;
|
|
private void phantomSettings() {
|
|
phantomRidable = getBoolean("mobs.phantom.ridable", phantomRidable);
|
|
phantomRidableInWater = getBoolean("mobs.phantom.ridable-in-water", phantomRidableInWater);
|
|
@@ -409,6 +410,7 @@ public class PurpurWorldConfig {
|
|
phantomMaxY = getDouble("mobs.phantom.ridable-max-y", phantomMaxY);
|
|
phantomFlameDamage = (float) getDouble("mobs.phantom.flames.damage", phantomFlameDamage);
|
|
phantomFlameFireTime = getInt("mobs.phantom.flames.fire-time", phantomFlameFireTime);
|
|
+ phantomIgnoreCreative = getBoolean("mobs.phantom.do-not-spawn-on-creative-players", phantomIgnoreCreative);
|
|
}
|
|
|
|
public boolean pigRidable = false;
|
|
--
|
|
2.24.0
|
|
|