mirror of
https://github.com/tanyaofei/minecraft-fakeplayer.git
synced 2025-09-14 11:16:46 +08:00
修复假人皮肤没有轮廓的问题
This commit is contained in:
parent
7844e7b481
commit
1a5b136be8
@ -193,4 +193,9 @@ public interface NMSServerPlayer {
|
||||
*/
|
||||
void setPlayBefore();
|
||||
|
||||
/**
|
||||
* 设置客户端选项
|
||||
*/
|
||||
void configClientOptions();
|
||||
|
||||
}
|
||||
|
@ -139,6 +139,7 @@ public class FakePlayer {
|
||||
var network = Main.getVersionSupport().network();
|
||||
network.bindEmptyServerGamePacketListener(Bukkit.getServer(), this.player, address);
|
||||
network.bindEmptyLoginPacketListener(Bukkit.getServer(), this.player, address);
|
||||
handle.configClientOptions(); // 处理皮肤设置问题
|
||||
|
||||
var spawnAt = option.spawnAt().clone();
|
||||
if (Worlds.isOverworld(spawnAt.getWorld())) {
|
||||
|
@ -2,13 +2,20 @@ package io.github.hello09x.fakeplayer.v1_20_R1.network;
|
||||
|
||||
import net.minecraft.network.Connection;
|
||||
import net.minecraft.network.protocol.Packet;
|
||||
import net.minecraft.network.syncher.EntityDataAccessor;
|
||||
import net.minecraft.network.syncher.EntityDataSerializers;
|
||||
import net.minecraft.network.syncher.SynchedEntityData;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.server.network.ServerGamePacketListenerImpl;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class EmptyServerGamePacketListener extends ServerGamePacketListenerImpl {
|
||||
public EmptyServerGamePacketListener(MinecraftServer minecraftServer, Connection networkManager, ServerPlayer entityPlayer) {
|
||||
super(minecraftServer, networkManager, entityPlayer);
|
||||
|
||||
|
||||
public EmptyServerGamePacketListener(@NotNull MinecraftServer minecraftServer, @NotNull Connection networkManager, @NotNull ServerPlayer player) {
|
||||
super(minecraftServer, networkManager, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -6,8 +6,11 @@ import io.github.hello09x.fakeplayer.api.spi.NMSServerPlayer;
|
||||
import io.github.hello09x.fakeplayer.v1_20_R1.network.EmptyAdvancements;
|
||||
import lombok.Getter;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.protocol.game.ServerboundClientInformationPacket;
|
||||
import net.minecraft.server.PlayerAdvancements;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.entity.HumanoidArm;
|
||||
import net.minecraft.world.entity.player.ChatVisiblity;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Entity;
|
||||
@ -197,4 +200,19 @@ public class NMSServerPlayerImpl implements NMSServerPlayer {
|
||||
player.readExtraData(new CompoundTag());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configClientOptions() {
|
||||
var option = new ServerboundClientInformationPacket(
|
||||
"en_us",
|
||||
Bukkit.getViewDistance(),
|
||||
ChatVisiblity.FULL,
|
||||
false,
|
||||
(byte) (0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40),
|
||||
HumanoidArm.RIGHT,
|
||||
false,
|
||||
true
|
||||
);
|
||||
handle.updateOptions(option);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -7,7 +7,10 @@ import io.github.hello09x.fakeplayer.v1_20_R2.network.EmptyAdvancements;
|
||||
import lombok.Getter;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.PlayerAdvancements;
|
||||
import net.minecraft.server.level.ClientInformation;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.entity.HumanoidArm;
|
||||
import net.minecraft.world.entity.player.ChatVisiblity;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Entity;
|
||||
@ -197,4 +200,20 @@ public class NMSServerPlayerImpl implements NMSServerPlayer {
|
||||
player.readExtraData(new CompoundTag());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configClientOptions() {
|
||||
var option = new ClientInformation(
|
||||
"en_us",
|
||||
Bukkit.getViewDistance(),
|
||||
ChatVisiblity.FULL,
|
||||
false,
|
||||
(byte) (0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40),
|
||||
HumanoidArm.RIGHT,
|
||||
false,
|
||||
true
|
||||
);
|
||||
|
||||
handle.updateOptions(option);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user