2013-01-25 04:00:07 +01:00
|
|
|
From a92dd621c34cdca2b5c4ceb27ea92dec45129bba Mon Sep 17 00:00:00 2001
|
2013-01-25 03:27:22 +01:00
|
|
|
From: md_5 <md_5@live.com.au>
|
|
|
|
Date: Fri, 25 Jan 2013 13:15:42 +1100
|
|
|
|
Subject: [PATCH] Track Xray timings.
|
|
|
|
|
|
|
|
---
|
2013-01-25 04:00:07 +01:00
|
|
|
src/main/java/net/minecraft/server/Packet51MapChunk.java | 2 +-
|
|
|
|
src/main/java/org/bukkit/craftbukkit/OrebfuscatorManager.java | 11 +++++++++++
|
|
|
|
2 files changed, 12 insertions(+), 1 deletion(-)
|
2013-01-25 03:27:22 +01:00
|
|
|
|
2013-01-25 04:00:07 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/Packet51MapChunk.java b/src/main/java/net/minecraft/server/Packet51MapChunk.java
|
|
|
|
index 365116a..230dd62 100644
|
|
|
|
--- a/src/main/java/net/minecraft/server/Packet51MapChunk.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Packet51MapChunk.java
|
|
|
|
@@ -46,7 +46,7 @@ public class Packet51MapChunk extends Packet {
|
|
|
|
|
|
|
|
this.d = chunkmap.c;
|
|
|
|
this.c = chunkmap.b;
|
|
|
|
- org.bukkit.craftbukkit.OrebfuscatorManager.obfuscate(chunk.x, chunk.z, i, chunkmap.a, chunk.world); // Spigot (Orebfuscator)
|
|
|
|
+ org.bukkit.craftbukkit.OrebfuscatorManager.obfuscateSync(chunk.x, chunk.z, i, chunkmap.a, chunk.world); // Spigot (Orebfuscator)
|
|
|
|
|
|
|
|
try {
|
|
|
|
this.inflatedBuffer = chunkmap.a;
|
2013-01-25 03:27:22 +01:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/OrebfuscatorManager.java b/src/main/java/org/bukkit/craftbukkit/OrebfuscatorManager.java
|
2013-01-25 04:00:07 +01:00
|
|
|
index 7178dfb..c0ee505 100644
|
2013-01-25 03:27:22 +01:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/OrebfuscatorManager.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/OrebfuscatorManager.java
|
|
|
|
@@ -2,11 +2,14 @@ package org.bukkit.craftbukkit;
|
|
|
|
|
|
|
|
import net.minecraft.server.Block;
|
|
|
|
import net.minecraft.server.World;
|
|
|
|
+import org.bukkit.event.CustomTimingsHandler;
|
|
|
|
|
|
|
|
public class OrebfuscatorManager {
|
|
|
|
|
|
|
|
// Used to keep track of which blocks to obfuscate
|
|
|
|
private static boolean[] obfuscateBlocks = new boolean[Short.MAX_VALUE];
|
|
|
|
+ private static final CustomTimingsHandler obfuscate = new CustomTimingsHandler("xray - obfuscate");
|
|
|
|
+ private static final CustomTimingsHandler update = new CustomTimingsHandler("xray - update");
|
|
|
|
|
|
|
|
// Default blocks
|
|
|
|
static {
|
2013-01-25 04:00:07 +01:00
|
|
|
@@ -24,7 +27,15 @@ public class OrebfuscatorManager {
|
2013-01-25 03:27:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public static void updateNearbyBlocks(World world, int x, int y, int z) {
|
|
|
|
+ update.startTiming();
|
|
|
|
updateNearbyBlocks(world, x, y, z, world.getServer().orebfuscatorUpdateRadius);
|
|
|
|
+ update.stopTiming();
|
2013-01-25 04:00:07 +01:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static void obfuscateSync(int chunkX, int chunkY, int bitmask, byte[] buffer, World world) {
|
2013-01-25 03:27:22 +01:00
|
|
|
+ obfuscate.startTiming();
|
2013-01-25 04:00:07 +01:00
|
|
|
+ obfuscate(chunkX, chunkY, bitmask, buffer, world);
|
2013-01-25 03:27:22 +01:00
|
|
|
+ obfuscate.stopTiming();
|
|
|
|
}
|
|
|
|
|
2013-01-25 04:00:07 +01:00
|
|
|
public static void obfuscate(int chunkX, int chunkY, int bitmask, byte[] buffer, World world) {
|
2013-01-25 03:27:22 +01:00
|
|
|
--
|
|
|
|
1.8.1-rc2
|
|
|
|
|