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 command to invalidate spawn locations in a dimension #9

Merged
merged 6 commits into from
Feb 10, 2021

Conversation

ALongStringOfNumbers
Copy link
Member

To tag on to #3 and closes #7, this PR adds a command to invalidate the stored dimPos of the spawn point in a dimension for the player. This is useful for when the player had an invalid spawn point before the changes that went in in #3.

The syntax is /dimensionalEdibles invalidate <dimID>

Copy link

@Exaxxion Exaxxion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a great start. During review I realized a few things that we should take into consideration.

The first one is that server operators might want to be able to configure the permission level required to issue the command. Normally the place you teleport to with a cake is locked-in on first use, but being able to invalidate the cache means you can move the cake to end up somewhere else. This is a change from the prior behavior that could potentially be exploited, so this command could reasonably be considered a cheat for administration purposes.

On that same vein, if players don't have permission to use the command, it should be possible for an operator/admin to issue it on behalf of another player. We should ask for an additional argument which is the target player's name.

Lastly, the language file entry for the command failing seems to be almost the same as the usage string, except one has brackets around dimID. We should give the caller a more informative error message depending on what problem was encountered.

@ALongStringOfNumbers
Copy link
Member Author

I have now added a required player argument to the command, which can be done with @p if you want to target yourself, and made the operator level to execute the command configurable. If the player is incorrect, the generic minecraft incorrect player message will be shown.

@Exaxxion Exaxxion merged commit 1e3e858 into master Feb 10, 2021
@Exaxxion Exaxxion deleted the invalidationCommand branch February 10, 2021 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a mechanism for invalidating a player's dimensionCache
4 participants