aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/torui/coflsky/EventRegistry.java
blob: 06f94cd0ef42b06125ef0e4d42abf87691992264 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package de.torui.coflsky;

import java.util.UUID;

import net.minecraft.client.Minecraft;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.gui.MinecraftServerGui;
import net.minecraftforge.event.world.WorldEvent;
import net.minecraftforge.fml.client.FMLClientHandler;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent;
import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent;
import net.minecraftforge.fml.common.network.FMLNetworkEvent;
import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientConnectedToServerEvent;
import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientDisconnectionFromServerEvent;
import net.minecraftforge.fml.server.FMLServerHandler;

public class EventRegistry{

	
	@SubscribeEvent
	public void onConnectedToServerEvent(ClientConnectedToServerEvent event) {
	/*	if(!event.isLocal ) {
			//String serverIP =  Minecraft.getMinecraft().getCurrentServerData().serverIP;
			
		/*	if(false && serverIP.equals("hypixel.net")) {
				
			}*
		//UUID.randomUUID().toString();
		
		//String id = FMLClientHandler.instance().getClient().thePlayer.getUniqueID().toString();
		
		String id = UUID.randomUUID().toString();//Minecraft.getMinecraft().thePlayer.getUniqueID().toString();
		System.out.println("PlayerUUID:" + id);
		CoflSky.PlayerUUID = id;
		
		System.out.println("Connected to server");		
		CoflSky.Wrapper.start();
		System.out.println("CoflSky started");
		}*/
	}
	
	@SubscribeEvent
	public void onDisconnectedFromServerEvent(ClientDisconnectionFromServerEvent event) {	
		System.out.println("Disconnected from server");
		CoflSky.Wrapper.stop();
		System.out.println("CoflSky stopped");
	}
	/*@SubscribeEvent
public void OnSomething(FMLNetworkEvent.ClientConnectedToServerEvent event) {
		System.out.println("Client connect to server from network");
}
    
    @SubscribeEvent
    public void PlayerLoggedOut(PlayerLoggedOutEvent ploe) {
    	//CoflSky.Wrapper.stop();
    	System.out.println("COFLSKY disabled");   	
    }*/
		
}