Search in sources :

Example 1 with ParticleParamBlock

use of net.minecraft.server.v1_16_R3.ParticleParamBlock in project RoseStacker by Rosewood-Development.

the class HologramImpl method update.

@Override
protected void update(Player player) {
    Boolean visible = this.watchers.get(player);
    if (visible == null)
        return;
    List<DataWatcher.Item<?>> dataItems = new ArrayList<>();
    Optional<IChatBaseComponent> nameComponent = Optional.of(CraftChatMessage.fromStringOrNull(this.text));
    dataItems.add(new DataWatcher.Item<>(DataWatcherRegistry.f.a(2), nameComponent));
    dataItems.add(new DataWatcher.Item<>(DataWatcherRegistry.i.a(3), visible));
    dataItems.add(new DataWatcher.Item<>(DataWatcherRegistry.c.a(7), 0.5F));
    dataItems.add(new DataWatcher.Item<>(DataWatcherRegistry.i.a(9), true));
    dataItems.add(new DataWatcher.Item<>(DataWatcherRegistry.j.a(10), new ParticleParamBlock(Particles.BLOCK, Blocks.AIR.getBlockData())));
    PacketPlayOutEntityMetadata packet = new PacketPlayOutEntityMetadata(this.entityId, new DataWatcherWrapper(dataItems), false);
    ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
}
Also used : ArrayList(java.util.ArrayList) PacketPlayOutEntityMetadata(net.minecraft.server.v1_16_R2.PacketPlayOutEntityMetadata) IChatBaseComponent(net.minecraft.server.v1_16_R2.IChatBaseComponent) DataWatcherWrapper(dev.rosewood.rosestacker.nms.v1_16_R2.entity.DataWatcherWrapper) CraftPlayer(org.bukkit.craftbukkit.v1_16_R2.entity.CraftPlayer) ParticleParamBlock(net.minecraft.server.v1_16_R2.ParticleParamBlock) DataWatcher(net.minecraft.server.v1_16_R2.DataWatcher)

Example 2 with ParticleParamBlock

use of net.minecraft.server.v1_16_R3.ParticleParamBlock in project RoseStacker by Rosewood-Development.

the class HologramImpl method update.

@Override
protected void update(Player player) {
    Boolean visible = this.watchers.get(player);
    if (visible == null)
        return;
    List<DataWatcher.Item<?>> dataItems = new ArrayList<>();
    Optional<IChatBaseComponent> nameComponent = Optional.of(CraftChatMessage.fromStringOrNull(this.text));
    dataItems.add(new DataWatcher.Item<>(DataWatcherRegistry.f.a(2), nameComponent));
    dataItems.add(new DataWatcher.Item<>(DataWatcherRegistry.i.a(3), visible));
    dataItems.add(new DataWatcher.Item<>(DataWatcherRegistry.c.a(7), 0.5F));
    dataItems.add(new DataWatcher.Item<>(DataWatcherRegistry.i.a(9), true));
    dataItems.add(new DataWatcher.Item<>(DataWatcherRegistry.j.a(10), new ParticleParamBlock(Particles.BLOCK, Blocks.AIR.getBlockData())));
    PacketPlayOutEntityMetadata packet = new PacketPlayOutEntityMetadata(this.entityId, new DataWatcherWrapper(dataItems), false);
    ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
}
Also used : ArrayList(java.util.ArrayList) PacketPlayOutEntityMetadata(net.minecraft.server.v1_16_R3.PacketPlayOutEntityMetadata) IChatBaseComponent(net.minecraft.server.v1_16_R3.IChatBaseComponent) DataWatcherWrapper(dev.rosewood.rosestacker.nms.v1_16_R3.entity.DataWatcherWrapper) CraftPlayer(org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer) ParticleParamBlock(net.minecraft.server.v1_16_R3.ParticleParamBlock) DataWatcher(net.minecraft.server.v1_16_R3.DataWatcher)

Aggregations

ArrayList (java.util.ArrayList)2 DataWatcherWrapper (dev.rosewood.rosestacker.nms.v1_16_R2.entity.DataWatcherWrapper)1 DataWatcherWrapper (dev.rosewood.rosestacker.nms.v1_16_R3.entity.DataWatcherWrapper)1 DataWatcher (net.minecraft.server.v1_16_R2.DataWatcher)1 IChatBaseComponent (net.minecraft.server.v1_16_R2.IChatBaseComponent)1 PacketPlayOutEntityMetadata (net.minecraft.server.v1_16_R2.PacketPlayOutEntityMetadata)1 ParticleParamBlock (net.minecraft.server.v1_16_R2.ParticleParamBlock)1 DataWatcher (net.minecraft.server.v1_16_R3.DataWatcher)1 IChatBaseComponent (net.minecraft.server.v1_16_R3.IChatBaseComponent)1 PacketPlayOutEntityMetadata (net.minecraft.server.v1_16_R3.PacketPlayOutEntityMetadata)1 ParticleParamBlock (net.minecraft.server.v1_16_R3.ParticleParamBlock)1 CraftPlayer (org.bukkit.craftbukkit.v1_16_R2.entity.CraftPlayer)1 CraftPlayer (org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer)1