From 410f69edfbc6ee7c70e30306a6bc030a408b2c27 Mon Sep 17 00:00:00 2001 From: MazeXD Date: Tue, 9 Sep 2014 22:52:02 +0200 Subject: [PATCH 1/3] Add NBT interfaces --- .../spongepowered/api/nbt/ByteArrayTag.java | 36 +++ .../org/spongepowered/api/nbt/ByteTag.java | 36 +++ .../spongepowered/api/nbt/CompoundTag.java | 260 ++++++++++++++++++ .../org/spongepowered/api/nbt/DoubleTag.java | 36 +++ .../org/spongepowered/api/nbt/EndTag.java | 31 +++ .../org/spongepowered/api/nbt/FloatTag.java | 36 +++ .../spongepowered/api/nbt/IntArrayTag.java | 36 +++ .../org/spongepowered/api/nbt/IntTag.java | 36 +++ .../org/spongepowered/api/nbt/ListTag.java | 153 +++++++++++ .../org/spongepowered/api/nbt/LongTag.java | 36 +++ .../org/spongepowered/api/nbt/ShortTag.java | 36 +++ .../org/spongepowered/api/nbt/StringTag.java | 36 +++ .../java/org/spongepowered/api/nbt/Tag.java | 80 ++++++ .../org/spongepowered/api/nbt/TagFactory.java | 107 +++++++ .../org/spongepowered/api/nbt/TagType.java | 43 +++ 15 files changed, 998 insertions(+) create mode 100644 src/main/java/org/spongepowered/api/nbt/ByteArrayTag.java create mode 100644 src/main/java/org/spongepowered/api/nbt/ByteTag.java create mode 100644 src/main/java/org/spongepowered/api/nbt/CompoundTag.java create mode 100644 src/main/java/org/spongepowered/api/nbt/DoubleTag.java create mode 100644 src/main/java/org/spongepowered/api/nbt/EndTag.java create mode 100644 src/main/java/org/spongepowered/api/nbt/FloatTag.java create mode 100644 src/main/java/org/spongepowered/api/nbt/IntArrayTag.java create mode 100644 src/main/java/org/spongepowered/api/nbt/IntTag.java create mode 100644 src/main/java/org/spongepowered/api/nbt/ListTag.java create mode 100644 src/main/java/org/spongepowered/api/nbt/LongTag.java create mode 100644 src/main/java/org/spongepowered/api/nbt/ShortTag.java create mode 100644 src/main/java/org/spongepowered/api/nbt/StringTag.java create mode 100644 src/main/java/org/spongepowered/api/nbt/Tag.java create mode 100644 src/main/java/org/spongepowered/api/nbt/TagFactory.java create mode 100644 src/main/java/org/spongepowered/api/nbt/TagType.java diff --git a/src/main/java/org/spongepowered/api/nbt/ByteArrayTag.java b/src/main/java/org/spongepowered/api/nbt/ByteArrayTag.java new file mode 100644 index 00000000000..0f32c76534e --- /dev/null +++ b/src/main/java/org/spongepowered/api/nbt/ByteArrayTag.java @@ -0,0 +1,36 @@ +/** + * This file is part of SpongeAPI, licensed under the MIT License (MIT). + * + * Copyright (c) 2014 SpongePowered + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.spongepowered.api.nbt; + +/** + * NBT tag representing a bytearray + */ +public interface ByteArrayTag extends Tag { + /** + * Gets the value of {@link ByteArrayTag} + * + * @return The value of {@link ByteArrayTag} + */ + byte[] getValue(); +} diff --git a/src/main/java/org/spongepowered/api/nbt/ByteTag.java b/src/main/java/org/spongepowered/api/nbt/ByteTag.java new file mode 100644 index 00000000000..696759f54b8 --- /dev/null +++ b/src/main/java/org/spongepowered/api/nbt/ByteTag.java @@ -0,0 +1,36 @@ +/** + * This file is part of SpongeAPI, licensed under the MIT License (MIT). + * + * Copyright (c) 2014 SpongePowered + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.spongepowered.api.nbt; + +/** + * NBT tag representing a byte + */ +public interface ByteTag extends Tag.Primitive { + /** + * Gets the value of {@link ByteTag} + * + * @return The value of {@link ByteTag} + */ + byte getValue(); +} diff --git a/src/main/java/org/spongepowered/api/nbt/CompoundTag.java b/src/main/java/org/spongepowered/api/nbt/CompoundTag.java new file mode 100644 index 00000000000..5d937967fba --- /dev/null +++ b/src/main/java/org/spongepowered/api/nbt/CompoundTag.java @@ -0,0 +1,260 @@ +/** + * This file is part of SpongeAPI, licensed under the MIT License (MIT). + * + * Copyright (c) 2014 SpongePowered + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.spongepowered.api.nbt; + +import java.util.Set; + +/** + * NBT tag representing a map + */ +public interface CompoundTag extends Tag { + /** + * Returns all keys of {@link CompoundTag} + * + * @return All keys of {@link CompoundTag} + */ + Set keys(); + + /** + * Checks if the {@link CompoundTag} contains a {@link Tag} with + * {@code key} + * + * @param key + * @return {@code true} if the {@link CompoundTag} contains a {@link Tag} with + * {@code key}, otherwise {@code false} + */ + boolean hasKey(String key); + + /** + * Checks if the {@link CompoundTag} contains a {@link Tag} of {@link TagType} + * with {@code key} + * + * @param key + * @param type + * @return {@code true} if the {@link CompoundTag} contains a {@link Tag} of + * {@link TagType} with {@code key}, otherwise {@code false} + */ + boolean hasKey(String key, TagType type); + + /** + * Sets {@code key} in {@link CompoundTag} to {@code value} + * + * @param key + * @return + */ + TagType getType(String key); + + /** + * Sets {@code key} in {@link CompoundTag} to {@code value} + * + * @param key + * @return + */ + boolean getBoolean(String key); + + /** + * Sets {@code key} in {@link CompoundTag} to {@code value} + * + * @param key + * @param value + */ + void setBoolean(String key, boolean value); + + /** + * Gets the {@link Tag} with {@code key} as byte + * + * @param key + * @return The {@link Tag} with {@code key} as byte + */ + byte getByte(String key); + + /** + * Sets {@code key} in {@link CompoundTag} to {@code value} + * + * @param key + * @param value + */ + void setByte(String key, byte value); + + /** + * Gets the {@link Tag} with {@code key} as short + * + * @param key + * @return The {@link Tag} with {@code key} as short + */ + short getShort(String key); + + /** + * Sets {@code key} in {@link CompoundTag} to {@code value} + * + * @param key + * @param value + */ + void setShort(String key, short value); + + /** + * Gets the {@link Tag} with {@code key} as int + * + * @param key + * @return The {@link Tag} with {@code key} as int + */ + int getInteger(String key); + + /** + * Sets {@code key} in {@link CompoundTag} to {@code value} + * + * @param key + * @param value + */ + void setInteger(String key, int value); + + /** + * Gets the {@link Tag} with {@code key} as long + * + * @param key + * @return The {@link Tag} with {@code key} as long + */ + long getLong(String key); + + /** + * Sets {@code key} in {@link CompoundTag} to {@code value} + * + * @param key + * @param value + */ + void setLong(String key, long value); + + /** + * Gets the {@link Tag} with {@code key} as float + * + * @param key + * @return The {@link Tag} with {@code key} as float + */ + float getFloat(String key); + + /** + * Sets {@code key} in {@link CompoundTag} to {@code value} + * + * @param key + * @param value + */ + void setFloat(String key, float value); + + /** + * Gets the {@link Tag} with {@code key} as double + * + * @param key + * @return The {@link Tag} with {@code key} as double + */ + double getDouble(String key); + + /** + * Sets {@code key} in {@link CompoundTag} to {@code value} + * + * @param key + * @param value + */ + void setDouble(String key, double value); + + /** + * Gets the {@link Tag} with {@code key} as byte[] + * + * @param key + * @return The {@link Tag} with {@code key} as byte[] + */ + byte[] getByteArray(String key); + + /** + * Sets {@code key} in {@link CompoundTag} to {@code value} + * + * @param key + * @param value + */ + void setByteArray(String key, byte[] value); + + /** + * Gets the {@link Tag} with {@code key} as int[] + * + * @param key + * @return The {@link Tag} with {@code key} as int[] + */ + int[] getIntArray(String key); + + /** + * Sets {@code key} in {@link CompoundTag} to {@code value} + * + * @param key + * @param value + */ + void setIntArray(String key, int[] value); + + /** + * Gets the {@link Tag} with {@code key} as {@link ListTag} of {@link TagType} + * + * @param key + * @param type + * @return The {@link Tag} with {@code key} as {@link ListTag} of {@link TagType} + */ + ListTag getList(String key, TagType type); + + /** + * Sets {@code list} in {@link CompoundTag} to {@code value} + * + * @param key + * @param list + */ + void setList(String key, ListTag list); + + /** + * Gets the {@link Tag} with {@code key} as {@link CompoundTag} + * + * @param key + * @return + */ + CompoundTag getCompound(String key); + + /** + * Sets {@code compound} in {@link CompoundTag} to {@code value} + * + * @param key + * @param compound + */ + void setCompound(String key, CompoundTag compound); + + /** + * Gets the {@link Tag} with {@code key} + * + * @param key + * @return + */ + Tag getTag(String key); + + /** + * Sets {@code tag} in {@link CompoundTag} to {@code value} + * + * @param key + * @param tag + */ + void setTag(String key, Tag tag); +} diff --git a/src/main/java/org/spongepowered/api/nbt/DoubleTag.java b/src/main/java/org/spongepowered/api/nbt/DoubleTag.java new file mode 100644 index 00000000000..1bdca0b9b34 --- /dev/null +++ b/src/main/java/org/spongepowered/api/nbt/DoubleTag.java @@ -0,0 +1,36 @@ +/** + * This file is part of SpongeAPI, licensed under the MIT License (MIT). + * + * Copyright (c) 2014 SpongePowered + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.spongepowered.api.nbt; + +/** + * NBT tag representing a double + */ +public interface DoubleTag extends Tag.Primitive { + /** + * Gets the value of {@link DoubleTag} + * + * @return The value of {@link DoubleTag} + */ + double getValue(); +} diff --git a/src/main/java/org/spongepowered/api/nbt/EndTag.java b/src/main/java/org/spongepowered/api/nbt/EndTag.java new file mode 100644 index 00000000000..1cb76945821 --- /dev/null +++ b/src/main/java/org/spongepowered/api/nbt/EndTag.java @@ -0,0 +1,31 @@ +/** + * This file is part of SpongeAPI, licensed under the MIT License (MIT). + * + * Copyright (c) 2014 SpongePowered + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.spongepowered.api.nbt; + +/** + * NBT tag representing an end + */ +public interface EndTag extends Tag { + +} diff --git a/src/main/java/org/spongepowered/api/nbt/FloatTag.java b/src/main/java/org/spongepowered/api/nbt/FloatTag.java new file mode 100644 index 00000000000..a1df7dc367f --- /dev/null +++ b/src/main/java/org/spongepowered/api/nbt/FloatTag.java @@ -0,0 +1,36 @@ +/** + * This file is part of SpongeAPI, licensed under the MIT License (MIT). + * + * Copyright (c) 2014 SpongePowered + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.spongepowered.api.nbt; + +/** + * NBT tag representing a float + */ +public interface FloatTag extends Tag.Primitive { + /** + * Gets the value of {@link FloatTag} + * + * @return The value of {@link FloatTag} + */ + float getValue(); +} diff --git a/src/main/java/org/spongepowered/api/nbt/IntArrayTag.java b/src/main/java/org/spongepowered/api/nbt/IntArrayTag.java new file mode 100644 index 00000000000..d397d563364 --- /dev/null +++ b/src/main/java/org/spongepowered/api/nbt/IntArrayTag.java @@ -0,0 +1,36 @@ +/** + * This file is part of SpongeAPI, licensed under the MIT License (MIT). + * + * Copyright (c) 2014 SpongePowered + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.spongepowered.api.nbt; + +/** + * NBT tag representing an intarray + */ +public interface IntArrayTag extends Tag { + /** + * Gets the value of {@link IntArrayTag} + * + * @return The value of {@link IntArrayTag} + */ + int[] getValue(); +} diff --git a/src/main/java/org/spongepowered/api/nbt/IntTag.java b/src/main/java/org/spongepowered/api/nbt/IntTag.java new file mode 100644 index 00000000000..4b08052df74 --- /dev/null +++ b/src/main/java/org/spongepowered/api/nbt/IntTag.java @@ -0,0 +1,36 @@ +/** + * This file is part of SpongeAPI, licensed under the MIT License (MIT). + * + * Copyright (c) 2014 SpongePowered + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.spongepowered.api.nbt; + +/** + * NBT tag representing an int + */ +public interface IntTag extends Tag.Primitive { + /** + * Gets the value of {@link IntTag} + * + * @return The value of {@link IntTag} + */ + int getValue(); +} diff --git a/src/main/java/org/spongepowered/api/nbt/ListTag.java b/src/main/java/org/spongepowered/api/nbt/ListTag.java new file mode 100644 index 00000000000..7fea023f7bf --- /dev/null +++ b/src/main/java/org/spongepowered/api/nbt/ListTag.java @@ -0,0 +1,153 @@ +/** + * This file is part of SpongeAPI, licensed under the MIT License (MIT). + * + * Copyright (c) 2014 SpongePowered + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.spongepowered.api.nbt; + +/** + * NBT tag representing a list + */ +public interface ListTag extends Tag { + /** + * Returns the count of tags in {@link ListTag} + * + * @return The count of tags in {@link ListTag} + */ + int count(); + + /** + * Gets the {@link TagType} of {@link Tag}s in {@link ListTag} + * + * @return The {@link TagType} of {@link Tag}s in {@link ListTag} + */ + TagType getListType(); + + /** + * Gets the {@link Tag} at {@code index} as byte + * + * @param index + * @return + */ + byte getByte(int index); + + /** + * Gets the {@link Tag} at {@code index} as short + * + * @param index + * @return + */ + short getShort(int index); + + /** + * Gets the {@link Tag} at {@code index} as int + * + * @param index + * @return + */ + int getInteger(int index); + + /** + * Gets the {@link Tag} at {@code index} as long + * + * @param index + * @return + */ + long getLong(int index); + + /** + * Gets the {@link Tag} at {@code index} as float + * + * @param index + * @return + */ + float getFloat(int index); + + /** + * Gets the {@link Tag} at {@code index} as double + * + * @param index + * @return + */ + double getDouble(int index); + + /** + * Gets the {@link Tag} at {@code index} as String + * + * @param index + * @return + */ + String getString(int index); + + /** + * Gets the {@link Tag} at {@code index} as byte[] + * + * @param index + * @return + */ + byte[] getByteArray(int index); + + /** + * Gets the {@link Tag} at {@code index} as int[] + * + * @param index + * @return + */ + int[] getIntArray(int index); + + /** + * Gets the {@link Tag} at {@code index} as {@link ListTag} + * + * @param index + * @return + */ + ListTag getList(int index); + + /** + * Gets the {@link Tag} at {@code index} as {@link CompoundTag} + * + * @param index + * @return + */ + CompoundTag getCompound(int index); + + /** + * Appends the {@link Tag} to {@code ListTag} + * + * @param tag + */ + void append(Tag tag); + + /** + * Inserts the {@link Tag} at {@code index} in {@code ListTag} + * + * @param index + * @param tag + */ + void insert(int index, Tag tag); + + /** + * Removes the {@link Tag} at {@code index} of {@code ListTag} + * + * @param index + */ + void remove(int index); +} diff --git a/src/main/java/org/spongepowered/api/nbt/LongTag.java b/src/main/java/org/spongepowered/api/nbt/LongTag.java new file mode 100644 index 00000000000..bf4f41b33aa --- /dev/null +++ b/src/main/java/org/spongepowered/api/nbt/LongTag.java @@ -0,0 +1,36 @@ +/** + * This file is part of SpongeAPI, licensed under the MIT License (MIT). + * + * Copyright (c) 2014 SpongePowered + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.spongepowered.api.nbt; + +/** + * NBT tag representing a long + */ +public interface LongTag extends Tag.Primitive { + /** + * Gets the value of {@link LongTag} + * + * @return The value of {@link LongTag} + */ + long getValue(); +} diff --git a/src/main/java/org/spongepowered/api/nbt/ShortTag.java b/src/main/java/org/spongepowered/api/nbt/ShortTag.java new file mode 100644 index 00000000000..1a7e8718ba3 --- /dev/null +++ b/src/main/java/org/spongepowered/api/nbt/ShortTag.java @@ -0,0 +1,36 @@ +/** + * This file is part of SpongeAPI, licensed under the MIT License (MIT). + * + * Copyright (c) 2014 SpongePowered + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.spongepowered.api.nbt; + +/** + * NBT tag representing a short + */ +public interface ShortTag extends Tag.Primitive { + /** + * Gets the value of {@link ShortTag} + * + * @return The value of {@link ShortTag} + */ + short getValue(); +} diff --git a/src/main/java/org/spongepowered/api/nbt/StringTag.java b/src/main/java/org/spongepowered/api/nbt/StringTag.java new file mode 100644 index 00000000000..3d2c083e5bc --- /dev/null +++ b/src/main/java/org/spongepowered/api/nbt/StringTag.java @@ -0,0 +1,36 @@ +/** + * This file is part of SpongeAPI, licensed under the MIT License (MIT). + * + * Copyright (c) 2014 SpongePowered + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.spongepowered.api.nbt; + +/** + * NBT tag representing a string + */ +public interface StringTag extends Tag { + /** + * Gets the value of {@link StringTag} + * + * @return The value of {@link StringTag} + */ + String getValue(); +} diff --git a/src/main/java/org/spongepowered/api/nbt/Tag.java b/src/main/java/org/spongepowered/api/nbt/Tag.java new file mode 100644 index 00000000000..aeb1ca251ce --- /dev/null +++ b/src/main/java/org/spongepowered/api/nbt/Tag.java @@ -0,0 +1,80 @@ +/** + * This file is part of SpongeAPI, licensed under the MIT License (MIT). + * + * Copyright (c) 2014 SpongePowered + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.spongepowered.api.nbt; + +/** + * Base for every NBT tag + */ +public interface Tag extends Cloneable { + /** + * Gets the {@link TagType} of {@link Tag} + * + * @return The {@link TagType} of {@link Tag} + */ + TagType getType(); + + public static interface Primitive extends Tag { + /** + * Returns the value of {@link Tag} as byte + * + * @return The value of {@link Tag} as byte + */ + byte asByte(); + + /** + * Returns the value of {@link Tag} as short + * + * @return The value of {@link Tag} as short + */ + short asShort(); + + /** + * Returns the value of {@link Tag} as int + * + * @return The value of {@link Tag} as int + */ + int asInteger(); + + /** + * Returns the value of {@link Tag} as long + * + * @return The value of {@link Tag} as long + */ + long asLong(); + + /** + * Returns the value of {@link Tag} as float + * + * @return The value of {@link Tag} as float + */ + float asFloat(); + + /** + * Returns the value of {@link Tag} as double + * + * @return The value of {@link Tag} as double + */ + double asDouble(); + } +} diff --git a/src/main/java/org/spongepowered/api/nbt/TagFactory.java b/src/main/java/org/spongepowered/api/nbt/TagFactory.java new file mode 100644 index 00000000000..41b49ea5d80 --- /dev/null +++ b/src/main/java/org/spongepowered/api/nbt/TagFactory.java @@ -0,0 +1,107 @@ +/** + * This file is part of SpongeAPI, licensed under the MIT License (MIT). + * + * Copyright (c) 2014 SpongePowered + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.spongepowered.api.nbt; + +/** + * Factory for {@link Tag}s + */ +public interface TagFactory { + /** + * Creates a new {@link ByteTag} with {@code value} + * + * @param value + * @return The new {@link ByteTag} + */ + ByteTag newByte(byte value); + + /** + * Creates a new {@link ShortTag} with {@code value} + * + * @param value + * @return The new {@link ShortTag} + */ + ShortTag newShort(byte value); + + /** + * Creates a new {@link IntTag} with {@code value} + * + * @param value + * @return The new {@link IntTag} + */ + IntTag newInteger(int value); + + /** + * Creates a new {@link LongTag} with {@code value} + * + * @param value + * @return The new {@link LongTag} + */ + LongTag newLong(long value); + + /** + * Creates a new {@link FloatTag} with {@code value} + * + * @param value + * @return The new {@link FloatTag} + */ + FloatTag newFloat(float value); + + /** + * Creates a new {@link DoubleTag} with {@code value} + * + * @param value + * @return The new {@link DoubleTag} + */ + DoubleTag newDouble(double value); + + /** + * Creates a new {@link ByteArrayTag} with {@code value} + * + * @param value + * @return The new {@link ByteArrayTag} + */ + ByteArrayTag newByteArray(byte[] value); + + /** + * Creates a new {@link IntArrayTag} with {@code value} + * + * @param value + * @return The new {@link IntArrayTag} + */ + IntArrayTag newIntArray(int[] value); + + /** + * Creates a new {@link ListTag} + * + * @return A new {@link ListTag} + */ + ListTag newList(); + + /** + * Creates a new {@link CompoundTag} + * + * @return A new {@link CompoundTag} + */ + CompoundTag newCompound(); +} diff --git a/src/main/java/org/spongepowered/api/nbt/TagType.java b/src/main/java/org/spongepowered/api/nbt/TagType.java new file mode 100644 index 00000000000..a4fef4bb4e0 --- /dev/null +++ b/src/main/java/org/spongepowered/api/nbt/TagType.java @@ -0,0 +1,43 @@ +/** + * This file is part of SpongeAPI, licensed under the MIT License (MIT). + * + * Copyright (c) 2014 SpongePowered + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package org.spongepowered.api.nbt; + +/** + * Enum for NBT tag types + */ +public enum TagType { + BYTE, + DOUBLE, + END, + FLOAT, + INT, + LONG, + SHORT, + STRING, + BYTEARRAY, + INTARRAY, + LIST, + COMPOUND, + PRIMITIVE +} From 3495342e56fd1485f6beb1a36a35ec9df2866e5c Mon Sep 17 00:00:00 2001 From: MazeXD Date: Sun, 14 Sep 2014 08:51:22 +0200 Subject: [PATCH 2/3] Fix javadoc in NBT interfaces --- .../spongepowered/api/nbt/ByteArrayTag.java | 12 +- .../org/spongepowered/api/nbt/ByteTag.java | 12 +- .../spongepowered/api/nbt/CompoundTag.java | 219 +++++++++--------- .../org/spongepowered/api/nbt/DoubleTag.java | 12 +- .../org/spongepowered/api/nbt/EndTag.java | 9 +- .../org/spongepowered/api/nbt/FloatTag.java | 12 +- .../spongepowered/api/nbt/IntArrayTag.java | 12 +- .../org/spongepowered/api/nbt/IntTag.java | 12 +- .../org/spongepowered/api/nbt/ListTag.java | 108 ++++----- .../org/spongepowered/api/nbt/LongTag.java | 12 +- .../org/spongepowered/api/nbt/ShortTag.java | 12 +- .../org/spongepowered/api/nbt/StringTag.java | 12 +- .../java/org/spongepowered/api/nbt/Tag.java | 27 ++- .../org/spongepowered/api/nbt/TagFactory.java | 42 ++-- .../org/spongepowered/api/nbt/TagType.java | 10 +- 15 files changed, 278 insertions(+), 245 deletions(-) diff --git a/src/main/java/org/spongepowered/api/nbt/ByteArrayTag.java b/src/main/java/org/spongepowered/api/nbt/ByteArrayTag.java index 0f32c76534e..cb235ae4aed 100644 --- a/src/main/java/org/spongepowered/api/nbt/ByteArrayTag.java +++ b/src/main/java/org/spongepowered/api/nbt/ByteArrayTag.java @@ -1,7 +1,8 @@ -/** - * This file is part of SpongeAPI, licensed under the MIT License (MIT). +/* + * This file is part of Sponge, licensed under the MIT License (MIT). * - * Copyright (c) 2014 SpongePowered + * Copyright (c) SpongePowered.org + * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,11 +25,12 @@ package org.spongepowered.api.nbt; /** - * NBT tag representing a bytearray + * NBT tag representing an array of bytes. */ public interface ByteArrayTag extends Tag { + /** - * Gets the value of {@link ByteArrayTag} + * Gets the value of {@link ByteArrayTag}. * * @return The value of {@link ByteArrayTag} */ diff --git a/src/main/java/org/spongepowered/api/nbt/ByteTag.java b/src/main/java/org/spongepowered/api/nbt/ByteTag.java index 696759f54b8..e6465d942a1 100644 --- a/src/main/java/org/spongepowered/api/nbt/ByteTag.java +++ b/src/main/java/org/spongepowered/api/nbt/ByteTag.java @@ -1,7 +1,8 @@ -/** - * This file is part of SpongeAPI, licensed under the MIT License (MIT). +/* + * This file is part of Sponge, licensed under the MIT License (MIT). * - * Copyright (c) 2014 SpongePowered + * Copyright (c) SpongePowered.org + * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,11 +25,12 @@ package org.spongepowered.api.nbt; /** - * NBT tag representing a byte + * NBT tag representing a byte. */ public interface ByteTag extends Tag.Primitive { + /** - * Gets the value of {@link ByteTag} + * Gets the value of {@link ByteTag}. * * @return The value of {@link ByteTag} */ diff --git a/src/main/java/org/spongepowered/api/nbt/CompoundTag.java b/src/main/java/org/spongepowered/api/nbt/CompoundTag.java index 5d937967fba..871818100cb 100644 --- a/src/main/java/org/spongepowered/api/nbt/CompoundTag.java +++ b/src/main/java/org/spongepowered/api/nbt/CompoundTag.java @@ -1,7 +1,8 @@ -/** - * This file is part of SpongeAPI, licensed under the MIT License (MIT). +/* + * This file is part of Sponge, licensed under the MIT License (MIT). * - * Copyright (c) 2014 SpongePowered + * Copyright (c) SpongePowered.org + * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -26,235 +27,237 @@ import java.util.Set; /** - * NBT tag representing a map + * NBT tag representing a map. */ public interface CompoundTag extends Tag { + /** - * Returns all keys of {@link CompoundTag} + * Returns all keys of {@link CompoundTag}. * * @return All keys of {@link CompoundTag} */ Set keys(); - + /** * Checks if the {@link CompoundTag} contains a {@link Tag} with - * {@code key} + * {@code key}. * - * @param key - * @return {@code true} if the {@link CompoundTag} contains a {@link Tag} with - * {@code key}, otherwise {@code false} + * @param key The key to get from {@link CompoundTag} + * @return {@code True} if the {@link CompoundTag} contains a {@link Tag} + * with {@code key}, otherwise {@code false} */ boolean hasKey(String key); /** - * Checks if the {@link CompoundTag} contains a {@link Tag} of {@link TagType} - * with {@code key} + * Checks if the {@link CompoundTag} contains a {@link Tag} of + * {@link TagType} with {@code key}. * - * @param key - * @param type - * @return {@code true} if the {@link CompoundTag} contains a {@link Tag} of - * {@link TagType} with {@code key}, otherwise {@code false} + * @param key The key to get from {@link CompoundTag} + * @param type The expected type + * @return {@code True} if the {@link CompoundTag} contains a {@link Tag} + * of {@link TagType} with {@code key}, otherwise {@code false} */ boolean hasKey(String key, TagType type); - + /** - * Sets {@code key} in {@link CompoundTag} to {@code value} + * Gets the {@link TagType} of {@link Tag} with {@code key}. * - * @param key - * @return + * @param key The key to get from {@link CompoundTag} + * @return The {@link TagType} of {@link Tag} with {@code key} */ TagType getType(String key); - + /** - * Sets {@code key} in {@link CompoundTag} to {@code value} + * Gets the boolean with {@code key}. * - * @param key - * @return + * @param key The key to get from {@link CompoundTag} + * @return The boolean with {@code key} */ boolean getBoolean(String key); - + /** - * Sets {@code key} in {@link CompoundTag} to {@code value} + * Sets {@code key} in {@link CompoundTag} to {@code value}. * - * @param key - * @param value + * @param key The key to set in {@link CompoundTag} + * @param value The boolean to set */ void setBoolean(String key, boolean value); - + /** - * Gets the {@link Tag} with {@code key} as byte + * Gets the byte with {@code key}. * - * @param key - * @return The {@link Tag} with {@code key} as byte + * @param key The key to get from {@link CompoundTag} + * @return The byte with {@code key} */ byte getByte(String key); - + /** - * Sets {@code key} in {@link CompoundTag} to {@code value} + * Sets {@code key} in {@link CompoundTag} to {@code value}. * - * @param key - * @param value + * @param key The key to set in {@link CompoundTag} + * @param value The byte to set */ void setByte(String key, byte value); - + /** - * Gets the {@link Tag} with {@code key} as short + * Gets the short with {@code key}. * - * @param key - * @return The {@link Tag} with {@code key} as short + * @param key The key to get from {@link CompoundTag} + * @return The short with {@code key} */ short getShort(String key); /** - * Sets {@code key} in {@link CompoundTag} to {@code value} + * Sets {@code key} in {@link CompoundTag} to {@code value}. * - * @param key - * @param value + * @param key The key to set in {@link CompoundTag} + * @param value The short to set */ void setShort(String key, short value); - + /** - * Gets the {@link Tag} with {@code key} as int + * Gets the integer with {@code key}. * - * @param key - * @return The {@link Tag} with {@code key} as int + * @param key The key to get from {@link CompoundTag} + * @return The integer with {@code key} */ int getInteger(String key); /** - * Sets {@code key} in {@link CompoundTag} to {@code value} + * Sets {@code key} in {@link CompoundTag} to {@code value}. * - * @param key - * @param value + * @param key The key to set in {@link CompoundTag} + * @param value The int to set */ void setInteger(String key, int value); - + /** - * Gets the {@link Tag} with {@code key} as long + * Gets the long with {@code key}. * - * @param key - * @return The {@link Tag} with {@code key} as long + * @param key The key to get from {@link CompoundTag} + * @return The long with {@code key} */ long getLong(String key); /** - * Sets {@code key} in {@link CompoundTag} to {@code value} + * Sets {@code key} in {@link CompoundTag} to {@code value}. * - * @param key - * @param value + * @param key The key to set in {@link CompoundTag} + * @param value The long to set */ void setLong(String key, long value); - + /** - * Gets the {@link Tag} with {@code key} as float + * Gets the float with {@code key}. * - * @param key - * @return The {@link Tag} with {@code key} as float + * @param key The key to get from {@link CompoundTag} + * @return The float with {@code key} */ float getFloat(String key); /** - * Sets {@code key} in {@link CompoundTag} to {@code value} + * Sets {@code key} in {@link CompoundTag} to {@code value}. * - * @param key - * @param value + * @param key The key to set in {@link CompoundTag} + * @param value The float to set */ void setFloat(String key, float value); - + /** - * Gets the {@link Tag} with {@code key} as double + * Gets the double with {@code key}. * - * @param key - * @return The {@link Tag} with {@code key} as double + * @param key The key to get from {@link CompoundTag} + * @return The double with {@code key} */ double getDouble(String key); /** - * Sets {@code key} in {@link CompoundTag} to {@code value} + * Sets {@code key} in {@link CompoundTag} to {@code value}. * - * @param key - * @param value + * @param key The key to set in {@link CompoundTag} + * @param value The double to set */ void setDouble(String key, double value); - + /** - * Gets the {@link Tag} with {@code key} as byte[] + * Gets the array of bytes with {@code key}. * - * @param key - * @return The {@link Tag} with {@code key} as byte[] + * @param key The key to get from {@link CompoundTag} + * @return The array of bytes with {@code key} */ byte[] getByteArray(String key); /** - * Sets {@code key} in {@link CompoundTag} to {@code value} + * Sets {@code key} in {@link CompoundTag} to {@code value}. * - * @param key - * @param value + * @param key The key to set in {@link CompoundTag} + * @param value The array of bytes to set */ void setByteArray(String key, byte[] value); - + /** - * Gets the {@link Tag} with {@code key} as int[] + * Gets the array of integers with {@code key}. * - * @param key - * @return The {@link Tag} with {@code key} as int[] + * @param key The key to get from {@link CompoundTag} + * @return The array of integers with {@code key} */ int[] getIntArray(String key); /** - * Sets {@code key} in {@link CompoundTag} to {@code value} + * Sets {@code key} in {@link CompoundTag} to {@code value}. * - * @param key - * @param value + * @param key The key to set in {@link CompoundTag} + * @param value The array of integers to set */ void setIntArray(String key, int[] value); - + /** - * Gets the {@link Tag} with {@code key} as {@link ListTag} of {@link TagType} + * Gets the {@link ListTag} of {@link TagType} with {@code key}. * - * @param key - * @param type - * @return The {@link Tag} with {@code key} as {@link ListTag} of {@link TagType} + * @param key The key to get from {@link CompoundTag} + * @param type The {@link TagType} of {@link ListTag} + * @return The {@link ListTag} of {@link TagType} with {@code key} + * */ ListTag getList(String key, TagType type); /** - * Sets {@code list} in {@link CompoundTag} to {@code value} + * Sets {@code key} in {@link CompoundTag} to {@code list}. * - * @param key - * @param list + * @param key The key to set in {@link CompoundTag} + * @param list The {@link ListTag} to set */ void setList(String key, ListTag list); - + /** - * Gets the {@link Tag} with {@code key} as {@link CompoundTag} + * Gets the {@link CompoundTag} with {@code key}. * - * @param key - * @return + * @param key The key to get from {@link CompoundTag} + * @return The {@link CompoundTag} with {@code key} */ CompoundTag getCompound(String key); /** - * Sets {@code compound} in {@link CompoundTag} to {@code value} + * Sets {@code key} in {@link CompoundTag} to {@code compound}. * - * @param key - * @param compound + * @param key The key to set in {@link CompoundTag} + * @param compound The {@link CompountTag} to set */ void setCompound(String key, CompoundTag compound); - + /** - * Gets the {@link Tag} with {@code key} + * Gets the {@link Tag} with {@code key}. * - * @param key - * @return + * @param key The key to get from {@link CompoundTag} + * @return The {@link Tag} with {@code key} */ Tag getTag(String key); - + /** - * Sets {@code tag} in {@link CompoundTag} to {@code value} + * Sets {@code key} in {@link CompoundTag} to {@code tag}. * - * @param key - * @param tag + * @param key The key to set in {@link CompoundTag} + * @param tag The {@link Tag} to set */ void setTag(String key, Tag tag); } diff --git a/src/main/java/org/spongepowered/api/nbt/DoubleTag.java b/src/main/java/org/spongepowered/api/nbt/DoubleTag.java index 1bdca0b9b34..d5999f3f443 100644 --- a/src/main/java/org/spongepowered/api/nbt/DoubleTag.java +++ b/src/main/java/org/spongepowered/api/nbt/DoubleTag.java @@ -1,7 +1,8 @@ -/** - * This file is part of SpongeAPI, licensed under the MIT License (MIT). +/* + * This file is part of Sponge, licensed under the MIT License (MIT). * - * Copyright (c) 2014 SpongePowered + * Copyright (c) SpongePowered.org + * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,11 +25,12 @@ package org.spongepowered.api.nbt; /** - * NBT tag representing a double + * NBT tag representing a double. */ public interface DoubleTag extends Tag.Primitive { + /** - * Gets the value of {@link DoubleTag} + * Gets the value of {@link DoubleTag}. * * @return The value of {@link DoubleTag} */ diff --git a/src/main/java/org/spongepowered/api/nbt/EndTag.java b/src/main/java/org/spongepowered/api/nbt/EndTag.java index 1cb76945821..aa9ec5c472c 100644 --- a/src/main/java/org/spongepowered/api/nbt/EndTag.java +++ b/src/main/java/org/spongepowered/api/nbt/EndTag.java @@ -1,7 +1,8 @@ -/** - * This file is part of SpongeAPI, licensed under the MIT License (MIT). +/* + * This file is part of Sponge, licensed under the MIT License (MIT). * - * Copyright (c) 2014 SpongePowered + * Copyright (c) SpongePowered.org + * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,7 +25,7 @@ package org.spongepowered.api.nbt; /** - * NBT tag representing an end + * NBT tag representing an end. */ public interface EndTag extends Tag { diff --git a/src/main/java/org/spongepowered/api/nbt/FloatTag.java b/src/main/java/org/spongepowered/api/nbt/FloatTag.java index a1df7dc367f..3246678404a 100644 --- a/src/main/java/org/spongepowered/api/nbt/FloatTag.java +++ b/src/main/java/org/spongepowered/api/nbt/FloatTag.java @@ -1,7 +1,8 @@ -/** - * This file is part of SpongeAPI, licensed under the MIT License (MIT). +/* + * This file is part of Sponge, licensed under the MIT License (MIT). * - * Copyright (c) 2014 SpongePowered + * Copyright (c) SpongePowered.org + * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,11 +25,12 @@ package org.spongepowered.api.nbt; /** - * NBT tag representing a float + * NBT tag representing a float. */ public interface FloatTag extends Tag.Primitive { + /** - * Gets the value of {@link FloatTag} + * Gets the value of {@link FloatTag}. * * @return The value of {@link FloatTag} */ diff --git a/src/main/java/org/spongepowered/api/nbt/IntArrayTag.java b/src/main/java/org/spongepowered/api/nbt/IntArrayTag.java index d397d563364..3475989e976 100644 --- a/src/main/java/org/spongepowered/api/nbt/IntArrayTag.java +++ b/src/main/java/org/spongepowered/api/nbt/IntArrayTag.java @@ -1,7 +1,8 @@ -/** - * This file is part of SpongeAPI, licensed under the MIT License (MIT). +/* + * This file is part of Sponge, licensed under the MIT License (MIT). * - * Copyright (c) 2014 SpongePowered + * Copyright (c) SpongePowered.org + * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,11 +25,12 @@ package org.spongepowered.api.nbt; /** - * NBT tag representing an intarray + * NBT tag representing an array of integers. */ public interface IntArrayTag extends Tag { + /** - * Gets the value of {@link IntArrayTag} + * Gets the value of {@link IntArrayTag}. * * @return The value of {@link IntArrayTag} */ diff --git a/src/main/java/org/spongepowered/api/nbt/IntTag.java b/src/main/java/org/spongepowered/api/nbt/IntTag.java index 4b08052df74..6d744e30224 100644 --- a/src/main/java/org/spongepowered/api/nbt/IntTag.java +++ b/src/main/java/org/spongepowered/api/nbt/IntTag.java @@ -1,7 +1,8 @@ -/** - * This file is part of SpongeAPI, licensed under the MIT License (MIT). +/* + * This file is part of Sponge, licensed under the MIT License (MIT). * - * Copyright (c) 2014 SpongePowered + * Copyright (c) SpongePowered.org + * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,11 +25,12 @@ package org.spongepowered.api.nbt; /** - * NBT tag representing an int + * NBT tag representing an int. */ public interface IntTag extends Tag.Primitive { + /** - * Gets the value of {@link IntTag} + * Gets the value of {@link IntTag}. * * @return The value of {@link IntTag} */ diff --git a/src/main/java/org/spongepowered/api/nbt/ListTag.java b/src/main/java/org/spongepowered/api/nbt/ListTag.java index 7fea023f7bf..a35436c6628 100644 --- a/src/main/java/org/spongepowered/api/nbt/ListTag.java +++ b/src/main/java/org/spongepowered/api/nbt/ListTag.java @@ -1,7 +1,8 @@ -/** - * This file is part of SpongeAPI, licensed under the MIT License (MIT). +/* + * This file is part of Sponge, licensed under the MIT License (MIT). * - * Copyright (c) 2014 SpongePowered + * Copyright (c) SpongePowered.org + * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,130 +25,133 @@ package org.spongepowered.api.nbt; /** - * NBT tag representing a list + * NBT tag representing a list. */ public interface ListTag extends Tag { + /** - * Returns the count of tags in {@link ListTag} + * Returns the count of tags in {@link ListTag}. * * @return The count of tags in {@link ListTag} */ int count(); - + /** - * Gets the {@link TagType} of {@link Tag}s in {@link ListTag} + * Gets the {@link TagType} of {@link Tag}s in {@link ListTag}. * * @return The {@link TagType} of {@link Tag}s in {@link ListTag} */ TagType getListType(); - + /** - * Gets the {@link Tag} at {@code index} as byte + * Gets the byte at {@code index}. * - * @param index - * @return + * @param index The index to get from {@link ListTag} + * @return The byte at {@code index} */ byte getByte(int index); /** - * Gets the {@link Tag} at {@code index} as short + * Gets the short at {@code index}. * - * @param index - * @return + * @param index The index to get from {@link ListTag} + * @return The short at {@code index} */ short getShort(int index); /** - * Gets the {@link Tag} at {@code index} as int + * Gets the integer at {@code index}. * - * @param index - * @return + * @param index The index to get from {@link ListTag} + * @return The integer at {@code index} */ int getInteger(int index); /** - * Gets the {@link Tag} at {@code index} as long + * Gets the long at {@code index}. * - * @param index - * @return + * @param index The index to get from {@link ListTag} + * @return The long at {@code index} */ long getLong(int index); /** - * Gets the {@link Tag} at {@code index} as float + * Gets the float at {@code index}. * - * @param index - * @return + * @param index The index to get from {@link ListTag} + * @return The float at {@code index} */ float getFloat(int index); /** - * Gets the {@link Tag} at {@code index} as double + * Gets the double at {@code index}. * - * @param index - * @return + * @param index The index to get from {@link ListTag} + * @return The double at {@code index} */ double getDouble(int index); /** - * Gets the {@link Tag} at {@code index} as String + * Gets the String at {@code index}. * - * @param index - * @return + * @param index The index to get from {@link ListTag} + * @return The String at {@code index} */ String getString(int index); /** - * Gets the {@link Tag} at {@code index} as byte[] + * Gets the array of bytes at {@code index}. * - * @param index - * @return + * @param index The index to get from {@link ListTag} + * @return The array of bytes at {@code index} */ byte[] getByteArray(int index); /** - * Gets the {@link Tag} at {@code index} as int[] + * Gets the array of integers at {@code index}. * - * @param index - * @return + * @param index The index to get from {@link ListTag} + * @return The array of integers at {@code index} */ int[] getIntArray(int index); /** - * Gets the {@link Tag} at {@code index} as {@link ListTag} + * Gets the {@link ListTag} of {@link TagType} at {@code index}. * - * @param index - * @return + * @param index The index to get from {@link ListTag} + * @param type The {@link TagType} of {@link ListTag} + * @return The {@link ListTag} of {@link TagType} at {@code index} + * */ - ListTag getList(int index); + ListTag getList(int index, TagType type); /** - * Gets the {@link Tag} at {@code index} as {@link CompoundTag} + * Gets the {@link CompoundTag} at {@code index}. * - * @param index - * @return + * @param index The index to get from {@link ListTag} + * @return The {@link CompoundTag} at {@code index} */ CompoundTag getCompound(int index); - + /** - * Appends the {@link Tag} to {@code ListTag} + * Appends the {@link Tag} to {@code ListTag}. * - * @param tag + * @param tag The {@link Tag} to append */ void append(Tag tag); - + /** - * Inserts the {@link Tag} at {@code index} in {@code ListTag} + * Inserts the {@link Tag} at {@code index} in {@code ListTag}. * - * @param index - * @param tag + * @param index The index to insert at {@link ListTag} + * @param tag The {@link Tag} to insert */ void insert(int index, Tag tag); - + /** - * Removes the {@link Tag} at {@code index} of {@code ListTag} + * Removes the {@link Tag} at {@code index} of {@code ListTag}. * - * @param index + * @param index The index to remove from {@link ListTag} */ void remove(int index); } diff --git a/src/main/java/org/spongepowered/api/nbt/LongTag.java b/src/main/java/org/spongepowered/api/nbt/LongTag.java index bf4f41b33aa..8df446b61c8 100644 --- a/src/main/java/org/spongepowered/api/nbt/LongTag.java +++ b/src/main/java/org/spongepowered/api/nbt/LongTag.java @@ -1,7 +1,8 @@ -/** - * This file is part of SpongeAPI, licensed under the MIT License (MIT). +/* + * This file is part of Sponge, licensed under the MIT License (MIT). * - * Copyright (c) 2014 SpongePowered + * Copyright (c) SpongePowered.org + * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,11 +25,12 @@ package org.spongepowered.api.nbt; /** - * NBT tag representing a long + * NBT tag representing a long. */ public interface LongTag extends Tag.Primitive { + /** - * Gets the value of {@link LongTag} + * Gets the value of {@link LongTag}. * * @return The value of {@link LongTag} */ diff --git a/src/main/java/org/spongepowered/api/nbt/ShortTag.java b/src/main/java/org/spongepowered/api/nbt/ShortTag.java index 1a7e8718ba3..6bc6b065171 100644 --- a/src/main/java/org/spongepowered/api/nbt/ShortTag.java +++ b/src/main/java/org/spongepowered/api/nbt/ShortTag.java @@ -1,7 +1,8 @@ -/** - * This file is part of SpongeAPI, licensed under the MIT License (MIT). +/* + * This file is part of Sponge, licensed under the MIT License (MIT). * - * Copyright (c) 2014 SpongePowered + * Copyright (c) SpongePowered.org + * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,11 +25,12 @@ package org.spongepowered.api.nbt; /** - * NBT tag representing a short + * NBT tag representing a short. */ public interface ShortTag extends Tag.Primitive { + /** - * Gets the value of {@link ShortTag} + * Gets the value of {@link ShortTag}. * * @return The value of {@link ShortTag} */ diff --git a/src/main/java/org/spongepowered/api/nbt/StringTag.java b/src/main/java/org/spongepowered/api/nbt/StringTag.java index 3d2c083e5bc..5fb97438970 100644 --- a/src/main/java/org/spongepowered/api/nbt/StringTag.java +++ b/src/main/java/org/spongepowered/api/nbt/StringTag.java @@ -1,7 +1,8 @@ -/** - * This file is part of SpongeAPI, licensed under the MIT License (MIT). +/* + * This file is part of Sponge, licensed under the MIT License (MIT). * - * Copyright (c) 2014 SpongePowered + * Copyright (c) SpongePowered.org + * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,11 +25,12 @@ package org.spongepowered.api.nbt; /** - * NBT tag representing a string + * NBT tag representing a string. */ public interface StringTag extends Tag { + /** - * Gets the value of {@link StringTag} + * Gets the value of {@link StringTag}. * * @return The value of {@link StringTag} */ diff --git a/src/main/java/org/spongepowered/api/nbt/Tag.java b/src/main/java/org/spongepowered/api/nbt/Tag.java index aeb1ca251ce..9cac9daf097 100644 --- a/src/main/java/org/spongepowered/api/nbt/Tag.java +++ b/src/main/java/org/spongepowered/api/nbt/Tag.java @@ -1,7 +1,8 @@ -/** - * This file is part of SpongeAPI, licensed under the MIT License (MIT). +/* + * This file is part of Sponge, licensed under the MIT License (MIT). * - * Copyright (c) 2014 SpongePowered + * Copyright (c) SpongePowered.org + * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,54 +25,56 @@ package org.spongepowered.api.nbt; /** - * Base for every NBT tag + * Base for every NBT tag. */ public interface Tag extends Cloneable { + /** - * Gets the {@link TagType} of {@link Tag} + * Gets the {@link TagType} of {@link Tag}. * * @return The {@link TagType} of {@link Tag} */ TagType getType(); - + public static interface Primitive extends Tag { + /** - * Returns the value of {@link Tag} as byte + * Returns the value of {@link Tag} as byte. * * @return The value of {@link Tag} as byte */ byte asByte(); /** - * Returns the value of {@link Tag} as short + * Returns the value of {@link Tag} as short. * * @return The value of {@link Tag} as short */ short asShort(); /** - * Returns the value of {@link Tag} as int + * Returns the value of {@link Tag} as int. * * @return The value of {@link Tag} as int */ int asInteger(); /** - * Returns the value of {@link Tag} as long + * Returns the value of {@link Tag} as long. * * @return The value of {@link Tag} as long */ long asLong(); /** - * Returns the value of {@link Tag} as float + * Returns the value of {@link Tag} as float. * * @return The value of {@link Tag} as float */ float asFloat(); /** - * Returns the value of {@link Tag} as double + * Returns the value of {@link Tag} as double. * * @return The value of {@link Tag} as double */ diff --git a/src/main/java/org/spongepowered/api/nbt/TagFactory.java b/src/main/java/org/spongepowered/api/nbt/TagFactory.java index 41b49ea5d80..b49fed33e09 100644 --- a/src/main/java/org/spongepowered/api/nbt/TagFactory.java +++ b/src/main/java/org/spongepowered/api/nbt/TagFactory.java @@ -1,7 +1,8 @@ -/** - * This file is part of SpongeAPI, licensed under the MIT License (MIT). +/* + * This file is part of Sponge, licensed under the MIT License (MIT). * - * Copyright (c) 2014 SpongePowered + * Copyright (c) SpongePowered.org + * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,43 +25,44 @@ package org.spongepowered.api.nbt; /** - * Factory for {@link Tag}s + * Factory for {@link Tag}s. */ public interface TagFactory { + /** - * Creates a new {@link ByteTag} with {@code value} + * Creates a new {@link ByteTag} with {@code value}. * * @param value * @return The new {@link ByteTag} */ ByteTag newByte(byte value); - + /** - * Creates a new {@link ShortTag} with {@code value} + * Creates a new {@link ShortTag} with {@code value}. * * @param value * @return The new {@link ShortTag} */ ShortTag newShort(byte value); - + /** - * Creates a new {@link IntTag} with {@code value} + * Creates a new {@link IntTag} with {@code value}. * * @param value * @return The new {@link IntTag} */ IntTag newInteger(int value); - + /** - * Creates a new {@link LongTag} with {@code value} + * Creates a new {@link LongTag} with {@code value}. * * @param value * @return The new {@link LongTag} */ LongTag newLong(long value); - + /** - * Creates a new {@link FloatTag} with {@code value} + * Creates a new {@link FloatTag} with {@code value}. * * @param value * @return The new {@link FloatTag} @@ -68,7 +70,7 @@ public interface TagFactory { FloatTag newFloat(float value); /** - * Creates a new {@link DoubleTag} with {@code value} + * Creates a new {@link DoubleTag} with {@code value}. * * @param value * @return The new {@link DoubleTag} @@ -76,7 +78,7 @@ public interface TagFactory { DoubleTag newDouble(double value); /** - * Creates a new {@link ByteArrayTag} with {@code value} + * Creates a new {@link ByteArrayTag} with {@code value}. * * @param value * @return The new {@link ByteArrayTag} @@ -84,22 +86,22 @@ public interface TagFactory { ByteArrayTag newByteArray(byte[] value); /** - * Creates a new {@link IntArrayTag} with {@code value} + * Creates a new {@link IntArrayTag} with {@code value}. * * @param value * @return The new {@link IntArrayTag} */ IntArrayTag newIntArray(int[] value); - + /** - * Creates a new {@link ListTag} + * Creates a new {@link ListTag}. * * @return A new {@link ListTag} */ ListTag newList(); - + /** - * Creates a new {@link CompoundTag} + * Creates a new {@link CompoundTag}. * * @return A new {@link CompoundTag} */ diff --git a/src/main/java/org/spongepowered/api/nbt/TagType.java b/src/main/java/org/spongepowered/api/nbt/TagType.java index a4fef4bb4e0..06d1952ff34 100644 --- a/src/main/java/org/spongepowered/api/nbt/TagType.java +++ b/src/main/java/org/spongepowered/api/nbt/TagType.java @@ -1,7 +1,8 @@ -/** - * This file is part of SpongeAPI, licensed under the MIT License (MIT). +/* + * This file is part of Sponge, licensed under the MIT License (MIT). * - * Copyright (c) 2014 SpongePowered + * Copyright (c) SpongePowered.org + * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,9 +25,10 @@ package org.spongepowered.api.nbt; /** - * Enum for NBT tag types + * Enum for NBT tag types. */ public enum TagType { + BYTE, DOUBLE, END, From 82e4cf3839d73ac42ee80af8d01b9f1ec59c5545 Mon Sep 17 00:00:00 2001 From: MazeXD Date: Tue, 16 Sep 2014 06:43:19 +0200 Subject: [PATCH 3/3] Rename package according to #SPONGE-35 --- .../java/org/spongepowered/api/{ => util}/nbt/ByteArrayTag.java | 2 +- src/main/java/org/spongepowered/api/{ => util}/nbt/ByteTag.java | 2 +- .../java/org/spongepowered/api/{ => util}/nbt/CompoundTag.java | 2 +- .../java/org/spongepowered/api/{ => util}/nbt/DoubleTag.java | 2 +- src/main/java/org/spongepowered/api/{ => util}/nbt/EndTag.java | 2 +- .../java/org/spongepowered/api/{ => util}/nbt/FloatTag.java | 2 +- .../java/org/spongepowered/api/{ => util}/nbt/IntArrayTag.java | 2 +- src/main/java/org/spongepowered/api/{ => util}/nbt/IntTag.java | 2 +- src/main/java/org/spongepowered/api/{ => util}/nbt/ListTag.java | 2 +- src/main/java/org/spongepowered/api/{ => util}/nbt/LongTag.java | 2 +- .../java/org/spongepowered/api/{ => util}/nbt/ShortTag.java | 2 +- .../java/org/spongepowered/api/{ => util}/nbt/StringTag.java | 2 +- src/main/java/org/spongepowered/api/{ => util}/nbt/Tag.java | 2 +- .../java/org/spongepowered/api/{ => util}/nbt/TagFactory.java | 2 +- src/main/java/org/spongepowered/api/{ => util}/nbt/TagType.java | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) rename src/main/java/org/spongepowered/api/{ => util}/nbt/ByteArrayTag.java (97%) rename src/main/java/org/spongepowered/api/{ => util}/nbt/ByteTag.java (97%) rename src/main/java/org/spongepowered/api/{ => util}/nbt/CompoundTag.java (99%) rename src/main/java/org/spongepowered/api/{ => util}/nbt/DoubleTag.java (97%) rename src/main/java/org/spongepowered/api/{ => util}/nbt/EndTag.java (97%) rename src/main/java/org/spongepowered/api/{ => util}/nbt/FloatTag.java (97%) rename src/main/java/org/spongepowered/api/{ => util}/nbt/IntArrayTag.java (97%) rename src/main/java/org/spongepowered/api/{ => util}/nbt/IntTag.java (97%) rename src/main/java/org/spongepowered/api/{ => util}/nbt/ListTag.java (99%) rename src/main/java/org/spongepowered/api/{ => util}/nbt/LongTag.java (97%) rename src/main/java/org/spongepowered/api/{ => util}/nbt/ShortTag.java (97%) rename src/main/java/org/spongepowered/api/{ => util}/nbt/StringTag.java (97%) rename src/main/java/org/spongepowered/api/{ => util}/nbt/Tag.java (98%) rename src/main/java/org/spongepowered/api/{ => util}/nbt/TagFactory.java (98%) rename src/main/java/org/spongepowered/api/{ => util}/nbt/TagType.java (97%) diff --git a/src/main/java/org/spongepowered/api/nbt/ByteArrayTag.java b/src/main/java/org/spongepowered/api/util/nbt/ByteArrayTag.java similarity index 97% rename from src/main/java/org/spongepowered/api/nbt/ByteArrayTag.java rename to src/main/java/org/spongepowered/api/util/nbt/ByteArrayTag.java index cb235ae4aed..c2585c05ab1 100644 --- a/src/main/java/org/spongepowered/api/nbt/ByteArrayTag.java +++ b/src/main/java/org/spongepowered/api/util/nbt/ByteArrayTag.java @@ -22,7 +22,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package org.spongepowered.api.nbt; +package org.spongepowered.api.util.nbt; /** * NBT tag representing an array of bytes. diff --git a/src/main/java/org/spongepowered/api/nbt/ByteTag.java b/src/main/java/org/spongepowered/api/util/nbt/ByteTag.java similarity index 97% rename from src/main/java/org/spongepowered/api/nbt/ByteTag.java rename to src/main/java/org/spongepowered/api/util/nbt/ByteTag.java index e6465d942a1..b97a07f0600 100644 --- a/src/main/java/org/spongepowered/api/nbt/ByteTag.java +++ b/src/main/java/org/spongepowered/api/util/nbt/ByteTag.java @@ -22,7 +22,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package org.spongepowered.api.nbt; +package org.spongepowered.api.util.nbt; /** * NBT tag representing a byte. diff --git a/src/main/java/org/spongepowered/api/nbt/CompoundTag.java b/src/main/java/org/spongepowered/api/util/nbt/CompoundTag.java similarity index 99% rename from src/main/java/org/spongepowered/api/nbt/CompoundTag.java rename to src/main/java/org/spongepowered/api/util/nbt/CompoundTag.java index 871818100cb..5e984e81c13 100644 --- a/src/main/java/org/spongepowered/api/nbt/CompoundTag.java +++ b/src/main/java/org/spongepowered/api/util/nbt/CompoundTag.java @@ -22,7 +22,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package org.spongepowered.api.nbt; +package org.spongepowered.api.util.nbt; import java.util.Set; diff --git a/src/main/java/org/spongepowered/api/nbt/DoubleTag.java b/src/main/java/org/spongepowered/api/util/nbt/DoubleTag.java similarity index 97% rename from src/main/java/org/spongepowered/api/nbt/DoubleTag.java rename to src/main/java/org/spongepowered/api/util/nbt/DoubleTag.java index d5999f3f443..0d40bdee3b5 100644 --- a/src/main/java/org/spongepowered/api/nbt/DoubleTag.java +++ b/src/main/java/org/spongepowered/api/util/nbt/DoubleTag.java @@ -22,7 +22,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package org.spongepowered.api.nbt; +package org.spongepowered.api.util.nbt; /** * NBT tag representing a double. diff --git a/src/main/java/org/spongepowered/api/nbt/EndTag.java b/src/main/java/org/spongepowered/api/util/nbt/EndTag.java similarity index 97% rename from src/main/java/org/spongepowered/api/nbt/EndTag.java rename to src/main/java/org/spongepowered/api/util/nbt/EndTag.java index aa9ec5c472c..90dca2bad60 100644 --- a/src/main/java/org/spongepowered/api/nbt/EndTag.java +++ b/src/main/java/org/spongepowered/api/util/nbt/EndTag.java @@ -22,7 +22,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package org.spongepowered.api.nbt; +package org.spongepowered.api.util.nbt; /** * NBT tag representing an end. diff --git a/src/main/java/org/spongepowered/api/nbt/FloatTag.java b/src/main/java/org/spongepowered/api/util/nbt/FloatTag.java similarity index 97% rename from src/main/java/org/spongepowered/api/nbt/FloatTag.java rename to src/main/java/org/spongepowered/api/util/nbt/FloatTag.java index 3246678404a..bdcbae9dc08 100644 --- a/src/main/java/org/spongepowered/api/nbt/FloatTag.java +++ b/src/main/java/org/spongepowered/api/util/nbt/FloatTag.java @@ -22,7 +22,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package org.spongepowered.api.nbt; +package org.spongepowered.api.util.nbt; /** * NBT tag representing a float. diff --git a/src/main/java/org/spongepowered/api/nbt/IntArrayTag.java b/src/main/java/org/spongepowered/api/util/nbt/IntArrayTag.java similarity index 97% rename from src/main/java/org/spongepowered/api/nbt/IntArrayTag.java rename to src/main/java/org/spongepowered/api/util/nbt/IntArrayTag.java index 3475989e976..9070b06e081 100644 --- a/src/main/java/org/spongepowered/api/nbt/IntArrayTag.java +++ b/src/main/java/org/spongepowered/api/util/nbt/IntArrayTag.java @@ -22,7 +22,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package org.spongepowered.api.nbt; +package org.spongepowered.api.util.nbt; /** * NBT tag representing an array of integers. diff --git a/src/main/java/org/spongepowered/api/nbt/IntTag.java b/src/main/java/org/spongepowered/api/util/nbt/IntTag.java similarity index 97% rename from src/main/java/org/spongepowered/api/nbt/IntTag.java rename to src/main/java/org/spongepowered/api/util/nbt/IntTag.java index 6d744e30224..c4406e56e6a 100644 --- a/src/main/java/org/spongepowered/api/nbt/IntTag.java +++ b/src/main/java/org/spongepowered/api/util/nbt/IntTag.java @@ -22,7 +22,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package org.spongepowered.api.nbt; +package org.spongepowered.api.util.nbt; /** * NBT tag representing an int. diff --git a/src/main/java/org/spongepowered/api/nbt/ListTag.java b/src/main/java/org/spongepowered/api/util/nbt/ListTag.java similarity index 99% rename from src/main/java/org/spongepowered/api/nbt/ListTag.java rename to src/main/java/org/spongepowered/api/util/nbt/ListTag.java index a35436c6628..1a9c93ad04b 100644 --- a/src/main/java/org/spongepowered/api/nbt/ListTag.java +++ b/src/main/java/org/spongepowered/api/util/nbt/ListTag.java @@ -22,7 +22,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package org.spongepowered.api.nbt; +package org.spongepowered.api.util.nbt; /** * NBT tag representing a list. diff --git a/src/main/java/org/spongepowered/api/nbt/LongTag.java b/src/main/java/org/spongepowered/api/util/nbt/LongTag.java similarity index 97% rename from src/main/java/org/spongepowered/api/nbt/LongTag.java rename to src/main/java/org/spongepowered/api/util/nbt/LongTag.java index 8df446b61c8..adc07ed5019 100644 --- a/src/main/java/org/spongepowered/api/nbt/LongTag.java +++ b/src/main/java/org/spongepowered/api/util/nbt/LongTag.java @@ -22,7 +22,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package org.spongepowered.api.nbt; +package org.spongepowered.api.util.nbt; /** * NBT tag representing a long. diff --git a/src/main/java/org/spongepowered/api/nbt/ShortTag.java b/src/main/java/org/spongepowered/api/util/nbt/ShortTag.java similarity index 97% rename from src/main/java/org/spongepowered/api/nbt/ShortTag.java rename to src/main/java/org/spongepowered/api/util/nbt/ShortTag.java index 6bc6b065171..232633232a9 100644 --- a/src/main/java/org/spongepowered/api/nbt/ShortTag.java +++ b/src/main/java/org/spongepowered/api/util/nbt/ShortTag.java @@ -22,7 +22,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package org.spongepowered.api.nbt; +package org.spongepowered.api.util.nbt; /** * NBT tag representing a short. diff --git a/src/main/java/org/spongepowered/api/nbt/StringTag.java b/src/main/java/org/spongepowered/api/util/nbt/StringTag.java similarity index 97% rename from src/main/java/org/spongepowered/api/nbt/StringTag.java rename to src/main/java/org/spongepowered/api/util/nbt/StringTag.java index 5fb97438970..30ebebc2e50 100644 --- a/src/main/java/org/spongepowered/api/nbt/StringTag.java +++ b/src/main/java/org/spongepowered/api/util/nbt/StringTag.java @@ -22,7 +22,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package org.spongepowered.api.nbt; +package org.spongepowered.api.util.nbt; /** * NBT tag representing a string. diff --git a/src/main/java/org/spongepowered/api/nbt/Tag.java b/src/main/java/org/spongepowered/api/util/nbt/Tag.java similarity index 98% rename from src/main/java/org/spongepowered/api/nbt/Tag.java rename to src/main/java/org/spongepowered/api/util/nbt/Tag.java index 9cac9daf097..e604d548b33 100644 --- a/src/main/java/org/spongepowered/api/nbt/Tag.java +++ b/src/main/java/org/spongepowered/api/util/nbt/Tag.java @@ -22,7 +22,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package org.spongepowered.api.nbt; +package org.spongepowered.api.util.nbt; /** * Base for every NBT tag. diff --git a/src/main/java/org/spongepowered/api/nbt/TagFactory.java b/src/main/java/org/spongepowered/api/util/nbt/TagFactory.java similarity index 98% rename from src/main/java/org/spongepowered/api/nbt/TagFactory.java rename to src/main/java/org/spongepowered/api/util/nbt/TagFactory.java index b49fed33e09..a5e57ac9f1f 100644 --- a/src/main/java/org/spongepowered/api/nbt/TagFactory.java +++ b/src/main/java/org/spongepowered/api/util/nbt/TagFactory.java @@ -22,7 +22,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package org.spongepowered.api.nbt; +package org.spongepowered.api.util.nbt; /** * Factory for {@link Tag}s. diff --git a/src/main/java/org/spongepowered/api/nbt/TagType.java b/src/main/java/org/spongepowered/api/util/nbt/TagType.java similarity index 97% rename from src/main/java/org/spongepowered/api/nbt/TagType.java rename to src/main/java/org/spongepowered/api/util/nbt/TagType.java index 06d1952ff34..57a7e07a1cd 100644 --- a/src/main/java/org/spongepowered/api/nbt/TagType.java +++ b/src/main/java/org/spongepowered/api/util/nbt/TagType.java @@ -22,7 +22,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package org.spongepowered.api.nbt; +package org.spongepowered.api.util.nbt; /** * Enum for NBT tag types.