diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/java/world/anhgelus/molehunt/Molehunt.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/world/anhgelus/molehunt/Molehunt.java b/src/main/java/world/anhgelus/molehunt/Molehunt.java index 140ab14..79903e2 100644 --- a/src/main/java/world/anhgelus/molehunt/Molehunt.java +++ b/src/main/java/world/anhgelus/molehunt/Molehunt.java @@ -8,6 +8,8 @@ import net.fabricmc.fabric.api.entity.event.v1.ServerLivingEntityEvents; import net.fabricmc.fabric.api.entity.event.v1.ServerPlayerEvents; import net.fabricmc.fabric.api.message.v1.ServerMessageEvents; import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry; +import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents; +import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; import net.minecraft.network.packet.s2c.play.OverlayMessageS2CPacket; import net.minecraft.server.command.ServerCommandSource; import net.minecraft.server.network.ServerPlayerEntity; @@ -96,6 +98,10 @@ public class Molehunt implements ModInitializer { newPlayer.changeGameMode(GameMode.SPECTATOR); }); + ServerPlayConnectionEvents.JOIN.register((handler, sender, server) -> { + ServerPlayNetworking.send(handler.player, new ConfigPayload(CONFIG.showNametags, CONFIG.showSkins, CONFIG.showTab)); + }); + PayloadTypeRegistry.playS2C().register(ConfigPayload.ID, ConfigPayload.CODEC); } } |
