Search in sources :

Example 1 with JNBTListTag

use of com.denizenscript.denizen.nms.util.jnbt.JNBTListTag in project Denizen-For-Bukkit by DenizenScript.

the class PacketHelperImpl method showBannerUpdate.

@Override
public void showBannerUpdate(Player player, Location location, DyeColor base, List<Pattern> patterns) {
    List<CompoundTag> nbtPatterns = new ArrayList<>();
    for (Pattern pattern : patterns) {
        nbtPatterns.add(NMSHandler.getInstance().createCompoundTag(new HashMap<>()).createBuilder().putInt("Color", pattern.getColor().getDyeData()).putString("Pattern", pattern.getPattern().getIdentifier()).build());
    }
    CompoundTag compoundTag = NMSHandler.getBlockHelper().getNbtData(location.getBlock()).createBuilder().put("Patterns", new JNBTListTag(CompoundTag.class, nbtPatterns)).build();
    showTileEntityData(player, location, 3, compoundTag);
}
Also used : Pattern(org.bukkit.block.banner.Pattern) JNBTListTag(com.denizenscript.denizen.nms.util.jnbt.JNBTListTag) CompoundTag(com.denizenscript.denizen.nms.util.jnbt.CompoundTag)

Example 2 with JNBTListTag

use of com.denizenscript.denizen.nms.util.jnbt.JNBTListTag in project Denizen-For-Bukkit by DenizenScript.

the class PacketHelperImpl method showBannerUpdate.

@Override
public void showBannerUpdate(Player player, Location location, DyeColor base, List<Pattern> patterns) {
    List<CompoundTag> nbtPatterns = new ArrayList<>();
    for (Pattern pattern : patterns) {
        nbtPatterns.add(NMSHandler.getInstance().createCompoundTag(new HashMap<>()).createBuilder().putInt("Color", pattern.getColor().getDyeData()).putString("Pattern", pattern.getPattern().getIdentifier()).build());
    }
    CompoundTag compoundTag = NMSHandler.getBlockHelper().getNbtData(location.getBlock()).createBuilder().put("Patterns", new JNBTListTag(CompoundTag.class, nbtPatterns)).build();
    showTileEntityData(player, location, 3, compoundTag);
}
Also used : Pattern(org.bukkit.block.banner.Pattern) JNBTListTag(com.denizenscript.denizen.nms.util.jnbt.JNBTListTag) CompoundTag(com.denizenscript.denizen.nms.util.jnbt.CompoundTag)

Example 3 with JNBTListTag

use of com.denizenscript.denizen.nms.util.jnbt.JNBTListTag in project Denizen-For-Bukkit by DenizenScript.

the class PacketHelperImpl method showBannerUpdate.

@Override
public void showBannerUpdate(Player player, Location location, DyeColor base, List<Pattern> patterns) {
    List<CompoundTag> nbtPatterns = new ArrayList<>();
    for (Pattern pattern : patterns) {
        nbtPatterns.add(NMSHandler.getInstance().createCompoundTag(new HashMap<>()).createBuilder().putInt("Color", pattern.getColor().getDyeData()).putString("Pattern", pattern.getPattern().getIdentifier()).build());
    }
    CompoundTag compoundTag = NMSHandler.getBlockHelper().getNbtData(location.getBlock()).createBuilder().put("Patterns", new JNBTListTag(CompoundTag.class, nbtPatterns)).build();
    showTileEntityData(player, location, 3, compoundTag);
}
Also used : Pattern(org.bukkit.block.banner.Pattern) JNBTListTag(com.denizenscript.denizen.nms.util.jnbt.JNBTListTag) CompoundTag(com.denizenscript.denizen.nms.util.jnbt.CompoundTag)

Aggregations

CompoundTag (com.denizenscript.denizen.nms.util.jnbt.CompoundTag)3 JNBTListTag (com.denizenscript.denizen.nms.util.jnbt.JNBTListTag)3 Pattern (org.bukkit.block.banner.Pattern)3