Skip to content

Commit

Permalink
Merge branch '1.19.4' into 1.20.1
Browse files Browse the repository at this point in the history
* 1.19.4:
  Fixed server
  • Loading branch information
Faboslav committed Dec 10, 2023
2 parents 9206219 + d03f196 commit 50ddf69
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.faboslav.friendsandfoes.util.client;

import net.minecraft.client.MinecraftClient;
import net.minecraft.entity.player.PlayerEntity;

public final class PlayerProvider
{
public static PlayerEntity getClientPlayer() {
return MinecraftClient.getInstance().player;
}

private PlayerProvider() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.faboslav.friendsandfoes.network.base.Packet;
import com.faboslav.friendsandfoes.network.base.PacketHandler;
import com.faboslav.friendsandfoes.platform.ModVersion;
import net.minecraft.client.MinecraftClient;
import com.faboslav.friendsandfoes.util.client.PlayerProvider;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.util.Identifier;
Expand Down Expand Up @@ -47,7 +47,7 @@ public static <T extends Packet<T>> void registerS2CPacket(
NetworkEvent.Context context = ctx.get();
PlayerEntity player = null;
if (context.getSender() == null) {
player = MinecraftClient.getInstance().player;
player = PlayerProvider.getClientPlayer();
}

if (player != null) {
Expand Down

0 comments on commit 50ddf69

Please sign in to comment.