diff --git a/mods/CORE/mcl_util/ringbuffer.lua b/mods/CORE/mcl_util/ringbuffer.lua index 34586cb0f..a39803f3d 100644 --- a/mods/CORE/mcl_util/ringbuffer.lua +++ b/mods/CORE/mcl_util/ringbuffer.lua @@ -42,4 +42,9 @@ function ringbuffer_class:serialize() return minetest.serialize(self.data) end +function ringbuffer.deserialize(size, serialized_data) + local rb_data = minetest.deserialize(serialized_data) + return rb_data and ringbuffer.new(size, rb_data) +end + return setmetatable(ringbuffer, ringbuffer_class)