Skip to content

Commit

Permalink
Fix players not able to join server with mod (#612)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rakambda authored Oct 16, 2023
1 parent 6678337 commit 096474e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ buildscript {
}

plugins {
id("idea")
alias(libs.plugins.curse)
alias(libs.plugins.modrinth)
alias(libs.plugins.names)
Expand All @@ -20,6 +21,7 @@ plugins {

allprojects {
apply plugin: "java"
apply plugin: "idea"

java.toolchain.languageVersion = JavaLanguageVersion.of(17)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package fr.rakambda.fallingtree.forge.network;

import fr.rakambda.fallingtree.common.FallingTreeCommon;
import fr.rakambda.fallingtree.common.network.ConfigurationPacket;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import net.minecraft.server.level.ServerPlayer;
Expand All @@ -26,7 +27,8 @@ public void onPlayerLoggedInEvent(@Nonnull PlayerEvent.PlayerLoggedInEvent event
if(event.getEntity() instanceof ServerPlayer serverPlayer){
var server = serverPlayer.getServer();
if(Objects.nonNull(server) && server.isDedicatedServer()){
ForgePacketHandler.INSTANCE.send(mod.getConfiguration(), PacketDistributor.PLAYER.with(serverPlayer));
var packet = ConfigurationPacket.get(mod.getConfiguration());
ForgePacketHandler.INSTANCE.send(packet, PacketDistributor.PLAYER.with(serverPlayer));
}
else{
log.info("Player connected to a local world, not setting up proxy config");
Expand Down

0 comments on commit 096474e

Please sign in to comment.