Search in sources :

Example 1 with CompoundTag

use of net.aufdemrand.denizen.nms.util.jnbt.CompoundTag in project Denizen-For-Bukkit by DenizenScript.

the class PacketHelper_v1_10_R1 method showBannerUpdate.

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

Example 2 with CompoundTag

use of net.aufdemrand.denizen.nms.util.jnbt.CompoundTag in project Denizen-For-Bukkit by DenizenScript.

the class ImprovedOfflinePlayer method setFlySpeed.

public void setFlySpeed(float speed) {
    CompoundTag compoundTag = (CompoundTag) this.compound.getValue().get("abilities");
    compoundTag = compoundTag.createBuilder().putFloat("flySpeed", speed).build();
    this.compound = compound.createBuilder().put("abilities", compoundTag).build();
    if (this.autosave) {
        savePlayerData();
    }
}
Also used : CompoundTag(net.aufdemrand.denizen.nms.util.jnbt.CompoundTag)

Example 3 with CompoundTag

use of net.aufdemrand.denizen.nms.util.jnbt.CompoundTag in project Denizen-For-Bukkit by DenizenScript.

the class PacketHelper_v1_8_R3 method showBannerUpdate.

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

Example 4 with CompoundTag

use of net.aufdemrand.denizen.nms.util.jnbt.CompoundTag in project Denizen-For-Bukkit by DenizenScript.

the class PacketHelper_v1_11_R1 method showBannerUpdate.

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

Example 5 with CompoundTag

use of net.aufdemrand.denizen.nms.util.jnbt.CompoundTag in project Denizen-For-Bukkit by DenizenScript.

the class PacketHelper_v1_9_R2 method showBannerUpdate.

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

Aggregations

CompoundTag (net.aufdemrand.denizen.nms.util.jnbt.CompoundTag)6 ArrayList (java.util.ArrayList)4 HashMap (java.util.HashMap)4 ListTag (net.aufdemrand.denizen.nms.util.jnbt.ListTag)4 Pattern (org.bukkit.block.banner.Pattern)4