Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
--- a/net/minecraft/commands/arguments/OperationArgument.java
+++ b/net/minecraft/commands/arguments/OperationArgument.java
@@ -48,7 +_,9 @@

@Override
public <S> CompletableFuture<Suggestions> listSuggestions(CommandContext<S> context, SuggestionsBuilder builder) {
- return SharedSuggestionProvider.suggest(new String[]{"=", "+=", "-=", "*=", "/=", "%=", "<", ">", "><"}, builder);
+ return SharedSuggestionProvider.suggest(new String[]{"=", "+=", "-=", "*=", "/=", "%=", "<", ">", "><"
+ , "&=", "|=", "^=", "~=", "<<=", ">>=", ">>>="}, // LegitSlimePaper - Add Bit operations
+ builder);
}

@Override
@@ -86,6 +_,15 @@
};
case "<" -> Math::min;
case ">" -> Math::max;
+ // LegitSlimePaper start - Add Bit operations
+ case "&=" -> (targetScore, sourceScore) -> targetScore & sourceScore;
+ case "|=" -> (targetScore, sourceScore) -> targetScore | sourceScore;
+ case "^=" -> (targetScore, sourceScore) -> targetScore ^ sourceScore;
+ case "~=" -> (targetScore, sourceScore) -> ~sourceScore;
+ case "<<=" -> (targetScore, sourceScore) -> targetScore << sourceScore;
+ case ">>=" -> (targetScore, sourceScore) -> targetScore >> sourceScore;
+ case ">>>=" -> (targetScore, sourceScore) -> targetScore >>> sourceScore;
+ // LegitSlimePaper end - Add Bit operations
default -> throw ERROR_INVALID_OPERATION.create();
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
--- a/net/minecraft/server/commands/ScoreboardCommand.java
+++ b/net/minecraft/server/commands/ScoreboardCommand.java
@@ -66,6 +_,7 @@
);

public static void register(CommandDispatcher<CommandSourceStack> dispatcher, CommandBuildContext context) {
+ OperationArgument operationArgument = OperationArgument.operation(); // LegitSlimePaper - Add Bit operations
dispatcher.register(
Commands.literal("scoreboard")
.requires(Commands.hasPermission(2))
@@ -365,7 +_,7 @@
.then(
Commands.argument("targetObjective", ObjectiveArgument.objective())
.then(
- Commands.argument("operation", OperationArgument.operation())
+ Commands.argument("operation", operationArgument).suggests(operationArgument::listSuggestions) // LegitSlimePaper - Add Bit operations
.then(
Commands.argument("source", ScoreHolderArgument.scoreHolders())
.suggests(ScoreHolderArgument.SUGGEST_SCORE_HOLDERS)