Skip to content

Commit f65a5f3

Browse files
committed
Readd join / leave messages
1 parent 395383b commit f65a5f3

3 files changed

Lines changed: 13 additions & 12 deletions

File tree

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ apply plugin: 'net.minecraftforge.gradle'
1313
apply plugin: 'eclipse'
1414
apply plugin: 'maven-publish'
1515

16-
version = '1.5.0'
16+
version = '1.5.1'
1717
group = 'simpleircbridge' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
1818
archivesBaseName = 'simpleircbridge'
1919

src/main/java/simpleircbridge/GameEventHandler.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import static simpleircbridge.SIBConstants.*;
44

55
import net.minecraftforge.event.ServerChatEvent;
6+
import net.minecraftforge.event.entity.player.PlayerEvent;
67
import net.minecraftforge.eventbus.api.SubscribeEvent;
78
import utils.IRCMinecraftConverter;
89

@@ -13,15 +14,15 @@ public GameEventHandler(SimpleIRCBridge bridge) {
1314
this.bridge = bridge;
1415
}
1516

16-
// @SubscribeEvent
17-
// public void playerLoggedIn(PlayerEvent.PlayerLoggedInEvent e) {
18-
// toIrc(String.format(FORMAT1_MC_LOGIN, SIBUtil.mangle(e.getPlayer().getDisplayName().getString())));
19-
// }
20-
//
21-
// @SubscribeEvent
22-
// public void playerLoggedOut(PlayerEvent.PlayerLoggedOutEvent e) {
23-
// toIrc(String.format(FORMAT1_MC_LOGOUT, SIBUtil.mangle(e.getPlayer().getDisplayName().getString())));
24-
// }
17+
@SubscribeEvent
18+
public void playerLoggedIn(PlayerEvent.PlayerLoggedInEvent e) {
19+
toIrc(String.format(FORMAT1_MC_LOGIN, SIBUtil.mangle(e.getEntity().getDisplayName().getString())));
20+
}
21+
22+
@SubscribeEvent
23+
public void playerLoggedOut(PlayerEvent.PlayerLoggedOutEvent e) {
24+
toIrc(String.format(FORMAT1_MC_LOGOUT, SIBUtil.mangle(e.getEntity().getDisplayName().getString())));
25+
}
2526

2627
// @SubscribeEvent
2728
// public void command(CommandEvent e) {

src/main/java/simpleircbridge/SIBConstants.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
*/
77
public class SIBConstants {
88
/* == MC FORMATS, 1 PARAMETER == */
9-
public static final String FORMAT1_MC_LOGIN = "--> %s joined the game";
10-
public static final String FORMAT1_MC_LOGOUT = "<-- %s left the game";
9+
public static final String FORMAT1_MC_LOGIN = "> %s joined the game";
10+
public static final String FORMAT1_MC_LOGOUT = "< %s left the game";
1111
public static final String FORMAT1_MC_DEATH = "RIP: %s";
1212

1313
/* == MC FORMATS, 2 PARAMETERS == */

0 commit comments

Comments
 (0)