0
0
mirror of https://github.com/PaperMC/Paper.git synced 2025-06-15 20:42:00 +00:00

38 Commits

Author SHA1 Message Date
42a2a6c2b5 Supports the ability for commands to be registered internally (#12520) 2025-05-06 16:05:00 -04:00
f00727c57e 1.21.5
Co-authored-by: Bjarne Koll <git@lynxplay.dev>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
Co-authored-by: MiniDigger | Martin <admin@minidigger.dev>
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
Co-authored-by: Noah van der Aa <ndvdaa@gmail.com>
Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
Co-authored-by: Shane Freeder <theboyetronic@gmail.com>
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
Co-authored-by: Tamion <70228790+notTamion@users.noreply.github.com>
Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com>
2025-04-12 17:27:00 +02:00
142695eb00 Default minecraft alias to redirect (#12146)
While the running server will still be using the recently introduced
copy-mechanic for vanilla command namespacing, the data converter logic
relies on the fact that namespaced aliases were redirects as well.

To not break the converted, the commands type now takes a modern flag
only set by the running server.
2025-02-18 00:09:54 +01:00
3b9106c7d1 Readd dead redirect recovery (#12136)
While the paper command system no longer uses redirects for namespaced
registration, vanilla still does. This means that removal of vanilla
redirecting target nodes still causes issues, e.g. the removal of the
vanilla 'msg' node in favour of a command alias one.
Redirecting nodes like tell, minecraft:msg and minecraft:tell are broken
by this and need to by flattened before sending them to the client.
2025-02-17 23:51:52 +01:00
84609dc046 Don't auto-create any brig redirects (#11954) 2025-02-16 13:55:27 -08:00
eb4db794eb Make CommandSourceStack respect hidden players (#11898) 2025-01-12 17:50:08 +01:00
c2f24e1567 Feat: Add 'with' methods to CommandSourceStack (#11868) 2025-01-11 13:29:16 -08:00
85c428b0be Fix unintentional change to default "overridePermissions" argument (#11759) 2024-12-21 10:25:14 +01:00
49f715fdda update brig in the API and patch cleanup 2024-12-18 18:30:29 -08:00
6126012369 readd beacon effect cause 2024-12-18 19:29:39 +01:00
acd43900f5 remove more imports and cleanup 2024-12-15 12:51:34 -08:00
6dcb4a33b6 Fix some compilation errors 2024-12-15 21:28:08 +01:00
4c723932f6 Small fixups 2024-12-15 12:13:09 +01:00
f1ee7a0262 net.minecraft.commands.arguments(.{blocks|item}) 2024-12-14 20:30:36 +01:00
aa7204fd62 net.minecraft.commands.arguments.selector 2024-12-13 19:46:27 -08:00
f73e864f18 Commands 2024-12-13 21:21:57 +01:00
45ddf764d9 Move patches to unapplied 2024-12-12 12:30:31 +01:00
ea24e2c6aa Fix incorrect command serialization by creating new Command
Fixes #11649 - As noted in the issue, when CommandNodes are serialized
they are used as the key in a Map. Their equals()/hashcode() should only
match if they are equal nodes (name & command), but due to the erasure of the command field pre-serialization, nodes with different commands can be mapped onto the same value. This causes the client to interpret both nodes as the same, causing suggestions where they should not.

This is fixed by creating a different no-op command for the
erasure, instead of them holding the same lambda.
2024-11-26 20:45:52 +01:00
164078cd2a Prioritize Minecraft commands in function parsing and command blocks 2024-07-01 11:58:49 -07:00
977543c545 Brigadier based command API
== AT ==
public net.minecraft.commands.arguments.blocks.BlockInput tag
public net.minecraft.commands.arguments.DimensionArgument ERROR_INVALID_VALUE
public net.minecraft.server.ReloadableServerResources registryLookup
public net.minecraft.server.ReloadableServerResources

Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Marc Baloup <marc.baloup@laposte.net>
2022-08-01 22:50:34 -04:00
3758965f88 Improve tag parser handling 2024-02-05 11:54:04 +01:00
b0579722db Fix cmd permission levels for command blocks 2022-01-24 15:32:02 -08:00
7c7eff2c01 Fix EntityArgument and EntitySelectorParser permissions to align with EntitySelector#checkPermissions
Fixes where the user has permission for selectors but not their
suggestions, which especially matters when we force suggestions to
the server for this type
2022-10-26 13:13:12 -07:00
1158ad3a6a Fix suggest command message for brigadier syntax exceptions
This is a bug accidentally introduced in upstream CB
2022-08-01 20:13:02 -05:00
6dafeceebd Vanilla command permission fixes
Fixes permission checks for vanilla commands which don't have a
requirement, as well as for namespaced vanilla commands.

== AT ==
public-f com.mojang.brigadier.tree.CommandNode requirement
2021-08-25 13:19:53 -07:00
6949e999eb Send empty commands if tab completion is disabled 2021-04-26 01:27:08 +01:00
6ba5436a48 Empty commands shall not be dispatched 2021-01-06 23:38:43 +01:00
def8b96d4b Thread Safe Vanilla Command permission checking
Datapacks check this on load and are built concurrently. This was breaking them badly due
to race conditions.

Plus, .canUse we want to be safe for async anyways.
2020-07-11 03:54:28 -04:00
35b7f788a9 misc debugging dumps 2021-02-18 20:23:28 +00:00
05f977e3d1 Brigadier Mojang API
Adds AsyncPlayerSendCommandsEvent
  - Allows modifying on a per command basis what command data they see.

Adds CommandRegisteredEvent
  - Allows manipulating the CommandNode to add more children/metadata for the client
2020-04-19 18:15:29 -04:00
41218728d9 Async command map building
This adds a custom pool inorder to make sure that they are closed
without much though, as it doesn't matter if the client is not sent
commands if the server is restarting. Using the default async pool caused issues to arise
due to the shutdown logic generally being much later.
2020-04-08 02:42:14 -05:00
551d6ee71e Add UnknownCommandEvent
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2017-06-17 18:48:21 -04:00
66779f5c86 Adventure
== AT ==
public net.minecraft.network.chat.HoverEvent$ItemStackInfo item
public net.minecraft.network.chat.HoverEvent$ItemStackInfo count
public net.minecraft.network.chat.HoverEvent$ItemStackInfo components
public net.minecraft.network.chat.contents.TranslatableContents filterAllowedArguments(Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;

Co-authored-by: zml <zml@stellardrift.ca>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2021-01-29 17:54:03 +01:00
f829dcd46a MC Dev fixes 2016-03-30 19:36:20 -04:00
c3ce457c08 Add Option to Silence CommandBlock Console
By: md_5 <git@md-5.net>
2014-02-09 14:39:01 +11:00
cabf908e4c Allow Disabling of Command TabComplete
By: md_5 <git@md-5.net>
2013-06-21 18:05:54 +10:00
30e4583dbe Remap CraftBukkit to Mojang+Yarn Mappings
By: Initial Source <noreply+automated@papermc.io>
2024-12-11 22:26:55 +01:00
a265d64138 Move CraftBukkit per-file patches
By: Initial <noreply+automated@papermc.io>
2024-12-11 22:26:36 +01:00