WATER_BUCKET, LAVA_BUCKET, MILK_BUCKET

This commit is contained in:
GameHerobrine 2022-07-12 00:03:31 +03:00
parent c049278a6d
commit 992f54c696
3 changed files with 8 additions and 2 deletions

View file

@ -240,6 +240,10 @@ class BlockAPI{
}
if(defined(strtoupper($b[0]))){
$explodedString = explode(":", constant(strtoupper($b[0])));
if(count($explodedString) == 2){
$meta = (int) $explodedString[1];
}
$item = BlockAPI::getItem(constant(strtoupper($b[0])), $meta);
if($item->getID() === AIR and strtoupper($b[0]) !== "AIR"){
$item = BlockAPI::getItem(((int) $b[0]) & 0xFFFF, $meta);

View file

@ -101,7 +101,9 @@ define("GOLDEN_APPLE", 322);
define("SIGN", 323);
define("WOODEN_DOOR", 324);
define("BUCKET", 325);
define("WATER_BUCKET", "325:8");
define("LAVA_BUCKET", "325:10");
define("MILK_BUCKET", "325:1");
define("MINECART", 328);
define("SADDLE", 329);
define("IRON_DOOR", 330);

View file

@ -31,7 +31,7 @@ class BucketItem extends Item{
if($target instanceof LiquidBlock){
$level->setBlock($target, new AirBlock(), true, false, true);
if(($player->gamemode & 0x01) === 0){
$this->meta = ($target instanceof WaterBlock) ? WATER:LAVA;
$this->meta = ($target instanceof WaterBlock) ? WATER : LAVA;
}
return true;
}