Add phantom creative and insomniac controls

This commit is contained in:
William Blake Galbreath
2020-04-25 15:13:41 -05:00
parent 56752585e8
commit 8a71e1c7da
3 changed files with 23 additions and 9 deletions

View File

@@ -1,5 +1,14 @@
--- a/net/minecraft/world/level/levelgen/PhantomSpawner.java
+++ b/net/minecraft/world/level/levelgen/PhantomSpawner.java
@@ -48,7 +48,7 @@
while (iterator.hasNext()) {
ServerPlayer entityplayer = (ServerPlayer) iterator.next();
- if (!entityplayer.isSpectator()) {
+ if (!entityplayer.isSpectator() && (!world.paperConfig().entities.behavior.phantomsDoNotSpawnOnCreativePlayers || !entityplayer.isCreative())) { // Paper - Add phantom creative and insomniac controls
BlockPos blockposition = entityplayer.blockPosition();
if (!world.dimensionType().hasSkyLight() || blockposition.getY() >= world.getSeaLevel() && world.canSeeSky(blockposition)) {
@@ -69,12 +69,22 @@
int k = 1 + randomsource.nextInt(difficultydamagescaler.getDifficulty().getId() + 1);