summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/APIDump
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-11-05 22:16:42 +0100
committermadmaxoft <github@xoft.cz>2013-11-05 22:16:42 +0100
commit13800a0023da222b1cd95402f0944035301e0fa1 (patch)
treeb26b142cd865c744d2eab2bacd8dca41288a7452 /MCServer/Plugins/APIDump
parentProtocol 1.7: More client-bound packets. (diff)
downloadcuberite-13800a0023da222b1cd95402f0944035301e0fa1.tar
cuberite-13800a0023da222b1cd95402f0944035301e0fa1.tar.gz
cuberite-13800a0023da222b1cd95402f0944035301e0fa1.tar.bz2
cuberite-13800a0023da222b1cd95402f0944035301e0fa1.tar.lz
cuberite-13800a0023da222b1cd95402f0944035301e0fa1.tar.xz
cuberite-13800a0023da222b1cd95402f0944035301e0fa1.tar.zst
cuberite-13800a0023da222b1cd95402f0944035301e0fa1.zip
Diffstat (limited to 'MCServer/Plugins/APIDump')
-rw-r--r--MCServer/Plugins/APIDump/APIDesc.lua38
1 files changed, 38 insertions, 0 deletions
diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua
index f8e201244..ebe284ad6 100644
--- a/MCServer/Plugins/APIDump/APIDesc.lua
+++ b/MCServer/Plugins/APIDump/APIDesc.lua
@@ -2395,6 +2395,44 @@ World:ForEachEntity(
},
}, -- HTTPRequest
+ ItemCategory =
+ {
+ Desc = [[
+ This class contains static functions for determining item categories. All of the functions are
+ called directly on the class table, unlike most other object, which require an instance first.
+ ]],
+ Functions =
+ {
+ IsArmor = { Params = "ItemType", Return = "bool", Notes = "(STATIC) Returns true if the specified item type is any kind of an armor." },
+ IsAxe = { Params = "ItemType", Return = "bool", Notes = "(STATIC) Returns true if the specified item type is any kind of an axe." },
+ IsBoots = { Params = "ItemType", Return = "bool", Notes = "(STATIC) Returns true if the specified item type is any kind of boots." },
+ IsChestPlate = { Params = "ItemType", Return = "bool", Notes = "(STATIC) Returns true if the specified item type is any kind of a chestplate." },
+ IsHelmet = { Params = "ItemType", Return = "bool", Notes = "(STATIC) Returns true if the specified item type is any kind of a helmet." },
+ IsHoe = { Params = "ItemType", Return = "bool", Notes = "(STATIC) Returns true if the specified item type is any kind of a hoe." },
+ IsLeggings = { Params = "ItemType", Return = "bool", Notes = "(STATIC) Returns true if the specified item type is any kind of a leggings." },
+ IsPickaxe = { Params = "ItemType", Return = "bool", Notes = "(STATIC) Returns true if the specified item type is any kind of a pickaxe." },
+ IsShovel = { Params = "ItemType", Return = "bool", Notes = "(STATIC) Returns true if the specified item type is any kind of a shovel." },
+ IsSword = { Params = "ItemType", Return = "bool", Notes = "(STATIC) Returns true if the specified item type is any kind of a sword." },
+ IsTool = { Params = "ItemType", Return = "bool", Notes = "(STATIC) Returns true if the specified item type is any kind of a tool (axe, hoe, pickaxe, shovel or FIXME: sword)" },
+ },
+ AdditionalInfo =
+ {
+ {
+ Header = "Code example",
+ Contents = [[
+ The following code snippet checks if the player holds a shovel.
+<pre class="prettyprint lang-lua">
+-- a_Player is a {{cPlayer}} object, possibly received as a hook param
+local HeldItem = a_Player:GetEquippedItem();
+if (cItemCategory:IsShovel(HeldItem.m_ItemType)) then
+ -- It's a shovel
+end
+</pre>
+ ]],
+ }
+ },
+ }, -- ItemCategory
+
TakeDamageInfo =
{
Desc = [[The TakeDamageInfo is a struct that contains the amount of damage, and the entity that caused the damage. It is used in the {{OnTakeDamage|OnTakeDamage}}() hook and in the {{cEntity|cEntity}}'s TakeDamage() function.