2017-06-19 09:36:55 +08:00
From cdeef2924460c8256fdbeaddad748cbc2561a3bf Mon Sep 17 00:00:00 2001
2016-04-18 05:28:16 +08:00
From: Aikar <aikar@aikar.co>
Date: Sun, 17 Apr 2016 17:27:09 -0400
Subject: [PATCH] Prevent Fire from loading chunks
This causes the nether to spam unload/reload chunks, plus overall
bad behavior.
diff --git a/src/main/java/net/minecraft/server/BlockFire.java b/src/main/java/net/minecraft/server/BlockFire.java
2017-06-19 09:36:55 +08:00
index a3a5c853..6832a19a 100644
2016-04-18 05:28:16 +08:00
--- a/src/main/java/net/minecraft/server/BlockFire.java
+++ b/src/main/java/net/minecraft/server/BlockFire.java
2017-03-15 22:32:50 +08:00
@@ -164,6 +164,7 @@ public class BlockFire extends Block {
2016-04-18 05:28:16 +08:00
}
BlockPosition blockposition1 = blockposition.a(j, l, k);
+ if (!world.isLoaded(blockposition1)) continue; // Paper
int j1 = this.d(world, blockposition1);
if (j1 > 0) {
2017-05-15 02:05:01 +08:00
@@ -232,10 +233,13 @@ public class BlockFire extends Block {
2016-04-18 05:28:16 +08:00
}
2017-03-15 22:32:50 +08:00
private void a(World world, BlockPosition blockposition, int i, Random random, int j, BlockPosition sourceposition) { // CraftBukkit add sourceposition
+ // Paper start
+ final IBlockData iblockdata = world.getTypeIfLoaded(blockposition);
+ if (iblockdata == null) return;
2017-05-15 02:05:01 +08:00
int k = this.e(world.getType(blockposition).getBlock());
2016-04-18 05:28:16 +08:00
if (random.nextInt(i) < k) {
- IBlockData iblockdata = world.getType(blockposition);
+ //IBlockData iblockdata = world.getType(blockposition); // Paper
// CraftBukkit start
org.bukkit.block.Block theBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
2017-05-15 02:05:01 +08:00
@@ -294,6 +298,8 @@ public class BlockFire extends Block {
2016-04-18 05:28:16 +08:00
for (int k = 0; k < j; ++k) {
EnumDirection enumdirection = aenumdirection[k];
+ final IBlockData type = world.getTypeIfLoaded(blockposition.shift(enumdirection)); // Paper
+ if (type == null) continue; // Paper
2017-05-15 02:05:01 +08:00
i = Math.max(this.f(world.getType(blockposition.shift(enumdirection)).getBlock()), i);
2016-04-18 05:28:16 +08:00
}
--
2017-06-19 09:36:55 +08:00
2.13.1.windows.2
2016-04-18 05:28:16 +08:00