mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Adding (most) of the sapling functionality. It has yet to work, since MEET_OTHER was not implemented at the time of this commit. Hopefully it will work when merged with celeron's latest.
This commit is contained in:
parent
789c88509c
commit
85f119e1e6
8 changed files with 141 additions and 2 deletions
|
@ -2735,6 +2735,34 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
|
|||
UpdateCrafting(player->peer_id);
|
||||
SendInventory(player->peer_id);
|
||||
}
|
||||
|
||||
item = NULL;
|
||||
|
||||
if(mineral != MINERAL_NONE)
|
||||
item = getDiggedMineralItem(mineral);
|
||||
|
||||
// If not mineral
|
||||
if(item == NULL)
|
||||
{
|
||||
std::string &extra_dug_s = content_features(material).extra_dug_item;
|
||||
s32 extra_rarity = content_features(material).extra_dug_item_rarity;
|
||||
if(extra_dug_s != "" && extra_rarity != 0
|
||||
&& myrand() % extra_rarity == 0)
|
||||
{
|
||||
std::istringstream is(extra_dug_s, std::ios::binary);
|
||||
item = InventoryItem::deSerialize(is);
|
||||
}
|
||||
}
|
||||
|
||||
if(item != NULL)
|
||||
{
|
||||
// Add a item to inventory
|
||||
player->inventory.addItem("main", item);
|
||||
|
||||
// Send inventory
|
||||
UpdateCrafting(player->peer_id);
|
||||
SendInventory(player->peer_id);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue