|
|
|
@ -1289,7 +1289,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+import com.google.common.base.Preconditions;
|
|
|
|
+import com.google.common.base.Preconditions;
|
|
|
|
+import com.google.common.collect.EvictingQueue;
|
|
|
|
+import com.google.common.collect.EvictingQueue;
|
|
|
|
+import com.google.common.collect.Lists;
|
|
|
|
+import com.google.common.collect.Lists;
|
|
|
|
+import org.apache.commons.lang.Validate;
|
|
|
|
|
|
|
|
+import org.bukkit.Bukkit;
|
|
|
|
+import org.bukkit.Bukkit;
|
|
|
|
+import org.bukkit.command.CommandSender;
|
|
|
|
+import org.bukkit.command.CommandSender;
|
|
|
|
+import org.bukkit.plugin.Plugin;
|
|
|
|
+import org.bukkit.plugin.Plugin;
|
|
|
|
@ -1523,7 +1522,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ * @param sender The listener to send responses too.
|
|
|
|
+ * @param sender The listener to send responses too.
|
|
|
|
+ */
|
|
|
|
+ */
|
|
|
|
+ public static void generateReport(@NotNull TimingsReportListener sender) {
|
|
|
|
+ public static void generateReport(@NotNull TimingsReportListener sender) {
|
|
|
|
+ Validate.notNull(sender);
|
|
|
|
+ Preconditions.checkNotNull(sender);
|
|
|
|
+ requestingReport.add(sender);
|
|
|
|
+ requestingReport.add(sender);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
@ -1588,9 +1587,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ */
|
|
|
|
+ */
|
|
|
|
+package co.aikar.timings;
|
|
|
|
+package co.aikar.timings;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
|
|
+import com.google.common.base.Preconditions;
|
|
|
|
+import com.google.common.collect.ImmutableList;
|
|
|
|
+import com.google.common.collect.ImmutableList;
|
|
|
|
+import net.kyori.adventure.text.format.NamedTextColor;
|
|
|
|
+import net.kyori.adventure.text.format.NamedTextColor;
|
|
|
|
+import org.apache.commons.lang.Validate;
|
|
|
|
|
|
|
|
+import org.bukkit.command.CommandSender;
|
|
|
|
+import org.bukkit.command.CommandSender;
|
|
|
|
+import org.bukkit.command.defaults.BukkitCommand;
|
|
|
|
+import org.bukkit.command.defaults.BukkitCommand;
|
|
|
|
+import org.bukkit.util.StringUtil;
|
|
|
|
+import org.bukkit.util.StringUtil;
|
|
|
|
@ -1672,9 +1671,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ @NotNull
|
|
|
|
+ @NotNull
|
|
|
|
+ @Override
|
|
|
|
+ @Override
|
|
|
|
+ public List<String> tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) {
|
|
|
|
+ public List<String> tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) {
|
|
|
|
+ Validate.notNull(sender, "Sender cannot be null");
|
|
|
|
+ Preconditions.checkNotNull(sender, "Sender cannot be null");
|
|
|
|
+ Validate.notNull(args, "Arguments cannot be null");
|
|
|
|
+ Preconditions.checkNotNull(args, "Arguments cannot be null");
|
|
|
|
+ Validate.notNull(alias, "Alias cannot be null");
|
|
|
|
+ Preconditions.checkNotNull(alias, "Alias cannot be null");
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ if (args.length == 1) {
|
|
|
|
+ if (args.length == 1) {
|
|
|
|
+ return StringUtil.copyPartialMatches(args[0], TIMINGS_SUBCOMMANDS,
|
|
|
|
+ return StringUtil.copyPartialMatches(args[0], TIMINGS_SUBCOMMANDS,
|
|
|
|
@ -1885,19 +1884,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
@@ -0,0 +0,0 @@
|
|
|
|
@@ -0,0 +0,0 @@
|
|
|
|
+package co.aikar.timings;
|
|
|
|
+package co.aikar.timings;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
|
|
+import com.google.common.base.Preconditions;
|
|
|
|
+import com.google.common.collect.Lists;
|
|
|
|
+import com.google.common.collect.Lists;
|
|
|
|
+import org.apache.commons.lang.Validate;
|
|
|
|
|
|
|
|
+import org.bukkit.Bukkit;
|
|
|
|
+import org.bukkit.Bukkit;
|
|
|
|
+import org.bukkit.command.CommandSender;
|
|
|
|
+import org.bukkit.command.CommandSender;
|
|
|
|
+import org.bukkit.command.ConsoleCommandSender;
|
|
|
|
+import org.bukkit.command.ConsoleCommandSender;
|
|
|
|
+import org.bukkit.command.MessageCommandSender;
|
|
|
|
+import org.bukkit.command.MessageCommandSender;
|
|
|
|
+import org.bukkit.command.RemoteConsoleCommandSender;
|
|
|
|
+import org.bukkit.command.RemoteConsoleCommandSender;
|
|
|
|
+
|
|
|
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
+import org.jetbrains.annotations.NotNull;
|
|
|
|
+import org.jetbrains.annotations.NotNull;
|
|
|
|
+import org.jetbrains.annotations.Nullable;
|
|
|
|
+import org.jetbrains.annotations.Nullable;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
|
|
+
|
|
|
|
+@SuppressWarnings("WeakerAccess")
|
|
|
|
+@SuppressWarnings("WeakerAccess")
|
|
|
|
+public class TimingsReportListener implements net.kyori.adventure.audience.ForwardingAudience, MessageCommandSender {
|
|
|
|
+public class TimingsReportListener implements net.kyori.adventure.audience.ForwardingAudience, MessageCommandSender {
|
|
|
|
+ private final List<CommandSender> senders;
|
|
|
|
+ private final List<CommandSender> senders;
|
|
|
|
@ -1914,8 +1912,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ this(senders, null);
|
|
|
|
+ this(senders, null);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ public TimingsReportListener(@NotNull List<CommandSender> senders, @Nullable Runnable onDone) {
|
|
|
|
+ public TimingsReportListener(@NotNull List<CommandSender> senders, @Nullable Runnable onDone) {
|
|
|
|
+ Validate.notNull(senders);
|
|
|
|
+ Preconditions.checkNotNull(senders);
|
|
|
|
+ Validate.notEmpty(senders);
|
|
|
|
+ Preconditions.checkArgument(!senders.isEmpty(), "senders is empty");
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ this.senders = Lists.newArrayList(senders);
|
|
|
|
+ this.senders = Lists.newArrayList(senders);
|
|
|
|
+ this.onDone = onDone;
|
|
|
|
+ this.onDone = onDone;
|
|
|
|
@ -2947,7 +2945,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
@@ -0,0 +0,0 @@
|
|
|
|
@@ -0,0 +0,0 @@
|
|
|
|
+package org.bukkit.command;
|
|
|
|
+package org.bukkit.command;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+import org.apache.commons.lang.NotImplementedException;
|
|
|
|
|
|
|
|
+import org.bukkit.Bukkit;
|
|
|
|
+import org.bukkit.Bukkit;
|
|
|
|
+import org.bukkit.Server;
|
|
|
|
+import org.bukkit.Server;
|
|
|
|
+import org.bukkit.permissions.Permission;
|
|
|
|
+import org.bukkit.permissions.Permission;
|
|
|
|
@ -2994,90 +2991,90 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ // Paper start
|
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
|
|
|
+ @Override
|
|
|
|
+ default net.kyori.adventure.text.@org.jetbrains.annotations.NotNull Component name() {
|
|
|
|
+ default net.kyori.adventure.text.@org.jetbrains.annotations.NotNull Component name() {
|
|
|
|
+ throw new NotImplementedException();
|
|
|
|
+ throw new UnsupportedOperationException();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+ // Paper end
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @NotNull
|
|
|
|
+ @NotNull
|
|
|
|
+ @Override
|
|
|
|
+ @Override
|
|
|
|
+ default String getName() {
|
|
|
|
+ default String getName() {
|
|
|
|
+ throw new NotImplementedException();
|
|
|
|
+ throw new UnsupportedOperationException();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ @Override
|
|
|
|
+ default boolean isOp() {
|
|
|
|
+ default boolean isOp() {
|
|
|
|
+ throw new NotImplementedException();
|
|
|
|
+ throw new UnsupportedOperationException();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ @Override
|
|
|
|
+ default void setOp(boolean value) {
|
|
|
|
+ default void setOp(boolean value) {
|
|
|
|
+ throw new NotImplementedException();
|
|
|
|
+ throw new UnsupportedOperationException();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ @Override
|
|
|
|
+ default boolean isPermissionSet(@NotNull String name) {
|
|
|
|
+ default boolean isPermissionSet(@NotNull String name) {
|
|
|
|
+ throw new NotImplementedException();
|
|
|
|
+ throw new UnsupportedOperationException();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ @Override
|
|
|
|
+ default boolean isPermissionSet(@NotNull Permission perm) {
|
|
|
|
+ default boolean isPermissionSet(@NotNull Permission perm) {
|
|
|
|
+ throw new NotImplementedException();
|
|
|
|
+ throw new UnsupportedOperationException();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ @Override
|
|
|
|
+ default boolean hasPermission(@NotNull String name) {
|
|
|
|
+ default boolean hasPermission(@NotNull String name) {
|
|
|
|
+ throw new NotImplementedException();
|
|
|
|
+ throw new UnsupportedOperationException();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ @Override
|
|
|
|
+ default boolean hasPermission(@NotNull Permission perm) {
|
|
|
|
+ default boolean hasPermission(@NotNull Permission perm) {
|
|
|
|
+ throw new NotImplementedException();
|
|
|
|
+ throw new UnsupportedOperationException();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @NotNull
|
|
|
|
+ @NotNull
|
|
|
|
+ @Override
|
|
|
|
+ @Override
|
|
|
|
+ default PermissionAttachment addAttachment(@NotNull Plugin plugin, @NotNull String name, boolean value) {
|
|
|
|
+ default PermissionAttachment addAttachment(@NotNull Plugin plugin, @NotNull String name, boolean value) {
|
|
|
|
+ throw new NotImplementedException();
|
|
|
|
+ throw new UnsupportedOperationException();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @NotNull
|
|
|
|
+ @NotNull
|
|
|
|
+ @Override
|
|
|
|
+ @Override
|
|
|
|
+ default PermissionAttachment addAttachment(@NotNull Plugin plugin) {
|
|
|
|
+ default PermissionAttachment addAttachment(@NotNull Plugin plugin) {
|
|
|
|
+ throw new NotImplementedException();
|
|
|
|
+ throw new UnsupportedOperationException();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @NotNull
|
|
|
|
+ @NotNull
|
|
|
|
+ @Override
|
|
|
|
+ @Override
|
|
|
|
+ default PermissionAttachment addAttachment(@NotNull Plugin plugin, @NotNull String name, boolean value, int ticks) {
|
|
|
|
+ default PermissionAttachment addAttachment(@NotNull Plugin plugin, @NotNull String name, boolean value, int ticks) {
|
|
|
|
+ throw new NotImplementedException();
|
|
|
|
+ throw new UnsupportedOperationException();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @NotNull
|
|
|
|
+ @NotNull
|
|
|
|
+ @Override
|
|
|
|
+ @Override
|
|
|
|
+ default PermissionAttachment addAttachment(@NotNull Plugin plugin, int ticks) {
|
|
|
|
+ default PermissionAttachment addAttachment(@NotNull Plugin plugin, int ticks) {
|
|
|
|
+ throw new NotImplementedException();
|
|
|
|
+ throw new UnsupportedOperationException();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ @Override
|
|
|
|
+ default void removeAttachment(@NotNull PermissionAttachment attachment) {
|
|
|
|
+ default void removeAttachment(@NotNull PermissionAttachment attachment) {
|
|
|
|
+ throw new NotImplementedException();
|
|
|
|
+ throw new UnsupportedOperationException();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ @Override
|
|
|
|
+ default void recalculatePermissions() {
|
|
|
|
+ default void recalculatePermissions() {
|
|
|
|
+ throw new NotImplementedException();
|
|
|
|
+ throw new UnsupportedOperationException();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @NotNull
|
|
|
|
+ @NotNull
|
|
|
|
+ @Override
|
|
|
|
+ @Override
|
|
|
|
+ default Set<PermissionAttachmentInfo> getEffectivePermissions() {
|
|
|
|
+ default Set<PermissionAttachmentInfo> getEffectivePermissions() {
|
|
|
|
+ throw new NotImplementedException();
|
|
|
|
+ throw new UnsupportedOperationException();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @NotNull
|
|
|
|
+ @NotNull
|
|
|
|
+ @Override
|
|
|
|
+ @Override
|
|
|
|
+ default Spigot spigot() {
|
|
|
|
+ default Spigot spigot() {
|
|
|
|
+ throw new NotImplementedException();
|
|
|
|
+ throw new UnsupportedOperationException();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+}
|
|
|
|
|