Java Code Examples for cn.nukkit.nbt.stream.NBTInputStream#readInt()

The following examples show how to use cn.nukkit.nbt.stream.NBTInputStream#readInt() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IntArrayTag.java    From Jupiter with GNU General Public License v3.0 5 votes vote down vote up
@Override
void load(NBTInputStream dis) throws IOException {
    int length = dis.readInt();
    data = new int[length];
    for (int i = 0; i < length; i++) {
        data[i] = dis.readInt();
    }
}
 
Example 2
Source File: ListTag.java    From Jupiter with GNU General Public License v3.0 5 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
void load(NBTInputStream dis) throws IOException {
    type = dis.readByte();
    int size = dis.readInt();

    list = new ArrayList<>();
    for (int i = 0; i < size; i++) {
        Tag tag = Tag.newTag(type, null);
        tag.load(dis);
        list.add((T) tag);
    }
}
 
Example 3
Source File: IntArrayTag.java    From Nukkit with GNU General Public License v3.0 5 votes vote down vote up
@Override
void load(NBTInputStream dis) throws IOException {
    int length = dis.readInt();
    data = new int[length];
    for (int i = 0; i < length; i++) {
        data[i] = dis.readInt();
    }
}
 
Example 4
Source File: ListTag.java    From Nukkit with GNU General Public License v3.0 5 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
void load(NBTInputStream dis) throws IOException {
    type = dis.readByte();
    int size = dis.readInt();

    list = new ArrayList<>(size);
    for (int i = 0; i < size; i++) {
        Tag tag = Tag.newTag(type, null);
        tag.load(dis);
        tag.setName("");
        list.add((T) tag);
    }
}
 
Example 5
Source File: IntArrayTag.java    From Nukkit with GNU General Public License v3.0 5 votes vote down vote up
@Override
void load(NBTInputStream dis) throws IOException {
    int length = dis.readInt();
    data = new int[length];
    for (int i = 0; i < length; i++) {
        data[i] = dis.readInt();
    }
}
 
Example 6
Source File: ListTag.java    From Nukkit with GNU General Public License v3.0 5 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
void load(NBTInputStream dis) throws IOException {
    type = dis.readByte();
    int size = dis.readInt();

    list = new ArrayList<>();
    for (int i = 0; i < size; i++) {
        Tag tag = Tag.newTag(type, null);
        tag.load(dis);
        list.add((T) tag);
    }
}
 
Example 7
Source File: ByteArrayTag.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
@Override
void load(NBTInputStream dis) throws IOException {
    int length = dis.readInt();
    data = new byte[length];
    dis.readFully(data);
}
 
Example 8
Source File: IntTag.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
@Override
void load(NBTInputStream dis) throws IOException {
    data = dis.readInt();
}
 
Example 9
Source File: ByteArrayTag.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
void load(NBTInputStream dis) throws IOException {
    int length = dis.readInt();
    data = new byte[length];
    dis.readFully(data);
}
 
Example 10
Source File: IntTag.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
void load(NBTInputStream dis) throws IOException {
    data = dis.readInt();
}
 
Example 11
Source File: ByteArrayTag.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
void load(NBTInputStream dis) throws IOException {
    int length = dis.readInt();
    data = new byte[length];
    dis.readFully(data);
}
 
Example 12
Source File: IntTag.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
@Override
void load(NBTInputStream dis) throws IOException {
    data = dis.readInt();
}