Skip to content

Commit

Permalink
1.2: IncomingChatEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
RoboMWM committed Dec 30, 2017
1 parent bc72411 commit 33730b9
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>to.us.mlgfort</groupId>
<artifactId>CommunicationConnector</artifactId>
<version>1.1</version>
<version>1.2</version>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public void sendToApps(Apps sendingApp, String name, String message)
sendToIRC(prefixWithWhitespace + ": " + message);
if (sendingApp != Apps.DUMCORD) //Must ensure DiscordSRV integration is disabled in PurpleIRC
sendToDiscord("`" + prefix + ":` " + message);
this.getServer().getPluginManager().callEvent(new IncomingChatEvent(name, message));
}

public void sendToAllApps(String name, String message)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package to.us.mlgfort.communicationconnector;

import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;

/**
* Created on 12/29/2017.
*
* Chat incoming from an app to MC server
*
* @author RoboMWM
*/
public class IncomingChatEvent extends Event
{
// Custom Event Requirements
private static final HandlerList handlers = new HandlerList();
public static HandlerList getHandlerList() {
return handlers;
}
@Override
public HandlerList getHandlers() {
return handlers;
}

private String name;
private String message;

public IncomingChatEvent(String name, String message)
{
this.name = name;
this.message = message;
}

public String getMessage()
{
return message;
}

public String getName()
{
return name;
}
}

0 comments on commit 33730b9

Please sign in to comment.