aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0233-Prevent-Frosted-Ice-from-loading-holding-chunks.patch
blob: 78cefbbdd444d35db65451a89598041d6ec89537 (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
From 4a099bffa3eb608b42cf27f5796a192910a17811 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


diff --git a/src/main/java/net/minecraft/server/BlockIceFrost.java b/src/main/java/net/minecraft/server/BlockIceFrost.java
index 2c881be1ed..2c4bbc7890 100644
--- a/src/main/java/net/minecraft/server/BlockIceFrost.java
+++ b/src/main/java/net/minecraft/server/BlockIceFrost.java
@@ -25,7 +25,8 @@ public class BlockIceFrost extends BlockIce {
                     EnumDirection enumdirection = aenumdirection[j];
 
                     blockposition_pooledblockposition.g(blockposition).c(enumdirection);
-                    IBlockData iblockdata1 = world.getType(blockposition_pooledblockposition);
+                    IBlockData iblockdata1 = world.getTypeIfLoaded(blockposition_pooledblockposition); // Paper - don't load chunks
+                    if (iblockdata1 == null) continue; // Paper
 
                     if (iblockdata1.getBlock() == this && !this.c(iblockdata1, world, blockposition_pooledblockposition)) {
                         world.getBlockTickList().a(blockposition_pooledblockposition, this, MathHelper.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay
@@ -87,7 +88,7 @@ public class BlockIceFrost extends BlockIce {
                 EnumDirection enumdirection = aenumdirection[l];
 
                 blockposition_pooledblockposition.g(blockposition).c(enumdirection);
-                if (iblockaccess.getType(blockposition_pooledblockposition).getBlock() == this) {
+                if (((World) iblockaccess).getBlockIfLoaded(blockposition_pooledblockposition) == this) { // Paper - don't load chunks
                     ++j;
                     if (j >= i) {
                         boolean flag = false;
-- 
2.21.0