From 2fc84f6c676174cf24c6f4e80288ffdb077b02eb Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 12 Aug 2022 17:24:43 +0100 Subject: [PATCH] ItemFactory: treat durables with negative meta as unknown items fixes #5117 --- src/item/ItemFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/item/ItemFactory.php b/src/item/ItemFactory.php index eefb5eb95..4a949f843 100644 --- a/src/item/ItemFactory.php +++ b/src/item/ItemFactory.php @@ -472,7 +472,7 @@ class ItemFactory{ if(isset($this->list[$offset = self::getListOffset($id, $meta)])){ $item = clone $this->list[$offset]; }elseif(isset($this->list[$zero = self::getListOffset($id, 0)]) && $this->list[$zero] instanceof Durable){ - if($meta <= $this->list[$zero]->getMaxDurability()){ + if($meta >= 0 && $meta <= $this->list[$zero]->getMaxDurability()){ $item = clone $this->list[$zero]; $item->setDamage($meta); }else{