mirror of
https://github.com/songoda/SongodaCore.git
synced 2025-02-02 12:41:32 +01:00
Merge get and add compound methods.
This commit is contained in:
parent
a615e8ba7b
commit
fbfdfe0393
@ -25,8 +25,6 @@ public interface NBTCompound {
|
||||
|
||||
NBTCompound remove(String tag);
|
||||
|
||||
NBTCompound addNewCompound(String tag);
|
||||
|
||||
boolean has(String tag);
|
||||
|
||||
NBTObject getNBTObject(String tag);
|
||||
|
@ -86,13 +86,6 @@ public class NBTCompoundImpl implements NBTCompound {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTCompound addNewCompound(String tag) {
|
||||
NBTTagCompound newCompound = new NBTTagCompound();
|
||||
compound.set(tag, newCompound);
|
||||
return new NBTCompoundImpl(newCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean has(String tag) {
|
||||
return compound.hasKey(tag);
|
||||
@ -145,7 +138,13 @@ public class NBTCompoundImpl implements NBTCompound {
|
||||
|
||||
@Override
|
||||
public NBTCompound getCompound(String tag) {
|
||||
return getNBTObject(tag).asCompound();
|
||||
if (has(tag)) {
|
||||
return getNBTObject(tag).asCompound();
|
||||
} else {
|
||||
NBTTagCompound newCompound = new NBTTagCompound();
|
||||
compound.set(tag, newCompound);
|
||||
return new NBTCompoundImpl(newCompound);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -86,13 +86,6 @@ public class NBTCompoundImpl implements NBTCompound {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTCompound addNewCompound(String tag) {
|
||||
NBTTagCompound newCompound = new NBTTagCompound();
|
||||
compound.set(tag, newCompound);
|
||||
return new NBTCompoundImpl(newCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean has(String tag) {
|
||||
return compound.hasKey(tag);
|
||||
@ -145,7 +138,13 @@ public class NBTCompoundImpl implements NBTCompound {
|
||||
|
||||
@Override
|
||||
public NBTCompound getCompound(String tag) {
|
||||
return getNBTObject(tag).asCompound();
|
||||
if (has(tag)) {
|
||||
return getNBTObject(tag).asCompound();
|
||||
} else {
|
||||
NBTTagCompound newCompound = new NBTTagCompound();
|
||||
compound.set(tag, newCompound);
|
||||
return new NBTCompoundImpl(newCompound);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -86,13 +86,6 @@ public class NBTCompoundImpl implements NBTCompound {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTCompound addNewCompound(String tag) {
|
||||
NBTTagCompound newCompound = new NBTTagCompound();
|
||||
compound.set(tag, newCompound);
|
||||
return new NBTCompoundImpl(newCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean has(String tag) {
|
||||
return compound.hasKey(tag);
|
||||
@ -145,7 +138,13 @@ public class NBTCompoundImpl implements NBTCompound {
|
||||
|
||||
@Override
|
||||
public NBTCompound getCompound(String tag) {
|
||||
return getNBTObject(tag).asCompound();
|
||||
if (has(tag)) {
|
||||
return getNBTObject(tag).asCompound();
|
||||
} else {
|
||||
NBTTagCompound newCompound = new NBTTagCompound();
|
||||
compound.set(tag, newCompound);
|
||||
return new NBTCompoundImpl(newCompound);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -86,13 +86,6 @@ public class NBTCompoundImpl implements NBTCompound {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTCompound addNewCompound(String tag) {
|
||||
NBTTagCompound newCompound = new NBTTagCompound();
|
||||
compound.set(tag, newCompound);
|
||||
return new NBTCompoundImpl(newCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean has(String tag) {
|
||||
return compound.hasKey(tag);
|
||||
@ -145,7 +138,13 @@ public class NBTCompoundImpl implements NBTCompound {
|
||||
|
||||
@Override
|
||||
public NBTCompound getCompound(String tag) {
|
||||
return getNBTObject(tag).asCompound();
|
||||
if (has(tag)) {
|
||||
return getNBTObject(tag).asCompound();
|
||||
} else {
|
||||
NBTTagCompound newCompound = new NBTTagCompound();
|
||||
compound.set(tag, newCompound);
|
||||
return new NBTCompoundImpl(newCompound);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -86,13 +86,6 @@ public class NBTCompoundImpl implements NBTCompound {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTCompound addNewCompound(String tag) {
|
||||
NBTTagCompound newCompound = new NBTTagCompound();
|
||||
compound.set(tag, newCompound);
|
||||
return new NBTCompoundImpl(newCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean has(String tag) {
|
||||
return compound.hasKey(tag);
|
||||
@ -145,7 +138,13 @@ public class NBTCompoundImpl implements NBTCompound {
|
||||
|
||||
@Override
|
||||
public NBTCompound getCompound(String tag) {
|
||||
return getNBTObject(tag).asCompound();
|
||||
if (has(tag)) {
|
||||
return getNBTObject(tag).asCompound();
|
||||
} else {
|
||||
NBTTagCompound newCompound = new NBTTagCompound();
|
||||
compound.set(tag, newCompound);
|
||||
return new NBTCompoundImpl(newCompound);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -86,13 +86,6 @@ public class NBTCompoundImpl implements NBTCompound {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTCompound addNewCompound(String tag) {
|
||||
NBTTagCompound newCompound = new NBTTagCompound();
|
||||
compound.set(tag, newCompound);
|
||||
return new NBTCompoundImpl(newCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean has(String tag) {
|
||||
return compound.hasKey(tag);
|
||||
@ -145,7 +138,13 @@ public class NBTCompoundImpl implements NBTCompound {
|
||||
|
||||
@Override
|
||||
public NBTCompound getCompound(String tag) {
|
||||
return getNBTObject(tag).asCompound();
|
||||
if (has(tag)) {
|
||||
return getNBTObject(tag).asCompound();
|
||||
} else {
|
||||
NBTTagCompound newCompound = new NBTTagCompound();
|
||||
compound.set(tag, newCompound);
|
||||
return new NBTCompoundImpl(newCompound);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -86,13 +86,6 @@ public class NBTCompoundImpl implements NBTCompound {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTCompound addNewCompound(String tag) {
|
||||
NBTTagCompound newCompound = new NBTTagCompound();
|
||||
compound.set(tag, newCompound);
|
||||
return new NBTCompoundImpl(newCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean has(String tag) {
|
||||
return compound.hasKey(tag);
|
||||
@ -145,7 +138,13 @@ public class NBTCompoundImpl implements NBTCompound {
|
||||
|
||||
@Override
|
||||
public NBTCompound getCompound(String tag) {
|
||||
return getNBTObject(tag).asCompound();
|
||||
if (has(tag)) {
|
||||
return getNBTObject(tag).asCompound();
|
||||
} else {
|
||||
NBTTagCompound newCompound = new NBTTagCompound();
|
||||
compound.set(tag, newCompound);
|
||||
return new NBTCompoundImpl(newCompound);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -86,13 +86,6 @@ public class NBTCompoundImpl implements NBTCompound {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTCompound addNewCompound(String tag) {
|
||||
NBTTagCompound newCompound = new NBTTagCompound();
|
||||
compound.set(tag, newCompound);
|
||||
return new NBTCompoundImpl(newCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean has(String tag) {
|
||||
return compound.hasKey(tag);
|
||||
@ -145,7 +138,13 @@ public class NBTCompoundImpl implements NBTCompound {
|
||||
|
||||
@Override
|
||||
public NBTCompound getCompound(String tag) {
|
||||
return getNBTObject(tag).asCompound();
|
||||
if (has(tag)) {
|
||||
return getNBTObject(tag).asCompound();
|
||||
} else {
|
||||
NBTTagCompound newCompound = new NBTTagCompound();
|
||||
compound.set(tag, newCompound);
|
||||
return new NBTCompoundImpl(newCompound);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -86,13 +86,6 @@ public class NBTCompoundImpl implements NBTCompound {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTCompound addNewCompound(String tag) {
|
||||
NBTTagCompound newCompound = new NBTTagCompound();
|
||||
compound.set(tag, newCompound);
|
||||
return new NBTCompoundImpl(newCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean has(String tag) {
|
||||
return compound.hasKey(tag);
|
||||
@ -145,7 +138,13 @@ public class NBTCompoundImpl implements NBTCompound {
|
||||
|
||||
@Override
|
||||
public NBTCompound getCompound(String tag) {
|
||||
return getNBTObject(tag).asCompound();
|
||||
if (has(tag)) {
|
||||
return getNBTObject(tag).asCompound();
|
||||
} else {
|
||||
NBTTagCompound newCompound = new NBTTagCompound();
|
||||
compound.set(tag, newCompound);
|
||||
return new NBTCompoundImpl(newCompound);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -87,13 +87,6 @@ public class NBTCompoundImpl implements NBTCompound {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTCompound addNewCompound(String tag) {
|
||||
NBTTagCompound newCompound = new NBTTagCompound();
|
||||
compound.set(tag, newCompound);
|
||||
return new NBTCompoundImpl(newCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean has(String tag) {
|
||||
return compound.hasKey(tag);
|
||||
@ -146,7 +139,13 @@ public class NBTCompoundImpl implements NBTCompound {
|
||||
|
||||
@Override
|
||||
public NBTCompound getCompound(String tag) {
|
||||
return getNBTObject(tag).asCompound();
|
||||
if (has(tag)) {
|
||||
return getNBTObject(tag).asCompound();
|
||||
} else {
|
||||
NBTTagCompound newCompound = new NBTTagCompound();
|
||||
compound.set(tag, newCompound);
|
||||
return new NBTCompoundImpl(newCompound);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -87,13 +87,6 @@ public class NBTCompoundImpl implements NBTCompound {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTCompound addNewCompound(String tag) {
|
||||
NBTTagCompound newCompound = new NBTTagCompound();
|
||||
compound.set(tag, newCompound);
|
||||
return new NBTCompoundImpl(newCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean has(String tag) {
|
||||
return compound.hasKey(tag);
|
||||
@ -146,7 +139,13 @@ public class NBTCompoundImpl implements NBTCompound {
|
||||
|
||||
@Override
|
||||
public NBTCompound getCompound(String tag) {
|
||||
return getNBTObject(tag).asCompound();
|
||||
if (has(tag)) {
|
||||
return getNBTObject(tag).asCompound();
|
||||
} else {
|
||||
NBTTagCompound newCompound = new NBTTagCompound();
|
||||
compound.set(tag, newCompound);
|
||||
return new NBTCompoundImpl(newCompound);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -87,13 +87,6 @@ public class NBTCompoundImpl implements NBTCompound {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTCompound addNewCompound(String tag) {
|
||||
NBTTagCompound newCompound = new NBTTagCompound();
|
||||
compound.set(tag, newCompound);
|
||||
return new NBTCompoundImpl(newCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean has(String tag) {
|
||||
return compound.hasKey(tag);
|
||||
@ -146,7 +139,13 @@ public class NBTCompoundImpl implements NBTCompound {
|
||||
|
||||
@Override
|
||||
public NBTCompound getCompound(String tag) {
|
||||
return getNBTObject(tag).asCompound();
|
||||
if (has(tag)) {
|
||||
return getNBTObject(tag).asCompound();
|
||||
} else {
|
||||
NBTTagCompound newCompound = new NBTTagCompound();
|
||||
compound.set(tag, newCompound);
|
||||
return new NBTCompoundImpl(newCompound);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -86,13 +86,6 @@ public class NBTCompoundImpl implements NBTCompound {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTCompound addNewCompound(String tag) {
|
||||
NBTTagCompound newCompound = new NBTTagCompound();
|
||||
compound.set(tag, newCompound);
|
||||
return new NBTCompoundImpl(newCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean has(String tag) {
|
||||
return compound.hasKey(tag);
|
||||
@ -145,7 +138,13 @@ public class NBTCompoundImpl implements NBTCompound {
|
||||
|
||||
@Override
|
||||
public NBTCompound getCompound(String tag) {
|
||||
return getNBTObject(tag).asCompound();
|
||||
if (has(tag)) {
|
||||
return getNBTObject(tag).asCompound();
|
||||
} else {
|
||||
NBTTagCompound newCompound = new NBTTagCompound();
|
||||
compound.set(tag, newCompound);
|
||||
return new NBTCompoundImpl(newCompound);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -86,13 +86,6 @@ public class NBTCompoundImpl implements NBTCompound {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTCompound addNewCompound(String tag) {
|
||||
NBTTagCompound newCompound = new NBTTagCompound();
|
||||
compound.set(tag, newCompound);
|
||||
return new NBTCompoundImpl(newCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean has(String tag) {
|
||||
return compound.hasKey(tag);
|
||||
@ -145,7 +138,13 @@ public class NBTCompoundImpl implements NBTCompound {
|
||||
|
||||
@Override
|
||||
public NBTCompound getCompound(String tag) {
|
||||
return getNBTObject(tag).asCompound();
|
||||
if (has(tag)) {
|
||||
return getNBTObject(tag).asCompound();
|
||||
} else {
|
||||
NBTTagCompound newCompound = new NBTTagCompound();
|
||||
compound.set(tag, newCompound);
|
||||
return new NBTCompoundImpl(newCompound);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user