Peripherals++

Peripherals++

359k Downloads

Chatbox cancelling every chat event

SarahGreyWolf opened this issue ยท 1 comments

commented

Your chatbox code appears to be cancelling every chat event.

public void onChat(ServerChatEvent event) {
if (Config.enableChatBox) {
String commandPrefix = Config.chatboxCommandPrefix.trim();
if (!commandPrefix.equals("") && !commandPrefix.equals(" ")) {
event.setCanceled(true);

This might not be right but from what I can tell you are trying to make it cancel the chat event only if it is prefixed by the prefix set in config, however what you seem to be doing is cancelling all chat as long as the commandPrefix is not set to '' or a space, maybe you want to be doing this:

public void onChat(ServerChatEvent event) {
if (Config.enableChatBox) {
String commandPrefix = Config.chatboxCommandPrefix.trim();
if(event.message!=commandPrefix){
if (!commandPrefix.equals("") && !commandPrefix.equals(" ")) {
event.setCanceled(true);

Sorry if I'm wrong its just a suggestion but I know something in the chatbox is preventing chat

commented

Gonna release a hotfix on curseforge right now, sorry!