public static CompoundTag getTag() { CompoundTag tag = new CompoundTag(); tag.putInt("int", 5); tag.putString("string", "text"); tag.putList("list", TagType.FLOAT, Arrays.asList(1.f, 2.f, 3.f)); tag.putCompound("compound", new CompoundTag()); return tag; }
public static List<CompoundTag> toNBT(BannerPattern pattern) { List<CompoundTag> patterns = new ArrayList<>(); for (BannerPattern.BannerLayer layer : pattern.getLayers()) { CompoundTag layerTag = new CompoundTag(); layerTag.putString("Pattern", layer.getTexture().getCode()); layerTag.putInt("Color", layer.getColor().getDyeData()); patterns.add(layerTag); } return patterns; }