Update Main.java

Added Chat listener, Added config generation