9
0
mirror of https://github.com/HibiscusMC/HMCCosmetics.git synced 2026-01-01 05:16:42 +00:00

Added skin overlay on wardrobe

This commit is contained in:
Fisher2911
2022-02-16 23:51:01 -05:00
parent f58d328bae
commit 832980f593
12 changed files with 84 additions and 3 deletions

View File

@@ -6,6 +6,7 @@ import com.comphenix.protocol.reflect.StructureModifier;
import com.comphenix.protocol.wrappers.EnumWrappers;
import com.comphenix.protocol.wrappers.PlayerInfoData;
import com.comphenix.protocol.wrappers.WrappedChatComponent;
import com.comphenix.protocol.wrappers.WrappedDataWatcher;
import com.comphenix.protocol.wrappers.WrappedGameProfile;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.properties.Property;
@@ -77,6 +78,23 @@ public class PlayerPackets_1_16_R3 implements PlayerPackets {
return playerPacket;
}
@Override
public PacketContainer getOverlayPacket(final int entityId) {
final PacketContainer metaContainer = new PacketContainer(PacketType.Play.Server.ENTITY_METADATA);
WrappedDataWatcher metaData = new WrappedDataWatcher();
final WrappedDataWatcher.Serializer byteSerializer = WrappedDataWatcher.Registry.get(Byte.class);
final byte mask = 0x01 | 0x02 | 0x04 | 0x08 | 0x010 | 0x020 | 0x40;
metaData.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(16, byteSerializer), mask);
metaContainer.getIntegers().write(0, entityId);
metaContainer.getWatchableCollectionModifier().write(0, metaData.getWatchableObjects());
return metaContainer;
}
private GameProfile getCopyProfile(final Player player, final UUID uuid) {
final GameProfile playerProfile = ((CraftPlayer) player).getProfile();
final GameProfile profile = new GameProfile(