NOT FINISHED: Current progress, updated upstream
This commit is contained in:
parent
87cdf6c201
commit
3d8746445e
30 changed files with 153 additions and 243 deletions
|
@ -1,4 +1,4 @@
|
|||
From 95d232b2294d238a0e77279b32e6870003ab28ba Mon Sep 17 00:00:00 2001
|
||||
From a54aaf050878b967a9ee98b9264f67e476ff26ba Mon Sep 17 00:00:00 2001
|
||||
From: Zach Brown <zach.brown@destroystokyo.com>
|
||||
Date: Mon, 29 Feb 2016 21:02:09 -0600
|
||||
Subject: [PATCH] Paper config files
|
||||
|
@ -576,10 +576,10 @@ index c7f5cba2d..330ea4e72 100644
|
|||
this.world = new CraftWorld((WorldServer) this, gen, env);
|
||||
this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 8b118e81e..dad2dc959 100644
|
||||
index ce5ebcc54..88766d30d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -742,6 +742,7 @@ public final class CraftServer implements Server {
|
||||
@@ -743,6 +743,7 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
|
||||
org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot
|
||||
|
@ -587,7 +587,7 @@ index 8b118e81e..dad2dc959 100644
|
|||
for (WorldServer world : console.worlds) {
|
||||
world.worldData.setDifficulty(difficulty);
|
||||
world.setSpawnFlags(monsters, animals);
|
||||
@@ -757,6 +758,7 @@ public final class CraftServer implements Server {
|
||||
@@ -758,6 +759,7 @@ public final class CraftServer implements Server {
|
||||
world.ticksPerMonsterSpawns = this.getTicksPerMonsterSpawns();
|
||||
}
|
||||
world.spigotConfig.init(); // Spigot
|
||||
|
@ -595,7 +595,7 @@ index 8b118e81e..dad2dc959 100644
|
|||
}
|
||||
|
||||
pluginManager.clearPlugins();
|
||||
@@ -764,6 +766,7 @@ public final class CraftServer implements Server {
|
||||
@@ -765,6 +767,7 @@ public final class CraftServer implements Server {
|
||||
resetRecipes();
|
||||
reloadData();
|
||||
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
|
||||
|
@ -603,7 +603,7 @@ index 8b118e81e..dad2dc959 100644
|
|||
overrideAllCommandBlockCommands = commandsConfiguration.getStringList("command-block-overrides").contains("*");
|
||||
ignoreVanillaPermissions = commandsConfiguration.getBoolean("ignore-vanilla-permissions");
|
||||
|
||||
@@ -1879,4 +1882,26 @@ public final class CraftServer implements Server {
|
||||
@@ -1880,4 +1883,26 @@ public final class CraftServer implements Server {
|
||||
{
|
||||
return spigot;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 169b26f073fe0a751e9e952766ae4fc3da0c4368 Mon Sep 17 00:00:00 2001
|
||||
From 7ac235f6e19a3c24fa6d3e8bef538626e3aac1fe Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Thu, 3 Mar 2016 04:00:11 -0600
|
||||
Subject: [PATCH] Timings v2
|
||||
|
@ -989,7 +989,7 @@ index ac6d8cc6e..d975c2ccf 100644
|
|||
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index 227bc857e..2adb21e55 100644
|
||||
index 749be86fe..c2eb3a58d 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -57,6 +57,7 @@ import org.bukkit.inventory.CraftingInventory;
|
||||
|
@ -1000,7 +1000,7 @@ index 227bc857e..2adb21e55 100644
|
|||
// CraftBukkit end
|
||||
|
||||
public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||
@@ -1609,7 +1610,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||
@@ -1615,7 +1616,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||
// CraftBukkit end
|
||||
|
||||
private void handleCommand(String s) {
|
||||
|
@ -1009,7 +1009,7 @@ index 227bc857e..2adb21e55 100644
|
|||
// CraftBukkit start - whole method
|
||||
if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot
|
||||
this.LOGGER.info(this.player.getName() + " issued server command: " + s);
|
||||
@@ -1620,7 +1621,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||
@@ -1626,7 +1627,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||
this.server.getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
|
@ -1018,7 +1018,7 @@ index 227bc857e..2adb21e55 100644
|
|||
return;
|
||||
}
|
||||
|
||||
@@ -1633,7 +1634,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||
@@ -1639,7 +1640,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||
java.util.logging.Logger.getLogger(PlayerConnection.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||
return;
|
||||
} finally {
|
||||
|
@ -1380,10 +1380,10 @@ index 784289c0d..d7f86bf76 100644
|
|||
|
||||
// CraftBukkit start
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index dad2dc959..88ea651ba 100644
|
||||
index 88766d30d..d33f237b7 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1852,12 +1852,31 @@ public final class CraftServer implements Server {
|
||||
@@ -1853,12 +1853,31 @@ public final class CraftServer implements Server {
|
||||
private final Spigot spigot = new Spigot()
|
||||
{
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 3d481b7c47b3781e9ee6bd3badaf44de6eae33df Mon Sep 17 00:00:00 2001
|
||||
From 8310c9fbbc16dd134af47991b8fd2b94ec6972f7 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Tue, 1 Mar 2016 23:09:29 -0600
|
||||
Subject: [PATCH] Further improve server tick loop
|
||||
|
@ -148,10 +148,10 @@ index 4889a82a2..2e691b9f6 100644
|
|||
}
|
||||
lastTick = curTime;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 28f6cdf96..2055bf7de 100644
|
||||
index 34a07a7e7..6e152fe17 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1849,6 +1849,17 @@ public final class CraftServer implements Server {
|
||||
@@ -1850,6 +1850,17 @@ public final class CraftServer implements Server {
|
||||
return CraftMagicNumbers.INSTANCE;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 76230fe4dce6a66d080d18d066a83fffd1291354 Mon Sep 17 00:00:00 2001
|
||||
From ab1bae7a2ab47f6b7af31ac4a92e6135ff84c490 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Thu, 3 Mar 2016 01:17:12 -0600
|
||||
Subject: [PATCH] Ensure commands are not ran async
|
||||
|
@ -14,10 +14,10 @@ big slowdown in execution but throwing an exception at same time to raise awaren
|
|||
that it is happening so that plugin authors can fix their code to stop executing commands async.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index 2adb21e55..27c255c8d 100644
|
||||
index c2eb3a58d..9c27966ea 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -1542,6 +1542,29 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||
@@ -1548,6 +1548,29 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||
}
|
||||
|
||||
if (!async && s.startsWith("/")) {
|
||||
|
@ -48,12 +48,12 @@ index 2adb21e55..27c255c8d 100644
|
|||
} else if (this.player.getChatFlags() == EntityHuman.EnumChatVisibility.SYSTEM) {
|
||||
// Do nothing, this is coming from a plugin
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 2055bf7de..29344593a 100644
|
||||
index 6e152fe17..d637199ca 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -688,6 +688,29 @@ public final class CraftServer implements Server {
|
||||
Validate.notNull(sender, "Sender cannot be null");
|
||||
@@ -689,6 +689,29 @@ public final class CraftServer implements Server {
|
||||
Validate.notNull(commandLine, "CommandLine cannot be null");
|
||||
org.spigotmc.AsyncCatcher.catchOp( "command dispatch" ); // Spigot
|
||||
|
||||
+ // Paper Start
|
||||
+ if (!org.spigotmc.AsyncCatcher.shuttingDown && !Bukkit.isPrimaryThread()) {
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
From 96c952ead9d29b9e4ce25edabbb6dbd967ffcf07 Mon Sep 17 00:00:00 2001
|
||||
From ae3186b04c366d0b9b11b9c98955a51c48fee46d Mon Sep 17 00:00:00 2001
|
||||
From: kashike <kashike@vq.lc>
|
||||
Date: Thu, 3 Mar 2016 02:15:57 -0600
|
||||
Subject: [PATCH] Expose server CommandMap
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 29344593a..32a05ca18 100644
|
||||
index d637199ca..703d38f0c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1603,6 +1603,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1604,6 +1604,7 @@ public final class CraftServer implements Server {
|
||||
return helpMap;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,28 +1,9 @@
|
|||
From e8d1d0159c1cba0d04340218e701786a9adf8d66 Mon Sep 17 00:00:00 2001
|
||||
From be350e0077e7b6c99d9117bc35e9ac3715fca21b Mon Sep 17 00:00:00 2001
|
||||
From: Jedediah Smith <jedediah@silencegreys.com>
|
||||
Date: Sat, 4 Apr 2015 23:17:52 -0400
|
||||
Subject: [PATCH] Complete resource pack API
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index 27c255c8d..2cc277e4f 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -1308,7 +1308,13 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||
|
||||
}
|
||||
|
||||
- public void a(PacketPlayInResourcePackStatus packetplayinresourcepackstatus) {}
|
||||
+ public void a(PacketPlayInResourcePackStatus packetplayinresourcepackstatus) {
|
||||
+ // Paper start;
|
||||
+ final PlayerResourcePackStatusEvent.Status status = PlayerResourcePackStatusEvent.Status.values()[packetplayinresourcepackstatus.status.ordinal()];
|
||||
+ this.getPlayer().setResourcePackStatus(status);
|
||||
+ this.server.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(getPlayer(), status));
|
||||
+ // Paper end
|
||||
+ }
|
||||
|
||||
public void a(PacketPlayInBoatMove packetplayinboatmove) {
|
||||
PlayerConnectionUtils.ensureMainThread(packetplayinboatmove, this, this.player.getWorldServer());
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index aacf8ea7f..f6a7f08f9 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 71f4d4247cb4ab0e25b12805cdcb6aa50a9c30a0 Mon Sep 17 00:00:00 2001
|
||||
From 17106878d61a4014f256fb538e80ec6efdadc788 Mon Sep 17 00:00:00 2001
|
||||
From: William <admin@domnian.com>
|
||||
Date: Fri, 18 Mar 2016 03:30:17 -0400
|
||||
Subject: [PATCH] Allow Reloading of Custom Permissions
|
||||
|
@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Custom Permissions
|
|||
https://github.com/PaperMC/Paper/issues/49
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 6dae117ac..5ffb335f5 100644
|
||||
index 4db5aacc4..1c9637ff7 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1959,5 +1959,20 @@ public final class CraftServer implements Server {
|
||||
@@ -1960,5 +1960,20 @@ public final class CraftServer implements Server {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 9fdf883e7c73906f9c5219c1a45475e09fd738c6 Mon Sep 17 00:00:00 2001
|
||||
From ed96bba4daeabf7326e2caaabbc0d29b1412a1e9 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Fri, 18 Mar 2016 13:50:14 -0400
|
||||
Subject: [PATCH] Remove Metadata on reload
|
||||
|
@ -7,10 +7,10 @@ Metadata is not meant to persist reload as things break badly with non primitive
|
|||
This will remove metadata on reload so it does not crash everything if a plugin uses it.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 5ffb335f5..f98f355dd 100644
|
||||
index 1c9637ff7..f90dc11f2 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -786,8 +786,18 @@ public final class CraftServer implements Server {
|
||||
@@ -787,8 +787,18 @@ public final class CraftServer implements Server {
|
||||
world.paperConfig.init(); // Paper
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From c0013f59652a0a64e836a922863092944b8ef36f Mon Sep 17 00:00:00 2001
|
||||
From 45ab5aca8f811f11099ff7d2eeca2edcf0fe376a Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Sat, 13 Sep 2014 23:14:43 -0400
|
||||
Subject: [PATCH] Configurable Keep Spawn Loaded range per world
|
||||
|
@ -54,10 +54,10 @@ index e42a334bc..d15afd595 100644
|
|||
|
||||
public void a(Packet<?> packet) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index f98f355dd..2bcd1c3ca 100644
|
||||
index f90dc11f2..06b59657f 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1007,7 +1007,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1008,7 +1008,7 @@ public final class CraftServer implements Server {
|
||||
System.out.println("Preparing start region for level " + (console.worlds.size() - 1) + " (Seed: " + internal.getSeed() + ")");
|
||||
|
||||
if (internal.getWorld().getKeepSpawnInMemory()) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From eb105e6e240bc10506a92fc0972efbbf8912ee05 Mon Sep 17 00:00:00 2001
|
||||
From 2062affcd6a91a4412d256001eddf48c20ba4bb0 Mon Sep 17 00:00:00 2001
|
||||
From: Gabriele C <sgdc3.mail@gmail.com>
|
||||
Date: Fri, 5 Aug 2016 01:03:08 +0200
|
||||
Subject: [PATCH] Add setting for proxy online mode status
|
||||
|
@ -33,10 +33,10 @@ index f13534917..85c7a96c5 100644
|
|||
} else {
|
||||
String[] astring1 = astring;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 2bcd1c3ca..a36192362 100644
|
||||
index 06b59657f..6c7151536 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1374,7 +1374,8 @@ public final class CraftServer implements Server {
|
||||
@@ -1375,7 +1375,8 @@ public final class CraftServer implements Server {
|
||||
// Spigot Start
|
||||
GameProfile profile = null;
|
||||
// Only fetch an online UUID in online mode
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From c1b9295b23dbaf419b41f1fbe6aa1df6cccfbbe6 Mon Sep 17 00:00:00 2001
|
||||
From e3b16b09f178839a08a58cabb3c7b8a3a04933ae Mon Sep 17 00:00:00 2001
|
||||
From: Zach Brown <zach.brown@destroystokyo.com>
|
||||
Date: Sun, 11 Sep 2016 14:30:57 -0500
|
||||
Subject: [PATCH] Configurable packet in spam threshold
|
||||
|
@ -23,10 +23,10 @@ index cf06f8ac3..2001175bf 100644
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index c09620b37..aa7c019ab 100644
|
||||
index e9ce81bfc..c757881b7 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -1185,13 +1185,14 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||
@@ -1186,13 +1186,14 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||
// Spigot start - limit place/interactions
|
||||
private int limitedPackets;
|
||||
private long lastLimitedPacket = -1;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 92afeaf4b7ea1551a2a035a2e0443e28571f5a00 Mon Sep 17 00:00:00 2001
|
||||
From b8aacaf96f78054dfc5e2882462375d3b491e087 Mon Sep 17 00:00:00 2001
|
||||
From: willies952002 <admin@domnian.com>
|
||||
Date: Mon, 28 Nov 2016 10:21:52 -0500
|
||||
Subject: [PATCH] Allow Reloading of Command Aliases
|
||||
|
@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Command Aliases
|
|||
Reload the aliases stored in commands.yml
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index a36192362..f3dfd65d6 100644
|
||||
index 6c7151536..1b6a849e2 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1985,5 +1985,24 @@ public final class CraftServer implements Server {
|
||||
@@ -1986,5 +1986,24 @@ public final class CraftServer implements Server {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
From 1d07c47c26d62a65101a2a873e4737f94f975b86 Mon Sep 17 00:00:00 2001
|
||||
From d05c7f07de546d123328cbbb9ab4dd39c8e18090 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Himing <mhiming@gmail.com>
|
||||
Date: Sun, 8 Jan 2017 18:50:35 +1100
|
||||
Subject: [PATCH] Fix block break desync
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index b69c194bb..25e3d6423 100644
|
||||
index a7132427a..32c99085f 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -1144,6 +1144,8 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||
@@ -1145,6 +1145,8 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||
double d3 = d0 * d0 + d1 * d1 + d2 * d2;
|
||||
|
||||
if (d3 > 36.0D) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 4da4707066e2b1a70a6406e205be0c072c10da99 Mon Sep 17 00:00:00 2001
|
||||
From 782de6915346ade4415e251417b825f9d5027dac Mon Sep 17 00:00:00 2001
|
||||
From: kashike <kashike@vq.lc>
|
||||
Date: Fri, 9 Jun 2017 07:24:34 -0700
|
||||
Subject: [PATCH] Add configuration option to prevent player names from being
|
||||
|
@ -20,10 +20,10 @@ index ea6fcb39f..dbafef023 100644
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index f3dfd65d6..6c611c0df 100644
|
||||
index 1b6a849e2..470e334f7 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2004,5 +2004,10 @@ public final class CraftServer implements Server {
|
||||
@@ -2005,5 +2005,10 @@ public final class CraftServer implements Server {
|
||||
commandMap.registerServerAliases();
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 161a4fa741fe2a3ac45c495a7966493116048201 Mon Sep 17 00:00:00 2001
|
||||
From d671e6f9baa04e24af9751c81d428b61757ae3c0 Mon Sep 17 00:00:00 2001
|
||||
From: Minecrell <minecrell@minecrell.net>
|
||||
Date: Fri, 9 Jun 2017 19:03:43 +0200
|
||||
Subject: [PATCH] Use TerminalConsoleAppender for console improvements
|
||||
|
@ -310,7 +310,7 @@ index 5e833c378..0f39fa49f 100644
|
|||
|
||||
this.k = new GameProfileBanList(PlayerList.a);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 6c611c0df..3b10c5e61 100644
|
||||
index 470e334f7..9fe7c6a0d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -137,8 +137,8 @@ import java.nio.ByteBuffer;
|
||||
|
@ -323,7 +323,7 @@ index 6c611c0df..3b10c5e61 100644
|
|||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.craftbukkit.block.data.CraftBlockData;
|
||||
@@ -1140,9 +1140,13 @@ public final class CraftServer implements Server {
|
||||
@@ -1141,9 +1141,13 @@ public final class CraftServer implements Server {
|
||||
return logger;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
From 9b1c57eced435652b0ab33f81636733bde8728b8 Mon Sep 17 00:00:00 2001
|
||||
From 48e60197f559cbbedc2e69fc36de72626c1553a8 Mon Sep 17 00:00:00 2001
|
||||
From: Sweepyoface <github@sweepy.pw>
|
||||
Date: Sat, 17 Jun 2017 18:48:21 -0400
|
||||
Subject: [PATCH] Add UnknownCommandEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 3b10c5e61..46f86359c 100644
|
||||
index 9fe7c6a0d..69cfe5c4d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -79,6 +79,7 @@ import org.bukkit.craftbukkit.util.Versioning;
|
||||
|
@ -16,7 +16,7 @@ index 3b10c5e61..46f86359c 100644
|
|||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.event.player.PlayerChatTabCompleteEvent;
|
||||
import org.bukkit.event.server.BroadcastMessageEvent;
|
||||
@@ -719,7 +720,13 @@ public final class CraftServer implements Server {
|
||||
@@ -720,7 +721,13 @@ public final class CraftServer implements Server {
|
||||
|
||||
// Spigot start
|
||||
if (!org.spigotmc.SpigotConfig.unknownCommandMessage.isEmpty()) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 614281018d171ed41567a3abfaac9b589157a9dc Mon Sep 17 00:00:00 2001
|
||||
From 7adc17f9b34a0fc2365f72f04462d4e902a9919e Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Mon, 15 Jan 2018 22:11:48 -0500
|
||||
Subject: [PATCH] Basic PlayerProfile API
|
||||
|
@ -486,7 +486,7 @@ index a47a51a41..4c476f757 100644
|
|||
|
||||
private UserCacheEntry(GameProfile gameprofile, Date date) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 46f86359c..26bbb0265 100644
|
||||
index 69cfe5c4d..0ef1186b9 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -152,6 +152,10 @@ import org.bukkit.craftbukkit.util.CraftNamespacedKey;
|
||||
|
@ -500,7 +500,7 @@ index 46f86359c..26bbb0265 100644
|
|||
public final class CraftServer implements Server {
|
||||
private final String serverName = "Paper"; // Paper
|
||||
private final String serverVersion;
|
||||
@@ -2020,5 +2024,21 @@ public final class CraftServer implements Server {
|
||||
@@ -2021,5 +2025,21 @@ public final class CraftServer implements Server {
|
||||
public boolean suggestPlayerNamesWhenNullTabCompletions() {
|
||||
return com.destroystokyo.paper.PaperConfig.suggestPlayersWhenNullTabCompletions;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From a267bc488bbe04958b64ce137b2a483737976473 Mon Sep 17 00:00:00 2001
|
||||
From 941c7fed4bfadedf10f30caf187e3f86a43e1e0a Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Wed, 4 May 2016 22:43:12 -0400
|
||||
Subject: [PATCH] Implement ensureServerConversions API
|
||||
|
@ -7,10 +7,10 @@ This will take a Bukkit ItemStack and run it through any conversions a server pr
|
|||
to ensure it meets latest minecraft expectations.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
index e305d663a..503dd5827 100644
|
||||
index 59d2685dc..27a264f54 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
@@ -287,4 +287,10 @@ public final class CraftItemFactory implements ItemFactory {
|
||||
@@ -288,4 +288,10 @@ public final class CraftItemFactory implements ItemFactory {
|
||||
public Material updateMaterial(ItemMeta meta, Material material) throws IllegalArgumentException {
|
||||
return ((CraftMetaItem) meta).updateMaterial(material);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From c49c483e01b88e0baaf6e43ce5732dc16eb85c24 Mon Sep 17 00:00:00 2001
|
||||
From 1a5effd5460ca5dcba227eecfb2387ad4c170a57 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Wed, 4 May 2016 23:59:38 -0400
|
||||
Subject: [PATCH] Implement getI18NDisplayName
|
||||
|
@ -8,10 +8,10 @@ Currently the server only supports the English language. To override this,
|
|||
You must replace the language file embedded in the server jar.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
index 503dd5827..73785830f 100644
|
||||
index 27a264f54..6fc0ce050 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
@@ -292,5 +292,18 @@ public final class CraftItemFactory implements ItemFactory {
|
||||
@@ -293,5 +293,18 @@ public final class CraftItemFactory implements ItemFactory {
|
||||
public ItemStack ensureServerConversions(ItemStack item) {
|
||||
return CraftItemStack.asCraftMirror(CraftItemStack.asNMSCopy(item));
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
From a1241df8d09b0b85541b860c16da86cdd179ecf3 Mon Sep 17 00:00:00 2001
|
||||
From 7cc2935836c4f7c33e12958c81a9855b0e087540 Mon Sep 17 00:00:00 2001
|
||||
From: Zach Brown <zach.brown@destroystokyo.com>
|
||||
Date: Thu, 28 Sep 2017 17:21:44 -0400
|
||||
Subject: [PATCH] Add PlayerJumpEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
index 85e617979..8cf082d2e 100644
|
||||
index f08c0ba60..1b944abea 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
@@ -1460,6 +1460,7 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
|
@ -17,7 +17,7 @@ index 85e617979..8cf082d2e 100644
|
|||
super.cG();
|
||||
this.a(StatisticList.JUMP);
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index 128b2beb5..2255b8ccb 100644
|
||||
index bf549bfed..25c38f3bb 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -57,6 +57,8 @@ import org.bukkit.inventory.CraftingInventory;
|
||||
|
@ -29,7 +29,7 @@ index 128b2beb5..2255b8ccb 100644
|
|||
import co.aikar.timings.MinecraftTimings; // Paper
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -860,7 +862,34 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||
@@ -861,7 +863,34 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||
d8 = d5 - this.p;
|
||||
d9 = d6 - this.q;
|
||||
if (this.player.onGround && !packetplayinflying.b() && d8 > 0.0D) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From d6b423ce8aea858a4e606fd70e440b302706c6f5 Mon Sep 17 00:00:00 2001
|
||||
From 4d3673f412e0f7bffbe4535345d9710736aa3899 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Sun, 26 Nov 2017 13:19:58 -0500
|
||||
Subject: [PATCH] AsyncTabCompleteEvent
|
||||
|
@ -14,46 +14,40 @@ completion, such as offline players.
|
|||
Also adds isCommand and getLocation to the sync TabCompleteEvent
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index e01013efd..74a665142 100644
|
||||
index d47805962..ea29b1b2a 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -2277,24 +2277,51 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||
// CraftBukkit end
|
||||
@@ -504,18 +504,59 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||
}
|
||||
|
||||
- public void a(PacketPlayInTabComplete packetplayintabcomplete) {
|
||||
- PlayerConnectionUtils.ensureMainThread(packetplayintabcomplete, this, this.player.x());
|
||||
+ // Paper start - async tab completion
|
||||
+ public void a(PacketPlayInTabComplete packet) {
|
||||
public void a(PacketPlayInTabComplete packetplayintabcomplete) {
|
||||
- PlayerConnectionUtils.ensureMainThread(packetplayintabcomplete, this, this.player.getWorldServer());
|
||||
+ // PlayerConnectionUtils.ensureMainThread(packetplayintabcomplete, this, this.player.getWorldServer()); // Paper - run this async
|
||||
// CraftBukkit start
|
||||
if (chatSpamField.addAndGet(this, 10) > 500 && !this.minecraftServer.getPlayerList().isOp(this.player.getProfile())) {
|
||||
if (chatSpamField.addAndGet(this, 5) > 500 && !this.minecraftServer.getPlayerList().isOp(this.player.getProfile())) {
|
||||
- this.disconnect(new ChatMessage("disconnect.spam", new Object[0]));
|
||||
+ minecraftServer.postToMainThread(() -> this.disconnect(new ChatMessage("disconnect.spam", new Object[0])));
|
||||
+ minecraftServer.postToMainThread(() -> this.disconnect(new ChatMessage("disconnect.spam", new Object[0]))); // Paper
|
||||
return;
|
||||
}
|
||||
// CraftBukkit end
|
||||
- ArrayList arraylist = Lists.newArrayList();
|
||||
- Iterator iterator = this.minecraftServer.tabCompleteCommand(this.player, packetplayintabcomplete.a(), packetplayintabcomplete.b(), packetplayintabcomplete.c()).iterator();
|
||||
|
||||
- while (iterator.hasNext()) {
|
||||
- String s = (String) iterator.next();
|
||||
- // CraftBukkit end
|
||||
- ParseResults parseresults = this.minecraftServer.getCommandDispatcher().a().parse(packetplayintabcomplete.c(), this.player.getCommandListener());
|
||||
+ // Paper start
|
||||
+ com.destroystokyo.paper.event.server.AsyncTabCompleteEvent event;
|
||||
+ java.util.List<String> completions = new ArrayList<>();
|
||||
+ BlockPosition blockpos = packet.b();
|
||||
+ String buffer = packet.a();
|
||||
+ boolean isCommand = buffer.startsWith("/") || packet.c();
|
||||
+ java.util.List<String> completions = new java.util.ArrayList<>();
|
||||
+ String buffer = packetplayintabcomplete.c();
|
||||
+ event = new com.destroystokyo.paper.event.server.AsyncTabCompleteEvent(this.getPlayer(), completions,
|
||||
+ buffer, isCommand, blockpos != null ? MCUtil.toLocation(player.world, blockpos) : null);
|
||||
+ buffer, true, null);
|
||||
+ event.callEvent();
|
||||
+ completions = event.isCancelled() ? com.google.common.collect.ImmutableList.of() : event.getCompletions();
|
||||
+ if (event.isCancelled() || event.isHandled()) {
|
||||
+
|
||||
+ // Still fire sync event with the provided completions, if someone is listening
|
||||
+ if (!event.isCancelled() && org.bukkit.event.server.TabCompleteEvent.getHandlerList().getRegisteredListeners().length > 0) {
|
||||
+ java.util.List<String> finalCompletions = completions;
|
||||
+ Waitable<java.util.List<String>> syncCompletions = new Waitable<java.util.List<String>>() {
|
||||
+ @Override
|
||||
+ protected java.util.List<String> evaluate() {
|
||||
+ org.bukkit.event.server.TabCompleteEvent syncEvent = new org.bukkit.event.server.TabCompleteEvent(PlayerConnection.this.getPlayer(), buffer, finalCompletions, isCommand, blockpos != null ? MCUtil.toLocation(player.world, blockpos) : null);
|
||||
+ org.bukkit.event.server.TabCompleteEvent syncEvent = new org.bukkit.event.server.TabCompleteEvent(PlayerConnection.this.getPlayer(), buffer, finalCompletions, true, null);
|
||||
+ return syncEvent.callEvent() ? syncEvent.getCompletions() : com.google.common.collect.ImmutableList.of();
|
||||
+ }
|
||||
+ };
|
||||
|
@ -64,33 +58,42 @@ index e01013efd..74a665142 100644
|
|||
+ e1.printStackTrace();
|
||||
+ }
|
||||
+ }
|
||||
|
||||
- arraylist.add(s);
|
||||
+ this.player.playerConnection.sendPacket(new PacketPlayOutTabComplete(completions.toArray(new String[completions.size()])));
|
||||
+ java.util.List<String> otherSuggestions = completions;
|
||||
+ minecraftServer.postToMainThread(() -> sendSuggestions(packetplayintabcomplete, otherSuggestions));
|
||||
+ return;
|
||||
}
|
||||
-
|
||||
- this.player.playerConnection.sendPacket(new PacketPlayOutTabComplete((String[]) arraylist.toArray(new String[arraylist.size()])));
|
||||
+ minecraftServer.postToMainThread(() -> {
|
||||
+ java.util.List<String> syncCompletions = this.minecraftServer.tabCompleteCommand(this.player, buffer, blockpos, isCommand);
|
||||
+ this.player.playerConnection.sendPacket(new PacketPlayOutTabComplete(syncCompletions.toArray(new String[syncCompletions.size()])));
|
||||
+ });
|
||||
+ // Paper end
|
||||
+ }
|
||||
+ minecraftServer.postToMainThread(() -> sendSuggestions(packetplayintabcomplete, null));
|
||||
+ }
|
||||
+ public void sendSuggestions(PacketPlayInTabComplete packetplayintabcomplete, java.util.List<String> otherSuggestions) {
|
||||
|
||||
- this.minecraftServer.getCommandDispatcher().a().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> {
|
||||
- if (((Suggestions) suggestions).isEmpty()) return; // CraftBukkit - don't send through empty suggestions - prevents [<args>] from showing for plugins with nothing more to offer
|
||||
- this.networkManager.sendPacket(new PacketPlayOutTabComplete(packetplayintabcomplete.b(), (Suggestions) suggestions)); // CraftBukkit - decompile error
|
||||
+ ParseResults parseresults = this.minecraftServer.getCommandDispatcher().a().parse(packetplayintabcomplete.c(), this.player.getCommandListener());
|
||||
+ //noinspection unchecked
|
||||
+ java.util.concurrent.CompletableFuture<Suggestions> completionSuggestions = this.minecraftServer.getCommandDispatcher().a().getCompletionSuggestions(parseresults);
|
||||
+ completionSuggestions.thenAccept((Suggestions suggestions) -> {
|
||||
+ if (otherSuggestions != null && !otherSuggestions.isEmpty()) {
|
||||
+ com.mojang.brigadier.suggestion.SuggestionsBuilder builder = new com.mojang.brigadier.suggestion.SuggestionsBuilder(packetplayintabcomplete.c(), packetplayintabcomplete.b());
|
||||
+ otherSuggestions.forEach(builder::suggest);
|
||||
+ suggestions.getList().addAll(builder.build().getList());
|
||||
+ }
|
||||
+ // Paper end
|
||||
+ if (suggestions.isEmpty()) return; // CraftBukkit - don't send through empty suggestions - prevents [<args>] from showing for plugins with nothing more to offer
|
||||
+ this.networkManager.sendPacket(new PacketPlayOutTabComplete(packetplayintabcomplete.b(), suggestions)); // CraftBukkit - decompile error
|
||||
});
|
||||
}
|
||||
|
||||
public void a(PacketPlayInSettings packetplayinsettings) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 2dd7ed96a..e86c16755 100644
|
||||
index 0ef1186b9..d605e5792 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1643,8 +1643,8 @@ public final class CraftServer implements Server {
|
||||
} else {
|
||||
@@ -1685,7 +1685,7 @@ public final class CraftServer implements Server {
|
||||
offers = tabCompleteChat(player, message);
|
||||
}
|
||||
-
|
||||
|
||||
- TabCompleteEvent tabEvent = new TabCompleteEvent(player, message, offers);
|
||||
+
|
||||
+ TabCompleteEvent tabEvent = new TabCompleteEvent(player, message, offers, message.startsWith("/") || forceCommand, pos != null ? MCUtil.toLocation(((CraftWorld) player.getWorld()).getHandle(), pos) : null); // Paper
|
||||
+ TabCompleteEvent tabEvent = new TabCompleteEvent(player, message, offers, message.startsWith("/") || forceCommand, pos != null ? MCUtil.toLocation(((CraftWorld) player.getWorld()).getHandle(), new BlockPosition(pos)) : null); // Paper
|
||||
getPluginManager().callEvent(tabEvent);
|
||||
|
||||
return tabEvent.isCancelled() ? Collections.EMPTY_LIST : tabEvent.getCompletions();
|
||||
|
@ -139,5 +142,5 @@ index 1e3aae3b8..95d13c146 100644
|
|||
Waitable<List<String>> waitable = new Waitable<List<String>>() {
|
||||
@Override
|
||||
--
|
||||
2.17.1
|
||||
2.18.0
|
||||
|
|
@ -1,14 +1,14 @@
|
|||
From 9879e7c10bb47f2cfaa41d001896592517a6b429 Mon Sep 17 00:00:00 2001
|
||||
From fe8bfba5b4261ca168861e7015077de0f245c2db Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Wed, 29 Nov 2017 22:18:54 -0500
|
||||
Subject: [PATCH] Avoid NPE in PathfinderGoalTempt
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PathfinderGoalTempt.java b/src/main/java/net/minecraft/server/PathfinderGoalTempt.java
|
||||
index 188825d19..8004f3a3f 100644
|
||||
index 154202700..64b1ac71b 100644
|
||||
--- a/src/main/java/net/minecraft/server/PathfinderGoalTempt.java
|
||||
+++ b/src/main/java/net/minecraft/server/PathfinderGoalTempt.java
|
||||
@@ -54,7 +54,7 @@ public class PathfinderGoalTempt extends PathfinderGoal {
|
||||
@@ -52,7 +52,7 @@ public class PathfinderGoalTempt extends PathfinderGoal {
|
||||
}
|
||||
this.target = (event.getTarget() == null) ? null : ((CraftLivingEntity) event.getTarget()).getHandle();
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
From b5f98ca545e3f16e608e3c0ef67be1d04188c261 Mon Sep 17 00:00:00 2001
|
||||
From b4d0bde98db80bfe668ce7aaa663f0a28ab6f7b7 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Tue, 19 Dec 2017 22:02:53 -0500
|
||||
Subject: [PATCH] PlayerPickupExperienceEvent
|
||||
|
@ -6,18 +6,18 @@ Subject: [PATCH] PlayerPickupExperienceEvent
|
|||
Allows plugins to cancel a player picking up an experience orb
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java
|
||||
index d567ad4a5..ff5cc74ba 100644
|
||||
index 79d80596d..a87ef5fb8 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java
|
||||
@@ -206,7 +206,7 @@ public class EntityExperienceOrb extends Entity {
|
||||
@@ -218,7 +218,7 @@ public class EntityExperienceOrb extends Entity {
|
||||
|
||||
public void d(EntityHuman entityhuman) {
|
||||
if (!this.world.isClientSide) {
|
||||
- if (this.c == 0 && entityhuman.bD == 0) {
|
||||
+ if (this.c == 0 && entityhuman.bD == 0 && new com.destroystokyo.paper.event.player.PlayerPickupExperienceEvent(((EntityPlayer) entityhuman).getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) this.getBukkitEntity()).callEvent()) { // Paper
|
||||
entityhuman.bD = 2;
|
||||
- if (this.c == 0 && entityhuman.bJ == 0) {
|
||||
+ if (this.c == 0 && entityhuman.bJ == 0 && new com.destroystokyo.paper.event.player.PlayerPickupExperienceEvent(((EntityPlayer) entityhuman).getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) this.getBukkitEntity()).callEvent()) { // Paper
|
||||
entityhuman.bJ = 2;
|
||||
entityhuman.receive(this, 1);
|
||||
ItemStack itemstack = EnchantmentManager.b(Enchantments.C, (EntityLiving) entityhuman);
|
||||
ItemStack itemstack = EnchantmentManager.b(Enchantments.G, (EntityLiving) entityhuman);
|
||||
--
|
||||
2.18.0
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
From 4104f9583f512022acc4fe898d4487df59a1029a Mon Sep 17 00:00:00 2001
|
||||
From 74074907e815897a829332df3e128f981cf653a1 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Tue, 19 Dec 2017 22:57:26 -0500
|
||||
Subject: [PATCH] ExperienceOrbMergeEvent
|
||||
|
@ -8,10 +8,10 @@ Plugins can cancel this if they want to ensure experience orbs do not lose impor
|
|||
metadata such as spawn reason, or conditionally move data from source to target.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 39b90fb4c..c0816b9f8 100644
|
||||
index 069ba83db..ee061d693 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -1153,7 +1153,7 @@ public abstract class World implements IBlockAccess {
|
||||
@@ -1008,7 +1008,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose
|
||||
for (Entity e : entities) {
|
||||
if (e instanceof EntityExperienceOrb) {
|
||||
EntityExperienceOrb loopItem = (EntityExperienceOrb) e;
|
|
@ -1,4 +1,4 @@
|
|||
From 5a07c0ee8d6b1ae0143448473c2e081ec6517412 Mon Sep 17 00:00:00 2001
|
||||
From 07b82eb3e7d10b50aedf8b73f80d3952fd65536c Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Wed, 20 Dec 2017 17:36:49 -0500
|
||||
Subject: [PATCH] Ability to apply mending to XP API
|
||||
|
@ -10,11 +10,11 @@ of giving the player experience points.
|
|||
Both an API To standalone mend, and apply mending logic to .giveExp has been added.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EnchantmentManager.java b/src/main/java/net/minecraft/server/EnchantmentManager.java
|
||||
index 98300d0a2..f714dc326 100644
|
||||
index 3204d94c5..e4ed9e206 100644
|
||||
--- a/src/main/java/net/minecraft/server/EnchantmentManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/EnchantmentManager.java
|
||||
@@ -226,6 +226,7 @@ public class EnchantmentManager {
|
||||
return getEnchantmentLevel(Enchantments.D, itemstack) > 0;
|
||||
@@ -245,6 +245,7 @@ public class EnchantmentManager {
|
||||
return getEnchantmentLevel(Enchantments.F, itemstack) > 0;
|
||||
}
|
||||
|
||||
+ public static ItemStack getRandomEquippedItemWithEnchant(Enchantment enchantment, EntityLiving entityliving) { return b(enchantment, entityliving); } // Paper - OBFHELPER
|
||||
|
@ -22,66 +22,40 @@ index 98300d0a2..f714dc326 100644
|
|||
List list = enchantment.a(entityliving);
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Enchantments.java b/src/main/java/net/minecraft/server/Enchantments.java
|
||||
index 35e87eb1c..74a6a4f60 100644
|
||||
index 0f4aad20f..3a5263fd9 100644
|
||||
--- a/src/main/java/net/minecraft/server/Enchantments.java
|
||||
+++ b/src/main/java/net/minecraft/server/Enchantments.java
|
||||
@@ -32,7 +32,7 @@ public class Enchantments {
|
||||
public static final Enchantment ARROW_INFINITE = a("infinity");
|
||||
public static final Enchantment LUCK = a("luck_of_the_sea");
|
||||
public static final Enchantment LURE = a("lure");
|
||||
- public static final Enchantment C = a("mending");
|
||||
+ public static final Enchantment C = a("mending"); public static final Enchantment MENDING = C; // Paper - OBFHELPER
|
||||
public static final Enchantment D = a("vanishing_curse");
|
||||
@@ -36,7 +36,7 @@ public class Enchantments {
|
||||
public static final Enchantment D = a("impaling");
|
||||
public static final Enchantment E = a("riptide");
|
||||
public static final Enchantment F = a("channeling");
|
||||
- public static final Enchantment G = a("mending");
|
||||
+ public static final Enchantment G = a("mending");public static final Enchantment MENDING = G; // Paper - OBFHELPER
|
||||
public static final Enchantment H = a("vanishing_curse");
|
||||
|
||||
@Nullable
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java
|
||||
index ff5cc74ba..1c59fd966 100644
|
||||
index a87ef5fb8..b8bfc7577 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java
|
||||
@@ -234,10 +234,12 @@ public class EntityExperienceOrb extends Entity {
|
||||
@@ -246,10 +246,12 @@ public class EntityExperienceOrb extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
+ public int durToXp(int i) { return c(i); } // Paper OBFHELPER
|
||||
private int c(int i) {
|
||||
+ public int durToXp(int i) { return b(i); } // Paper OBFHELPER
|
||||
private int b(int i) {
|
||||
return i / 2;
|
||||
}
|
||||
|
||||
+ public int xpToDur(int i) { return d(i); } // Paper OBFHELPER
|
||||
private int d(int i) {
|
||||
+ public int xpToDur(int i) { return c(i); } // Paper OBFHELPER
|
||||
private int c(int i) {
|
||||
return i * 2;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
index d666088f2..f6b802dc8 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
@@ -29,7 +29,7 @@ public final class ItemStack {
|
||||
private Item item;
|
||||
private NBTTagCompound tag;
|
||||
private boolean g;
|
||||
- private int damage;
|
||||
+ private int damage; public void setDamage(int i) { this.damage = i; } // Paper - OBFHELPER
|
||||
private EntityItemFrame i;
|
||||
private Block j;
|
||||
private boolean k;
|
||||
@@ -350,10 +350,12 @@ public final class ItemStack {
|
||||
return this.getItem().k();
|
||||
}
|
||||
|
||||
+ public boolean hasDamage() { return h(); } // Paper OBFHELPER
|
||||
public boolean h() {
|
||||
return this.f() && this.damage > 0;
|
||||
}
|
||||
|
||||
+ public int getDamage() { return i(); } // Paper OBFHELPER
|
||||
public int i() {
|
||||
return this.damage;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index d69784386..77c50ba14 100644
|
||||
index 9f9002dd8..c2cd5ac4b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -927,8 +927,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -970,8 +970,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
return GameMode.getByValue(getHandle().playerInteractManager.getGameMode().getId());
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
From 2de47d2a780d542cb93b6fa85bb8e90535a8de14 Mon Sep 17 00:00:00 2001
|
||||
From b317d6346419650c31540d2e7d2998107dabe890 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Mon, 1 Jan 2018 15:41:59 -0500
|
||||
Subject: [PATCH] Configurable Chunks Sends per Tick setting
|
||||
|
@ -8,10 +8,10 @@ Vanilla already had this limited, make it configurable.
|
|||
Limit how much exploration lags the server
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 535a8d3ed..e3ff78180 100644
|
||||
index 33743f8fd..49f282332 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -463,4 +463,13 @@ public class PaperWorldConfig {
|
||||
@@ -393,4 +393,13 @@ public class PaperWorldConfig {
|
||||
expMergeMaxValue = getInt("experience-merge-max-value", -1);
|
||||
log("Experience Merge Max Value: " + expMergeMaxValue);
|
||||
}
|
||||
|
@ -26,10 +26,10 @@ index 535a8d3ed..e3ff78180 100644
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
index 4af557321..6ee9f6cfb 100644
|
||||
index bfe2d03a5..9fd07f859 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
@@ -198,7 +198,7 @@ public class PlayerChunkMap {
|
||||
@@ -172,7 +172,7 @@ public class PlayerChunkMap {
|
||||
}
|
||||
|
||||
if (!this.g.isEmpty()) {
|
|
@ -1,48 +0,0 @@
|
|||
From dd48bbfe6038596192469c818bb31f0a29d71646 Mon Sep 17 00:00:00 2001
|
||||
From: Shane Freeder <theboyetronic@gmail.com>
|
||||
Date: Mon, 18 Dec 2017 07:26:56 +0000
|
||||
Subject: [PATCH] Don't blindly send unlit chunks when lighting updates are
|
||||
allowed
|
||||
|
||||
Spigot, by default, disables several mechanisms around how chunks are
|
||||
lit, if ever, which has forced them to always send chunks before vanilla
|
||||
would consider them ready to send, causing for lots of issues around
|
||||
lighting glitches.
|
||||
|
||||
Shamefully, the amount of work to relight chunks can be detremental
|
||||
to some servers, meaning that forcibily disabling light updates can
|
||||
cause major performance issues.
|
||||
|
||||
as such, we make a compromise; if this "feature" is disabled, we will
|
||||
only send chunks which are actually ready to be sent, otherwise, we
|
||||
will always send chunks.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index cb33cf902..87d0d426f 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -68,7 +68,7 @@ public class Chunk {
|
||||
// Paper end
|
||||
private boolean done;
|
||||
private boolean lit;
|
||||
- private boolean r;
|
||||
+ private boolean r; private boolean isTicked() { return r; }; // Paper - OBFHELPER
|
||||
private boolean s;
|
||||
private boolean t;
|
||||
private long lastSaved;
|
||||
@@ -1174,7 +1174,11 @@ public class Chunk {
|
||||
* We cannot unfortunately do this lighting stage during chunk gen as it appears to put a lot more noticeable load on the server, than when it is done at play time.
|
||||
* For now at least we will simply send all chunks, in accordance with pre 1.7 behaviour.
|
||||
*/
|
||||
- return true;
|
||||
+ // Paper Start
|
||||
+ // if randomLightUpdates are disabled, we should always return true, otherwise chunks may never send
|
||||
+ // to the client due to not being lit, otherwise retain standard behavior and only send properly lit chunks.
|
||||
+ return !this.world.spigotConfig.randomLightUpdates || (this.isTicked() && this.done && this.lit);
|
||||
+ // Paper End
|
||||
// Spigot End
|
||||
}
|
||||
|
||||
--
|
||||
2.18.0
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit a71d06a0c8426f7d1d23f9e76ea6cdf47b666db5
|
||||
Subproject commit de019a35f009518bbabb3f39383e374cf8aae799
|
|
@ -1 +1 @@
|
|||
Subproject commit 11bdb291b30fed321b346668a4b5e4ddf45229b6
|
||||
Subproject commit 83d9d09afb65204de4f6050c4033d482dd2a0d6a
|
Loading…
Reference in a new issue