mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Added Liquids properties
This commit is contained in:
parent
328cc968bd
commit
8d6d5306c1
@ -58,10 +58,10 @@ class BlockAPI{
|
||||
PLANKS => "PlanksBlock",
|
||||
SAPLING => "SaplingBlock",
|
||||
BEDROCK => "BedrockBlock",
|
||||
/*WATER => (new GenericBlock(WATER, 0, "")),
|
||||
STILL_WATER => (new GenericBlock(STILL_WATER, 0, "")),
|
||||
LAVA => (new GenericBlock(LAVA, 0, "")),
|
||||
STILL_LAVA => (new GenericBlock(STILL_LAVA, 0, "")),*/
|
||||
WATER => "WaterBlock",
|
||||
STILL_WATER => "StillWaterBlock",
|
||||
LAVA => "LavaBlock",
|
||||
STILL_LAVA => "StillLavaBlock",
|
||||
SAND => "SandBlock",
|
||||
GRAVEL => "GravelBlock",
|
||||
GOLD_ORE => "GoldOreBlock",
|
||||
|
@ -40,6 +40,7 @@ abstract class Block{
|
||||
public $isPlaceable = true;
|
||||
public $inWorld = false;
|
||||
public $hasPhysics = false;
|
||||
public $isLiquid = false;
|
||||
public $v = false;
|
||||
|
||||
public function __construct($id, $meta = 0, $name = "Unknown"){
|
||||
@ -63,7 +64,7 @@ abstract class Block{
|
||||
|
||||
final public function position(Vector3 $v){
|
||||
$this->inWorld = true;
|
||||
$this->position = new Vector3((int) $v->x, (int) $v->y, (int) $v->z);
|
||||
$this->v = new Vector3((int) $v->x, (int) $v->y, (int) $v->z);
|
||||
}
|
||||
|
||||
public function getDrops(Item $item, Player $player){
|
||||
|
33
src/classes/material/block/LiquidBlock.php
Normal file
33
src/classes/material/block/LiquidBlock.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|
||||
-
|
||||
/ \
|
||||
/ \
|
||||
/ PocketMine \
|
||||
/ MP \
|
||||
|\ @shoghicp /|
|
||||
|. \ / .|
|
||||
| .. \ / .. |
|
||||
| .. | .. |
|
||||
| .. | .. |
|
||||
\ | /
|
||||
\ | /
|
||||
\ | /
|
||||
\ | /
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
class LiquidBlock extends TransparentBlock{
|
||||
public function __construct($id, $meta = 0, $name = "Unknown"){
|
||||
parent::__construct($id, $meta, $name);
|
||||
$this->isLiquid = true;
|
||||
}
|
||||
}
|
33
src/classes/material/block/liquid/Lava.php
Normal file
33
src/classes/material/block/liquid/Lava.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|
||||
-
|
||||
/ \
|
||||
/ \
|
||||
/ PocketMine \
|
||||
/ MP \
|
||||
|\ @shoghicp /|
|
||||
|. \ / .|
|
||||
| .. \ / .. |
|
||||
| .. | .. |
|
||||
| .. | .. |
|
||||
\ | /
|
||||
\ | /
|
||||
\ | /
|
||||
\ | /
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
class LavaBlock extends LiquidBlock{
|
||||
public function __construct($meta = 0){
|
||||
parent::__construct(LAVA, $meta, "Lava");
|
||||
}
|
||||
|
||||
}
|
33
src/classes/material/block/liquid/StillLava.php
Normal file
33
src/classes/material/block/liquid/StillLava.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|
||||
-
|
||||
/ \
|
||||
/ \
|
||||
/ PocketMine \
|
||||
/ MP \
|
||||
|\ @shoghicp /|
|
||||
|. \ / .|
|
||||
| .. \ / .. |
|
||||
| .. | .. |
|
||||
| .. | .. |
|
||||
\ | /
|
||||
\ | /
|
||||
\ | /
|
||||
\ | /
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
class StillLavaBlock extends LiquidBlock{
|
||||
public function __construct($meta = 0){
|
||||
parent::__construct(STILL_LAVA, $meta, "Still Lava");
|
||||
}
|
||||
|
||||
}
|
33
src/classes/material/block/liquid/StillWater.php
Normal file
33
src/classes/material/block/liquid/StillWater.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|
||||
-
|
||||
/ \
|
||||
/ \
|
||||
/ PocketMine \
|
||||
/ MP \
|
||||
|\ @shoghicp /|
|
||||
|. \ / .|
|
||||
| .. \ / .. |
|
||||
| .. | .. |
|
||||
| .. | .. |
|
||||
\ | /
|
||||
\ | /
|
||||
\ | /
|
||||
\ | /
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
class StillWaterBlock extends LiquidBlock{
|
||||
public function __construct($meta = 0){
|
||||
parent::__construct(STILL_WATER, $meta, "Still Water");
|
||||
}
|
||||
|
||||
}
|
33
src/classes/material/block/liquid/Water.php
Normal file
33
src/classes/material/block/liquid/Water.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|
||||
-
|
||||
/ \
|
||||
/ \
|
||||
/ PocketMine \
|
||||
/ MP \
|
||||
|\ @shoghicp /|
|
||||
|. \ / .|
|
||||
| .. \ / .. |
|
||||
| .. | .. |
|
||||
| .. | .. |
|
||||
\ | /
|
||||
\ | /
|
||||
\ | /
|
||||
\ | /
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
class WaterBlock extends LiquidBlock{
|
||||
public function __construct($meta = 0){
|
||||
parent::__construct(WATER, $meta, "Water");
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user