summaryrefslogtreecommitdiffstats
path: root/src/Enchantments.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-01-19 22:50:50 +0100
committerMattes D <github@xoft.cz>2014-01-19 22:50:50 +0100
commit865016abe2d879a00b93945dc4984341191995db (patch)
tree1833001d20b08a20dde0e56d59e0515827ab296e /src/Enchantments.h
parentMerge pull request #565 from mc-server/commandblockfixes (diff)
parentSwitched EnchantmentSerilizer to namespace (diff)
downloadcuberite-865016abe2d879a00b93945dc4984341191995db.tar
cuberite-865016abe2d879a00b93945dc4984341191995db.tar.gz
cuberite-865016abe2d879a00b93945dc4984341191995db.tar.bz2
cuberite-865016abe2d879a00b93945dc4984341191995db.tar.lz
cuberite-865016abe2d879a00b93945dc4984341191995db.tar.xz
cuberite-865016abe2d879a00b93945dc4984341191995db.tar.zst
cuberite-865016abe2d879a00b93945dc4984341191995db.zip
Diffstat (limited to 'src/Enchantments.h')
-rw-r--r--src/Enchantments.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Enchantments.h b/src/Enchantments.h
index 7581b87b5..e984df92e 100644
--- a/src/Enchantments.h
+++ b/src/Enchantments.h
@@ -8,6 +8,7 @@
#pragma once
+#include "WorldStorage/EnchantmentSerializer.h"
@@ -20,7 +21,6 @@ class cParsedNBT;
-// tolua_begin
/** Class that stores item enchantments or stored-enchantments
The enchantments may be serialized to a stringspec and read back from such stringspec.
@@ -29,10 +29,12 @@ mapping each enchantment's id onto its level. ID may be either a number or the e
Level value of 0 means no such enchantment, and it will not be stored in the m_Enchantments.
Serialization will never put zero-level enchantments into the stringspec and will always use numeric IDs.
*/
+// tolua_begin
class cEnchantments
{
public:
/// Individual enchantment IDs, corresponding to their NBT IDs ( http://www.minecraftwiki.net/wiki/Data_Values#Enchantment_IDs )
+
enum
{
enchProtection = 0,
@@ -97,10 +99,10 @@ public:
bool operator !=(const cEnchantments & a_Other) const;
/// Writes the enchantments into the specified NBT writer; begins with the LIST tag of the specified name ("ench" or "StoredEnchantments")
- void WriteToNBTCompound(cFastNBTWriter & a_Writer, const AString & a_ListTagName) const;
+ friend void EnchantmentSerializer::WriteToNBTCompound(cEnchantments const& a_Enchantments, cFastNBTWriter & a_Writer, const AString & a_ListTagName);
/// Reads the enchantments from the specified NBT list tag (ench or StoredEnchantments)
- void ParseFromNBT(const cParsedNBT & a_NBT, int a_EnchListTagIdx);
+ friend void EnchantmentSerializer::ParseFromNBT(cEnchantments& a_Enchantments, const cParsedNBT & a_NBT, int a_EnchListTagIdx);
protected:
/// Maps enchantment ID -> enchantment level