testserver/CraftBukkit-Patches/0022-Send-maps-a-lot-less-o...

65 lines
3.1 KiB
Diff
Raw Normal View History

2013-02-15 23:13:00 +00:00
From c990d9e10a9a8285c8d408c6cb665c1f1e640545 Mon Sep 17 00:00:00 2001
2013-02-02 08:41:11 +00:00
From: md_5 <md_5@live.com.au>
Date: Sat, 2 Feb 2013 19:40:53 +1100
Subject: [PATCH] Send maps a lot less often to combat the lag they cause.
---
src/main/java/net/minecraft/server/EntityTrackerEntry.java | 2 +-
2013-02-15 07:34:42 +00:00
src/main/java/org/bukkit/craftbukkit/CraftServer.java | 1 +
src/main/java/org/bukkit/craftbukkit/Spigot.java | 1 +
src/main/resources/configurations/bukkit.yml | 1 +
4 files changed, 4 insertions(+), 1 deletion(-)
2013-02-02 08:41:11 +00:00
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
2013-02-15 07:34:42 +00:00
index a026c4c..27a548f 100644
2013-02-02 08:41:11 +00:00
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
@@ -73,7 +73,7 @@ public class EntityTrackerEntry {
this.broadcast(new Packet39AttachEntity(this.tracker, this.tracker.vehicle));
}
- if (this.tracker instanceof EntityItemFrame && this.m % 10 == 0) {
2013-02-15 07:34:42 +00:00
+ if (this.tracker instanceof EntityItemFrame && this.m % tracker.world.getServer().mapSendInterval == 0) {
2013-02-02 08:41:11 +00:00
EntityItemFrame i4 = (EntityItemFrame) this.tracker;
ItemStack i5 = i4.i();
2013-02-15 07:34:42 +00:00
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
2013-02-15 23:13:00 +00:00
index 204af22..f00b28d 100644
2013-02-15 07:34:42 +00:00
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
2013-02-15 23:13:00 +00:00
@@ -179,6 +179,7 @@ public final class CraftServer implements Server {
2013-02-15 07:34:42 +00:00
public boolean ipFilter = false;
public boolean commandComplete = true;
public List<String> spamGuardExclusions;
+ public int mapSendInterval = 10000;
// Spigot end
static {
diff --git a/src/main/java/org/bukkit/craftbukkit/Spigot.java b/src/main/java/org/bukkit/craftbukkit/Spigot.java
2013-02-15 23:13:00 +00:00
index b124dab..c712b52 100644
2013-02-15 07:34:42 +00:00
--- a/src/main/java/org/bukkit/craftbukkit/Spigot.java
+++ b/src/main/java/org/bukkit/craftbukkit/Spigot.java
@@ -22,6 +22,7 @@ public class Spigot {
server.ipFilter = configuration.getBoolean("settings.filter-unsafe-ips", false);
server.commandComplete = configuration.getBoolean("settings.command-complete", true);
server.spamGuardExclusions = configuration.getStringList("settings.spam-exclusions");
+ server.mapSendInterval = configuration.getInt("settings.map-send-interval", server.mapSendInterval);
server.orebfuscatorEnabled = configuration.getBoolean("orebfuscator.enable", false);
2013-02-15 23:13:00 +00:00
server.orebfuscatorEngineMode = configuration.getInt("orebfuscator.engine-mode", 1);
2013-02-15 07:34:42 +00:00
diff --git a/src/main/resources/configurations/bukkit.yml b/src/main/resources/configurations/bukkit.yml
2013-02-15 23:13:00 +00:00
index 3228d17..3122a14 100644
2013-02-15 07:34:42 +00:00
--- a/src/main/resources/configurations/bukkit.yml
+++ b/src/main/resources/configurations/bukkit.yml
@@ -34,6 +34,7 @@ settings:
command-complete: true
spam-exclusions:
- /skill
+ map-send-interval: 10000
world-settings:
default:
growth-chunks-per-tick: 650
2013-02-02 08:41:11 +00:00
--
1.8.1-rc2