-
Notifications
You must be signed in to change notification settings - Fork 31
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 #61 from FTBTeam/dev
Dev
- Loading branch information
Showing
20 changed files
with
82 additions
and
98 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
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
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
13 changes: 4 additions & 9 deletions
13
common/src/main/java/dev/ftb/mods/ftbessentials/net/FTBEssentialsNet.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,14 +1,9 @@ | ||
package dev.ftb.mods.ftbessentials.net; | ||
|
||
import dev.architectury.networking.simple.MessageType; | ||
import dev.architectury.networking.simple.SimpleNetworkManager; | ||
import dev.ftb.mods.ftbessentials.FTBEssentials; | ||
import dev.ftb.mods.ftblibrary.util.NetworkHelper; | ||
|
||
public interface FTBEssentialsNet { | ||
SimpleNetworkManager NET = SimpleNetworkManager.create(FTBEssentials.MOD_ID); | ||
|
||
MessageType UPDATE_TAB_NAME = NET.registerS2C("update_tab_name", UpdateTabNameMessage::new); | ||
|
||
static void init() { | ||
public class FTBEssentialsNet { | ||
public static void init() { | ||
NetworkHelper.registerS2C(UpdateTabNameMessage.TYPE, UpdateTabNameMessage.STREAM_CODEC, UpdateTabNameMessage::handle); | ||
} | ||
} |
58 changes: 20 additions & 38 deletions
58
common/src/main/java/dev/ftb/mods/ftbessentials/net/UpdateTabNameMessage.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,54 +1,36 @@ | ||
package dev.ftb.mods.ftbessentials.net; | ||
|
||
import dev.architectury.networking.NetworkManager; | ||
import dev.architectury.networking.simple.BaseS2CMessage; | ||
import dev.architectury.networking.simple.MessageType; | ||
import dev.ftb.mods.ftbessentials.FTBEssentials; | ||
import dev.ftb.mods.ftbessentials.util.FTBEPlayerData.RecordingStatus; | ||
import dev.ftb.mods.ftblibrary.util.NetworkHelper; | ||
import net.minecraft.core.UUIDUtil; | ||
import net.minecraft.network.FriendlyByteBuf; | ||
import net.minecraft.network.codec.ByteBufCodecs; | ||
import net.minecraft.network.codec.StreamCodec; | ||
import net.minecraft.network.protocol.common.custom.CustomPacketPayload; | ||
import net.minecraft.resources.ResourceLocation; | ||
|
||
import java.util.UUID; | ||
|
||
public class UpdateTabNameMessage extends BaseS2CMessage { | ||
public final UUID uuid; | ||
public final String name; | ||
public final String nickname; | ||
public final RecordingStatus recording; | ||
public final boolean afk; | ||
public record UpdateTabNameMessage(UUID uuid, String name, String nickname, RecordingStatus recording, boolean afk) implements CustomPacketPayload { | ||
public static final Type<UpdateTabNameMessage> TYPE = new Type<>(new ResourceLocation(FTBEssentials.MOD_ID, "update_tab_name")); | ||
|
||
public UpdateTabNameMessage(UUID id, String n, String nn, RecordingStatus r, boolean a) { | ||
uuid = id; | ||
name = n; | ||
nickname = nn; | ||
recording = r; | ||
afk = a; | ||
} | ||
|
||
public UpdateTabNameMessage(FriendlyByteBuf buf) { | ||
uuid = new UUID(buf.readLong(), buf.readLong()); | ||
name = buf.readUtf(Short.MAX_VALUE); | ||
nickname = buf.readUtf(Short.MAX_VALUE); | ||
recording = buf.readEnum(RecordingStatus.class); | ||
afk = buf.readBoolean(); | ||
} | ||
public static StreamCodec<FriendlyByteBuf, UpdateTabNameMessage> STREAM_CODEC = StreamCodec.composite( | ||
UUIDUtil.STREAM_CODEC, UpdateTabNameMessage::uuid, | ||
ByteBufCodecs.STRING_UTF8, UpdateTabNameMessage::name, | ||
ByteBufCodecs.STRING_UTF8, UpdateTabNameMessage::nickname, | ||
NetworkHelper.enumStreamCodec(RecordingStatus.class), UpdateTabNameMessage::recording, | ||
ByteBufCodecs.BOOL, UpdateTabNameMessage::afk, | ||
UpdateTabNameMessage::new | ||
); | ||
|
||
@Override | ||
public MessageType getType() { | ||
return FTBEssentialsNet.UPDATE_TAB_NAME; | ||
} | ||
|
||
@Override | ||
public void write(FriendlyByteBuf buf) { | ||
buf.writeLong(uuid.getMostSignificantBits()); | ||
buf.writeLong(uuid.getLeastSignificantBits()); | ||
buf.writeUtf(name, Short.MAX_VALUE); | ||
buf.writeUtf(nickname, Short.MAX_VALUE); | ||
buf.writeEnum(recording); | ||
buf.writeBoolean(afk); | ||
public static void handle(UpdateTabNameMessage message, NetworkManager.PacketContext packetContext) { | ||
packetContext.queue(() -> FTBEssentials.PROXY.updateTabName(message)); | ||
} | ||
|
||
@Override | ||
public void handle(NetworkManager.PacketContext packetContext) { | ||
FTBEssentials.PROXY.updateTabName(this); | ||
public Type<UpdateTabNameMessage> type() { | ||
return TYPE; | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
common/src/main/java/dev/ftb/mods/ftbessentials/util/WarmupCooldownTeleporter.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
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,24 +1,25 @@ | ||
org.gradle.jvmargs=-Xmx3G | ||
|
||
enabled_platforms=fabric,forge,neoforge | ||
# enabled_platforms=fabric,forge,neoforge | ||
enabled_platforms=fabric,neoforge | ||
mod_id=ftbessentials | ||
archives_base_name=ftb-essentials | ||
maven_group=dev.ftb.mods | ||
minecraft_version=1.20.4 | ||
mod_version=2004.1.2 | ||
minecraft_version=1.20.6 | ||
mod_version=2006.1.0 | ||
mod_author=FTB Team | ||
|
||
# Deps | ||
forge_version=49.0.31 | ||
neoforge_version=20.4.196 | ||
forge_version=50.0.9 | ||
neoforge_version=20.6.100-beta | ||
neoforge_loader_version=1 | ||
fabric_loader_version=0.15.7 | ||
fabric_api_version=0.96.4+1.20.4 | ||
fabric_loader_version=0.15.10 | ||
fabric_api_version=0.99.0+1.20.6 | ||
|
||
architectury_version=11.1.17 | ||
architectury_version=12.1.3 | ||
|
||
ftb_library_version=2004.2.0 | ||
ftb_ranks_version=2004.2.0 | ||
ftb_library_version=2006.1.1 | ||
ftb_ranks_version=2006.1.0 | ||
|
||
# common curseforge project for forge and fabric | ||
curseforge_id=410811 |
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
Oops, something went wrong.