mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-04 14:12:20 -07:00
Update upstream B/CB/S
Remove two features added upstream
This commit is contained in:
@@ -1,167 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: DemonWav <demonwav@gmail.com>
|
|
||||||
Date: Mon, 29 Feb 2016 19:37:41 -0600
|
|
||||||
Subject: [PATCH] Add Location support to tab completers (vanilla feature
|
|
||||||
missing in CraftBukkit)
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/src/main/java/org/bukkit/command/Command.java
|
|
||||||
+++ b/src/main/java/org/bukkit/command/Command.java
|
|
||||||
@@ -0,0 +0,0 @@ import java.util.Set;
|
|
||||||
import org.apache.commons.lang.Validate;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
+import org.bukkit.Location;
|
|
||||||
import org.bukkit.Server;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.entity.minecart.CommandMinecart;
|
|
||||||
@@ -0,0 +0,0 @@ public abstract class Command {
|
|
||||||
return matchedPlayers;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // Paper start - location tab-completes
|
|
||||||
+
|
|
||||||
+ /**
|
|
||||||
+ * Executed on tab completion for this command, returning a list of options the player can tab through. This method
|
|
||||||
+ * returns the {@link Location} of the block the player is looking at at the time of the tab complete.
|
|
||||||
+ * <p>
|
|
||||||
+ * Commands that want to use the Location information in their tab-complete implementations need to override this
|
|
||||||
+ * method. The Location provided by this method is the block that the player is currently looking at when the player
|
|
||||||
+ * attempts the tab complete. For this to be valid, the block must be highlighted by the player (i.e. the player is
|
|
||||||
+ * close enough to interact with the block).
|
|
||||||
+ *
|
|
||||||
+ * @param sender Source object which is executing this command
|
|
||||||
+ * @param alias the alias being used
|
|
||||||
+ * @param args All arguments passed to the command, split via ' '
|
|
||||||
+ * @param location the location of the block the player is looking at
|
|
||||||
+ * @return a list of tab-completions for the specified arguments. This
|
|
||||||
+ * will never be null. List may be immutable.
|
|
||||||
+ * @throws IllegalArgumentException if sender, alias, or args is null
|
|
||||||
+ */
|
|
||||||
+ public List<String> tabComplete(CommandSender sender, String alias, String[] args, Location location) throws IllegalArgumentException {
|
|
||||||
+ // Simply default to the standard tab-complete, subclasses can override this if needed
|
|
||||||
+ return tabComplete(sender, alias, args);
|
|
||||||
+ }
|
|
||||||
+ // Paper end
|
|
||||||
+
|
|
||||||
/**
|
|
||||||
* Returns the name of this command
|
|
||||||
*
|
|
||||||
diff --git a/src/main/java/org/bukkit/command/PluginCommand.java b/src/main/java/org/bukkit/command/PluginCommand.java
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/src/main/java/org/bukkit/command/PluginCommand.java
|
|
||||||
+++ b/src/main/java/org/bukkit/command/PluginCommand.java
|
|
||||||
@@ -0,0 +0,0 @@ package org.bukkit.command;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.apache.commons.lang.Validate;
|
|
||||||
+import org.bukkit.Location;
|
|
||||||
import org.bukkit.plugin.Plugin;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@@ -0,0 +0,0 @@ public final class PluginCommand extends Command implements PluginIdentifiableCo
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public java.util.List<String> tabComplete(CommandSender sender, String alias, String[] args) throws CommandException, IllegalArgumentException {
|
|
||||||
+ return tabComplete(sender, alias, args, null); // Paper - The code from this method has been (slightly modified) moved to the Location method.
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ // PaperSpigot start - location tab-completes
|
|
||||||
+ /**
|
|
||||||
+ * This code was copied from tabComplete(CommandSender sender, String alias, String[] args)
|
|
||||||
+ */
|
|
||||||
+ @Override
|
|
||||||
+ public List<String> tabComplete(CommandSender sender, String alias, String[] args, Location location) throws CommandException, IllegalArgumentException {
|
|
||||||
Validate.notNull(sender, "Sender cannot be null");
|
|
||||||
Validate.notNull(args, "Arguments cannot be null");
|
|
||||||
Validate.notNull(alias, "Alias cannot be null");
|
|
||||||
@@ -0,0 +0,0 @@ public final class PluginCommand extends Command implements PluginIdentifiableCo
|
|
||||||
List<String> completions = null;
|
|
||||||
try {
|
|
||||||
if (completer != null) {
|
|
||||||
- completions = completer.onTabComplete(sender, this, alias, args);
|
|
||||||
+ completions = completer.onTabComplete(sender, this, alias, args, location); // Paper - add location argument
|
|
||||||
}
|
|
||||||
if (completions == null && executor instanceof TabCompleter) {
|
|
||||||
- completions = ((TabCompleter) executor).onTabComplete(sender, this, alias, args);
|
|
||||||
+ completions = ((TabCompleter) executor).onTabComplete(sender, this, alias, args, location); // Paper - add location argument
|
|
||||||
}
|
|
||||||
} catch (Throwable ex) {
|
|
||||||
StringBuilder message = new StringBuilder();
|
|
||||||
@@ -0,0 +0,0 @@ public final class PluginCommand extends Command implements PluginIdentifiableCo
|
|
||||||
}
|
|
||||||
return completions;
|
|
||||||
}
|
|
||||||
+ // Paper end
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
|
||||||
+++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java
|
|
||||||
@@ -0,0 +0,0 @@ import java.util.Map;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
import org.apache.commons.lang.Validate;
|
|
||||||
+import org.bukkit.Location;
|
|
||||||
import org.bukkit.Server;
|
|
||||||
import org.bukkit.command.defaults.*;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
@@ -0,0 +0,0 @@ public class SimpleCommandMap implements CommandMap {
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> tabComplete(CommandSender sender, String cmdLine) {
|
|
||||||
+ return tabComplete(sender, cmdLine, null); // Paper - location tab-completes, code moved below
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ // Paper start - location tab-completes
|
|
||||||
+ /**
|
|
||||||
+ * This code was copied, except for the noted change, from tabComplete(CommandSender sender, String cmdLine)
|
|
||||||
+ */
|
|
||||||
+ public List<String> tabComplete(CommandSender sender, String cmdLine, Location location) {
|
|
||||||
Validate.notNull(sender, "Sender cannot be null");
|
|
||||||
Validate.notNull(cmdLine, "Command line cannot null");
|
|
||||||
|
|
||||||
@@ -0,0 +0,0 @@ public class SimpleCommandMap implements CommandMap {
|
|
||||||
String[] args = PATTERN_ON_SPACE.split(argLine, -1);
|
|
||||||
|
|
||||||
try {
|
|
||||||
- return target.tabComplete(sender, commandName, args);
|
|
||||||
+ return target.tabComplete(sender, commandName, args, location); // Paper - add location argument
|
|
||||||
} catch (CommandException ex) {
|
|
||||||
throw ex;
|
|
||||||
} catch (Throwable ex) {
|
|
||||||
throw new CommandException("Unhandled exception executing tab-completer for '" + cmdLine + "' in " + target, ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+ // Paper end
|
|
||||||
|
|
||||||
public Collection<Command> getCommands() {
|
|
||||||
return Collections.unmodifiableCollection(knownCommands.values());
|
|
||||||
diff --git a/src/main/java/org/bukkit/command/TabCompleter.java b/src/main/java/org/bukkit/command/TabCompleter.java
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/src/main/java/org/bukkit/command/TabCompleter.java
|
|
||||||
+++ b/src/main/java/org/bukkit/command/TabCompleter.java
|
|
||||||
@@ -0,0 +0,0 @@
|
|
||||||
package org.bukkit.command;
|
|
||||||
|
|
||||||
+import org.bukkit.Location;
|
|
||||||
+
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@@ -0,0 +0,0 @@ public interface TabCompleter {
|
|
||||||
* to default to the command executor
|
|
||||||
*/
|
|
||||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args);
|
|
||||||
+
|
|
||||||
+ // Paper start - location tab-completes
|
|
||||||
+ default List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args, Location location) {
|
|
||||||
+ return onTabComplete(sender, command, alias, args);
|
|
||||||
+ }
|
|
||||||
+ // Paper end
|
|
||||||
}
|
|
||||||
--
|
|
@@ -492,7 +492,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ throw new CommandException(msg, ex);
|
+ throw new CommandException(msg, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Paper end
|
|
||||||
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
|
||||||
|
@@ -3365,7 +3365,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
@@ -0,0 +0,0 @@ public final class JavaPluginLoader implements PluginLoader {
|
@@ -0,0 +0,0 @@ public final class JavaPluginLoader implements PluginLoader {
|
||||||
private final Pattern[] fileFilters = new Pattern[] { Pattern.compile("\\.jar$"), };
|
private final Pattern[] fileFilters = new Pattern[] { Pattern.compile("\\.jar$"), };
|
||||||
private final Map<String, Class<?>> classes = new java.util.concurrent.ConcurrentHashMap<String, Class<?>>(); // Spigot
|
private final Map<String, Class<?>> classes = new java.util.concurrent.ConcurrentHashMap<String, Class<?>>(); // Spigot
|
||||||
private final Map<String, PluginClassLoader> loaders = new LinkedHashMap<String, PluginClassLoader>();
|
private final Map<String, PluginClassLoader> loaders = Collections.synchronizedMap(new LinkedHashMap<String, PluginClassLoader>());
|
||||||
- public static final CustomTimingsHandler pluginParentTimer = new CustomTimingsHandler("** Plugins"); // Spigot
|
- public static final CustomTimingsHandler pluginParentTimer = new CustomTimingsHandler("** Plugins"); // Spigot
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1,158 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: DemonWav <demonwav@gmail.com>
|
|
||||||
Date: Thu, 3 Mar 2016 01:44:39 -0600
|
|
||||||
Subject: [PATCH] Add Location support to tab completers (vanilla feature
|
|
||||||
missing in CraftBukkit)
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
||||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
|
||||||
private void allChunksAreSlimeChunks() {
|
|
||||||
allChunksAreSlimeChunks = getBoolean("all-chunks-are-slime-chunks", false);
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ public boolean allowBlockLocationTabCompletion;
|
|
||||||
+ private void allowBlockLocationTabCompletion() {
|
|
||||||
+ allowBlockLocationTabCompletion = getBoolean("allow-block-location-tab-completion", true);
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
||||||
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
|
|
||||||
return arraylist;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
- return server.tabComplete(icommandlistener, s); // PAIL : todo args
|
|
||||||
+ return server.tabComplete(icommandlistener, s, blockposition); // PAIL : todo args // Paper - add Location arg
|
|
||||||
// CraftBukkit end
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
||||||
@@ -0,0 +0,0 @@ import javax.imageio.ImageIO;
|
|
||||||
|
|
||||||
import net.minecraft.server.*;
|
|
||||||
|
|
||||||
-import org.bukkit.BanList;
|
|
||||||
-import org.bukkit.Bukkit;
|
|
||||||
-import org.bukkit.ChatColor;
|
|
||||||
-import org.bukkit.GameMode;
|
|
||||||
-import org.bukkit.OfflinePlayer;
|
|
||||||
-import org.bukkit.Server;
|
|
||||||
-import org.bukkit.UnsafeValues;
|
|
||||||
+import net.minecraft.server.WorldType;
|
|
||||||
+import org.bukkit.*;
|
|
||||||
import org.bukkit.Warning.WarningState;
|
|
||||||
import org.bukkit.World;
|
|
||||||
import org.bukkit.World.Environment;
|
|
||||||
-import org.bukkit.WorldCreator;
|
|
||||||
import org.bukkit.boss.BarColor;
|
|
||||||
import org.bukkit.boss.BarFlag;
|
|
||||||
import org.bukkit.boss.BarStyle;
|
|
||||||
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> tabComplete(net.minecraft.server.ICommandListener sender, String message) {
|
|
||||||
+ return tabComplete(sender, message, null); // Paper - location tab-completes. Original code here moved below
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ // Paper start - add BlockPosition support
|
|
||||||
+ /*
|
|
||||||
+ this code is copied, except for the noted change, from the original tabComplete(net.minecraft.server.ICommandListener sender, String message) method
|
|
||||||
+ */
|
|
||||||
+ public List<String> tabComplete(net.minecraft.server.ICommandListener sender, String message, BlockPosition blockPosition) {
|
|
||||||
if (!(sender instanceof EntityPlayer)) {
|
|
||||||
return ImmutableList.of();
|
|
||||||
}
|
|
||||||
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {
|
|
||||||
List<String> offers;
|
|
||||||
Player player = ((EntityPlayer) sender).getBukkitEntity();
|
|
||||||
if (message.startsWith("/")) {
|
|
||||||
- offers = tabCompleteCommand(player, message);
|
|
||||||
+ offers = tabCompleteCommand(player, message, blockPosition);
|
|
||||||
} else {
|
|
||||||
offers = tabCompleteChat(player, message);
|
|
||||||
}
|
|
||||||
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {
|
|
||||||
getPluginManager().callEvent(tabEvent);
|
|
||||||
|
|
||||||
return tabEvent.isCancelled() ? Collections.EMPTY_LIST : tabEvent.getCompletions();
|
|
||||||
+ // Paper end
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> tabCompleteCommand(Player player, String message) {
|
|
||||||
+ return tabCompleteCommand(player, message, null); // Paper - location tab-completes. Original code here moved below
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ // Paper start - add BlockPosition support
|
|
||||||
+ /*
|
|
||||||
+ this code is copied, except for the noted change, from the original tabComplete(net.minecraft.server.ICommandListener sender, String message) method
|
|
||||||
+ */
|
|
||||||
+ public List<String> tabCompleteCommand(Player player, String message, BlockPosition blockPosition) {
|
|
||||||
// Spigot Start
|
|
||||||
- if ( (org.spigotmc.SpigotConfig.tabComplete < 0 || message.length() <= org.spigotmc.SpigotConfig.tabComplete) && !message.contains( " " ) )
|
|
||||||
+ if ( (org.spigotmc.SpigotConfig.tabComplete < 0 || message.length() <= org.spigotmc.SpigotConfig.tabComplete) && !message.contains( " " ) )
|
|
||||||
{
|
|
||||||
return ImmutableList.of();
|
|
||||||
}
|
|
||||||
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {
|
|
||||||
|
|
||||||
List<String> completions = null;
|
|
||||||
try {
|
|
||||||
- completions = getCommandMap().tabComplete(player, message.substring(1));
|
|
||||||
+ // send location info if presen
|
|
||||||
+ // completions = getCommandMap().tabComplete(player, message.substring(1));
|
|
||||||
+ if (blockPosition == null || !((CraftWorld) player.getWorld()).getHandle().paperConfig.allowBlockLocationTabCompletion) {
|
|
||||||
+ completions = getCommandMap().tabComplete(player, message.substring(1));
|
|
||||||
+ } else {
|
|
||||||
+ completions = getCommandMap().tabComplete(player, message.substring(1), new Location(player.getWorld(), blockPosition.getX(), blockPosition.getY(), blockPosition.getZ()));
|
|
||||||
+ }
|
|
||||||
+ // Paper end
|
|
||||||
} catch (CommandException ex) {
|
|
||||||
player.sendMessage(ChatColor.RED + "An internal error occurred while attempting to tab-complete this command");
|
|
||||||
getLogger().log(Level.SEVERE, "Exception when " + player.getName() + " attempted to tab complete " + message, ex);
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java
|
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java
|
|
||||||
@@ -0,0 +0,0 @@ import net.minecraft.server.*;
|
|
||||||
|
|
||||||
import org.apache.commons.lang.Validate;
|
|
||||||
import org.apache.logging.log4j.Level;
|
|
||||||
+import org.bukkit.Location;
|
|
||||||
import org.bukkit.command.BlockCommandSender;
|
|
||||||
import org.bukkit.command.CommandSender;
|
|
||||||
import org.bukkit.command.ConsoleCommandSender;
|
|
||||||
@@ -0,0 +0,0 @@ public final class VanillaCommandWrapper extends VanillaCommand {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<String> tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException {
|
|
||||||
+ return tabComplete(sender, alias, args, null); // Paper - location tab-completes. Original code moved below
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ // Paper start - location tab-completes
|
|
||||||
+ /*
|
|
||||||
+ this code is copied, except for the noted change, from the original tabComplete(CommandSender sender, String alias, String[] args) method
|
|
||||||
+ */
|
|
||||||
+ @Override
|
|
||||||
+ public List<String> tabComplete(CommandSender sender, String alias, String[] args, Location location) throws IllegalArgumentException {
|
|
||||||
Validate.notNull(sender, "Sender cannot be null");
|
|
||||||
Validate.notNull(args, "Arguments cannot be null");
|
|
||||||
Validate.notNull(alias, "Alias cannot be null");
|
|
||||||
- return (List<String>) vanillaCommand.tabComplete(MinecraftServer.getServer(), getListener(sender), args, new BlockPosition(0, 0, 0));
|
|
||||||
+ if (location == null) { // PaperSpigot use location information if available
|
|
||||||
+ return (List<String>) vanillaCommand.tabComplete(MinecraftServer.getServer(), getListener(sender), args, new BlockPosition(0, 0, 0));
|
|
||||||
+ } else {
|
|
||||||
+ return (List<String>) vanillaCommand.tabComplete(MinecraftServer.getServer(), getListener(sender), args, new BlockPosition(location.getBlockX(), location.getBlockY(), location.getBlockZ()));
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
public static CommandSender lastSender = null; // Nasty :(
|
|
||||||
--
|
|
@@ -9,8 +9,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||||
private void allowBlockLocationTabCompletion() {
|
private void allChunksAreSlimeChunks() {
|
||||||
allowBlockLocationTabCompletion = getBoolean("allow-block-location-tab-completion", true);
|
allChunksAreSlimeChunks = getBoolean("all-chunks-are-slime-chunks", false);
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ public int portalSearchRadius;
|
+ public int portalSearchRadius;
|
||||||
|
@@ -91,7 +91,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean c() {
|
public boolean c() {
|
||||||
- if (this.b.isEmpty()) {
|
- // CraftBukkit start
|
||||||
|
- Iterator<Map.Entry<ChunkCoordIntPair, NBTTagCompound>> iter = this.b.entrySet().iterator();
|
||||||
|
- if (!iter.hasNext()) {
|
||||||
|
- // CraftBukkit end
|
||||||
+ // Paper start - Chunk queue improvements
|
+ // Paper start - Chunk queue improvements
|
||||||
+ QueuedChunk chunk = queue.poll();
|
+ QueuedChunk chunk = queue.poll();
|
||||||
+ if (chunk == null) {
|
+ if (chunk == null) {
|
||||||
@@ -102,14 +105,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
- ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair) this.b.keySet().iterator().next();
|
- // CraftBukkit start
|
||||||
|
- Map.Entry<ChunkCoordIntPair, NBTTagCompound> entry = iter.next();
|
||||||
|
- iter.remove(); // Pop single entry
|
||||||
|
- ChunkCoordIntPair chunkcoordintpair = entry.getKey();
|
||||||
|
- // CraftBukkit end
|
||||||
+ ChunkCoordIntPair chunkcoordintpair = chunk.coords; // Paper - Chunk queue improvements
|
+ ChunkCoordIntPair chunkcoordintpair = chunk.coords; // Paper - Chunk queue improvements
|
||||||
|
|
||||||
boolean flag;
|
boolean flag;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
- this.c.add(chunkcoordintpair);
|
- this.c.add(chunkcoordintpair);
|
||||||
- NBTTagCompound nbttagcompound = (NBTTagCompound) this.b.remove(chunkcoordintpair);
|
- NBTTagCompound nbttagcompound = (NBTTagCompound) entry.getValue(); // CraftBukkit
|
||||||
+ //this.c.add(chunkcoordintpair);
|
+ //this.c.add(chunkcoordintpair);
|
||||||
+ NBTTagCompound nbttagcompound = chunk.compound; // Paper - Chunk queue improvements
|
+ NBTTagCompound nbttagcompound = chunk.compound; // Paper - Chunk queue improvements
|
||||||
|
|
||||||
|
@@ -10,9 +10,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||||
@@ -0,0 +0,0 @@ public class Chunk {
|
@@ -0,0 +0,0 @@ public class Chunk {
|
||||||
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
world.timings.syncChunkLoadPostTimer.stopTiming(); // Paper
|
|
||||||
world.timings.syncChunkLoadPopulateNeighbors.startTiming(); // Paper
|
|
||||||
- Chunk chunk = ichunkprovider.getLoadedChunkAt(this.locX, this.locZ - 1);
|
- Chunk chunk = ichunkprovider.getLoadedChunkAt(this.locX, this.locZ - 1);
|
||||||
- Chunk chunk1 = ichunkprovider.getLoadedChunkAt(this.locX + 1, this.locZ);
|
- Chunk chunk1 = ichunkprovider.getLoadedChunkAt(this.locX + 1, this.locZ);
|
||||||
- Chunk chunk2 = ichunkprovider.getLoadedChunkAt(this.locX, this.locZ + 1);
|
- Chunk chunk2 = ichunkprovider.getLoadedChunkAt(this.locX, this.locZ + 1);
|
||||||
|
@@ -21,7 +21,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
Iterator iterator = entity.bx().iterator();
|
Iterator iterator = entity.bx().iterator();
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||||
index 1d47a117..f7d9a7c 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/server/World.java
|
--- a/src/main/java/net/minecraft/server/World.java
|
||||||
+++ b/src/main/java/net/minecraft/server/World.java
|
+++ b/src/main/java/net/minecraft/server/World.java
|
||||||
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
|
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
|
||||||
|
@@ -1,25 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jedediah Smith <jedediah@silencegreys.com>
|
|
||||||
Date: Tue, 29 Mar 2016 20:19:20 -0400
|
|
||||||
Subject: [PATCH] Fix some players not being kicked on shutdown
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
|
||||||
@@ -0,0 +0,0 @@ public abstract class PlayerList {
|
|
||||||
}
|
|
||||||
|
|
||||||
public void u() {
|
|
||||||
- for (int i = 0; i < this.players.size(); ++i) {
|
|
||||||
- ((EntityPlayer) this.players.get(i)).playerConnection.disconnect(this.server.server.getShutdownMessage()); // CraftBukkit - add custom shutdown message
|
|
||||||
+ // Paper start - Fix players being skipped due to concurrent list modification
|
|
||||||
+ for (EntityPlayer player : com.google.common.collect.ImmutableList.copyOf(this.players)) {
|
|
||||||
+ player.playerConnection.disconnect(this.server.server.getShutdownMessage()); // CraftBukkit - add custom shutdown message
|
|
||||||
}
|
|
||||||
+ // Paper end
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
--
|
|
@@ -10,8 +10,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
--- a/src/main/java/co/aikar/timings/WorldTimingsHandler.java
|
--- a/src/main/java/co/aikar/timings/WorldTimingsHandler.java
|
||||||
+++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
|
+++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
|
||||||
@@ -0,0 +0,0 @@ public class WorldTimingsHandler {
|
@@ -0,0 +0,0 @@ public class WorldTimingsHandler {
|
||||||
public final Timing chunkIOStage1;
|
public final Timing syncChunkLoadTileTicksTimer;
|
||||||
public final Timing chunkIOStage2;
|
public final Timing syncChunkLoadPostTimer;
|
||||||
|
|
||||||
+ public final Timing lightingQueueTimer;
|
+ public final Timing lightingQueueTimer;
|
||||||
+
|
+
|
||||||
|
@@ -136,142 +136,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ public static Timing getBlockTiming(Block block) {
|
+ public static Timing getBlockTiming(Block block) {
|
||||||
+ return Timings.ofSafe("## Scheduled Block: " + block.getName());
|
+ return Timings.ofSafe("## Scheduled Block: " + block.getName());
|
||||||
+ }
|
+ }
|
||||||
+
|
|
||||||
+ public static Timing getStructureTiming(StructureGenerator structureGenerator) {
|
|
||||||
+ return Timings.ofSafe("Structure Generator - " + structureGenerator.getName());
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
diff --git a/src/main/java/co/aikar/timings/TimedChunkGenerator.java b/src/main/java/co/aikar/timings/TimedChunkGenerator.java
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/src/main/java/co/aikar/timings/TimedChunkGenerator.java
|
|
||||||
@@ -0,0 +0,0 @@
|
|
||||||
+/*
|
|
||||||
+ * This file is licensed under the MIT License (MIT).
|
|
||||||
+ *
|
|
||||||
+ * Copyright (c) 2014-2016 Daniel Ennis <http://aikar.co>
|
|
||||||
+ *
|
|
||||||
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
+ * of this software and associated documentation files (the "Software"), to deal
|
|
||||||
+ * in the Software without restriction, including without limitation the rights
|
|
||||||
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
+ * copies of the Software, and to permit persons to whom the Software is
|
|
||||||
+ * furnished to do so, subject to the following conditions:
|
|
||||||
+ *
|
|
||||||
+ * The above copyright notice and this permission notice shall be included in
|
|
||||||
+ * all copies or substantial portions of the Software.
|
|
||||||
+ *
|
|
||||||
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
+ * THE SOFTWARE.
|
|
||||||
+ */
|
|
||||||
+
|
|
||||||
+package co.aikar.timings;
|
|
||||||
+
|
|
||||||
+import net.minecraft.server.BiomeBase.BiomeMeta;
|
|
||||||
+import net.minecraft.server.BlockPosition;
|
|
||||||
+import net.minecraft.server.Chunk;
|
|
||||||
+import net.minecraft.server.EnumCreatureType;
|
|
||||||
+import net.minecraft.server.World;
|
|
||||||
+import net.minecraft.server.WorldServer;
|
|
||||||
+import org.bukkit.Location;
|
|
||||||
+import org.bukkit.craftbukkit.generator.InternalChunkGenerator;
|
|
||||||
+import org.bukkit.generator.BlockPopulator;
|
|
||||||
+
|
|
||||||
+import javax.annotation.Nullable;
|
|
||||||
+import java.util.List;
|
|
||||||
+import java.util.Random;
|
|
||||||
+
|
|
||||||
+public class TimedChunkGenerator extends InternalChunkGenerator {
|
|
||||||
+ private final WorldServer world;
|
|
||||||
+ private final InternalChunkGenerator timedGenerator;
|
|
||||||
+
|
|
||||||
+ public TimedChunkGenerator(WorldServer worldServer, InternalChunkGenerator gen) {
|
|
||||||
+ world = worldServer;
|
|
||||||
+ timedGenerator = gen;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ @Deprecated
|
|
||||||
+ public byte[] generate(org.bukkit.World world, Random random, int x, int z) {
|
|
||||||
+ return timedGenerator.generate(world, random, x, z);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ @Deprecated
|
|
||||||
+ public short[][] generateExtBlockSections(org.bukkit.World world, Random random, int x, int z,
|
|
||||||
+ BiomeGrid biomes) {
|
|
||||||
+ return timedGenerator.generateExtBlockSections(world, random, x, z, biomes);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ @Deprecated
|
|
||||||
+ public byte[][] generateBlockSections(org.bukkit.World world, Random random, int x, int z,
|
|
||||||
+ BiomeGrid biomes) {
|
|
||||||
+ return timedGenerator.generateBlockSections(world, random, x, z, biomes);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public ChunkData generateChunkData(org.bukkit.World world, Random random, int x, int z, BiomeGrid biome) {
|
|
||||||
+ return timedGenerator.generateChunkData(world, random, x, z, biome);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public boolean canSpawn(org.bukkit.World world, int x, int z) {
|
|
||||||
+ return timedGenerator.canSpawn(world, x, z);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public List<BlockPopulator> getDefaultPopulators(org.bukkit.World world) {
|
|
||||||
+ return timedGenerator.getDefaultPopulators(world);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public Location getFixedSpawnLocation(org.bukkit.World world, Random random) {
|
|
||||||
+ return timedGenerator.getFixedSpawnLocation(world, random);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public Chunk getOrCreateChunk(int i, int j) {
|
|
||||||
+ try (Timing ignored = world.timings.chunkGeneration.startTiming()) {
|
|
||||||
+ return timedGenerator.getOrCreateChunk(i, j);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void recreateStructures(int i, int j) {
|
|
||||||
+ try (Timing ignored = world.timings.syncChunkLoadStructuresTimer.startTiming()) {
|
|
||||||
+ timedGenerator.recreateStructures(i, j);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public boolean a(Chunk chunk, int i, int j) {
|
|
||||||
+ return timedGenerator.a(chunk, i, j);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public List<BiomeMeta> getMobsFor(EnumCreatureType enumcreaturetype, BlockPosition blockposition) {
|
|
||||||
+ return timedGenerator.getMobsFor(enumcreaturetype, blockposition);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ @Nullable
|
|
||||||
+ public BlockPosition findNearestMapFeature(World world, String s, BlockPosition blockposition) {
|
|
||||||
+ return timedGenerator.findNearestMapFeature(world, s, blockposition);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ @Override
|
|
||||||
+ public void recreateStructures(Chunk chunk, int i, int j) {
|
|
||||||
+ try (Timing ignored = world.timings.syncChunkLoadStructuresTimer.startTiming()) {
|
|
||||||
+ timedGenerator.recreateStructures(chunk, i, j);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
|
diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
@@ -294,7 +158,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ public final Timing scheduledBlocksCleanup;
|
+ public final Timing scheduledBlocksCleanup;
|
||||||
+ public final Timing scheduledBlocksTicking;
|
+ public final Timing scheduledBlocksTicking;
|
||||||
+ public final Timing chunkTicks;
|
+ public final Timing chunkTicks;
|
||||||
+ public final Timing lightChunk;
|
|
||||||
+ public final Timing chunkTicksBlocks;
|
+ public final Timing chunkTicksBlocks;
|
||||||
+ public final Timing doVillages;
|
+ public final Timing doVillages;
|
||||||
+ public final Timing doChunkMap;
|
+ public final Timing doChunkMap;
|
||||||
@@ -319,12 +182,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ public final Timing syncChunkLoadTimer;
|
+ public final Timing syncChunkLoadTimer;
|
||||||
+ public final Timing syncChunkLoadDataTimer;
|
+ public final Timing syncChunkLoadDataTimer;
|
||||||
+ public final Timing syncChunkLoadStructuresTimer;
|
+ public final Timing syncChunkLoadStructuresTimer;
|
||||||
|
+ public final Timing syncChunkLoadEntitiesTimer;
|
||||||
|
+ public final Timing syncChunkLoadTileEntitiesTimer;
|
||||||
|
+ public final Timing syncChunkLoadTileTicksTimer;
|
||||||
+ public final Timing syncChunkLoadPostTimer;
|
+ public final Timing syncChunkLoadPostTimer;
|
||||||
+ public final Timing syncChunkLoadNBTTimer;
|
|
||||||
+ public final Timing syncChunkLoadPopulateNeighbors;
|
|
||||||
+ public final Timing chunkGeneration;
|
|
||||||
+ public final Timing chunkIOStage1;
|
|
||||||
+ public final Timing chunkIOStage2;
|
|
||||||
+
|
+
|
||||||
+ public WorldTimingsHandler(World server) {
|
+ public WorldTimingsHandler(World server) {
|
||||||
+ String name = server.worldData.getName() +" - ";
|
+ String name = server.worldData.getName() +" - ";
|
||||||
@@ -335,7 +196,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ scheduledBlocksCleanup = Timings.ofSafe(name + "Scheduled Blocks - Cleanup");
|
+ scheduledBlocksCleanup = Timings.ofSafe(name + "Scheduled Blocks - Cleanup");
|
||||||
+ scheduledBlocksTicking = Timings.ofSafe(name + "Scheduled Blocks - Ticking");
|
+ scheduledBlocksTicking = Timings.ofSafe(name + "Scheduled Blocks - Ticking");
|
||||||
+ chunkTicks = Timings.ofSafe(name + "Chunk Ticks");
|
+ chunkTicks = Timings.ofSafe(name + "Chunk Ticks");
|
||||||
+ lightChunk = Timings.ofSafe(name + "Light Chunk");
|
|
||||||
+ chunkTicksBlocks = Timings.ofSafe(name + "Chunk Ticks - Blocks");
|
+ chunkTicksBlocks = Timings.ofSafe(name + "Chunk Ticks - Blocks");
|
||||||
+ doVillages = Timings.ofSafe(name + "doVillages");
|
+ doVillages = Timings.ofSafe(name + "doVillages");
|
||||||
+ doChunkMap = Timings.ofSafe(name + "doChunkMap");
|
+ doChunkMap = Timings.ofSafe(name + "doChunkMap");
|
||||||
@@ -356,13 +216,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+
|
+
|
||||||
+ syncChunkLoadTimer = Timings.ofSafe(name + "syncChunkLoad");
|
+ syncChunkLoadTimer = Timings.ofSafe(name + "syncChunkLoad");
|
||||||
+ syncChunkLoadDataTimer = Timings.ofSafe(name + "syncChunkLoad - Data");
|
+ syncChunkLoadDataTimer = Timings.ofSafe(name + "syncChunkLoad - Data");
|
||||||
+ syncChunkLoadStructuresTimer = Timings.ofSafe(name + "chunkLoad - recreateStructures");
|
+ syncChunkLoadStructuresTimer = Timings.ofSafe(name + "chunkLoad - Structures");
|
||||||
|
+ syncChunkLoadEntitiesTimer = Timings.ofSafe(name + "chunkLoad - Entities");
|
||||||
|
+ syncChunkLoadTileEntitiesTimer = Timings.ofSafe(name + "chunkLoad - TileEntities");
|
||||||
|
+ syncChunkLoadTileTicksTimer = Timings.ofSafe(name + "chunkLoad - TileTicks");
|
||||||
+ syncChunkLoadPostTimer = Timings.ofSafe(name + "chunkLoad - Post");
|
+ syncChunkLoadPostTimer = Timings.ofSafe(name + "chunkLoad - Post");
|
||||||
+ syncChunkLoadNBTTimer = Timings.ofSafe(name + "chunkLoad - NBT");
|
|
||||||
+ syncChunkLoadPopulateNeighbors = Timings.ofSafe(name + "chunkLoad - Populate Neighbors");
|
|
||||||
+ chunkGeneration = Timings.ofSafe(name + "chunkGeneration");
|
|
||||||
+ chunkIOStage1 = Timings.ofSafe(name + "ChunkIO Stage 1 - DiskIO");
|
|
||||||
+ chunkIOStage2 = Timings.ofSafe(name + "ChunkIO Stage 2 - Post Load");
|
|
||||||
+
|
+
|
||||||
+ tracker1 = Timings.ofSafe(name + "tracker stage 1");
|
+ tracker1 = Timings.ofSafe(name + "tracker stage 1");
|
||||||
+ tracker2 = Timings.ofSafe(name + "tracker stage 2");
|
+ tracker2 = Timings.ofSafe(name + "tracker stage 2");
|
||||||
@@ -434,94 +292,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
|
|
||||||
public static int getId(Block block) {
|
public static int getId(Block block) {
|
||||||
return Block.REGISTRY.a(block); // CraftBukkit - decompile error
|
return Block.REGISTRY.a(block); // CraftBukkit - decompile error
|
||||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
|
||||||
@@ -0,0 +0,0 @@ public class Chunk {
|
|
||||||
|
|
||||||
// CraftBukkit start
|
|
||||||
public void loadNearby(IChunkProvider ichunkprovider, ChunkGenerator chunkgenerator, boolean newChunk) {
|
|
||||||
- world.timings.syncChunkLoadPostTimer.startTiming(); // Spigot
|
|
||||||
+ world.timings.syncChunkLoadPostTimer.startTiming(); // Paper
|
|
||||||
Server server = world.getServer();
|
|
||||||
if (server != null) {
|
|
||||||
/*
|
|
||||||
@@ -0,0 +0,0 @@ public class Chunk {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// CraftBukkit end
|
|
||||||
-
|
|
||||||
+ world.timings.syncChunkLoadPostTimer.stopTiming(); // Paper
|
|
||||||
+ world.timings.syncChunkLoadPopulateNeighbors.startTiming(); // Paper
|
|
||||||
Chunk chunk = ichunkprovider.getLoadedChunkAt(this.locX, this.locZ - 1);
|
|
||||||
Chunk chunk1 = ichunkprovider.getLoadedChunkAt(this.locX + 1, this.locZ);
|
|
||||||
Chunk chunk2 = ichunkprovider.getLoadedChunkAt(this.locX, this.locZ + 1);
|
|
||||||
@@ -0,0 +0,0 @@ public class Chunk {
|
|
||||||
chunk4.a(chunkgenerator);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- world.timings.syncChunkLoadPostTimer.stopTiming(); // Spigot
|
|
||||||
+ world.timings.syncChunkLoadPopulateNeighbors.stopTiming(); // Paper
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -0,0 +0,0 @@ public class Chunk {
|
|
||||||
}
|
|
||||||
|
|
||||||
public void o() {
|
|
||||||
+ world.timings.lightChunk.startTiming(); // Paper
|
|
||||||
this.done = true;
|
|
||||||
this.lit = true;
|
|
||||||
BlockPosition blockposition = new BlockPosition(this.locX << 4, 0, this.locZ << 4);
|
|
||||||
@@ -0,0 +0,0 @@ public class Chunk {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+ world.timings.lightChunk.stopTiming(); // Paper
|
|
||||||
}
|
|
||||||
|
|
||||||
private void z() {
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
|
||||||
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
|
||||||
|
|
||||||
public void loadEntities(Chunk chunk, NBTTagCompound nbttagcompound, World world) {
|
|
||||||
// CraftBukkit end
|
|
||||||
- world.timings.syncChunkLoadEntitiesTimer.startTiming(); // Spigot
|
|
||||||
+ world.timings.syncChunkLoadNBTTimer.startTiming(); // Spigot
|
|
||||||
NBTTagList nbttaglist1 = nbttagcompound.getList("Entities", 10);
|
|
||||||
|
|
||||||
if (nbttaglist1 != null) {
|
|
||||||
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
|
||||||
chunk.g(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- world.timings.syncChunkLoadEntitiesTimer.stopTiming(); // Spigot
|
|
||||||
- world.timings.syncChunkLoadTileEntitiesTimer.startTiming(); // Spigot
|
|
||||||
NBTTagList nbttaglist2 = nbttagcompound.getList("TileEntities", 10);
|
|
||||||
|
|
||||||
if (nbttaglist2 != null) {
|
|
||||||
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- world.timings.syncChunkLoadTileEntitiesTimer.stopTiming(); // Spigot
|
|
||||||
- world.timings.syncChunkLoadTileTicksTimer.startTiming(); // Spigot
|
|
||||||
|
|
||||||
if (nbttagcompound.hasKeyOfType("TileTicks", 9)) {
|
|
||||||
NBTTagList nbttaglist3 = nbttagcompound.getList("TileTicks", 10);
|
|
||||||
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- world.timings.syncChunkLoadTileTicksTimer.stopTiming(); // Spigot
|
|
||||||
+ world.timings.syncChunkLoadNBTTimer.stopTiming(); // Spigot
|
|
||||||
|
|
||||||
// return chunk; // CraftBukkit
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
|
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
|
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||||
@@ -986,48 +756,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
// this.minecraftServer.getCommandHandler().a(this.player, s);
|
// this.minecraftServer.getCommandHandler().a(this.player, s);
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/src/main/java/net/minecraft/server/StructureGenerator.java
|
|
||||||
+++ b/src/main/java/net/minecraft/server/StructureGenerator.java
|
|
||||||
@@ -0,0 +0,0 @@
|
|
||||||
package net.minecraft.server;
|
|
||||||
|
|
||||||
+import co.aikar.timings.MinecraftTimings;
|
|
||||||
+import co.aikar.timings.Timing;
|
|
||||||
import it.unimi.dsi.fastutil.longs.Long2ObjectMap;
|
|
||||||
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
|
|
||||||
import java.util.Iterator;
|
|
||||||
@@ -0,0 +0,0 @@ import java.util.Random;
|
|
||||||
|
|
||||||
public abstract class StructureGenerator extends WorldGenBase {
|
|
||||||
|
|
||||||
+ private final Timing timing = MinecraftTimings.getStructureTiming(this); // Paper
|
|
||||||
private PersistentStructure a;
|
|
||||||
protected Long2ObjectMap<StructureStart> c = new Long2ObjectOpenHashMap(1024);
|
|
||||||
|
|
||||||
public StructureGenerator() {}
|
|
||||||
|
|
||||||
+ public String getName() { return a(); } // Paper // OBF HELPER
|
|
||||||
public abstract String a();
|
|
||||||
|
|
||||||
protected final synchronized void a(World world, final int i, final int j, int k, int l, ChunkSnapshot chunksnapshot) {
|
|
||||||
@@ -0,0 +0,0 @@ public abstract class StructureGenerator extends WorldGenBase {
|
|
||||||
}
|
|
||||||
|
|
||||||
public synchronized boolean a(World world, Random random, ChunkCoordIntPair chunkcoordintpair) {
|
|
||||||
+ timing.startTiming(); // Paper
|
|
||||||
this.a(world);
|
|
||||||
int i = (chunkcoordintpair.x << 4) + 8;
|
|
||||||
int j = (chunkcoordintpair.z << 4) + 8;
|
|
||||||
@@ -0,0 +0,0 @@ public abstract class StructureGenerator extends WorldGenBase {
|
|
||||||
this.a(structurestart.e(), structurestart.f(), structurestart);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+ timing.stopTiming(); // Paper
|
|
||||||
|
|
||||||
return flag;
|
|
||||||
}
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
|
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/net/minecraft/server/TileEntity.java
|
--- a/src/main/java/net/minecraft/server/TileEntity.java
|
||||||
@@ -1235,15 +963,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
|
|
||||||
this.methodProfiler.b();
|
this.methodProfiler.b();
|
||||||
this.U.clear();
|
this.U.clear();
|
||||||
@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler {
|
|
||||||
gen = new org.bukkit.craftbukkit.generator.NormalChunkGenerator(this, this.getSeed());
|
|
||||||
}
|
|
||||||
|
|
||||||
- return new ChunkProviderServer(this, ichunkloader, gen);
|
|
||||||
+ return new ChunkProviderServer(this, ichunkloader, new co.aikar.timings.TimedChunkGenerator(this, gen)); // Paper
|
|
||||||
// CraftBukkit end
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||||
@@ -1460,50 +1179,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
- }
|
- }
|
||||||
- }
|
- }
|
||||||
-}
|
-}
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java
|
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java
|
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java
|
|
||||||
@@ -0,0 +0,0 @@
|
|
||||||
package org.bukkit.craftbukkit.chunkio;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
+
|
|
||||||
+import co.aikar.timings.Timing;
|
|
||||||
import net.minecraft.server.Chunk;
|
|
||||||
import net.minecraft.server.ChunkCoordIntPair;
|
|
||||||
import net.minecraft.server.ChunkRegionLoader;
|
|
||||||
@@ -0,0 +0,0 @@ class ChunkIOProvider implements AsynchronousExecutor.CallBackProvider<QueuedChu
|
|
||||||
|
|
||||||
// async stuff
|
|
||||||
public Chunk callStage1(QueuedChunk queuedChunk) throws RuntimeException {
|
|
||||||
- try {
|
|
||||||
+ try (Timing ignored = queuedChunk.provider.world.timings.chunkIOStage1.startTimingIfSync()) { // Paper
|
|
||||||
ChunkRegionLoader loader = queuedChunk.loader;
|
|
||||||
Object[] data = loader.loadChunk(queuedChunk.world, queuedChunk.x, queuedChunk.z);
|
|
||||||
|
|
||||||
@@ -0,0 +0,0 @@ class ChunkIOProvider implements AsynchronousExecutor.CallBackProvider<QueuedChu
|
|
||||||
queuedChunk.provider.originalGetChunkAt(queuedChunk.x, queuedChunk.z);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
+ try (Timing ignored = queuedChunk.provider.world.timings.chunkIOStage2.startTimingIfSync()) { // Paper
|
|
||||||
|
|
||||||
queuedChunk.loader.loadEntities(chunk, queuedChunk.compound.getCompound("Level"), queuedChunk.world);
|
|
||||||
chunk.setLastSaved(queuedChunk.provider.world.getTime());
|
|
||||||
@@ -0,0 +0,0 @@ class ChunkIOProvider implements AsynchronousExecutor.CallBackProvider<QueuedChu
|
|
||||||
chunk.addEntities();
|
|
||||||
|
|
||||||
if (queuedChunk.provider.chunkGenerator != null) {
|
|
||||||
- queuedChunk.provider.world.timings.syncChunkLoadStructuresTimer.startTiming(); // Spigot
|
|
||||||
queuedChunk.provider.chunkGenerator.recreateStructures(chunk, queuedChunk.x, queuedChunk.z);
|
|
||||||
- queuedChunk.provider.world.timings.syncChunkLoadStructuresTimer.stopTiming(); // Spigot
|
|
||||||
}
|
|
||||||
|
|
||||||
chunk.loadNearby(queuedChunk.provider, queuedChunk.provider.chunkGenerator, false);
|
|
||||||
+ } // Paper
|
|
||||||
}
|
|
||||||
|
|
||||||
public void callStage3(QueuedChunk queuedChunk, Chunk chunk, Runnable runnable) throws RuntimeException {
|
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
|
Submodule work/Bukkit updated: b28ed606f6...89e4f83cd4
Submodule work/CraftBukkit updated: 4507d99aea...43ab2669d7
Submodule work/Spigot updated: 1e4dd71cf2...455072c24e
Reference in New Issue
Block a user