Moved networking into its own class.
This commit is contained in:
21
src/main/java/dev/micle/totemofreviving/network/Network.java
Normal file
21
src/main/java/dev/micle/totemofreviving/network/Network.java
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
package dev.micle.totemofreviving.network;
|
||||||
|
|
||||||
|
import dev.micle.totemofreviving.TotemOfReviving;
|
||||||
|
import net.minecraftforge.fml.network.NetworkRegistry;
|
||||||
|
import net.minecraftforge.fml.network.simple.SimpleChannel;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
public final class Network {
|
||||||
|
public static final String VERSION = TotemOfReviving.MOD_ID + "-net-1";
|
||||||
|
|
||||||
|
public static SimpleChannel channel;
|
||||||
|
|
||||||
|
public static void init() {
|
||||||
|
channel = NetworkRegistry.ChannelBuilder.named(TotemOfReviving.createResourceLocation("network"))
|
||||||
|
.clientAcceptedVersions(s -> Objects.equals(s, VERSION))
|
||||||
|
.serverAcceptedVersions(s -> Objects.equals(s, VERSION))
|
||||||
|
.networkProtocolVersion(() -> VERSION)
|
||||||
|
.simpleChannel();
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user