Fixed furnaces crashing the server

Beware ListTag indices being strings! Should be impossible, but the NBT library is poorly designed.
This commit is contained in:
Dylan K. Taylor 2017-07-15 21:53:43 +01:00
parent 3150c50cac
commit 7c00982fff

View File

@ -123,8 +123,8 @@ class Furnace extends Spawnable implements InventoryHolder, Container, Nameable{
*/
protected function getSlotIndex(int $index) : int{
foreach($this->namedtag->Items as $i => $slot){
if($slot["Slot"] === $index){
return $i;
if((int) $slot["Slot"] === $index){
return (int) $i;
}
}