mirror of
https://github.com/danbulant/flying-squid
synced 2026-07-09 13:10:59 +00:00
fixes and improvements
This commit is contained in:
parent
5de808cca4
commit
18a56b51b0
1 changed files with 10 additions and 1 deletions
|
|
@ -3,15 +3,24 @@ module.exports=inject;
|
||||||
function inject(serv, player)
|
function inject(serv, player)
|
||||||
{
|
{
|
||||||
heldItemSlot=0;
|
heldItemSlot=0;
|
||||||
inventory=new Array(54);
|
heldItem=0;
|
||||||
|
inventory=new Array(44);
|
||||||
|
|
||||||
player._client.on("held_item_slot", function (packet) {
|
player._client.on("held_item_slot", function (packet) {
|
||||||
heldItemSlot = packet.slotId;
|
heldItemSlot = packet.slotId;
|
||||||
|
if(inventory[36+heldItemSlot]===undefined){
|
||||||
|
inventory[36+heldItemSlot]={
|
||||||
|
blockId:-1
|
||||||
|
};
|
||||||
|
}
|
||||||
|
heldItem = inventory[36+heldItemSlot];
|
||||||
});
|
});
|
||||||
|
|
||||||
player._client.on("set_creative_slot", function (packet) {
|
player._client.on("set_creative_slot", function (packet) {
|
||||||
inventory[packet.slot]=packet.item;
|
inventory[packet.slot]=packet.item;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
player.heldItem = heldItem;
|
||||||
player.heldItemSlot = heldItemSlot;
|
player.heldItemSlot = heldItemSlot;
|
||||||
player.inventory = inventory;
|
player.inventory = inventory;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue