aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/torui/coflsky/EventRegistry.java
blob: 216cd2cc9b65e1462e75dd656e627f421ff61fe8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package de.torui.coflsky;

import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.ServerData;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent;
import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent;

public class EventRegistry{

	@SubscribeEvent
    public void PlayerLoggedIn(PlayerLoggedInEvent plie) {
    	
		System.out.println("COFLSKY initialized");
		
		if(plie.player.getEntityWorld().isRemote) {
			//is a server
			ServerData sd = Minecraft.getMinecraft().getCurrentServerData();
			if(sd != null) {
				System.out.println("ServerIP:= " + sd.serverIP);
			} else {
				System.out.println("Could not get serverdata");
			}
			
			
		} else {
			System.out.println("World is not remote");
		}
    	
    }
    
    @SubscribeEvent
    public void PlayerLoggedOut(PlayerLoggedOutEvent ploe) {
    	System.out.println("COFLSKY disabled");
    }
		
}