Skip to content

Commit

Permalink
Removed debug prints and changed priority to lowest
Browse files Browse the repository at this point in the history
  • Loading branch information
Picono435 committed May 29, 2023
1 parent 8cd2807 commit af9cb1e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,10 @@ public void onInitialize() {

ServerPlayConnectionEvents.JOIN.register((handler, sender, server) -> {
PlayerState playerState = ServerState.getPlayerState(handler.player);
System.out.println("1");
if(!playerState.hasJoined) {
RandomTPMod.spawnTeleportPlayer(handler.getPlayer());
System.out.println("2");
playerState.hasJoined = true;
}
System.out.println("3");
});

CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import net.minecraftforge.event.RegisterCommandsEvent;
import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.event.server.ServerStartingEvent;
import net.minecraftforge.eventbus.api.EventPriority;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.server.permission.events.PermissionGatherEvent;
Expand Down Expand Up @@ -67,7 +68,7 @@ public void init(ServerStartingEvent event) {
RandomTPMod.getLogger().info("RandomTP successfully loaded.");
}

@SubscribeEvent
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onPlayerJoin(PlayerEvent.PlayerLoggedInEvent event) {
if(event.getEntity().level.isClientSide) return;
PlayerState playerState = ServerState.getPlayerState(event.getEntity());
Expand Down

0 comments on commit af9cb1e

Please sign in to comment.