API Surface (2)
boolean hasNext()
Tag next()
Code Graph: Dependencies (1)
Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.
Full Source
CollectionTag.java49 lines · Minecraft 26.3 · verbatim
| 1 | package net.minecraft.nbt;
|
| 2 |
|
| 3 | import java.util.Iterator;
|
| 4 | import java.util.NoSuchElementException;
|
| 5 | import java.util.stream.Stream;
|
| 6 | import java.util.stream.StreamSupport;
|
| 7 |
|
| 8 | public sealed interface CollectionTag extends Tag, Iterable<Tag> permits ListTag, ByteArrayTag, IntArrayTag, LongArrayTag {
|
| 9 | void clear();
|
| 10 |
|
| 11 | boolean setTag(int index, Tag tag);
|
| 12 |
|
| 13 | boolean addTag(int index, Tag tag);
|
| 14 |
|
| 15 | Tag remove(int index);
|
| 16 |
|
| 17 | Tag get(int index);
|
| 18 |
|
| 19 | int size();
|
| 20 |
|
| 21 | default boolean isEmpty() {
|
| 22 | return this.size() == 0;
|
| 23 | }
|
| 24 |
|
| 25 | @Override
|
| 26 | default Iterator<Tag> iterator() {
|
| 27 | return new Iterator<Tag>() {
|
| 28 | private int index;
|
| 29 |
|
| 30 | @Override
|
| 31 | public boolean hasNext() {
|
| 32 | return this.index < CollectionTag.this.size();
|
| 33 | }
|
| 34 |
|
| 35 | public Tag next() {
|
| 36 | if (!this.hasNext()) {
|
| 37 | throw new NoSuchElementException();
|
| 38 | } else {
|
| 39 | return CollectionTag.this.get(this.index++);
|
| 40 | }
|
| 41 | }
|
| 42 | };
|
| 43 | }
|
| 44 |
|
| 45 | default Stream<Tag> stream() {
|
| 46 | return StreamSupport.stream(this.spliterator(), false);
|
| 47 | }
|
| 48 | }
|
| 49 |
|
Decompiled Minecraft 26.3 source of CollectionTag (net/minecraft/nbt/CollectionTag.java) with Mojang official mappings, stored verbatim on the site.