aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0195-Prevent-Frosted-Ice-from-loading-holding-chunks.patch
blob: b9c45b572d126c62fe3dc7c8bfa549dada321a3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 10 Mar 2018 16:33:15 -0500
Subject: [PATCH] Prevent Frosted Ice from loading/holding chunks

1.17: Shouldn't be needed as blocks no longer tick without at least 1 radius chunk loaded.

diff --git a/src/main/java/net/minecraft/world/level/block/FrostedIceBlock.java b/src/main/java/net/minecraft/world/level/block/FrostedIceBlock.java
index 331b642c36af97f7f05bd63f96d42d1af443e5a3..a3af96b2518b41f370d09cfda26dc589b9ee977b 100644
--- a/src/main/java/net/minecraft/world/level/block/FrostedIceBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/FrostedIceBlock.java
@@ -38,7 +38,8 @@ public class FrostedIceBlock extends IceBlock {
 
             for(Direction direction : Direction.values()) {
                 mutableBlockPos.setWithOffset(pos, direction);
-                BlockState blockState = world.getBlockState(mutableBlockPos);
+                BlockState blockState = world.getBlockStateIfLoaded(mutableBlockPos); // Paper
+                if (blockState == null) { continue; } // Paper
                 if (blockState.is(this) && !this.slightlyMelt(blockState, world, mutableBlockPos)) {
                     world.scheduleTick(mutableBlockPos, this, Mth.nextInt(random, world.paperConfig().environment.frostedIce.delay.min, world.paperConfig().environment.frostedIce.delay.max)); // Paper - use configurable min/max delay
                 }
@@ -75,7 +76,10 @@ public class FrostedIceBlock extends IceBlock {
 
         for(Direction direction : Direction.values()) {
             mutableBlockPos.setWithOffset(pos, direction);
-            if (world.getBlockState(mutableBlockPos).is(this)) {
+            // Paper start
+            BlockState blockState = world.getBlockStateIfLoaded(mutableBlockPos);
+            if (blockState != null && blockState.is(this)) {
+                // Paper end
                 ++i;
                 if (i >= maxNeighbors) {
                     return false;