diff --git a/src/main/java/org/spacehq/opennbt/tag/CompoundTag.java b/src/main/java/org/spacehq/opennbt/tag/CompoundTag.java index debcc54..d3856da 100644 --- a/src/main/java/org/spacehq/opennbt/tag/CompoundTag.java +++ b/src/main/java/org/spacehq/opennbt/tag/CompoundTag.java @@ -74,8 +74,8 @@ public class CompoundTag extends Tag implements Iterable { * @param tagName Name of the tag. * @return The tag with the specified name. */ - public Tag get(String tagName) { - return this.value.get(tagName); + public T get(String tagName) { + return (T) this.value.get(tagName); } /** @@ -84,8 +84,8 @@ public class CompoundTag extends Tag implements Iterable { * @param tag Tag to put into this compound tag. * @return The previous tag associated with its name, or null if there wasn't one. */ - public Tag put(Tag tag) { - return this.value.put(tag.getName(), tag); + public T put(T tag) { + return (T) this.value.put(tag.getName(), tag); } /** @@ -94,8 +94,8 @@ public class CompoundTag extends Tag implements Iterable { * @param tagName Name of the tag to remove. * @return The removed tag. */ - public Tag remove(String tagName) { - return this.value.remove(tagName); + public T remove(String tagName) { + return (T) this.value.remove(tagName); } /**