mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-19 15:09:25 +00:00
36 lines
2.4 KiB
Diff
36 lines
2.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
|
Date: Sun, 25 Dec 2022 19:31:09 +0100
|
|
Subject: [PATCH] Don't load chunks to spawn phantoms
|
|
|
|
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
|
Gale - https://galemc.org
|
|
|
|
This patch is based on the following patch:
|
|
"Don't load chunks when spawning phantoms"
|
|
By: PureGero <puregero@gmail.com>
|
|
As part of: MultiPaper (https://github.com/MultiPaper/MultiPaper)
|
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
|
|
|
diff --git a/net/minecraft/world/level/levelgen/PhantomSpawner.java b/net/minecraft/world/level/levelgen/PhantomSpawner.java
|
|
index d2e674b046bcf82a239b4706c3b89197ec6749c8..1ec7abf2c82a5371fe1dacd57d90386fdae67f56 100644
|
|
--- a/net/minecraft/world/level/levelgen/PhantomSpawner.java
|
|
+++ b/net/minecraft/world/level/levelgen/PhantomSpawner.java
|
|
@@ -52,7 +52,15 @@ public class PhantomSpawner implements CustomSpawner {
|
|
BlockPos blockPos1 = blockPos.above(20 + randomSource.nextInt(15))
|
|
.east(-10 + randomSource.nextInt(21))
|
|
.south(-10 + randomSource.nextInt(21));
|
|
- BlockState blockState = level.getBlockState(blockPos1);
|
|
+ // Gale start - MultiPaper - don't load chunks to spawn phantoms
|
|
+ BlockState blockState;
|
|
+ if (level.galeConfig().smallOptimizations.loadChunks.toSpawnPhantoms) {
|
|
+ blockState = level.getBlockState(blockPos1);
|
|
+ } else {
|
|
+ blockState = level.getBlockStateIfLoaded(blockPos1);
|
|
+ if (blockState == null) continue;
|
|
+ }
|
|
+ // Gale end - MultiPaper - don't load chunks to spawn phantoms
|
|
FluidState fluidState = level.getFluidState(blockPos1);
|
|
if (NaturalSpawner.isValidEmptySpawnBlock(level, blockPos1, blockState, fluidState, EntityType.PHANTOM)) {
|
|
SpawnGroupData spawnGroupData = null;
|