Replaced array() with []

This commit is contained in:
Shoghi Cervantes
2014-08-28 17:04:22 +02:00
parent 2f2afe2336
commit eab86f5f90
122 changed files with 535 additions and 533 deletions

View File

@@ -392,7 +392,7 @@ class Item{
public static function init(){
if(count(self::$list) === 0){
self::$list = array(
self::$list = [
self::SUGARCANE => Sugarcane::class,
self::WHEAT_SEEDS => WheatSeeds::class,
self::PUMPKIN_SEEDS => PumpkinSeeds::class,
@@ -447,7 +447,7 @@ class Item{
self::FLINT_STEEL => FlintSteel::class,
self::SHEARS => Shears::class,
self::BOW => Bow::class,
);
];
foreach(Block::$list as $id => $class){
self::$list[$id] = $class;
}

View File

@@ -34,50 +34,50 @@ class Painting extends Item{
public function onActivate(Level $level, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
if($target->isTransparent === false and $face > 1 and $block->isSolid === false){
$faces = array(
$faces = [
2 => 1,
3 => 3,
4 => 0,
5 => 2,
);
$motives = array(
];
$motives = [
// Motive Width Height
array("Kebab", 1, 1),
array("Aztec", 1, 1),
array("Alban", 1, 1),
array("Aztec2", 1, 1),
array("Bomb", 1, 1),
array("Plant", 1, 1),
array("Wasteland", 1, 1),
array("Wanderer", 1, 2),
array("Graham", 1, 2),
array("Pool", 2, 1),
array("Courbet", 2, 1),
array("Sunset", 2, 1),
array("Sea", 2, 1),
array("Creebet", 2, 1),
array("Match", 2, 2),
array("Bust", 2, 2),
array("Stage", 2, 2),
array("Void", 2, 2),
array("SkullAndRoses", 2, 2),
["Kebab", 1, 1],
["Aztec", 1, 1],
["Alban", 1, 1],
["Aztec2", 1, 1],
["Bomb", 1, 1],
["Plant", 1, 1],
["Wasteland", 1, 1],
["Wanderer", 1, 2],
["Graham", 1, 2],
["Pool", 2, 1],
["Courbet", 2, 1],
["Sunset", 2, 1],
["Sea", 2, 1],
["Creebet", 2, 1],
["Match", 2, 2],
["Bust", 2, 2],
["Stage", 2, 2],
["Void", 2, 2],
["SkullAndRoses", 2, 2],
//array("Wither", 2, 2),
array("Fighters", 4, 2),
array("Skeleton", 4, 3),
array("DonkeyKong", 4, 3),
array("Pointer", 4, 4),
array("Pigscene", 4, 4),
array("Flaming Skull", 4, 4),
);
["Fighters", 4, 2],
["Skeleton", 4, 3],
["DonkeyKong", 4, 3],
["Pointer", 4, 4],
["Pigscene", 4, 4],
["Flaming Skull", 4, 4],
];
$motive = $motives[mt_rand(0, count($motives) - 1)];
$data = array(
$data = [
"x" => $target->x,
"y" => $target->y,
"z" => $target->z,
"yaw" => $faces[$face] * 90,
"Motive" => $motive[0],
);
];
//TODO
//$e = $server->api->entity->add($level, ENTITY_OBJECT, OBJECT_PAINTING, $data);
//$e->spawnToAll();

View File

@@ -60,7 +60,7 @@ abstract class Tool extends Item{
*/
public function getMaxDurability(){
$levels = array(
$levels = [
2 => 33,
1 => 60,
3 => 132,
@@ -69,7 +69,7 @@ abstract class Tool extends Item{
self::FLINT_STEEL => 65,
self::SHEARS => 239,
self::BOW => 385,
);
];
if(($type = $this->isPickaxe()) === false){
if(($type = $this->isAxe()) === false){