From 393f54fe286443e96f02cf905e28cdf1a17cce16 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Pueyo Date: Wed, 17 Apr 2013 19:48:13 +0200 Subject: [PATCH] /give compatible with "item-enforcement" = off --- src/API/BlockAPI.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/API/BlockAPI.php b/src/API/BlockAPI.php index 814f43d3..505ccba4 100644 --- a/src/API/BlockAPI.php +++ b/src/API/BlockAPI.php @@ -151,8 +151,11 @@ class BlockAPI{ } if($player instanceof Player){ - $player->addItem($item->getID(), $item->getMetadata(), $item->count); - //$this->drop(new Vector3($player->entity->x - 0.5, $player->entity->y, $player->entity->z - 0.5), $item, true); + if($this->server->api->getProperty("item-enforcement") === false){ + $this->drop(new Vector3($player->entity->x - 0.5, $player->entity->y, $player->entity->z - 0.5), $item, true); + }else{ + $player->addItem($item->getID(), $item->getMetadata(), $item->count); + } $output .= "Giving ".$item->count." of ".$item->getName()." (".$item->getID().":".$item->getMetadata().") to ".$player->username."\n"; }else{ $output .= "Unknown player\n";