Dediserver runs and talks to clients.

This commit is contained in:
cpw authored and LexManos committed 2018-09-05 12:35:31 -07:00
1 parent 506b51f189
commit 689ebd8036
31 files changed
+605 -324

No files matched your search

@@ -558,7 +558,7 @@ public class FMLCommonHandler
* Also verifies the client has the FML marker.
*
* @param packet Handshake Packet
* @param manager Network connection
* @param manager NetworkDirection connection
* @return True to allow connection, otherwise False.
*/
public boolean handleServerHandshake(C00Handshake packet, NetworkManager manager)
@@ -22,10 +22,20 @@ package net.minecraftforge.fml.common.event;
import net.minecraft.client.Minecraft;
import net.minecraftforge.fml.ModContainer;
import java.util.function.Supplier;
public class FMLClientInitEvent extends ModLifecycleEvent
{
public FMLClientInitEvent(Minecraft mc, ModContainer container)
private final Supplier<Minecraft> minecraftSupplier;
public FMLClientInitEvent(Supplier<Minecraft> mc, ModContainer container)
{
super(container);
this.minecraftSupplier = mc;
}
public Supplier<Minecraft> getMinecraftSupplier()
{
return minecraftSupplier;
}
}
@@ -19,13 +19,23 @@
package net.minecraftforge.fml.common.event;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.dedicated.DedicatedServer;
import net.minecraftforge.fml.ModContainer;
import java.util.function.Supplier;
public class FMLServerInitEvent extends ModLifecycleEvent
{
public FMLServerInitEvent(MinecraftServer server, ModContainer container)
private final Supplier<DedicatedServer> serverSupplier;
public FMLServerInitEvent(Supplier<DedicatedServer> server, ModContainer container)
{
super(container);
this.serverSupplier = server;
}
public Supplier<DedicatedServer> getServerSupplier()
{
return serverSupplier;
}
}
@@ -318,7 +318,7 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet<?>> im
private void kickWithMessage(String message)
{
FMLLog.log.error("Network Disconnect: {}", message);
FMLLog.log.error("NetworkDirection Disconnect: {}", message);
final TextComponentString TextComponentString = new TextComponentString(message);
if (side == Side.CLIENT)
{