Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a permanent identifier method to CommandSender #3048

Open
SOF3 opened this issue Jul 19, 2019 · 0 comments
Open

Add a permanent identifier method to CommandSender #3048

SOF3 opened this issue Jul 19, 2019 · 0 comments
Labels
BC break Breaks API compatibility Category: API Related to the plugin API

Comments

@SOF3
Copy link
Member

SOF3 commented Jul 19, 2019

Introduction

There is no reliable method to permanently identify a CommandSender. To permanently identify the console, the plugin has to check instanceof ConsoleCommandSender, but that assumes the knowledge that console is single-instance (or that other instances are supposed to imply the same thing as the console). To permanently identify a player, the plugin has to check for player UUID, which is not even in the CommandSender interface. To permanently identify plugin-defined CommandSender implementations... there is simply no reliable method.

Proposal

Introduce a getUniqueId method that returns ?UUID. If it returns null, the CommandSender cannot be uniquely identified. If it returns a UUID, users of CommandSender can rely on this value to identify a CommandSender over multiple sessions.

The ConsoleCommandSender unique ID can be generated from the server unique ID, which should be consistent throughout srever restarts.

Backward compatibility

This proposal is BC-breaking since CommandSender can be implemented

@SOF3 SOF3 added Category: API Related to the plugin API BC break Breaks API compatibility labels Jul 19, 2019
@SOF3 SOF3 added this to Command sender in Command system redesign Dec 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BC break Breaks API compatibility Category: API Related to the plugin API
Projects
Development

No branches or pull requests

1 participant