mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 03:59:43 +00:00
empty buckets can be stacked now
This commit is contained in:
parent
938637b2a2
commit
012f03a52b
4 changed files with 35 additions and 6 deletions
|
|
@ -1524,7 +1524,7 @@ class Player{
|
|||
if(EventHandler::callEvent(new DataPacketReceiveEvent($this, $packet)) === BaseEvent::DENY){
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
switch($packet->pid()){
|
||||
case 0x01:
|
||||
break;
|
||||
|
|
@ -2495,6 +2495,7 @@ class Player{
|
|||
$this->dataPacket($pk);
|
||||
break;
|
||||
}
|
||||
|
||||
if($item->getID() !== AIR and $slot->getID() == $item->getID()){
|
||||
if($slot->count < $item->count){
|
||||
if($this->removeItem($item->getID(), $item->getMetadata(), $item->count - $slot->count, false) === false){
|
||||
|
|
@ -2735,7 +2736,7 @@ class Player{
|
|||
$s = $this->getSlot($slot);
|
||||
if($s->count <= 0 or $s->getID() === AIR){
|
||||
$this->setSlot($slot, BlockAPI::getItem($item->getID(), $item->getMetadata(), $item->count), false);
|
||||
}else if($s->getID() == $item->getID() && $s->getMetadata() == $item->getMetadata() && ($s->count + $item->count) <= $s->maxStackSize){
|
||||
}else if($s->getID() == $item->getID() && $s->getMetadata() == $item->getMetadata() && ($s->count + $item->count) <= $s->getMaxStackSize()){
|
||||
$this->setSlot($slot, BlockAPI::getItem($item->getID(), $item->getMetadata(), $s->count + $item->count), false);
|
||||
}else{
|
||||
$f1 = 0.3;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue