Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Add /me command, closes #836 #837

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add /me command, closes #836 #837

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Aug 17, 2015

It should be better to simply create and override the /me command, instead of blocking it. Here's an image of how it looks like https://gyazo.com/dc6c7193eeb418ab816eaedd1508a9b3

@connorjayr
Copy link
Collaborator

You can still use /minecraft:me no matter what. We can't overwrite that command.

@ghost
Copy link
Author

ghost commented Aug 17, 2015

@connorjayr
Copy link
Collaborator

@Alfalik Did you test that? I've always had problems removing default permissions with the permission module.

@ghost
Copy link
Author

ghost commented Aug 17, 2015

@iEli2tyree011 Meh, players can still use default minecraft permissions, minecraft:me in this case.

@twizmwazin
Copy link
Owner

I'll be honest I'd rather just outright disable the vanilla command

@Pablete1234
Copy link
Collaborator

what about just a #toLowerCase.startsWith(/me)

@ghost
Copy link
Author

ghost commented Aug 22, 2015

This PR can be closed

@Pablete1234
Copy link
Collaborator

it still would be nice to add a cardinal /me so that it uses display names (with ranks and team) instead of white names, but the vanilla one should be left as it is (usable by default, and blocked during mute or gmute) and the same behaviour should be used for cardinal:me

As I see it, you should:
in BroadcastCommands.java line 35:
ChatUtil.getGlobalChannel().sendMessage("\u002A " + Players.getDisplayName(sender) + " " + ChatColor.YELLOW + cmd.getJoinedStrings(0));
in ranks.xml line 5:
<permission>cardinal.me<permission>
(so that cardinal.me is a default)
in PermissionModule.java line 153 & 161:
disablePermission(player, "cardinal.me");
enablePermission(player, "cardinal.me");
and remove all changes made to ChatModule.java

@ghost
Copy link
Author

ghost commented Aug 23, 2015

I've ammend the commit, so if a player do /minecraft:me, the player won't have access. Also, a /me command has been added (https://i.gyazo.com/c584771128c1a7ed04d39871b2d5cb97.png). As @Pablete1234 said, it display the actual rank and team of the player.

@Pablete1234
Copy link
Collaborator

Leave the old chat module as it was, if someone has their server on the bukkit setting that uses vanilla by default it will be better to also block the regular /me (bcos it will be the vanilla one)

@ghost
Copy link
Author

ghost commented Aug 28, 2015

The vanilla command is now totally disabled, and I've added a /me command that shows the rank and team of the player.

@unixfox
Copy link

unixfox commented Sep 1, 2015

👍

@CommandPermissions("cardinal.me")
public static void me(final CommandContext cmd, CommandSender sender) throws CommandException {
if (!(sender instanceof Player)) throw new CommandException(new LocalizedChatMessage(ChatConstant.ERROR_CONSOLE_NO_USE).getMessage(ChatUtil.getLocale(sender)));
if (!GameHandler.getGameHandler().getGlobalMute()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

if (!GameHandler.getGameHandler().getGlobalMute() || sender.hasPermission("cardinal.globalmute.override")) {

@SungMatt
Copy link
Contributor

Should have been fixed in 6ce8cbd , thanks for your work in this PR!

@Pablete1234
Copy link
Collaborator

@SungMatt it isn't quite fixed, but i agree thar 1.9 fixed quite alot of stuff with player selectors (try /minecraft:say @A[team=observers]) now bukkit properly uses scoreboard team color / names or something, but it's still not the bukkit display name, it's just the scoreboard team color

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants