-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #272 from FTBTeam/1.19/dev
1.19/dev
- Loading branch information
Showing
8 changed files
with
100 additions
and
1 deletion.
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
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
43 changes: 43 additions & 0 deletions
43
common/src/main/java/dev/ftb/mods/ftbchunks/net/AddWaypointPacket.java
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,43 @@ | ||
package dev.ftb.mods.ftbchunks.net; | ||
|
||
import dev.architectury.networking.NetworkManager; | ||
import dev.architectury.networking.simple.BaseS2CMessage; | ||
import dev.architectury.networking.simple.MessageType; | ||
import dev.ftb.mods.ftbchunks.FTBChunks; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.network.FriendlyByteBuf; | ||
|
||
public class AddWaypointPacket extends BaseS2CMessage { | ||
private final String name; | ||
private final BlockPos position; | ||
private final int color; | ||
|
||
public AddWaypointPacket(String name, BlockPos position, int color) { | ||
this.name = name; | ||
this.position = position; | ||
this.color = color; | ||
} | ||
|
||
public AddWaypointPacket(FriendlyByteBuf buf) { | ||
name = buf.readUtf(); | ||
position = buf.readBlockPos(); | ||
color = buf.readInt(); | ||
} | ||
|
||
@Override | ||
public MessageType getType() { | ||
return FTBChunksNet.ADD_WAYPOINT; | ||
} | ||
|
||
@Override | ||
public void write(FriendlyByteBuf buf) { | ||
buf.writeUtf(name); | ||
buf.writeBlockPos(position); | ||
buf.writeInt(color); | ||
} | ||
|
||
@Override | ||
public void handle(NetworkManager.PacketContext context) { | ||
FTBChunks.PROXY.addWaypoint(context.getPlayer(), name, position, color); | ||
} | ||
} |
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
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