From 5364f9e7a0cc9d8326f2a7356841db130880ed0c Mon Sep 17 00:00:00 2001 From: granny <contact@granny.dev> Date: Mon, 28 Oct 2024 00:03:55 -0700 Subject: [PATCH] Remove leftover missed timings calls (#11527) * remove leftover timings calls * remove unused imports --- patches/server/Brigadier-based-command-API.patch | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/patches/server/Brigadier-based-command-API.patch b/patches/server/Brigadier-based-command-API.patch index 93118ff19c..d97916ff36 100644 --- a/patches/server/Brigadier-based-command-API.patch +++ b/patches/server/Brigadier-based-command-API.patch @@ -1864,7 +1864,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ +package io.papermc.paper.command.brigadier.bukkit; + -+import co.aikar.timings.Timing; +import com.mojang.brigadier.arguments.StringArgumentType; +import com.mojang.brigadier.builder.RequiredArgumentBuilder; +import com.mojang.brigadier.context.CommandContext; @@ -1875,7 +1874,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +import com.mojang.brigadier.tree.LiteralCommandNode; +import io.papermc.paper.command.brigadier.CommandSourceStack; +import java.util.ArrayList; -+import java.util.Collections; +import net.minecraft.commands.CommandSource; +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; @@ -1888,7 +1886,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.logging.Level; -+import org.bukkit.entity.Entity; +import org.bukkit.entity.Player; +import org.bukkit.event.server.TabCompleteEvent; + @@ -1942,18 +1939,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public int run(CommandContext<CommandSourceStack> context) throws CommandSyntaxException { + CommandSender sender = context.getSource().getSender(); + -+ // Plugins do weird things to workaround normal registration -+ if (this.command.timings == null) { -+ this.command.timings = co.aikar.timings.TimingsManager.getCommandTiming(null, this.command); -+ } -+ + String content = context.getRange().get(context.getInput()); + String[] args = org.apache.commons.lang3.StringUtils.split(content, ' '); // fix adjacent spaces (from console/plugins) causing empty array elements + -+ try (Timing ignored = this.command.timings.startTiming()) { -+ // Note: we don't return the result of target.execute as thats success / failure, we return handled (true) or not handled (false) -+ this.command.execute(sender, this.literal, Arrays.copyOfRange(args, 1, args.length)); -+ } ++ // Note: we don't return the result of target.execute as thats success / failure, we return handled (true) or not handled (false) ++ this.command.execute(sender, this.literal, Arrays.copyOfRange(args, 1, args.length)); + + // return true as command was handled + return 1;