fix: update argument types from UUID to Player in history commands#3306
Draft
TheMeinerLP wants to merge 2 commits intoIntellectualSites:mainfrom
Draft
fix: update argument types from UUID to Player in history commands#3306TheMeinerLP wants to merge 2 commits intoIntellectualSites:mainfrom
TheMeinerLP wants to merge 2 commits intoIntellectualSites:mainfrom
Conversation
Member
|
Member
Author
@MattBDev told me already it |
Member
Author
|
@PierreSchwang its more complicated because something has changed in paper since 2 versions. |
Member
|
I mean, simply keeping the UUID and not looking up the UUID for suggestions would be a quick and working fix: Index: worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/platform/binding/ConsumeBindings.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/platform/binding/ConsumeBindings.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/platform/binding/ConsumeBindings.java
--- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/platform/binding/ConsumeBindings.java (revision d83f24a772ab5346a826a9bf8f418cd23ce339b2)
+++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extension/platform/binding/ConsumeBindings.java (date 1758062137429)
@@ -29,6 +29,7 @@
import com.sk89q.worldedit.world.block.BlockType;
import org.enginehub.piston.exception.StopExecutionException;
import org.enginehub.piston.inject.InjectedValueAccess;
+import org.enginehub.piston.inject.Key;
import java.util.UUID;
@@ -153,7 +154,7 @@
}
@Binding
- public UUID playerUUID(Actor actor, String argument) {
+ public UUID playerUUID(Actor actor, InjectedValueAccess context, String argument) {
if (argument.equals("me")) {
return actor.getUniqueId();
}
@@ -167,6 +168,10 @@
if (argument.length() > 16) {
uuid = UUID.fromString(argument);
} else {
+ // if the command is parsed for suggestions, we just return the actors UUID
+ if (context.injectedValue(Key.of(boolean.class)).orElse(false)) {
+ return actor.getUniqueId();
+ }
uuid = Fawe.platform().getUUID(argument);
}
if (uuid == null) {There is no reason to get the actual UUID for suggestions either way imo |
Member
Author
|
Thanks @PierreSchwang |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Fixes #3303
Description
Submitter Checklist
@since TODO.