Merge branch 'master' of https://git.froggi.es/frogcraft/FeatherMC into master
This commit is contained in:
commit
f0043ded2a
|
@ -1,7 +1,6 @@
|
||||||
#include "NBT.h"
|
#include "NBT.h"
|
||||||
|
|
||||||
#include "cNBT/nbt.h"
|
#include "cNBT/nbt.h"
|
||||||
#include "cNBT/list.h"
|
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
|
@ -188,9 +188,15 @@ namespace NBT
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
const T CompoundTag::Get(const char *name) const
|
const T CompoundTag::Get(const char* name) const
|
||||||
{
|
{
|
||||||
nbt_node *result = Internal::FindByName(m_node, name);
|
nbt_node* result = Internal::FindByName(m_node, name);
|
||||||
return T(result);
|
if constexpr (std::is_base_of<Tag, T>::value) {
|
||||||
|
return T(result);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// DataTag<T> can be auto converted to T
|
||||||
|
return DataTag<T>(result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue