3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-15 02:50:09 +01:00

Check if chunk is loading before obfuscating.

Dieser Commit ist enthalten in:
md_5 2013-01-22 09:57:22 +11:00
Ursprung f440cb30ed
Commit 43dc376b03

Datei anzeigen

@ -1,4 +1,4 @@
From e54edb89cff47a39424a7c2407dd5b401457bef6 Mon Sep 17 00:00:00 2001
From 651726d8d8d2b340212ad898826e88b1a0f7fd8e Mon Sep 17 00:00:00 2001
From: lishid <lishid@gmail.com>
Date: Mon, 21 Jan 2013 16:59:04 +1100
Subject: [PATCH] Add oreobfuscator for Spigot.
@ -10,9 +10,9 @@ Subject: [PATCH] Add oreobfuscator for Spigot.
.../minecraft/server/PlayerInteractManager.java | 5 ++
.../java/org/bukkit/craftbukkit/CraftServer.java | 9 +++
.../java/org/bukkit/craftbukkit/CraftWorld.java | 4 +
.../bukkit/craftbukkit/OrebfuscatorManager.java | 92 ++++++++++++++++++++++
.../bukkit/craftbukkit/OrebfuscatorManager.java | 93 ++++++++++++++++++++++
src/main/resources/configurations/bukkit.yml | 5 ++
8 files changed, 137 insertions(+), 1 deletion(-)
8 files changed, 138 insertions(+), 1 deletion(-)
create mode 100644 src/main/java/org/bukkit/craftbukkit/OrebfuscatorManager.java
diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java
@ -166,10 +166,10 @@ index 856307f..4861609 100644
public int cactusGrowthModifier = 100;
diff --git a/src/main/java/org/bukkit/craftbukkit/OrebfuscatorManager.java b/src/main/java/org/bukkit/craftbukkit/OrebfuscatorManager.java
new file mode 100644
index 0000000..8d4d4d3
index 0000000..6d5a519
--- /dev/null
+++ b/src/main/java/org/bukkit/craftbukkit/OrebfuscatorManager.java
@@ -0,0 +1,92 @@
@@ -0,0 +1,93 @@
+package org.bukkit.craftbukkit;
+
+import net.minecraft.server.Block;
@ -253,6 +253,7 @@ index 0000000..8d4d4d3
+
+ private static boolean areAjacentBlocksTransparent(World world, int x, int y, int z, int radius) {
+ return y > 0 && y <= world.getHeight()
+ && world.isLoaded(x, y, z)
+ && !Block.i(world.getTypeId(x, y, z))
+ || (radius > 0 && (areAjacentBlocksTransparent(world, x, y + 1, z, radius - 1)
+ || areAjacentBlocksTransparent(world, x, y - 1, z, radius - 1)