Skip to content

Commit

Permalink
Fixed error where Bukkit's say command was overridden by VRChat
Browse files Browse the repository at this point in the history
  • Loading branch information
Jmgiacone committed Jan 19, 2014
1 parent 0db89e9 commit ae761f5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/base/plugin/ChatHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.defaults.SayCommand;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
Expand Down Expand Up @@ -38,17 +39,17 @@ public void onEnable()

public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
{
// convert command input into lowercase string
String command = cmd.getName().toLowerCase();

//A player has to send this command
if (sender instanceof Player)
{
Player player = (Player) sender;
String name = player.getDisplayName();
Channel c;

// convert command input into lowercase string
String command = cmd.getName().toLowerCase();

switch (command)
switch (command)
{
case "ooc":
c = Channel.OOC;
Expand Down Expand Up @@ -111,6 +112,11 @@ public boolean onCommand(CommandSender sender, Command cmd, String label, String
}
return true;
}
else if(command.equalsIgnoreCase("say"))
{
new SayCommand().execute(sender, "", args);
return true;
}

sender.sendMessage("This command cannot be executed via console. Please log into an account and try again.");
return false;
Expand Down

0 comments on commit ae761f5

Please sign in to comment.