From 29567c56107c86b70da130f995564beb2eaf424c Mon Sep 17 00:00:00 2001
From: Tiger Wang
Date: Thu, 12 Jun 2014 15:21:07 +0100
Subject: Portals animate and delay correctly
---
MCServer/furnace.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'MCServer')
diff --git a/MCServer/furnace.txt b/MCServer/furnace.txt
index 1e98583ba..229a939ff 100644
--- a/MCServer/furnace.txt
+++ b/MCServer/furnace.txt
@@ -87,4 +87,4 @@
! 271:1 = 200 # 1 Wooden Axe -> 10 sec
! 269:1 = 200 # 1 Wooden Shovel -> 10 sec
! 290:1 = 200 # 1 Wooden Hoe -> 10 sec
-! 268:1 = 200 # 1 Wooden Sword -> 10 sec
+! 268:1 = 200 # 1 Wooden Sword -> 10 sec
\ No newline at end of file
--
cgit v1.2.3
From b2fbcaf1bf43ca1f0e6df48de8584149cbe50222 Mon Sep 17 00:00:00 2001
From: archshift
Date: Sun, 15 Jun 2014 20:27:27 -0700
Subject: Implemented PR suggestions
Furnace.txt: newline
BlockID: removed extraneous dimension mapping
cEntity: fixed typo
cPlayer: WorldPtr typedef
---
MCServer/furnace.txt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'MCServer')
diff --git a/MCServer/furnace.txt b/MCServer/furnace.txt
index 229a939ff..d6177184b 100644
--- a/MCServer/furnace.txt
+++ b/MCServer/furnace.txt
@@ -87,4 +87,5 @@
! 271:1 = 200 # 1 Wooden Axe -> 10 sec
! 269:1 = 200 # 1 Wooden Shovel -> 10 sec
! 290:1 = 200 # 1 Wooden Hoe -> 10 sec
-! 268:1 = 200 # 1 Wooden Sword -> 10 sec
\ No newline at end of file
+! 268:1 = 200 # 1 Wooden Sword -> 10 sec
+
--
cgit v1.2.3
From 5b2b6e06150b6299d1e19374be092c0858b0e3a8 Mon Sep 17 00:00:00 2001
From: archshift
Date: Thu, 12 Jun 2014 19:50:02 -0700
Subject: Pawn: renamed HandleEntityEffects to HandleEntityEffect
Exported entity effect functions for ToLua and documented them in APIDesc.lua
---
MCServer/Plugins/APIDump/APIDesc.lua | 3 +++
1 file changed, 3 insertions(+)
(limited to 'MCServer')
diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua
index 19ca971e2..1dba08fe3 100644
--- a/MCServer/Plugins/APIDump/APIDesc.lua
+++ b/MCServer/Plugins/APIDump/APIDesc.lua
@@ -1688,6 +1688,9 @@ a_Player:OpenWindow(Window);
TakeDamage = { Return = "" },
KilledBy = { Return = "" },
GetHealth = { Return = "number" },
+ AddEntityEffect = { Params = "EffectType, {{cEntityEffect}}", Return = "", Notes = "Applies an entity effect" },
+ RemoveEntityEffect = { Params = "EffectType", Return = "", Notes = "Removes a currently applied entity effect" },
+ ClearEntityEffects = { Return = "", Notes = "Removes all currently applied entity effects" },
},
Inherits = "cEntity",
}, -- cPawn
--
cgit v1.2.3
From a37d5410b4486dd95692076e3da0368a4ed23577 Mon Sep 17 00:00:00 2001
From: madmaxoft
Date: Fri, 13 Jun 2014 12:50:54 +0200
Subject: APIDump: Added OnEntityAddEffect hook documentation.
---
.../Plugins/APIDump/Hooks/OnEntityAddEffect.lua | 34 ++++++++++++++++++++++
1 file changed, 34 insertions(+)
create mode 100644 MCServer/Plugins/APIDump/Hooks/OnEntityAddEffect.lua
(limited to 'MCServer')
diff --git a/MCServer/Plugins/APIDump/Hooks/OnEntityAddEffect.lua b/MCServer/Plugins/APIDump/Hooks/OnEntityAddEffect.lua
new file mode 100644
index 000000000..423a2200b
--- /dev/null
+++ b/MCServer/Plugins/APIDump/Hooks/OnEntityAddEffect.lua
@@ -0,0 +1,34 @@
+return
+{
+ HOOK_ENTITY_ADD_EFFECT =
+ {
+ CalledWhen = "An entity effect is about to get added to an entity.",
+ DefaultFnName = "OnEntityAddEffect", -- also used as pagename
+ Desc = [[
+ This hook is called whenever an entity effect is about to be added to an entity. The plugin may
+ disallow the addition by returning true.
+ Note that this hook only fires for adding the effect, but not for the actual effect application. See
+ also the {{OnEntityRemoveEffect|HOOK_ENTITY_REMOVE_EFFECT}} for notification about effects expiring /
+ removing, and {{OnEntityApplyEffect|HOOK_ENTITY_APPLY_EFFECT}} for the actual effect application to the
+ entity.
+ ]],
+ Params =
+ {
+ { Name = "Entity", Type = "{{cEntity}}", Notes = "The entity to which the effect is about to be added" },
+ { Name = "EffectType", Type = "number", Notes = "The type of the effect to be added. One of the effXXX constants." },
+ { Name = "EffectDuration", Type = "number", Notes = "The duration of the effect to be added, in ticks." },
+ { Name = "EffectIntensity", Type = "number", Notes = "The intensity (level) of the effect to be added. " },
+ { Name = "Originator", Type = "{{cEntity}}", Notes = "The entity who originated the effect (threw the potion, the cavespider that used poison bite, etc.) May be nil if there's no originator associated with the effect. " },
+ { Name = "DistanceModifier", Type = "number", Notes = "The modifier for the effect intensity, based on distance. Used mainly for splash potions." },
+ },
+ Returns = [[
+ If the plugin returns true, the effect will not be added and none of the remaining hook handlers will
+ be called. If the plugin returns false, MCServer calls all the remaining hook handlers and finally
+ the effect is added to the entity.
+ ]],
+ }, -- HOOK_EXECUTE_COMMAND
+}
+
+
+
+
--
cgit v1.2.3
From f1491ad1d1df3e0b4d22af8329c95106e794ba01 Mon Sep 17 00:00:00 2001
From: Howaner
Date: Sun, 13 Jul 2014 01:18:41 +0200
Subject: Fixed diamond mover plugin
---
MCServer/Plugins/DiamondMover/DiamondMover.lua | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
(limited to 'MCServer')
diff --git a/MCServer/Plugins/DiamondMover/DiamondMover.lua b/MCServer/Plugins/DiamondMover/DiamondMover.lua
index 0fdd32250..d3e70acfc 100644
--- a/MCServer/Plugins/DiamondMover/DiamondMover.lua
+++ b/MCServer/Plugins/DiamondMover/DiamondMover.lua
@@ -22,6 +22,8 @@ function Initialize(Plugin)
Plugin:SetVersion(1);
cPluginManager.AddHook(cPluginManager.HOOK_PLAYER_USED_ITEM, OnPlayerUsedItem);
+
+ LOG("Initialized " .. Plugin:GetName() .. " v." .. Plugin:GetVersion());
return true;
end
@@ -36,8 +38,8 @@ function OnPlayerUsedItem(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX, Cu
return false;
end;
- if (Player:HasPermission("diamondmover.move") == false) then
- return true;
+ if (not Player:HasPermission("diamondmover.move")) then
+ return false;
end;
-- Rclk with a diamond to push in the direction the player is facing
@@ -56,7 +58,7 @@ function OnPlayerUsedItem(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX, Cu
if (PlayerPitch > 70) then -- looking down
BlockY = BlockY - 1;
else
- local PlayerRot = Player:GetRotation() + 180; -- Convert [-180, 180] into [0, 360] for simpler conditions
+ local PlayerRot = Player:GetYaw() + 180; -- Convert [-180, 180] into [0, 360] for simpler conditions
if ((PlayerRot < 45) or (PlayerRot > 315)) then
BlockZ = BlockZ - 1;
else
--
cgit v1.2.3
From 554e1c0dd3cedbcb4035d8ffa7351d56bee5dfb5 Mon Sep 17 00:00:00 2001
From: archshift
Date: Sun, 13 Jul 2014 16:10:01 -0700
Subject: OnEntityAddEffect.lua: Removed Originator param
---
MCServer/Plugins/APIDump/Hooks/OnEntityAddEffect.lua | 1 -
1 file changed, 1 deletion(-)
(limited to 'MCServer')
diff --git a/MCServer/Plugins/APIDump/Hooks/OnEntityAddEffect.lua b/MCServer/Plugins/APIDump/Hooks/OnEntityAddEffect.lua
index 423a2200b..1d1658a6f 100644
--- a/MCServer/Plugins/APIDump/Hooks/OnEntityAddEffect.lua
+++ b/MCServer/Plugins/APIDump/Hooks/OnEntityAddEffect.lua
@@ -18,7 +18,6 @@ return
{ Name = "EffectType", Type = "number", Notes = "The type of the effect to be added. One of the effXXX constants." },
{ Name = "EffectDuration", Type = "number", Notes = "The duration of the effect to be added, in ticks." },
{ Name = "EffectIntensity", Type = "number", Notes = "The intensity (level) of the effect to be added. " },
- { Name = "Originator", Type = "{{cEntity}}", Notes = "The entity who originated the effect (threw the potion, the cavespider that used poison bite, etc.) May be nil if there's no originator associated with the effect. " },
{ Name = "DistanceModifier", Type = "number", Notes = "The modifier for the effect intensity, based on distance. Used mainly for splash potions." },
},
Returns = [[
--
cgit v1.2.3
From fc6a5878df2615262eb53cb1ca4ccfcf1e299dc6 Mon Sep 17 00:00:00 2001
From: Howaner
Date: Fri, 18 Jul 2014 01:45:45 +0200
Subject: Removed special character in APIDump
---
MCServer/Plugins/APIDump/Hooks/OnPlayerUsedBlock.lua | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'MCServer')
diff --git a/MCServer/Plugins/APIDump/Hooks/OnPlayerUsedBlock.lua b/MCServer/Plugins/APIDump/Hooks/OnPlayerUsedBlock.lua
index 4c91ea89e..9a0e036b9 100644
--- a/MCServer/Plugins/APIDump/Hooks/OnPlayerUsedBlock.lua
+++ b/MCServer/Plugins/APIDump/Hooks/OnPlayerUsedBlock.lua
@@ -2,7 +2,7 @@ return
{
HOOK_PLAYER_USED_BLOCK =
{
- CalledWhen = "A player has just used a block (chest, furnace…). Notification only.",
+ CalledWhen = "A player has just used a block (chest, furnace...). Notification only.",
DefaultFnName = "OnPlayerUsedBlock", -- also used as pagename
Desc = [[
This hook is called after a {{cPlayer|player}} has right-clicked a block that can be used, such as a
--
cgit v1.2.3
From 51b91befbd26b630cd2cecaec081edd03edfb5f3 Mon Sep 17 00:00:00 2001
From: Howaner
Date: Fri, 18 Jul 2014 23:11:59 +0200
Subject: Added RemoveItem() function to the player inventory.
---
MCServer/Plugins/Debuggers/Debuggers.lua | 40 ++++++++++++++++++++++++++++----
1 file changed, 36 insertions(+), 4 deletions(-)
(limited to 'MCServer')
diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua
index 918204deb..95b36e854 100644
--- a/MCServer/Plugins/Debuggers/Debuggers.lua
+++ b/MCServer/Plugins/Debuggers/Debuggers.lua
@@ -60,9 +60,10 @@ function Initialize(Plugin)
PM:BindCommand("/ff", "debuggers", HandleFurnaceFuel, "- Shows how long the currently held item would burn in a furnace");
PM:BindCommand("/sched", "debuggers", HandleSched, "- Schedules a simple countdown using cWorld:ScheduleTask()");
PM:BindCommand("/cs", "debuggers", HandleChunkStay, "- Tests the ChunkStay Lua integration for the specified chunk coords");
- PM:BindCommand("/compo", "debuggers", HandleCompo, "- Tests the cCompositeChat bindings")
- PM:BindCommand("/sb", "debuggers", HandleSetBiome, "- Sets the biome around you to the specified one")
- PM:BindCommand("/wesel", "debuggers", HandleWESel, "- Expands the current WE selection by 1 block in X/Z")
+ PM:BindCommand("/compo", "debuggers", HandleCompo, "- Tests the cCompositeChat bindings");
+ PM:BindCommand("/sb", "debuggers", HandleSetBiome, "- Sets the biome around you to the specified one");
+ PM:BindCommand("/wesel", "debuggers", HandleWESel, "- Expands the current WE selection by 1 block in X/Z");
+ PM:BindCommand("/rmitem", "debuggers", HandleRMItem, "- Remove the specified item from the inventory.");
Plugin:AddWebTab("Debuggers", HandleRequest_Debuggers)
Plugin:AddWebTab("StressTest", HandleRequest_StressTest)
@@ -533,7 +534,7 @@ function OnTakeDamage(Receiver, TDI)
-- Receiver is cPawn
-- TDI is TakeDamageInfo
- LOG(Receiver:GetClass() .. " was dealt " .. DamageTypeToString(TDI.DamageType) .. " damage: Raw " .. TDI.RawDamage .. ", Final " .. TDI.FinalDamage .. " (" .. (TDI.RawDamage - TDI.FinalDamage) .. " covered by armor)");
+ -- LOG(Receiver:GetClass() .. " was dealt " .. DamageTypeToString(TDI.DamageType) .. " damage: Raw " .. TDI.RawDamage .. ", Final " .. TDI.FinalDamage .. " (" .. (TDI.RawDamage - TDI.FinalDamage) .. " covered by armor)");
return false;
end
@@ -1105,6 +1106,37 @@ end
+function HandleRMItem(a_Split, a_Player)
+ if ((#a_Split ~= 2) and (#a_Split ~= 3)) then
+ a_Player:SendMessage("Usage: /rmitem - [Count]")
+ return true
+ end
+
+ local Item = cItem()
+ if (not StringToItem(a_Split[2], Item)) then
+ a_Player:SendMessageFailure(a_Split[2] .. " isn't a valid item")
+ return true
+ end
+
+ if (#a_Split == 3) then
+ local Count = tonumber(a_Split[3])
+ if (Count == nil) then
+ a_Player:SendMessageFailure(a_Split[3] .. " isn't a valid number")
+ return true
+ end
+
+ Item.m_ItemCount = Count
+ end
+
+ local RemovedItems = a_Player:GetInventory():RemoveItem(Item)
+ a_Player:SendMessageSuccess("Removed " .. RemovedItems .. " Items!")
+ return true
+end
+
+
+
+
+
function HandleRequest_Debuggers(a_Request)
local FolderContents = cFile:GetFolderContents("./");
return "
The following objects have been returned by cFile:GetFolderContents():
- " .. table.concat(FolderContents, "
- ") .. "
";
--
cgit v1.2.3
From abe8a6bd4588892f27f779fd92beb941853c5583 Mon Sep 17 00:00:00 2001
From: madmaxoft
Date: Fri, 18 Jul 2014 23:48:06 +0200
Subject: APIDump: Documented RemoveItem().
---
MCServer/Plugins/APIDump/APIDesc.lua | 2 ++
1 file changed, 2 insertions(+)
(limited to 'MCServer')
diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua
index 0e626c580..e65da1d16 100644
--- a/MCServer/Plugins/APIDump/APIDesc.lua
+++ b/MCServer/Plugins/APIDump/APIDesc.lua
@@ -1155,6 +1155,7 @@ These ItemGrids are available in the API and can be manipulated by the plugins,
HasItems = { Params = "{{cItem|cItem}}", Return = "bool", Notes = "Returns true if there are at least as many items of the specified type as in the parameter" },
HowManyCanFit = { Params = "{{cItem|cItem}}", Return = "number", Notes = "Returns the number of the specified items that can fit in the storage, including empty slots" },
HowManyItems = { Params = "{{cItem|cItem}}", Return = "number", Notes = "Returns the number of the specified items that are currently stored" },
+ RemoveItem = { Params = "{{cItem}}", Return = "number", Notes = "Removes the specified item from the inventory, as many as possible, up to the item's m_ItemCount. Returns the number of items that were removed." },
RemoveOneEquippedItem = { Params = "", Return = "", Notes = "Removes one item from the hotbar's currently selected slot" },
SetArmorSlot = { Params = "ArmorSlotNum, {{cItem|cItem}}", Return = "", Notes = "Sets the specified armor slot contents" },
SetEquippedSlotNum = { Params = "EquippedSlotNum", Return = "", Notes = "Sets the currently selected hotbar slot number" },
@@ -1384,6 +1385,7 @@ local Item5 = cItem(E_ITEM_DIAMOND_CHESTPLATE, 1, 0, "thorns=1;unbreaking=3");
{ Params = "SlotNum", Return = "bool", Notes = "Returns true if the specified slot is empty, or an invalid slot is specified" },
{ Params = "X, Y", Return = "bool", Notes = "Returns true if the specified slot is empty, or an invalid slot is specified" },
},
+ RemoveItem = { Params = "{{cItem}}", Return = "number", Notes = "Removes the specified item from the grid, as many as possible, up to the item's m_ItemCount. Returns the number of items that were removed." },
RemoveOneItem =
{
{ Params = "SlotNum", Return = "{{cItem|cItem}}", Notes = "Removes one item from the stack in the specified slot and returns it as a single cItem. Empty slots are skipped and an empty item is returned" },
--
cgit v1.2.3
From 0346ab15adaf73e4d7c4ee4cfb175d40e721adfe Mon Sep 17 00:00:00 2001
From: madmaxoft
Date: Fri, 18 Jul 2014 23:51:15 +0200
Subject: Debuggers: Optimized and commented the /rmitem handler.
---
MCServer/Plugins/Debuggers/Debuggers.lua | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
(limited to 'MCServer')
diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua
index 95b36e854..b402c1867 100644
--- a/MCServer/Plugins/Debuggers/Debuggers.lua
+++ b/MCServer/Plugins/Debuggers/Debuggers.lua
@@ -1107,18 +1107,21 @@ end
function HandleRMItem(a_Split, a_Player)
- if ((#a_Split ~= 2) and (#a_Split ~= 3)) then
+ -- Check params:
+ if (a_Split[2] == nil) then
a_Player:SendMessage("Usage: /rmitem - [Count]")
return true
end
+ -- Parse the item type:
local Item = cItem()
if (not StringToItem(a_Split[2], Item)) then
a_Player:SendMessageFailure(a_Split[2] .. " isn't a valid item")
return true
end
- if (#a_Split == 3) then
+ -- Parse the optional item count
+ if (a_Split[3] ~= nil) then
local Count = tonumber(a_Split[3])
if (Count == nil) then
a_Player:SendMessageFailure(a_Split[3] .. " isn't a valid number")
@@ -1128,8 +1131,9 @@ function HandleRMItem(a_Split, a_Player)
Item.m_ItemCount = Count
end
- local RemovedItems = a_Player:GetInventory():RemoveItem(Item)
- a_Player:SendMessageSuccess("Removed " .. RemovedItems .. " Items!")
+ -- Remove the item:
+ local NumRemovedItems = a_Player:GetInventory():RemoveItem(Item)
+ a_Player:SendMessageSuccess("Removed " .. NumRemovedItems .. " Items!")
return true
end
--
cgit v1.2.3
From 1acd03f96f9b1133e1f76d76004f5fcddd0c4788 Mon Sep 17 00:00:00 2001
From: madmaxoft
Date: Mon, 28 Jul 2014 17:09:39 +0200
Subject: Added cClientHandle:GetUUIDsFromPlayerNames() to Lua API.
---
MCServer/Plugins/APIDump/APIDesc.lua | 1 +
1 file changed, 1 insertion(+)
(limited to 'MCServer')
diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua
index e65da1d16..f29c47338 100644
--- a/MCServer/Plugins/APIDump/APIDesc.lua
+++ b/MCServer/Plugins/APIDump/APIDesc.lua
@@ -529,6 +529,7 @@ end
GetPlayer = { Params = "", Return = "{{cPlayer|cPlayer}}", Notes = "Returns the player object connected to this client. Note that this may be nil, for example if the player object is not yet spawned." },
GetUniqueID = { Params = "", Return = "number", Notes = "Returns the UniqueID of the client used to identify the client in the server" },
GetUUID = { Params = "", Return = "string", Notes = "Returns the authentication-based UUID of the client. This UUID should be used to identify the player when persisting any player-related data." },
+ GetUUIDsFromPlayerNames = { Params = "PlayerNames", Return = "table", Notes = "(STATIC) Returns a table that contains the map, 'PlayerName' -> 'UUID', for all valid playernames in the input array-table. PlayerNames not recognized will not be set in the returned map. Queries the Mojang servers for the results. WARNING: Do NOT use this function while the server is running. Only use it when the server is starting up (inside the Initialize() method), otherwise you will lag the server severely. NOTE: Mojang API has a limit of 100 names per query and 600 queries per 10 minutes (may change)" },
GetUsername = { Params = "", Return = "string", Notes = "Returns the username that the client has provided" },
GetViewDistance = { Params = "", Return = "number", Notes = "Returns the viewdistance (number of chunks loaded for the player in each direction)" },
HasPluginChannel = { Params = "ChannelName", Return = "bool", Notes = "Returns true if the client has registered to receive messages on the specified plugin channel." },
--
cgit v1.2.3
From b6677efecdd026a7eb8d652a067e4770182cd7c1 Mon Sep 17 00:00:00 2001
From: madmaxoft
Date: Mon, 28 Jul 2014 17:14:23 +0200
Subject: Debuggers: Added an example for
cClientHandle:GetUUIDsFromPlayerNames().
---
MCServer/Plugins/Debuggers/Debuggers.lua | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
(limited to 'MCServer')
diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua
index b402c1867..80416acc7 100644
--- a/MCServer/Plugins/Debuggers/Debuggers.lua
+++ b/MCServer/Plugins/Debuggers/Debuggers.lua
@@ -80,6 +80,7 @@ function Initialize(Plugin)
TestBlockAreasString()
TestStringBase64()
+ TestUUIDFromName()
--[[
-- Test cCompositeChat usage in console-logging:
@@ -275,6 +276,36 @@ end
+function TestUUIDFromName()
+ LOG("Testing UUID-from-Name resolution...")
+
+ -- Test by querying a few existing names, along with a non-existent one:
+ local PlayerNames =
+ {
+ "xoft",
+ "aloe_vera",
+ "nonexistent_player",
+ }
+ -- WARNING: Blocking operation! DO NOT USE IN TICK THREAD!
+ local UUIDs = cClientHandle:GetUUIDsFromPlayerNames(PlayerNames)
+
+ -- Log the results:
+ for _, name in ipairs(PlayerNames) do
+ local UUID = UUIDs[name]
+ if (UUID == nil) then
+ LOG(" UUID(" .. name .. ") not found.")
+ else
+ LOG(" UUID(" .. name .. ") = \"" .. UUID .. "\"")
+ end
+ end
+
+ LOG("UUID-from-Name resolution test finished.")
+end
+
+
+
+
+
function TestSQLiteBindings()
LOG("Testing SQLite bindings...");
--
cgit v1.2.3
From 6476bd0e2ee7e128e3eaa56159f169f0a53736ff Mon Sep 17 00:00:00 2001
From: madmaxoft
Date: Wed, 30 Jul 2014 13:44:03 +0200
Subject: Exported cMojangAPI to Lua.
---
MCServer/Plugins/APIDump/APIDesc.lua | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
(limited to 'MCServer')
diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua
index f29c47338..e5114784e 100644
--- a/MCServer/Plugins/APIDump/APIDesc.lua
+++ b/MCServer/Plugins/APIDump/APIDesc.lua
@@ -529,7 +529,6 @@ end
GetPlayer = { Params = "", Return = "{{cPlayer|cPlayer}}", Notes = "Returns the player object connected to this client. Note that this may be nil, for example if the player object is not yet spawned." },
GetUniqueID = { Params = "", Return = "number", Notes = "Returns the UniqueID of the client used to identify the client in the server" },
GetUUID = { Params = "", Return = "string", Notes = "Returns the authentication-based UUID of the client. This UUID should be used to identify the player when persisting any player-related data." },
- GetUUIDsFromPlayerNames = { Params = "PlayerNames", Return = "table", Notes = "(STATIC) Returns a table that contains the map, 'PlayerName' -> 'UUID', for all valid playernames in the input array-table. PlayerNames not recognized will not be set in the returned map. Queries the Mojang servers for the results. WARNING: Do NOT use this function while the server is running. Only use it when the server is starting up (inside the Initialize() method), otherwise you will lag the server severely. NOTE: Mojang API has a limit of 100 names per query and 600 queries per 10 minutes (may change)" },
GetUsername = { Params = "", Return = "string", Notes = "Returns the username that the client has provided" },
GetViewDistance = { Params = "", Return = "number", Notes = "Returns the viewdistance (number of chunks loaded for the player in each direction)" },
HasPluginChannel = { Params = "ChannelName", Return = "bool", Notes = "Returns true if the client has registered to receive messages on the specified plugin channel." },
@@ -1607,6 +1606,31 @@ a_Player:OpenWindow(Window);
}, -- cMapManager
+ cMojangAPI =
+ {
+ Desc = [[
+ Provides interface to various API functions that Mojang provides through their servers. Note that
+ some of these calls will wait for a response from the network, and so shouldn't be used while the
+ server is fully running (or at least when there are players connected) to avoid percepted lag.
+
+ Some functions are static and do not require an instance to be called. For others, you need to get
+ the singleton instance of this class using {{cRoot}}'s GetMojangAPI() function.
+
+ Mojang uses two formats for UUIDs, short and dashed. MCServer works with short UUIDs internally, but
+ will convert to dashed UUIDs where needed - in the protocol login for example. The MakeUUIDShort()
+ and MakeUUIDDashed() functions are provided for plugins to use for conversion between the two
+ formats.
+ ]],
+ Functions =
+ {
+ AddPlayerNameToUUIDMapping = { Params = "PlayerName, UUID", Return = "", Notes = "Adds the specified PlayerName-to-UUID mapping into the cache, with current timestamp." },
+ GetUUIDsFromPlayerNames = { Params = "PlayerNames", Return = "table", Notes = "Returns a table that contains the map, 'PlayerName' -> 'UUID', for all valid playernames in the input array-table. PlayerNames not recognized will not be set in the returned map. Queries the Mojang servers for the results. WARNING: Do NOT use this function while the server is running. Only use it when the server is starting up (inside the Initialize() method), otherwise you will lag the server severely." },
+ MakeUUIDDashed = { Params = "UUID", Return = "DashedUUID", Notes = "(STATIC) Converts the UUID to a dashed format (\"01234567-8901-2345-6789-012345678901\"). Accepts both dashed and short UUIDs. Logs a warning and returns an empty string if UUID format not recognized." },
+ MakeUUIDShort = { Params = "UUID", Return = "ShortUUID", Notes = "(STATIC) Converts the UUID to a short format (without dashes, \"01234567890123456789012345678901\"). Accepts both dashed and short UUIDs. Logs a warning and returns an empty string if UUID format not recognized." },
+ },
+
+ },
+
cMonster =
{
Desc = [[
@@ -2002,6 +2026,7 @@ cPluginManager.AddHook(cPluginManager.HOOK_CHAT, OnChatMessage);
GetFurnaceFuelBurnTime = { Params = "{{cItem|Fuel}}", Return = "number", Notes = "(STATIC) Returns the number of ticks for how long the item would fuel a furnace. Returns zero if not a fuel." },
GetFurnaceRecipe = { Params = "{{cItem|InItem}}", Return = "{{cItem|OutItem}}, NumTicks, {{cItem|InItem}}", Notes = "(STATIC) Returns the furnace recipe for smelting the specified input. If a recipe is found, returns the smelted result, the number of ticks required for the smelting operation, and the input consumed (note that MCServer supports smelting M items into N items and different smelting rates). If no recipe is found, returns no value." },
GetGroupManager = { Params = "", Return = "{{cGroupManager|cGroupManager}}", Notes = "Returns the cGroupManager object." },
+ GetMojangAPI = { Params = "", Return = "{{cMojangAPI}}", Notes = "Returns the {{cMojangAPI}} object." },
GetPhysicalRAMUsage = { Params = "", Return = "number", Notes = "Returns the amount of physical RAM that the entire MCServer process is using, in KiB. Negative if the OS doesn't support this query." },
GetPluginManager = { Params = "", Return = "{{cPluginManager|cPluginManager}}", Notes = "Returns the cPluginManager object." },
GetPrimaryServerVersion = { Params = "", Return = "number", Notes = "Returns the servers primary server version." },
--
cgit v1.2.3
From afef7a79d7a214eec66e427da589172a40a18fef Mon Sep 17 00:00:00 2001
From: madmaxoft
Date: Wed, 30 Jul 2014 13:53:23 +0200
Subject: Debuggers: Updated for the new cMojangAPI changes.
---
MCServer/Plugins/Debuggers/Debuggers.lua | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
(limited to 'MCServer')
diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua
index 80416acc7..575d696cb 100644
--- a/MCServer/Plugins/Debuggers/Debuggers.lua
+++ b/MCServer/Plugins/Debuggers/Debuggers.lua
@@ -287,7 +287,7 @@ function TestUUIDFromName()
"nonexistent_player",
}
-- WARNING: Blocking operation! DO NOT USE IN TICK THREAD!
- local UUIDs = cClientHandle:GetUUIDsFromPlayerNames(PlayerNames)
+ local UUIDs = cMojangAPI:GetUUIDsFromPlayerNames(PlayerNames)
-- Log the results:
for _, name in ipairs(PlayerNames) do
@@ -299,6 +299,15 @@ function TestUUIDFromName()
end
end
+ -- Test once more with the same players, valid-only. This should go directly from cache, so fast.
+ LOG("Testing again with the same valid players...")
+ local ValidPlayerNames =
+ {
+ "xoft",
+ "aloe_vera",
+ }
+ UUIDs = cMojangAPI:GetUUIDsFromPlayerNames(ValidPlayerNames);
+
LOG("UUID-from-Name resolution test finished.")
end
--
cgit v1.2.3
From 1793644feff66b076980c669ede94d7b03eceafe Mon Sep 17 00:00:00 2001
From: madmaxoft
Date: Wed, 30 Jul 2014 14:02:36 +0200
Subject: APIDump: Fixed UUID-related documentation.
---
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 e5114784e..692ca80ac 100644
--- a/MCServer/Plugins/APIDump/APIDesc.lua
+++ b/MCServer/Plugins/APIDump/APIDesc.lua
@@ -523,12 +523,12 @@ end
Functions =
{
- GenerateOfflineUUID = { Params = "Username", Return = "string", Notes = "(STATIC) Generates an UUID based on the player name provided. This is used for the offline (non-auth) mode, when there's no UUID source. Each username generates a unique and constant UUID, so that when the player reconnects with the same name, their UUID is the same. Returns a 36-char UUID (with dashes)." },
+ GenerateOfflineUUID = { Params = "Username", Return = "string", Notes = "(STATIC) Generates an UUID based on the player name provided. This is used for the offline (non-auth) mode, when there's no UUID source. Each username generates a unique and constant UUID, so that when the player reconnects with the same name, their UUID is the same. Returns a 32-char UUID (no dashes)." },
GetLocale = { Params = "", Return = "Locale", Notes = "Returns the locale string that the client sends as part of the protocol handshake. Can be used to provide localized strings." },
GetPing = { Params = "", Return = "number", Notes = "Returns the ping time, in ms" },
GetPlayer = { Params = "", Return = "{{cPlayer|cPlayer}}", Notes = "Returns the player object connected to this client. Note that this may be nil, for example if the player object is not yet spawned." },
GetUniqueID = { Params = "", Return = "number", Notes = "Returns the UniqueID of the client used to identify the client in the server" },
- GetUUID = { Params = "", Return = "string", Notes = "Returns the authentication-based UUID of the client. This UUID should be used to identify the player when persisting any player-related data." },
+ GetUUID = { Params = "", Return = "string", Notes = "Returns the authentication-based UUID of the client. This UUID should be used to identify the player when persisting any player-related data. Returns a 32-char UUID (no dashes)" },
GetUsername = { Params = "", Return = "string", Notes = "Returns the username that the client has provided" },
GetViewDistance = { Params = "", Return = "number", Notes = "Returns the viewdistance (number of chunks loaded for the player in each direction)" },
HasPluginChannel = { Params = "ChannelName", Return = "bool", Notes = "Returns true if the client has registered to receive messages on the specified plugin channel." },
--
cgit v1.2.3
From a71c2da3f8ee329977902a36274d720908a77c48 Mon Sep 17 00:00:00 2001
From: madmaxoft
Date: Wed, 30 Jul 2014 17:07:57 +0200
Subject: APIDump: Added notes about cache to cMojangAPI.
---
MCServer/Plugins/APIDump/APIDesc.lua | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
(limited to 'MCServer')
diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua
index 692ca80ac..2a8ae90f9 100644
--- a/MCServer/Plugins/APIDump/APIDesc.lua
+++ b/MCServer/Plugins/APIDump/APIDesc.lua
@@ -1619,7 +1619,13 @@ a_Player:OpenWindow(Window);
Mojang uses two formats for UUIDs, short and dashed. MCServer works with short UUIDs internally, but
will convert to dashed UUIDs where needed - in the protocol login for example. The MakeUUIDShort()
and MakeUUIDDashed() functions are provided for plugins to use for conversion between the two
- formats.
+ formats.
+
+ This class will cache values returned by the API service. The cache will hold the values for 7 days
+ by default, after that, they will no longer be available. This is in order to not let the server get
+ banned from using the API service, since they are rate-limited to 600 queries per 10 minutes. The
+ cache contents also gets updated whenever a player successfully joins, since that makes the server
+ contact the API service, too, and retrieve the relevant data.
]],
Functions =
{
--
cgit v1.2.3
From 66d34b83d27a72ed4cc2598527c25dfb8c1a873c Mon Sep 17 00:00:00 2001
From: Howaner
Date: Wed, 30 Jul 2014 22:31:43 +0200
Subject: Added beacon documentation.
---
MCServer/Plugins/APIDump/APIDesc.lua | 1 +
MCServer/Plugins/APIDump/Classes/BlockEntities.lua | 26 ++++++++++++++++++++++
2 files changed, 27 insertions(+)
(limited to 'MCServer')
diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua
index e65da1d16..2a592e1e1 100644
--- a/MCServer/Plugins/APIDump/APIDesc.lua
+++ b/MCServer/Plugins/APIDump/APIDesc.lua
@@ -2244,6 +2244,7 @@ end
DigBlock = { Params = "X, Y, Z", Return = "", Notes = "Replaces the specified block with air, without dropping the usual pickups for the block. Wakes up the simulators for the block and its neighbors." },
DoExplosionAt = { Params = "Force, X, Y, Z, CanCauseFire, Source, SourceData", Return = "", Notes = "Creates an explosion of the specified relative force in the specified position. If CanCauseFire is set, the explosion will set blocks on fire, too. The Source parameter specifies the source of the explosion, one of the esXXX constants. The SourceData parameter is specific to each source type, usually it provides more info about the source." },
DoWithBlockEntityAt = { Params = "X, Y, Z, CallbackFunction, [CallbackData]", Return = "bool", Notes = "If there is a block entity at the specified coords, calls the CallbackFunction with the {{cBlockEntity}} parameter representing the block entity. The CallbackFunction has the following signature: function Callback({{cBlockEntity|BlockEntity}}, [CallbackData])
The function returns false if there is no block entity, or if there is, it returns the bool value that the callback has returned. Use {{tolua}}.cast() to cast the Callback's BlockEntity parameter to the correct {{cBlockEntity}} descendant." },
+ DoWithBeaconAt = { Params = "X, Y, Z, CallbackFunction, [CallbackData]", Return = "bool", Notes = "If there is a beacon at the specified coords, calls the CallbackFunction with the {{cBeaconEntity}} parameter representing the beacon. The CallbackFunction has the following signature: function Callback({{cBeaconEntity|BeaconEntity}}, [CallbackData])
The function returns false if there is no beacon, or if there is, it returns the bool value that the callback has returned." },
DoWithChestAt = { Params = "X, Y, Z, CallbackFunction, [CallbackData]", Return = "bool", Notes = "If there is a chest at the specified coords, calls the CallbackFunction with the {{cChestEntity}} parameter representing the chest. The CallbackFunction has the following signature: function Callback({{cChestEntity|ChestEntity}}, [CallbackData])
The function returns false if there is no chest, or if there is, it returns the bool value that the callback has returned." },
DoWithCommandBlockAt = { Params = "X, Y, Z, CallbackFunction, [CallbackData]", Return = "bool", Notes = "If there is a command block at the specified coords, calls the CallbackFunction with the {{cCommandBlockEntity}} parameter representing the command block. The CallbackFunction has the following signature: function Callback({{cCommandBlockEntity|CommandBlockEntity}}, [CallbackData])
The function returns false if there is no command block, or if there is, it returns the bool value that the callback has returned." },
DoWithDispenserAt = { Params = "X, Y, Z, CallbackFunction, [CallbackData]", Return = "bool", Notes = "If there is a dispenser at the specified coords, calls the CallbackFunction with the {{cDispenserEntity}} parameter representing the dispenser. The CallbackFunction has the following signature: function Callback({{cDispenserEntity|DispenserEntity}}, [CallbackData])
The function returns false if there is no dispenser, or if there is, it returns the bool value that the callback has returned." },
diff --git a/MCServer/Plugins/APIDump/Classes/BlockEntities.lua b/MCServer/Plugins/APIDump/Classes/BlockEntities.lua
index de42f66df..294d47295 100644
--- a/MCServer/Plugins/APIDump/Classes/BlockEntities.lua
+++ b/MCServer/Plugins/APIDump/Classes/BlockEntities.lua
@@ -50,6 +50,32 @@ return
},
},
+ cBeaconEntity =
+ {
+ Desc = [[
+ A beacon entity is a {{cBlockEntityWithItems|cBlockEntityWithItems}} descendant that represents a beacon
+ in the world.
+ ]],
+
+ Inherits = "cBlockEntityWithItems",
+
+ Functions =
+ {
+ IsActive = { Params = "", Return = "bool", Notes = "Is the beacon active?" },
+ GetBeaconLevel = { Params = "", Return = "number", Notes = "Returns the beacon level. (0 - 4)" },
+ GetPrimaryPotion = { Params = "", Return = "EffectType", Notes = "Returns the primary potion." },
+ GetSecondaryPotion = { Params = "", Return = "EffectType", Notes = "Returns the secondary potion." },
+ SelectPrimaryPotion = { Params = "EffectType", Return = "bool", Notes = "Select the primary potion. Returns false when the potion is invalid." },
+ SelectSecondaryPotion = { Params = "EffectType", Return = "bool", Notes = "Select the secondary potion. Returns false when the potion is invalid." },
+ CalculatePyramidLevel = { Params = "", Return = "number", Notes = "Calculate the amount of layers the pyramid below the beacon has." },
+ IsBeaconBlocked = { Params = "", Return = "bool", Notes = "Is the beacon blocked by non-transparent blocks that are higher than the beacon?" },
+ UpdateBeacon = { Params = "", Return = "", Notes = "Update the beacon." },
+ GiveEffects = { Params = "", Return = "", Notes = "Give the near-players the effects." },
+ IsMineralBlock = { Params = "BLOCKTYPE", Return = "bool", Notes = "Returns true if the block is a diamond block, a golden block, an iron block or an emerald block." },
+ IsValidPotion = { Params = "EffectType", Return = "bool", Notes = "Returns true if the potion can be used." },
+ },
+ },
+
cChestEntity =
{
Desc = [[
--
cgit v1.2.3
From 8b519bf6e20a987c9544ef11f0df6467831cc069 Mon Sep 17 00:00:00 2001
From: madmaxoft
Date: Thu, 31 Jul 2014 10:02:50 +0200
Subject: MojangAPI: Added a UseCachedOnly param to GetUUIDsFromPlayerNames().
---
MCServer/Plugins/APIDump/APIDesc.lua | 2 +-
MCServer/Plugins/Debuggers/Debuggers.lua | 32 +++++++++++++++++++++++++++++++-
2 files changed, 32 insertions(+), 2 deletions(-)
(limited to 'MCServer')
diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua
index 2a8ae90f9..9d0e90999 100644
--- a/MCServer/Plugins/APIDump/APIDesc.lua
+++ b/MCServer/Plugins/APIDump/APIDesc.lua
@@ -1630,7 +1630,7 @@ a_Player:OpenWindow(Window);
Functions =
{
AddPlayerNameToUUIDMapping = { Params = "PlayerName, UUID", Return = "", Notes = "Adds the specified PlayerName-to-UUID mapping into the cache, with current timestamp." },
- GetUUIDsFromPlayerNames = { Params = "PlayerNames", Return = "table", Notes = "Returns a table that contains the map, 'PlayerName' -> 'UUID', for all valid playernames in the input array-table. PlayerNames not recognized will not be set in the returned map. Queries the Mojang servers for the results. WARNING: Do NOT use this function while the server is running. Only use it when the server is starting up (inside the Initialize() method), otherwise you will lag the server severely." },
+ GetUUIDsFromPlayerNames = { Params = "PlayerNames, [UseOnlyCached]", Return = "table", Notes = "Returns a table that contains the map, 'PlayerName' -> 'UUID', for all valid playernames in the input array-table. PlayerNames not recognized will not be set in the returned map. If UseOnlyCached is false (the default), queries the Mojang servers for the results that are not in the cache.
WARNING: Do NOT use this function with UseOnlyCached set to false while the server is running. Only use it when the server is starting up (inside the Initialize() method), otherwise you will lag the server severely." },
MakeUUIDDashed = { Params = "UUID", Return = "DashedUUID", Notes = "(STATIC) Converts the UUID to a dashed format (\"01234567-8901-2345-6789-012345678901\"). Accepts both dashed and short UUIDs. Logs a warning and returns an empty string if UUID format not recognized." },
MakeUUIDShort = { Params = "UUID", Return = "ShortUUID", Notes = "(STATIC) Converts the UUID to a short format (without dashes, \"01234567890123456789012345678901\"). Accepts both dashed and short UUIDs. Logs a warning and returns an empty string if UUID format not recognized." },
},
diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua
index 575d696cb..075cfa40c 100644
--- a/MCServer/Plugins/Debuggers/Debuggers.lua
+++ b/MCServer/Plugins/Debuggers/Debuggers.lua
@@ -307,8 +307,38 @@ function TestUUIDFromName()
"aloe_vera",
}
UUIDs = cMojangAPI:GetUUIDsFromPlayerNames(ValidPlayerNames);
+
+ -- Log the results:
+ for _, name in ipairs(ValidPlayerNames) do
+ local UUID = UUIDs[name]
+ if (UUID == nil) then
+ LOG(" UUID(" .. name .. ") not found.")
+ else
+ LOG(" UUID(" .. name .. ") = \"" .. UUID .. "\"")
+ end
+ end
+
+ -- Test yet again, cache-only:
+ LOG("Testing once more, cache only...")
+ local PlayerNames3 =
+ {
+ "xoft",
+ "aloe_vera",
+ "notch", -- Valid player name, but not cached (most likely :)
+ }
+ UUIDs = cMojangAPI:GetUUIDsFromPlayerNames(PlayerNames3, true)
- LOG("UUID-from-Name resolution test finished.")
+ -- Log the results:
+ for _, name in ipairs(PlayerNames3) do
+ local UUID = UUIDs[name]
+ if (UUID == nil) then
+ LOG(" UUID(" .. name .. ") not found.")
+ else
+ LOG(" UUID(" .. name .. ") = \"" .. UUID .. "\"")
+ end
+ end
+
+ LOG("UUID-from-Name resolution tests finished.")
end
--
cgit v1.2.3
From c49d4fd215170da29b5c285cc6a344ec102764c6 Mon Sep 17 00:00:00 2001
From: Howaner
Date: Thu, 31 Jul 2014 12:15:18 +0200
Subject: Updated documentation.
---
MCServer/Plugins/APIDump/Classes/BlockEntities.lua | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
(limited to 'MCServer')
diff --git a/MCServer/Plugins/APIDump/Classes/BlockEntities.lua b/MCServer/Plugins/APIDump/Classes/BlockEntities.lua
index 294d47295..524087a8e 100644
--- a/MCServer/Plugins/APIDump/Classes/BlockEntities.lua
+++ b/MCServer/Plugins/APIDump/Classes/BlockEntities.lua
@@ -63,16 +63,16 @@ return
{
IsActive = { Params = "", Return = "bool", Notes = "Is the beacon active?" },
GetBeaconLevel = { Params = "", Return = "number", Notes = "Returns the beacon level. (0 - 4)" },
- GetPrimaryPotion = { Params = "", Return = "EffectType", Notes = "Returns the primary potion." },
- GetSecondaryPotion = { Params = "", Return = "EffectType", Notes = "Returns the secondary potion." },
- SelectPrimaryPotion = { Params = "EffectType", Return = "bool", Notes = "Select the primary potion. Returns false when the potion is invalid." },
- SelectSecondaryPotion = { Params = "EffectType", Return = "bool", Notes = "Select the secondary potion. Returns false when the potion is invalid." },
+ GetPrimaryEffect = { Params = "", Return = "EffectType", Notes = "Returns the primary potion." },
+ GetSecondaryEffect = { Params = "", Return = "EffectType", Notes = "Returns the secondary potion." },
+ SelectPrimaryEffect = { Params = "EffectType", Return = "bool", Notes = "Select the primary effect. Returns false when the effect is invalid." },
+ SelectSecondaryEffect = { Params = "EffectType", Return = "bool", Notes = "Select the secondary effect. Returns false when the effect is invalid." },
CalculatePyramidLevel = { Params = "", Return = "number", Notes = "Calculate the amount of layers the pyramid below the beacon has." },
IsBeaconBlocked = { Params = "", Return = "bool", Notes = "Is the beacon blocked by non-transparent blocks that are higher than the beacon?" },
UpdateBeacon = { Params = "", Return = "", Notes = "Update the beacon." },
GiveEffects = { Params = "", Return = "", Notes = "Give the near-players the effects." },
IsMineralBlock = { Params = "BLOCKTYPE", Return = "bool", Notes = "Returns true if the block is a diamond block, a golden block, an iron block or an emerald block." },
- IsValidPotion = { Params = "EffectType", Return = "bool", Notes = "Returns true if the potion can be used." },
+ IsValidEffect = { Params = "EffectType", Return = "bool", Notes = "Returns true if the effect can be used." },
},
},
--
cgit v1.2.3
From c138d19c31ee85a38fe758bc2c69591bcfe42230 Mon Sep 17 00:00:00 2001
From: Howaner
Date: Thu, 31 Jul 2014 18:16:52 +0200
Subject: Updated documentation again.
---
MCServer/Plugins/APIDump/Classes/BlockEntities.lua | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
(limited to 'MCServer')
diff --git a/MCServer/Plugins/APIDump/Classes/BlockEntities.lua b/MCServer/Plugins/APIDump/Classes/BlockEntities.lua
index 524087a8e..90ebf12e6 100644
--- a/MCServer/Plugins/APIDump/Classes/BlockEntities.lua
+++ b/MCServer/Plugins/APIDump/Classes/BlockEntities.lua
@@ -63,10 +63,10 @@ return
{
IsActive = { Params = "", Return = "bool", Notes = "Is the beacon active?" },
GetBeaconLevel = { Params = "", Return = "number", Notes = "Returns the beacon level. (0 - 4)" },
- GetPrimaryEffect = { Params = "", Return = "EffectType", Notes = "Returns the primary potion." },
- GetSecondaryEffect = { Params = "", Return = "EffectType", Notes = "Returns the secondary potion." },
- SelectPrimaryEffect = { Params = "EffectType", Return = "bool", Notes = "Select the primary effect. Returns false when the effect is invalid." },
- SelectSecondaryEffect = { Params = "EffectType", Return = "bool", Notes = "Select the secondary effect. Returns false when the effect is invalid." },
+ GetPrimaryEffect = { Params = "", Return = "EffectType", Notes = "Returns the primary effect." },
+ GetSecondaryEffect = { Params = "", Return = "EffectType", Notes = "Returns the secondary effect." },
+ SetPrimaryEffect = { Params = "EffectType", Return = "bool", Notes = "Select the primary effect. Returns false when the effect is invalid." },
+ SetSecondaryEffect = { Params = "EffectType", Return = "bool", Notes = "Select the secondary effect. Returns false when the effect is invalid." },
CalculatePyramidLevel = { Params = "", Return = "number", Notes = "Calculate the amount of layers the pyramid below the beacon has." },
IsBeaconBlocked = { Params = "", Return = "bool", Notes = "Is the beacon blocked by non-transparent blocks that are higher than the beacon?" },
UpdateBeacon = { Params = "", Return = "", Notes = "Update the beacon." },
--
cgit v1.2.3
From c865fc8ca501e7405da2ce8353628373e4526053 Mon Sep 17 00:00:00 2001
From: Tiger Wang
Date: Fri, 1 Aug 2014 22:05:40 +0100
Subject: Improved endermen code a little
---
MCServer/monsters.ini | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'MCServer')
diff --git a/MCServer/monsters.ini b/MCServer/monsters.ini
index b631fc1a9..d29b01d8f 100644
--- a/MCServer/monsters.ini
+++ b/MCServer/monsters.ini
@@ -44,7 +44,7 @@ MaxHealth=10
AttackRange=2.0
AttackRate=1
AttackDamage=4.0
-SightDistance=25.0
+SightDistance=64.0
MaxHealth=40
[ZombiePigman]
--
cgit v1.2.3
From 003f18bd0f7593bddf5c6af89e3f6fc13632300d Mon Sep 17 00:00:00 2001
From: madmaxoft
Date: Sun, 3 Aug 2014 12:12:28 +0200
Subject: Added cMojangAPI:GetUUIDFromPlayerName().
This is a simpler way to ask for a single name -> uuid conversion.
---
MCServer/Plugins/APIDump/APIDesc.lua | 1 +
1 file changed, 1 insertion(+)
(limited to 'MCServer')
diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua
index 1fa2608b3..4f8567530 100644
--- a/MCServer/Plugins/APIDump/APIDesc.lua
+++ b/MCServer/Plugins/APIDump/APIDesc.lua
@@ -1630,6 +1630,7 @@ a_Player:OpenWindow(Window);
Functions =
{
AddPlayerNameToUUIDMapping = { Params = "PlayerName, UUID", Return = "", Notes = "Adds the specified PlayerName-to-UUID mapping into the cache, with current timestamp." },
+ GetUUIDFromPlayerName = { Params = "PlayerName, [UseOnlyCached]", Return = "UUID", Notes = "Returns the UUID that corresponds to the given playername, or an empty string on error. If UseOnlyCached is false (the default), queries the Mojang servers if the playername is not in the cache.
WARNING: Do NOT use this function with UseOnlyCached set to false while the server is running. Only use it when the server is starting up (inside the Initialize() method), otherwise you will lag the server severely." },
GetUUIDsFromPlayerNames = { Params = "PlayerNames, [UseOnlyCached]", Return = "table", Notes = "Returns a table that contains the map, 'PlayerName' -> 'UUID', for all valid playernames in the input array-table. PlayerNames not recognized will not be set in the returned map. If UseOnlyCached is false (the default), queries the Mojang servers for the results that are not in the cache.
WARNING: Do NOT use this function with UseOnlyCached set to false while the server is running. Only use it when the server is starting up (inside the Initialize() method), otherwise you will lag the server severely." },
MakeUUIDDashed = { Params = "UUID", Return = "DashedUUID", Notes = "(STATIC) Converts the UUID to a dashed format (\"01234567-8901-2345-6789-012345678901\"). Accepts both dashed and short UUIDs. Logs a warning and returns an empty string if UUID format not recognized." },
MakeUUIDShort = { Params = "UUID", Return = "ShortUUID", Notes = "(STATIC) Converts the UUID to a short format (without dashes, \"01234567890123456789012345678901\"). Accepts both dashed and short UUIDs. Logs a warning and returns an empty string if UUID format not recognized." },
--
cgit v1.2.3
From 21f52676f3848d58ff1e4eb511c691d4a4ed824b Mon Sep 17 00:00:00 2001
From: madmaxoft
Date: Sun, 3 Aug 2014 21:32:20 +0200
Subject: cMojangAPI: Added UUID-to-Name lookup.
Also fixed the bindings, now all functions are static-like.
---
MCServer/Plugins/APIDump/APIDesc.lua | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
(limited to 'MCServer')
diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua
index 4f8567530..ad3b24ca5 100644
--- a/MCServer/Plugins/APIDump/APIDesc.lua
+++ b/MCServer/Plugins/APIDump/APIDesc.lua
@@ -1613,8 +1613,7 @@ a_Player:OpenWindow(Window);
some of these calls will wait for a response from the network, and so shouldn't be used while the
server is fully running (or at least when there are players connected) to avoid percepted lag.
- Some functions are static and do not require an instance to be called. For others, you need to get
- the singleton instance of this class using {{cRoot}}'s GetMojangAPI() function.
+ All the functions are static, call them using the cMojangAPI:Function()
convention.
Mojang uses two formats for UUIDs, short and dashed. MCServer works with short UUIDs internally, but
will convert to dashed UUIDs where needed - in the protocol login for example. The MakeUUIDShort()
@@ -1629,11 +1628,12 @@ a_Player:OpenWindow(Window);
]],
Functions =
{
- AddPlayerNameToUUIDMapping = { Params = "PlayerName, UUID", Return = "", Notes = "Adds the specified PlayerName-to-UUID mapping into the cache, with current timestamp." },
- GetUUIDFromPlayerName = { Params = "PlayerName, [UseOnlyCached]", Return = "UUID", Notes = "Returns the UUID that corresponds to the given playername, or an empty string on error. If UseOnlyCached is false (the default), queries the Mojang servers if the playername is not in the cache.
WARNING: Do NOT use this function with UseOnlyCached set to false while the server is running. Only use it when the server is starting up (inside the Initialize() method), otherwise you will lag the server severely." },
- GetUUIDsFromPlayerNames = { Params = "PlayerNames, [UseOnlyCached]", Return = "table", Notes = "Returns a table that contains the map, 'PlayerName' -> 'UUID', for all valid playernames in the input array-table. PlayerNames not recognized will not be set in the returned map. If UseOnlyCached is false (the default), queries the Mojang servers for the results that are not in the cache.
WARNING: Do NOT use this function with UseOnlyCached set to false while the server is running. Only use it when the server is starting up (inside the Initialize() method), otherwise you will lag the server severely." },
- MakeUUIDDashed = { Params = "UUID", Return = "DashedUUID", Notes = "(STATIC) Converts the UUID to a dashed format (\"01234567-8901-2345-6789-012345678901\"). Accepts both dashed and short UUIDs. Logs a warning and returns an empty string if UUID format not recognized." },
- MakeUUIDShort = { Params = "UUID", Return = "ShortUUID", Notes = "(STATIC) Converts the UUID to a short format (without dashes, \"01234567890123456789012345678901\"). Accepts both dashed and short UUIDs. Logs a warning and returns an empty string if UUID format not recognized." },
+ AddPlayerNameToUUIDMapping = { Params = "PlayerName, UUID", Return = "", Notes = "(STATIC) Adds the specified PlayerName-to-UUID mapping into the cache, with current timestamp. Accepts both short or dashed UUIDs. " },
+ GetPlayerNameFromUUID = { Params = "UUID, [UseOnlyCached]", Return = "PlayerName", Notes = "(STATIC) Returns the playername that corresponds to the given UUID, or an empty string on error. If UseOnlyCached is false (the default), queries the Mojang servers if the UUID is not in the cache. The UUID can be either short or dashed.
WARNING: Do NOT use this function with UseOnlyCached set to false while the server is running. Only use it when the server is starting up (inside the Initialize() method), otherwise you will lag the server severely." },
+ GetUUIDFromPlayerName = { Params = "PlayerName, [UseOnlyCached]", Return = "UUID", Notes = "(STATIC) Returns the (short) UUID that corresponds to the given playername, or an empty string on error. If UseOnlyCached is false (the default), queries the Mojang servers if the playername is not in the cache.
WARNING: Do NOT use this function with UseOnlyCached set to false while the server is running. Only use it when the server is starting up (inside the Initialize() method), otherwise you will lag the server severely." },
+ GetUUIDsFromPlayerNames = { Params = "PlayerNames, [UseOnlyCached]", Return = "table", Notes = "(STATIC) Returns a table that contains the map, 'PlayerName' -> '(short) UUID', for all valid playernames in the input array-table. PlayerNames not recognized will not be set in the returned map. If UseOnlyCached is false (the default), queries the Mojang servers for the results that are not in the cache.
WARNING: Do NOT use this function with UseOnlyCached set to false while the server is running. Only use it when the server is starting up (inside the Initialize() method), otherwise you will lag the server severely." },
+ MakeUUIDDashed = { Params = "UUID", Return = "DashedUUID", Notes = "(STATIC) Converts the UUID to a dashed format (\"01234567-8901-2345-6789-012345678901\"). Accepts both dashed or short UUIDs. Logs a warning and returns an empty string if UUID format not recognized." },
+ MakeUUIDShort = { Params = "UUID", Return = "ShortUUID", Notes = "(STATIC) Converts the UUID to a short format (without dashes, \"01234567890123456789012345678901\"). Accepts both dashed or short UUIDs. Logs a warning and returns an empty string if UUID format not recognized." },
},
},
@@ -2017,7 +2017,6 @@ cPluginManager.AddHook(cPluginManager.HOOK_CHAT, OnChatMessage);
]],
Functions =
{
- Get = { Params = "", Return = "Root object", Notes = "(STATIC)This function returns the cRoot object." },
BroadcastChat = { Params = "Message", Return = "", Notes = "Broadcasts a message to every player in the server. No formatting is done by the server." },
BroadcastChatFailure = { Params = "Message", Return = "", Notes = "Prepends Rose [INFO] / colours entire text (depending on ShouldUseChatPrefixes()) and broadcasts message. For a command that failed to run because of insufficient permissions, etc." },
BroadcastChatFatal = { Params = "Message", Return = "", Notes = "Prepends Red [FATAL] / colours entire text (depending on ShouldUseChatPrefixes()) and broadcasts message. For a plugin that crashed, or similar." },
@@ -2028,12 +2027,12 @@ cPluginManager.AddHook(cPluginManager.HOOK_CHAT, OnChatMessage);
FindAndDoWithPlayer = { Params = "PlayerName, CallbackFunction", Return = "", Notes = "Calls the given callback function for all players with names partially (or fully) matching the name string provided." },
ForEachPlayer = { Params = "CallbackFunction", Return = "", Notes = "Calls the given callback function for each player. The callback function has the following signature:
function Callback({{cPlayer|cPlayer}})
" },
ForEachWorld = { Params = "CallbackFunction", Return = "", Notes = "Calls the given callback function for each world. The callback function has the following signature: function Callback({{cWorld|cWorld}})
" },
+ Get = { Params = "", Return = "Root object", Notes = "(STATIC)This function returns the cRoot object." },
GetCraftingRecipes = { Params = "", Return = "{{cCraftingRecipe|cCraftingRecipe}}", Notes = "Returns the CraftingRecipes object" },
GetDefaultWorld = { Params = "", Return = "{{cWorld|cWorld}}", Notes = "Returns the world object from the default world." },
GetFurnaceFuelBurnTime = { Params = "{{cItem|Fuel}}", Return = "number", Notes = "(STATIC) Returns the number of ticks for how long the item would fuel a furnace. Returns zero if not a fuel." },
GetFurnaceRecipe = { Params = "{{cItem|InItem}}", Return = "{{cItem|OutItem}}, NumTicks, {{cItem|InItem}}", Notes = "(STATIC) Returns the furnace recipe for smelting the specified input. If a recipe is found, returns the smelted result, the number of ticks required for the smelting operation, and the input consumed (note that MCServer supports smelting M items into N items and different smelting rates). If no recipe is found, returns no value." },
GetGroupManager = { Params = "", Return = "{{cGroupManager|cGroupManager}}", Notes = "Returns the cGroupManager object." },
- GetMojangAPI = { Params = "", Return = "{{cMojangAPI}}", Notes = "Returns the {{cMojangAPI}} object." },
GetPhysicalRAMUsage = { Params = "", Return = "number", Notes = "Returns the amount of physical RAM that the entire MCServer process is using, in KiB. Negative if the OS doesn't support this query." },
GetPluginManager = { Params = "", Return = "{{cPluginManager|cPluginManager}}", Notes = "Returns the cPluginManager object." },
GetPrimaryServerVersion = { Params = "", Return = "number", Notes = "Returns the servers primary server version." },
--
cgit v1.2.3
From f5aaf52210369862a045c074429428012607c445 Mon Sep 17 00:00:00 2001
From: madmaxoft
Date: Sun, 3 Aug 2014 21:32:53 +0200
Subject: Debuggers: Added a Name-from-UUID cMojangAPI test.
---
MCServer/Plugins/Debuggers/Debuggers.lua | 7 +++++++
1 file changed, 7 insertions(+)
(limited to 'MCServer')
diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua
index 075cfa40c..7e220952e 100644
--- a/MCServer/Plugins/Debuggers/Debuggers.lua
+++ b/MCServer/Plugins/Debuggers/Debuggers.lua
@@ -339,6 +339,13 @@ function TestUUIDFromName()
end
LOG("UUID-from-Name resolution tests finished.")
+
+ LOG("Performing a Name-from-UUID test...")
+ -- local NameToTest = "aloe_vera"
+ local NameToTest = "xoft"
+ local Name = cMojangAPI:GetPlayerNameFromUUID(UUIDs[NameToTest])
+ LOG("Name(" .. UUIDs[NameToTest] .. ") = '" .. Name .. "', expected '" .. NameToTest .. "'.")
+ LOG("Name-from-UUID test finished.")
end
--
cgit v1.2.3
From 01e9d6311a4c27af044e8c9be3c67000124321e9 Mon Sep 17 00:00:00 2001
From: Tiger Wang
Date: Mon, 4 Aug 2014 14:24:46 +0100
Subject: Updated submodules
---
MCServer/Plugins/Core | 2 +-
MCServer/Plugins/ProtectionAreas | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
(limited to 'MCServer')
diff --git a/MCServer/Plugins/Core b/MCServer/Plugins/Core
index 3790f78d3..1b16c23c2 160000
--- a/MCServer/Plugins/Core
+++ b/MCServer/Plugins/Core
@@ -1 +1 @@
-Subproject commit 3790f78d3f7503ff33a423b8e73e81a275562783
+Subproject commit 1b16c23c216d359e9fe0334c63deeecc347e69bd
diff --git a/MCServer/Plugins/ProtectionAreas b/MCServer/Plugins/ProtectionAreas
index 9edfee930..7765048fa 160000
--- a/MCServer/Plugins/ProtectionAreas
+++ b/MCServer/Plugins/ProtectionAreas
@@ -1 +1 @@
-Subproject commit 9edfee93048f214175cbed7eb2a3f77f7ac4abb2
+Subproject commit 7765048fa740b8f119db72a4ccc546504f86b2ab
--
cgit v1.2.3
From 43de9af8786243c90832b78f8c19ec92fb218392 Mon Sep 17 00:00:00 2001
From: Howaner
Date: Tue, 5 Aug 2014 13:54:04 +0200
Subject: Added api documentation for Clamp()
---
MCServer/Plugins/APIDump/APIDesc.lua | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
(limited to 'MCServer')
diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua
index ad3b24ca5..64ba80c5f 100644
--- a/MCServer/Plugins/APIDump/APIDesc.lua
+++ b/MCServer/Plugins/APIDump/APIDesc.lua
@@ -2760,15 +2760,16 @@ end
Functions =
{
AddFaceDirection = {Params = "BlockX, BlockY, BlockZ, BlockFace, [IsInverse]", Return = "BlockX, BlockY, BlockZ", Notes = "Returns the coords of a block adjacent to the specified block through the specified {{Globals#BlockFaces|face}}"},
- BlockFaceToString = { Params = "{{Globals#BlockFaces|eBlockFace}}", Return = "string", Notes = "Returns the string representation of the {{Globals#BlockFaces|eBlockFace}} constant. Uses the axis-direction-based names, such as BLOCK_FACE_XP." },
+ BlockFaceToString = {Params = "{{Globals#BlockFaces|eBlockFace}}", Return = "string", Notes = "Returns the string representation of the {{Globals#BlockFaces|eBlockFace}} constant. Uses the axis-direction-based names, such as BLOCK_FACE_XP." },
BlockStringToType = {Params = "BlockTypeString", Return = "BLOCKTYPE", Notes = "Returns the block type parsed from the given string"},
+ Clamp = {Params = "Number, Min, Max", Return = "number", Notes = "Clamp the number to the specified range."},
ClickActionToString = {Params = "{{Globals#ClickAction|ClickAction}}", Return = "string", Notes = "Returns a string description of the ClickAction enumerated value"},
DamageTypeToString = {Params = "{{Globals#DamageType|DamageType}}", Return = "string", Notes = "Converts the {{Globals#DamageType|DamageType}} enumerated value to a string representation "},
EscapeString = {Params = "string", Return = "string", Notes = "Returns a copy of the string with all quotes and backslashes escaped by a backslash"},
GetChar = {Params = "String, Pos", Return = "string", Notes = "Returns one character from the string, specified by position "},
GetIniItemSet = { Params = "IniFile, SectionName, KeyName, DefaultValue", Return = "{{cItem}}", Notes = "Returns the item that has been read from the specified INI file value. If the value is not present in the INI file, the DefaultValue is stored in the file and parsed as the result. Returns empty item if the value cannot be parsed. " },
GetTime = {Return = "number", Notes = "Returns the current OS time, as a unix time stamp (number of seconds since Jan 1, 1970)"},
- IsBiomeNoDownfall = { Params = "Biome", Return = "bool", Notes = "Returns true if the biome is 'dry', that is, there is no precipitation during rains and storms." },
+ IsBiomeNoDownfall = {Params = "Biome", Return = "bool", Notes = "Returns true if the biome is 'dry', that is, there is no precipitation during rains and storms." },
IsValidBlock = {Params = "BlockType", Return = "bool", Notes = "Returns true if BlockType is a known block type"},
IsValidItem = {Params = "ItemType", Return = "bool", Notes = "Returns true if ItemType is a known item type"},
ItemToFullString = {Params = "{{cItem|cItem}}", Return = "string", Notes = "Returns the string representation of the item, in the format 'ItemTypeText:ItemDamage * Count'"},
--
cgit v1.2.3
From f7726317c9c1c27fa3d0b9b7c2df35ffff6f1f1a Mon Sep 17 00:00:00 2001
From: Christophe Piveteau
Date: Mon, 11 Aug 2014 18:57:41 +0200
Subject: Add entry for bat in monsters.ini
---
MCServer/monsters.ini | 6 ++++++
1 file changed, 6 insertions(+)
(limited to 'MCServer')
diff --git a/MCServer/monsters.ini b/MCServer/monsters.ini
index d29b01d8f..c4bc8c810 100644
--- a/MCServer/monsters.ini
+++ b/MCServer/monsters.ini
@@ -185,4 +185,10 @@ AttackDamage=6.0
SightDistance=25.0
MaxHealth=100
+[Bat]
+AttackRange=2.0
+AttackRate=1
+AttackDamage=0.0
+SightDistance=25.0
+MaxHealth=6
--
cgit v1.2.3
From 6c8baf66c81e043710e70d8de584ab93d1cbbfc8 Mon Sep 17 00:00:00 2001
From: Howaner
Date: Sat, 16 Aug 2014 18:49:24 +0200
Subject: Updated HOOK_PLAYER_MOVING documentation.
---
MCServer/Plugins/APIDump/Hooks/OnPlayerMoving.lua | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
(limited to 'MCServer')
diff --git a/MCServer/Plugins/APIDump/Hooks/OnPlayerMoving.lua b/MCServer/Plugins/APIDump/Hooks/OnPlayerMoving.lua
index 2756529ef..4385bf94d 100644
--- a/MCServer/Plugins/APIDump/Hooks/OnPlayerMoving.lua
+++ b/MCServer/Plugins/APIDump/Hooks/OnPlayerMoving.lua
@@ -11,9 +11,11 @@ return
Params =
{
{ Name = "Player", Type = "{{cPlayer}}", Notes = "The player who has moved. The object already has the new position stored in it." },
+ { Name = "OldPosition", Type = "{{Vector3d}}", Notes = "The old position." },
+ { Name = "NewPosition", Type = "{{Vector3d}}", Notes = "The new position." },
},
Returns = [[
- If the function returns true, movement is prohibited. FIXME: The player's client is not informed.
+ If the function returns true, movement is prohibited.
If the function returns false or no value, other plugins' callbacks are called and finally the new
position is permanently stored in the cPlayer object.
--
cgit v1.2.3