2016-09-11 02:42:47 +00:00
|
|
|
From 72649486d710ff8a72fa0d26f18ed110a679d3be Mon Sep 17 00:00:00 2001
|
2016-04-17 21:28:16 +00: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
|
2016-07-17 01:10:43 +00:00
|
|
|
index 1b91f58..c348221 100644
|
2016-04-17 21:28:16 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/BlockFire.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/BlockFire.java
|
2016-05-12 02:07:46 +00:00
|
|
|
@@ -162,6 +162,7 @@ public class BlockFire extends Block {
|
2016-04-17 21:28:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
BlockPosition blockposition1 = blockposition.a(j, l, k);
|
|
|
|
+ if (!world.isLoaded(blockposition1)) continue; // Paper
|
|
|
|
int j1 = this.d(world, blockposition1);
|
|
|
|
|
|
|
|
if (j1 > 0) {
|
2016-05-12 02:07:46 +00:00
|
|
|
@@ -230,10 +231,12 @@ public class BlockFire extends Block {
|
2016-04-17 21:28:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private void a(World world, BlockPosition blockposition, int i, Random random, int j) {
|
|
|
|
- int k = this.c(world.getType(blockposition).getBlock());
|
|
|
|
+ final IBlockData iblockdata = world.getTypeIfLoaded(blockposition); // Paper
|
|
|
|
+ if (iblockdata == null) return; // Paper
|
|
|
|
+ int k = this.c(iblockdata.getBlock()); // Paper
|
|
|
|
|
|
|
|
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());
|
2016-05-12 02:07:46 +00:00
|
|
|
@@ -291,7 +294,9 @@ public class BlockFire extends Block {
|
2016-04-17 21:28:16 +00:00
|
|
|
for (int k = 0; k < j; ++k) {
|
|
|
|
EnumDirection enumdirection = aenumdirection[k];
|
|
|
|
|
|
|
|
- i = Math.max(this.d(world.getType(blockposition.shift(enumdirection)).getBlock()), i);
|
|
|
|
+ final IBlockData type = world.getTypeIfLoaded(blockposition.shift(enumdirection)); // Paper
|
|
|
|
+ if (type == null) continue; // Paper
|
|
|
|
+ i = Math.max(this.d(type.getBlock()), i); // Paper
|
|
|
|
}
|
|
|
|
|
|
|
|
return i;
|
|
|
|
--
|
2016-09-11 02:42:47 +00:00
|
|
|
2.10.0.windows.1
|
2016-04-17 21:28:16 +00:00
|
|
|
|