forked from FrostDracony/NewFantasyMod
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
50 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 0 additions & 40 deletions
40
src/main/java/mod/dragonita/fantasymod/customthings/ClientSendFunction.java
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
src/main/java/mod/dragonita/fantasymod/customthings/PacketHandler.java
This file was deleted.
Oops, something went wrong.
41 changes: 0 additions & 41 deletions
41
src/main/java/mod/dragonita/fantasymod/customthings/PanicMessage.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package network; | ||
|
||
import mod.dragonita.fantasymod.Main; | ||
import net.minecraft.entity.player.ServerPlayerEntity; | ||
import net.minecraft.util.ResourceLocation; | ||
import net.minecraftforge.fml.network.NetworkDirection; | ||
import net.minecraftforge.fml.network.NetworkRegistry; | ||
import net.minecraftforge.fml.network.simple.SimpleChannel; | ||
|
||
public class PacketHandler { | ||
private static final String PROTOCOL_VERSION = "1"; | ||
public static final SimpleChannel CHANNEL = NetworkRegistry.newSimpleChannel(new ResourceLocation(Main.MODID, "main"), | ||
() -> PROTOCOL_VERSION, | ||
PROTOCOL_VERSION::equals, | ||
PROTOCOL_VERSION::equals | ||
); | ||
private static int ID; | ||
|
||
public static void init(){ | ||
//int ID; you can also use a local var because it gets called only 1 time | ||
//CHANNEL.registerMessage(ID++, PanicMessage.class, PanicMessage::encode, PanicMessage::new, PanicMessageHandler::handle); | ||
} | ||
|
||
public static <MSG> void sentToClient(MSG msg, ServerPlayerEntity playerEntity){ | ||
CHANNEL.sendTo(msg, playerEntity.connection.netManager, NetworkDirection.PLAY_TO_CLIENT); | ||
} | ||
} |
3cd683d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank for helping me!