diff options
author | Alexander Harkness <bearbin@gmail.com> | 2013-07-27 17:15:29 +0200 |
---|---|---|
committer | Alexander Harkness <bearbin@gmail.com> | 2013-07-27 17:15:29 +0200 |
commit | aa6445042163366b225cf65f6ce7186377f2faf6 (patch) | |
tree | 1593ac9b849f3416aafa70c440694200c62e6b2c /MCServer/Plugins/Core/item.lua | |
parent | Merge pull request #3 from mc-server/git-transition (diff) | |
download | cuberite-aa6445042163366b225cf65f6ce7186377f2faf6.tar cuberite-aa6445042163366b225cf65f6ce7186377f2faf6.tar.gz cuberite-aa6445042163366b225cf65f6ce7186377f2faf6.tar.bz2 cuberite-aa6445042163366b225cf65f6ce7186377f2faf6.tar.lz cuberite-aa6445042163366b225cf65f6ce7186377f2faf6.tar.xz cuberite-aa6445042163366b225cf65f6ce7186377f2faf6.tar.zst cuberite-aa6445042163366b225cf65f6ce7186377f2faf6.zip |
Diffstat (limited to 'MCServer/Plugins/Core/item.lua')
-rw-r--r-- | MCServer/Plugins/Core/item.lua | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/MCServer/Plugins/Core/item.lua b/MCServer/Plugins/Core/item.lua deleted file mode 100644 index 86ff0576f..000000000 --- a/MCServer/Plugins/Core/item.lua +++ /dev/null @@ -1,39 +0,0 @@ -function HandleItemCommand(Split, Player)
- if ((#Split ~= 2) and (#Split ~=3)) then
- Player:SendMessage(cChatColor.Green .. "Usage: /item [ItemType/Name:Dmg] <Amount>");
- return true;
- end
-
- local Item = cItem();
- local FoundItem = StringToItem(Split[2], Item);
-
- if not(IsValidItem(Item.m_ItemType)) then -- StringToItem does not check if item is valid
- FoundItem = false
- end
-
- if not(FoundItem) then
- Player:SendMessage( cChatColor.Green .. "Invalid Item type / name !" )
- return true
- end
-
- local ItemAmount = 1;
- if (#Split == 3) then
- ItemAmount = tonumber(Split[3]);
- if ((ItemAmount == nil) or (ItemAmount < 1) or (ItemAmount > 512)) then
- Player:SendMessage(cChatColor.Green .. "Invalid Amount!");
- return true;
- end
- end
-
- Item.m_ItemCount = ItemAmount;
-
- local ItemsGiven = Player:GetInventory():AddItem(Item);
- if (ItemsGiven == ItemAmount) then
- Player:SendMessage( cChatColor.Green .. "There you go !");
- LOG("Gave " .. Player:GetName() .. " " .. Item.m_ItemCount .. " times " .. Item.m_ItemType .. ":" .. Item.m_ItemDamage);
- else
- Player:SendMessage(cChatColor.Green .. "Not enough space in inventory, only gave " .. ItemsGiven);
- LOG("Player " .. Player:GetName() .. " asked for " .. Item.m_ItemCount .. " times " .. Item.m_ItemType .. ":" .. Item.m_ItemDamage ..", but only could fit " .. ItemsGiven);
- end
- return true;
-end
\ No newline at end of file |