mirror of
https://github.com/danbulant/flying-squid
synced 2026-06-20 06:51:42 +00:00
Merge pull request #237 from FlyingPony/master
Inventory related stuff for #236
This commit is contained in:
commit
fffccdc127
2 changed files with 12 additions and 1 deletions
|
|
@ -67,7 +67,15 @@ module.exports.player = function(player,serv)
|
|||
if(clickInfo.mouseButton == 0){
|
||||
// Drop one item at slot
|
||||
// Inventory handles removing one
|
||||
return;
|
||||
|
||||
const heldItem = player.inventory.slots[36+player.heldItemSlot];
|
||||
serv.spawnObject(2, player.world, player.position, {
|
||||
velocity: new Vec3(0, 0, 0),
|
||||
itemId: heldItem.type,
|
||||
itemDamage: heldItem.metadata,
|
||||
pickupTime: 500,
|
||||
deathTime: 60 * 5 * 100
|
||||
});
|
||||
}else{
|
||||
// Drop full stack at slot
|
||||
// Inventory handles removing the whole stack
|
||||
|
|
|
|||
|
|
@ -33,6 +33,9 @@ module.exports.player=function(player,serv)
|
|||
pitch: 0.8
|
||||
});
|
||||
}
|
||||
|
||||
player.inventory.slots[36+player.heldItemSlot]--;
|
||||
|
||||
if(heldItem.blockId!=323){
|
||||
player.changeBlock(position, id, damage);
|
||||
}else if(direction==1){
|
||||
|
|
|
|||
Loading…
Reference in a new issue