-
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/fabric' into fabric
# Conflicts: # src/main/resources/assets/clientcommands/lang/en_us.json
- Loading branch information
Showing
27 changed files
with
632 additions
and
177 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
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
6 changes: 6 additions & 0 deletions
6
src/main/java/net/earthcomputer/clientcommands/c2c/C2CPacketListener.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 |
---|---|---|
@@ -1,8 +1,14 @@ | ||
package net.earthcomputer.clientcommands.c2c; | ||
|
||
import net.earthcomputer.clientcommands.c2c.packets.MessageC2CPacket; | ||
import net.earthcomputer.clientcommands.c2c.packets.PutTicTacToeMarkC2CPacket; | ||
import net.earthcomputer.clientcommands.c2c.packets.StartTicTacToeGameC2CPacket; | ||
import net.minecraft.network.PacketListener; | ||
|
||
public interface C2CPacketListener extends PacketListener { | ||
void onMessageC2CPacket(MessageC2CPacket packet); | ||
|
||
void onStartTicTacToeGameC2CPacket(StartTicTacToeGameC2CPacket packet); | ||
|
||
void onPutTicTacToeMarkC2CPacket(PutTicTacToeMarkC2CPacket packet); | ||
} |
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
35 changes: 35 additions & 0 deletions
35
src/main/java/net/earthcomputer/clientcommands/c2c/packets/PutTicTacToeMarkC2CPacket.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,35 @@ | ||
package net.earthcomputer.clientcommands.c2c.packets; | ||
|
||
import net.earthcomputer.clientcommands.c2c.C2CPacketListener; | ||
import net.minecraft.network.FriendlyByteBuf; | ||
import net.minecraft.network.RegistryFriendlyByteBuf; | ||
import net.minecraft.network.codec.StreamCodec; | ||
import net.minecraft.network.protocol.Packet; | ||
import net.minecraft.network.protocol.PacketFlow; | ||
import net.minecraft.network.protocol.PacketType; | ||
import net.minecraft.resources.ResourceLocation; | ||
|
||
public record PutTicTacToeMarkC2CPacket(String sender, byte x, byte y) implements Packet<C2CPacketListener> { | ||
public static final StreamCodec<RegistryFriendlyByteBuf, PutTicTacToeMarkC2CPacket> CODEC = Packet.codec(PutTicTacToeMarkC2CPacket::write, PutTicTacToeMarkC2CPacket::new); | ||
public static final PacketType<PutTicTacToeMarkC2CPacket> ID = new PacketType<>(PacketFlow.CLIENTBOUND, new ResourceLocation("clientcommands", "put_tic_tac_toe_mark")); | ||
|
||
public PutTicTacToeMarkC2CPacket(FriendlyByteBuf buf) { | ||
this(buf.readUtf(), buf.readByte(), buf.readByte()); | ||
} | ||
|
||
public void write(FriendlyByteBuf buf) { | ||
buf.writeUtf(this.sender); | ||
buf.writeByte(this.x); | ||
buf.writeByte(this.y); | ||
} | ||
|
||
@Override | ||
public void handle(C2CPacketListener handler) { | ||
handler.onPutTicTacToeMarkC2CPacket(this); | ||
} | ||
|
||
@Override | ||
public PacketType<? extends Packet<C2CPacketListener>> type() { | ||
return ID; | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
src/main/java/net/earthcomputer/clientcommands/c2c/packets/StartTicTacToeGameC2CPacket.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,34 @@ | ||
package net.earthcomputer.clientcommands.c2c.packets; | ||
|
||
import net.earthcomputer.clientcommands.c2c.C2CPacketListener; | ||
import net.minecraft.network.FriendlyByteBuf; | ||
import net.minecraft.network.RegistryFriendlyByteBuf; | ||
import net.minecraft.network.codec.StreamCodec; | ||
import net.minecraft.network.protocol.Packet; | ||
import net.minecraft.network.protocol.PacketFlow; | ||
import net.minecraft.network.protocol.PacketType; | ||
import net.minecraft.resources.ResourceLocation; | ||
|
||
public record StartTicTacToeGameC2CPacket(String sender, boolean accept) implements Packet<C2CPacketListener> { | ||
public static final StreamCodec<RegistryFriendlyByteBuf, StartTicTacToeGameC2CPacket> CODEC = Packet.codec(StartTicTacToeGameC2CPacket::write, StartTicTacToeGameC2CPacket::new); | ||
public static final PacketType<StartTicTacToeGameC2CPacket> ID = new PacketType<>(PacketFlow.CLIENTBOUND, new ResourceLocation("clientcommands", "start_tic_tac_toe_game")); | ||
|
||
public StartTicTacToeGameC2CPacket(FriendlyByteBuf buf) { | ||
this(buf.readUtf(), buf.readBoolean()); | ||
} | ||
|
||
public void write(FriendlyByteBuf buf) { | ||
buf.writeUtf(this.sender); | ||
buf.writeBoolean(this.accept); | ||
} | ||
|
||
@Override | ||
public void handle(C2CPacketListener handler) { | ||
handler.onStartTicTacToeGameC2CPacket(this); | ||
} | ||
|
||
@Override | ||
public PacketType<? extends Packet<C2CPacketListener>> type() { | ||
return ID; | ||
} | ||
} |
Oops, something went wrong.