From c7fb00085854ed76b8b8945968de0505b8fbe8a2 Mon Sep 17 00:00:00 2001 From: andrew Date: Fri, 14 Feb 2014 17:38:22 +0200 Subject: EmptyMap item handler --- MCServer/crafting.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'MCServer') diff --git a/MCServer/crafting.txt b/MCServer/crafting.txt index fe9a465d0..92abe24cb 100644 --- a/MCServer/crafting.txt +++ b/MCServer/crafting.txt @@ -156,7 +156,7 @@ Lighter = IronIngot, 1:1 | Flint, 2:2 Lighter = IronIngot, 2:1 | Flint, 1:2 Bucket = IronIngot, 1:1, 2:2, 3:1 Compass = IronIngot, 2:1, 1:2, 3:2, 2:3 | RedstoneDust, 2:2 -Map = Paper, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | Compass, 2:2 +EmptyMap = Paper, 1:1, 1:2, 1:3, 2:1, 2:3, 3:1, 3:2, 3:3 | Compass, 2:2 Watch = GoldIngot, 2:1, 1:2, 3:2, 2:3 | RedstoneDust, 2:2 FishingRod = Stick, 1:3, 2:2, 3:1 | String, 3:2, 3:3 FishingRod = Stick, 3:3, 2:2, 1:1 | String, 1:2, 1:3 -- cgit v1.2.3 From 866fde81ca50f223c88af77d0092a2f4e60f7ce9 Mon Sep 17 00:00:00 2001 From: andrew Date: Sat, 22 Feb 2014 13:59:49 +0200 Subject: Documented and exported cMap --- MCServer/Plugins/APIDump/APIDesc.lua | 49 ++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'MCServer') diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua index 73bb5c7fb..296a60640 100644 --- a/MCServer/Plugins/APIDump/APIDesc.lua +++ b/MCServer/Plugins/APIDump/APIDesc.lua @@ -1485,6 +1485,55 @@ a_Player:OpenWindow(Window); Inherits = "cWindow", }, -- cLuaWindow + cMap = + { + Desc = [[ + This class encapsulates a single in-game colored map.

+

+ The contents (i.e. pixel data) of a cMap are dynamically updated by each + tracked {{cPlayer}} instance. Furthermore, a cMap maintains and periodically + updates a list of map decorators, which are objects drawn on the map that + can freely move (e.g. Player and item frame pointers). + ]], + Functions = + { + EraseData = { Params = "", Return = "", Notes = "Erases all pixel data." }, + GetCenterX = { Params = "", Return = "number", Notes = "Returns the X coord of the map's center." }, + GetCenterZ = { Params = "", Return = "number", Notes = "Returns the Y coord of the map's center." }, + GetDimension = { Params = "", Return = "eDimension", Notes = "Returns the dimension of the associated world." }, + GetHeight = { Params = "", Return = "number", Notes = "Returns the height of the map." }, + GetID = { Params = "", Return = "number", Notes = "Returns the numerical ID of the map. (The item damage value)" }, + GetName = { Params = "", Return = "string", Notes = "Returns the name of the map." }, + GetNumPixels = { Params = "", Return = "number", Notes = "Returns the number of pixels in this map." }, + GetPixel = { Params = "PixelX, PixelZ", Return = "ColorID", Notes = "Returns the color of the specified pixel." }, + GetPixelWidth = { Params = "", Return = "number", Notes = "Returns the width of a single pixel in blocks." }, + GetScale = { Params = "", Return = "number", Notes = "Returns the scale of the map. Range: [0,4]" }, + GetWidth = { Params = "", Return = "number", Notes = "Returns the width of the map." }, + GetWorld = { Params = "", Return = "cWorld", Notes = "Returns the associated world." }, + Resize = { Params = "Width, Height", Return = "", Notes = "Resizes the map. WARNING: This will erase the pixel data." }, + SetPixel = { Params = "PixelX, PixelZ, ColorID", Return = "bool", Notes = "Sets the color of the specified pixel. Returns false on error (Out of range)." }, + SetPosition = { Params = "CenterX, CenterZ", Return = "", Notes = "Relocates the map. The pixel data will not be modified." }, + SetScale = { Params = "number", Return = "", Notes = "Rescales the map. The pixel data will not be modified." }, + }, + Constants = + { + E_BASE_COLOR_BLUE = { Notes = "" }, + E_BASE_COLOR_BROWN = { Notes = "" }, + E_BASE_COLOR_DARK_BROWN = { Notes = "" }, + E_BASE_COLOR_DARK_GRAY = { Notes = "" }, + E_BASE_COLOR_DARK_GREEN = { Notes = "" }, + E_BASE_COLOR_GRAY_1 = { Notes = "" }, + E_BASE_COLOR_GRAY_2 = { Notes = "" }, + E_BASE_COLOR_LIGHT_BROWN = { Notes = "" }, + E_BASE_COLOR_LIGHT_GRAY = { Notes = "" }, + E_BASE_COLOR_LIGHT_GREEN = { Notes = "" }, + E_BASE_COLOR_PALE_BLUE = { Notes = "" }, + E_BASE_COLOR_RED = { Notes = "" }, + E_BASE_COLOR_TRANSPARENT = { Notes = "" }, + E_BASE_COLOR_WHITE = { Notes = "" }, + }, + }, -- cMap + cMonster = { Desc = [[ -- cgit v1.2.3 From 9fa4fa1cc737a0cf9a078956def206c31a4ebd02 Mon Sep 17 00:00:00 2001 From: andrew Date: Sun, 23 Feb 2014 12:55:55 +0200 Subject: Documented and exported cMapManager --- MCServer/Plugins/APIDump/APIDesc.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'MCServer') diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua index 296a60640..8265b4e19 100644 --- a/MCServer/Plugins/APIDump/APIDesc.lua +++ b/MCServer/Plugins/APIDump/APIDesc.lua @@ -1534,6 +1534,19 @@ a_Player:OpenWindow(Window); }, }, -- cMap + cMapManager = + { + Desc = [[ + This class is associated with a single {{cWorld}} instance and manages a list of maps. + ]], + Functions = + { + DoWithMap = { Params = "ID, Callback", Return = "bool", Notes = "Calls the callback for the map with the specified ID. Returns true if the map was found and the callback called, false if map not found." }, + GetNumMaps = { Params = "", Return = "number", Notes = "Returns the number of registered maps." }, + }, + + }, -- cMapManager + cMonster = { Desc = [[ @@ -2289,6 +2302,7 @@ World:ForEachEntity( ]], }, }, -- AdditionalInfo + Inherits = "cMapManager" }, -- cWorld HTTPFormData = -- cgit v1.2.3 From 30b22e9f59e0873be84e80c83d274dbe5353b835 Mon Sep 17 00:00:00 2001 From: andrew Date: Sun, 23 Feb 2014 13:25:02 +0200 Subject: Manually exported DoWithMap --- MCServer/Plugins/APIDump/APIDesc.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'MCServer') diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua index 8265b4e19..c8811df66 100644 --- a/MCServer/Plugins/APIDump/APIDesc.lua +++ b/MCServer/Plugins/APIDump/APIDesc.lua @@ -1541,7 +1541,7 @@ a_Player:OpenWindow(Window); ]], Functions = { - DoWithMap = { Params = "ID, Callback", Return = "bool", Notes = "Calls the callback for the map with the specified ID. Returns true if the map was found and the callback called, false if map not found." }, + DoWithMap = { Params = "ID, CallbackFunction, [CallbackData]", Return = "bool", Notes = "If a map with the specified ID exists, calls the CallbackFunction for that map. The CallbackFunction has the following signature:

function Callback({{cMap|Map}}, [CallbackData])
Returns true if the map was found and the callback called, false if map not found." }, GetNumMaps = { Params = "", Return = "number", Notes = "Returns the number of registered maps." }, }, -- cgit v1.2.3 From f47187394572027cbfa07884cba2f54eaa6972ec Mon Sep 17 00:00:00 2001 From: andrew Date: Sun, 23 Feb 2014 15:03:40 +0200 Subject: Maps: Improvements --- MCServer/Plugins/APIDump/APIDesc.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'MCServer') diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua index c8811df66..8e9d239fa 100644 --- a/MCServer/Plugins/APIDump/APIDesc.lua +++ b/MCServer/Plugins/APIDump/APIDesc.lua @@ -2165,7 +2165,8 @@ end GetGeneratorQueueLength = { Params = "", Return = "number", Notes = "Returns the number of chunks that are queued in the chunk generator." }, GetHeight = { Params = "BlockX, BlockZ", Return = "number", Notes = "Returns the maximum height of the particula block column in the world. If the chunk is not loaded, it waits for it to load / generate. WARNING: Do not use, Use TryGetHeight() instead for a non-waiting version, otherwise you run the risk of a deadlock!" }, GetIniFileName = { Params = "", Return = "string", Notes = "Returns the name of the world.ini file that the world uses to store the information." }, - GetLightingQueueLength = { Params = "", Return = "number", Notes = "Returns the number of chunks in the lighting thread's queue." }, + GetLightingQueueLength = { Params = "", Return = "number", Notes = "Returns the number of chunks in the lighting thread's queue." }, + GetMapManager = { Params = "", Return = "{{cMapManager}}", Notes = "Returns the {{cMapManager|MapManager}} object used by this world." }, GetMaxCactusHeight = { Params = "", Return = "number", Notes = "Returns the configured maximum height to which cacti will grow naturally." }, GetMaxSugarcaneHeight = { Params = "", Return = "number", Notes = "Returns the configured maximum height to which sugarcane will grow naturally." }, GetName = { Params = "", Return = "string", Notes = "Returns the name of the world, as specified in the settings.ini file." }, @@ -2302,7 +2303,6 @@ World:ForEachEntity( ]], }, }, -- AdditionalInfo - Inherits = "cMapManager" }, -- cWorld HTTPFormData = -- cgit v1.2.3