Search in sources :

Example 1 with WrapperPlayServerPlayerInfo

use of com.comphenix.packetwrapper.WrapperPlayServerPlayerInfo in project AdvancedReplay by Jumper251.

the class PacketNPC method getInfoAddPacket.

private WrapperPlayServerPlayerInfo getInfoAddPacket() {
    WrapperPlayServerPlayerInfo infoPacket = new WrapperPlayServerPlayerInfo();
    infoPacket.setAction(EnumWrappers.PlayerInfoAction.ADD_PLAYER);
    WrappedGameProfile profile = this.profile != null ? this.profile : new WrappedGameProfile(this.uuid, this.name);
    PlayerInfoData data = new PlayerInfoData(profile, 1, EnumWrappers.NativeGameMode.CREATIVE, WrappedChatComponent.fromText(this.name));
    List<PlayerInfoData> dataList = new ArrayList<PlayerInfoData>();
    dataList.add(data);
    infoPacket.setData(dataList);
    return infoPacket;
}
Also used : PlayerInfoData(com.comphenix.protocol.wrappers.PlayerInfoData) ArrayList(java.util.ArrayList) WrapperPlayServerPlayerInfo(com.comphenix.packetwrapper.WrapperPlayServerPlayerInfo) WrappedGameProfile(com.comphenix.protocol.wrappers.WrappedGameProfile)

Example 2 with WrapperPlayServerPlayerInfo

use of com.comphenix.packetwrapper.WrapperPlayServerPlayerInfo in project AdvancedReplay by Jumper251.

the class PacketNPC method getInfoRemovePacket.

private WrapperPlayServerPlayerInfo getInfoRemovePacket() {
    WrapperPlayServerPlayerInfo infoPacket = new WrapperPlayServerPlayerInfo();
    infoPacket.setAction(EnumWrappers.PlayerInfoAction.REMOVE_PLAYER);
    WrappedGameProfile profile = this.profile != null ? this.profile : new WrappedGameProfile(this.uuid, this.name);
    PlayerInfoData data = new PlayerInfoData(profile, 1, EnumWrappers.NativeGameMode.CREATIVE, WrappedChatComponent.fromText(this.name));
    List<PlayerInfoData> dataList = new ArrayList<PlayerInfoData>();
    dataList.add(data);
    infoPacket.setData(dataList);
    return infoPacket;
}
Also used : PlayerInfoData(com.comphenix.protocol.wrappers.PlayerInfoData) ArrayList(java.util.ArrayList) WrapperPlayServerPlayerInfo(com.comphenix.packetwrapper.WrapperPlayServerPlayerInfo) WrappedGameProfile(com.comphenix.protocol.wrappers.WrappedGameProfile)

Example 3 with WrapperPlayServerPlayerInfo

use of com.comphenix.packetwrapper.WrapperPlayServerPlayerInfo in project AdvancedReplay by Jumper251.

the class PacketNPCOld method getInfoRemovePacket.

private WrapperPlayServerPlayerInfo getInfoRemovePacket() {
    WrapperPlayServerPlayerInfo infoPacket = new WrapperPlayServerPlayerInfo();
    infoPacket.setAction(EnumWrappers.PlayerInfoAction.REMOVE_PLAYER);
    WrappedGameProfile profile = this.profile != null ? this.profile : new WrappedGameProfile(this.uuid, this.name);
    PlayerInfoData data = new PlayerInfoData(profile, 1, EnumWrappers.NativeGameMode.CREATIVE, WrappedChatComponent.fromText(this.name));
    List<PlayerInfoData> dataList = new ArrayList<PlayerInfoData>();
    dataList.add(data);
    infoPacket.setData(dataList);
    return infoPacket;
}
Also used : PlayerInfoData(com.comphenix.protocol.wrappers.PlayerInfoData) ArrayList(java.util.ArrayList) WrapperPlayServerPlayerInfo(com.comphenix.packetwrapper.WrapperPlayServerPlayerInfo) WrappedGameProfile(com.comphenix.protocol.wrappers.WrappedGameProfile)

Example 4 with WrapperPlayServerPlayerInfo

use of com.comphenix.packetwrapper.WrapperPlayServerPlayerInfo in project AdvancedReplay by Jumper251.

the class PacketNPCOld method getInfoAddPacket.

private WrapperPlayServerPlayerInfo getInfoAddPacket() {
    WrapperPlayServerPlayerInfo infoPacket = new WrapperPlayServerPlayerInfo();
    infoPacket.setAction(EnumWrappers.PlayerInfoAction.ADD_PLAYER);
    WrappedGameProfile profile = this.profile != null ? this.profile : new WrappedGameProfile(this.uuid, this.name);
    PlayerInfoData data = new PlayerInfoData(profile, 1, EnumWrappers.NativeGameMode.CREATIVE, WrappedChatComponent.fromText(this.name));
    List<PlayerInfoData> dataList = new ArrayList<PlayerInfoData>();
    dataList.add(data);
    infoPacket.setData(dataList);
    return infoPacket;
}
Also used : PlayerInfoData(com.comphenix.protocol.wrappers.PlayerInfoData) ArrayList(java.util.ArrayList) WrapperPlayServerPlayerInfo(com.comphenix.packetwrapper.WrapperPlayServerPlayerInfo) WrappedGameProfile(com.comphenix.protocol.wrappers.WrappedGameProfile)

Aggregations

WrapperPlayServerPlayerInfo (com.comphenix.packetwrapper.WrapperPlayServerPlayerInfo)4 PlayerInfoData (com.comphenix.protocol.wrappers.PlayerInfoData)4 WrappedGameProfile (com.comphenix.protocol.wrappers.WrappedGameProfile)4 ArrayList (java.util.ArrayList)4