Skip to content

Instantly share code, notes, and snippets.

@eternalharvest
Last active July 15, 2017 15:09
Show Gist options
  • Save eternalharvest/7bfee25a3aad96dd021ca5c8d870eeee to your computer and use it in GitHub Desktop.
Save eternalharvest/7bfee25a3aad96dd021ca5c8d870eeee to your computer and use it in GitHub Desktop.
<?php
# class PlayerInventory {
public function onSlotChange($index, $before){
$holder = $this->getHolder();
if($holder instanceof Player and !$holder->spawned){
return;
}
if($index < $this->getSize()){
parent::onSlotChange($index, $before);
}else{
$this->sendArmorSlot($index, $this->getViewers());
$this->sendArmorSlot($index, $this->getHolder()->getViewers());
}
}
# }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment