Skip to content

Commit

Permalink
fix: fixed fake player entity for 1.19.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Gurkengewuerz committed Apr 9, 2023
1 parent b38d0f7 commit 16d0c28
Showing 1 changed file with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
package de.mc8051.clientenhancements.client;

import com.mojang.authlib.GameProfile;
import net.minecraft.client.network.AbstractClientPlayerEntity;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.client.network.OtherClientPlayerEntity;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.Entity;
import net.minecraft.entity.data.DataTracker;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.Identifier;

public class FakePlayerEntity extends OtherClientPlayerEntity {
import java.util.UUID;

public class FakePlayerEntity extends AbstractClientPlayerEntity {

private ClientPlayerEntity player;
private ClientWorld world;

public FakePlayerEntity(ClientPlayerEntity player, ClientWorld world) {
super(world, player.getGameProfile());
super(world, new GameProfile(UUID.randomUUID(), player.getName().getString()));

this.player = player;
this.world = world;
Expand Down Expand Up @@ -61,4 +65,12 @@ public void despawn() {
public void resetPlayerPosition() {
player.refreshPositionAndAngles(getX(), getY(), getZ(), getYaw(), getPitch());
}

@Override
public Identifier getSkinTexture() {
if (hasSkinTexture())
return super.getSkinTexture();
else
return player.getSkinTexture();
}
}

0 comments on commit 16d0c28

Please sign in to comment.