Make block constructors not write to this->meta directly

This commit is contained in:
Dylan K. Taylor 2018-09-16 14:10:40 +01:00
parent ed8b8a13a3
commit f7f06c993d
132 changed files with 132 additions and 132 deletions

View File

@ -35,7 +35,7 @@ class Air extends Transparent{
protected $id = self::AIR;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -40,7 +40,7 @@ class Anvil extends Fallable{
protected $id = self::ANVIL;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function isTransparent() : bool{

View File

@ -77,7 +77,7 @@ abstract class BaseRail extends Flowable{
];
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getHardness() : float{

View File

@ -45,7 +45,7 @@ class Bed extends Transparent{
protected $itemId = Item::BED;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getHardness() : float{

View File

@ -30,7 +30,7 @@ class Bedrock extends Solid{
protected $id = self::BEDROCK;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -31,7 +31,7 @@ class Beetroot extends Crops{
protected $id = self::BEETROOT_BLOCK;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -34,7 +34,7 @@ class BoneBlock extends Solid{
protected $id = Block::BONE_BLOCK;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -31,7 +31,7 @@ class Bookshelf extends Solid{
protected $id = self::BOOKSHELF;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -30,7 +30,7 @@ class BrewingStand extends Transparent{
protected $id = self::BREWING_STAND_BLOCK;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -30,7 +30,7 @@ class BrickStairs extends Stair{
protected $id = self::BRICK_STAIRS;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getHardness() : float{

View File

@ -30,7 +30,7 @@ class Bricks extends Solid{
protected $id = self::BRICK_BLOCK;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getHardness() : float{

View File

@ -38,7 +38,7 @@ class BurningFurnace extends Solid{
protected $itemId = self::FURNACE;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -30,7 +30,7 @@ use pocketmine\Player;
abstract class Button extends Flowable{
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getVariantBitmask() : int{

View File

@ -39,7 +39,7 @@ class Cactus extends Transparent{
protected $id = self::CACTUS;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getHardness() : float{

View File

@ -37,7 +37,7 @@ class Cake extends Transparent implements FoodSource{
protected $id = self::CAKE_BLOCK;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getHardness() : float{

View File

@ -35,7 +35,7 @@ class Carpet extends Flowable{
protected $id = self::CARPET;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getHardness() : float{

View File

@ -31,7 +31,7 @@ class Carrot extends Crops{
protected $id = self::CARROT_BLOCK;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -37,7 +37,7 @@ class Chest extends Transparent{
protected $id = self::CHEST;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getHardness() : float{

View File

@ -31,7 +31,7 @@ class Clay extends Solid{
protected $id = self::CLAY_BLOCK;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getHardness() : float{

View File

@ -30,7 +30,7 @@ class Coal extends Solid{
protected $id = self::COAL_BLOCK;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getHardness() : float{

View File

@ -32,7 +32,7 @@ class CoalOre extends Solid{
protected $id = self::COAL_ORE;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getHardness() : float{

View File

@ -30,7 +30,7 @@ class Cobblestone extends Solid{
protected $id = self::COBBLESTONE;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getToolType() : int{

View File

@ -30,7 +30,7 @@ class CobblestoneStairs extends Stair{
protected $id = self::COBBLESTONE_STAIRS;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getHardness() : float{

View File

@ -34,7 +34,7 @@ class CobblestoneWall extends Transparent{
protected $id = self::COBBLESTONE_WALL;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getToolType() : int{

View File

@ -32,7 +32,7 @@ class Cobweb extends Flowable{
protected $id = self::COBWEB;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function hasEntityCollision() : bool{

View File

@ -28,7 +28,7 @@ class CocoaBlock extends Transparent{
protected $id = self::COCOA_BLOCK;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -31,7 +31,7 @@ class Concrete extends Solid{
protected $id = Block::CONCRETE;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -31,7 +31,7 @@ class ConcretePowder extends Fallable{
protected $id = self::CONCRETE_POWDER;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -32,7 +32,7 @@ class CraftingTable extends Solid{
protected $id = self::CRAFTING_TABLE;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getHardness() : float{

View File

@ -33,7 +33,7 @@ class Dandelion extends Flowable{
protected $id = self::DANDELION;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -28,7 +28,7 @@ class DaylightSensor extends Transparent{
protected $id = self::DAYLIGHT_SENSOR;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -34,7 +34,7 @@ class DeadBush extends Flowable{
protected $id = self::DEAD_BUSH;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -30,7 +30,7 @@ class Diamond extends Solid{
protected $id = self::DIAMOND_BLOCK;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getHardness() : float{

View File

@ -32,7 +32,7 @@ class DiamondOre extends Solid{
protected $id = self::DIAMOND_ORE;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getHardness() : float{

View File

@ -32,7 +32,7 @@ class Dirt extends Solid{
protected $id = self::DIRT;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getHardness() : float{

View File

@ -35,7 +35,7 @@ class DoublePlant extends Flowable{
protected $id = self::DOUBLE_PLANT;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function canBeReplaced() : bool{

View File

@ -29,7 +29,7 @@ use pocketmine\item\ItemFactory;
abstract class DoubleSlab extends Solid{
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
abstract public function getSlabId() : int;

View File

@ -30,7 +30,7 @@ class Emerald extends Solid{
protected $id = self::EMERALD_BLOCK;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getHardness() : float{

View File

@ -32,7 +32,7 @@ class EmeraldOre extends Solid{
protected $id = self::EMERALD_ORE;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -36,7 +36,7 @@ class EnchantingTable extends Transparent{
protected $id = self::ENCHANTING_TABLE;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{

View File

@ -31,7 +31,7 @@ class EndPortalFrame extends Solid{
protected $id = self::END_PORTAL_FRAME;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getLightLevel() : int{

View File

@ -34,7 +34,7 @@ class EndRod extends Flowable{
protected $id = Block::END_ROD;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -30,7 +30,7 @@ class EndStone extends Solid{
protected $id = self::END_STONE;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -30,7 +30,7 @@ class EndStoneBricks extends Solid{
protected $id = self::END_BRICKS;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -33,7 +33,7 @@ class Farmland extends Transparent{
protected $id = self::FARMLAND;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -29,7 +29,7 @@ use pocketmine\math\Facing;
abstract class Fence extends Transparent{
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getThickness() : float{

View File

@ -38,7 +38,7 @@ class Fire extends Flowable{
protected $id = self::FIRE;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function hasEntityCollision() : bool{

View File

@ -42,7 +42,7 @@ class Flower extends Flowable{
protected $id = self::RED_FLOWER;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -40,7 +40,7 @@ class FlowerPot extends Flowable{
protected $itemId = Item::FLOWER_POT;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -30,7 +30,7 @@ class Glass extends Transparent{
protected $id = self::GLASS;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -30,7 +30,7 @@ class GlassPane extends Thin{
protected $id = self::GLASS_PANE;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -31,7 +31,7 @@ class GlowingObsidian extends Solid{
protected $id = self::GLOWING_OBSIDIAN;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -31,7 +31,7 @@ class Glowstone extends Transparent{
protected $id = self::GLOWSTONE;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -30,7 +30,7 @@ class Gold extends Solid{
protected $id = self::GOLD_BLOCK;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -30,7 +30,7 @@ class GoldOre extends Solid{
protected $id = self::GOLD_ORE;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -38,7 +38,7 @@ class Grass extends Solid{
protected $id = self::GRASS;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -33,7 +33,7 @@ class GrassPath extends Transparent{
protected $id = self::GRASS_PATH;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -31,7 +31,7 @@ class Gravel extends Fallable{
protected $id = self::GRAVEL;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -30,7 +30,7 @@ class HardenedClay extends Solid{
protected $id = self::HARDENED_CLAY;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -33,7 +33,7 @@ class HayBale extends Solid{
protected $id = self::HAY_BALE;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -32,7 +32,7 @@ class Ice extends Transparent{
protected $id = self::ICE;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -30,7 +30,7 @@ class Iron extends Solid{
protected $id = self::IRON_BLOCK;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -30,7 +30,7 @@ class IronBars extends Thin{
protected $id = self::IRON_BARS;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -33,7 +33,7 @@ class IronDoor extends Door{
protected $itemId = Item::IRON_DOOR;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -30,7 +30,7 @@ class IronOre extends Solid{
protected $id = self::IRON_ORE;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -36,7 +36,7 @@ class ItemFrame extends Flowable{
protected $itemId = Item::ITEM_FRAME;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -35,7 +35,7 @@ class Ladder extends Transparent{
protected $id = self::LADDER;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -30,7 +30,7 @@ class Lapis extends Solid{
protected $id = self::LAPIS_BLOCK;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -32,7 +32,7 @@ class LapisOre extends Solid{
protected $id = self::LAPIS_ORE;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getHardness() : float{

View File

@ -36,7 +36,7 @@ class Lava extends Liquid{
protected $id = self::FLOWING_LAVA;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getLightLevel() : int{

View File

@ -43,7 +43,7 @@ class Leaves extends Transparent{
protected $woodType = self::WOOD;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getHardness() : float{

View File

@ -34,7 +34,7 @@ class Lever extends Flowable{
protected $id = self::LEVER;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -33,7 +33,7 @@ class Magma extends Solid{
protected $id = Block::MAGMA;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -31,7 +31,7 @@ class Melon extends Transparent{
protected $id = self::MELON_BLOCK;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -38,7 +38,7 @@ class MelonStem extends Crops{
}
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function onRandomTick() : void{

View File

@ -31,7 +31,7 @@ class MonsterSpawner extends Transparent{
protected $id = self::MONSTER_SPAWNER;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getHardness() : float{

View File

@ -34,7 +34,7 @@ class Mycelium extends Solid{
protected $id = self::MYCELIUM;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -30,7 +30,7 @@ class NetherBrickStairs extends Stair{
protected $id = self::NETHER_BRICK_STAIRS;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -32,7 +32,7 @@ class NetherQuartzOre extends Solid{
protected $id = Block::NETHER_QUARTZ_ORE;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -31,7 +31,7 @@ class NetherReactor extends Solid{
protected $id = Block::NETHER_REACTOR;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -28,7 +28,7 @@ class NetherWartBlock extends Solid{
protected $id = Block::NETHER_WART_BLOCK;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -37,7 +37,7 @@ class NetherWartPlant extends Flowable{
protected $itemId = Item::NETHER_WART;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -30,7 +30,7 @@ class Netherrack extends Solid{
protected $id = self::NETHERRACK;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -28,7 +28,7 @@ class NoteBlock extends Solid{
protected $id = self::NOTE_BLOCK;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -30,7 +30,7 @@ class Obsidian extends Solid{
protected $id = self::OBSIDIAN;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -28,7 +28,7 @@ class PackedIce extends Solid{
protected $id = self::PACKED_ICE;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -34,7 +34,7 @@ class Planks extends Solid{
protected $id = self::WOODEN_PLANKS;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getHardness() : float{

View File

@ -28,7 +28,7 @@ class Podzol extends Solid{
protected $id = self::PODZOL;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getToolType() : int{

View File

@ -31,7 +31,7 @@ class Potato extends Crops{
protected $id = self::POTATO_BLOCK;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -34,7 +34,7 @@ class Prismarine extends Solid{
protected $id = self::PRISMARINE;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getHardness() : float{

View File

@ -28,7 +28,7 @@ class Pumpkin extends Solid{
protected $id = self::PUMPKIN;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getHardness() : float{

View File

@ -34,7 +34,7 @@ class PumpkinStem extends Crops{
protected $id = self::PUMPKIN_STEM;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -30,7 +30,7 @@ class PurpurStairs extends Stair{
protected $id = self::PURPUR_STAIRS;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -38,7 +38,7 @@ class Quartz extends Solid{
protected $id = self::QUARTZ_BLOCK;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getHardness() : float{

View File

@ -30,7 +30,7 @@ class QuartzStairs extends Stair{
protected $id = self::QUARTZ_STAIRS;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getHardness() : float{

View File

@ -33,7 +33,7 @@ class RedMushroom extends Flowable{
protected $id = self::RED_MUSHROOM;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -30,7 +30,7 @@ class RedMushroomBlock extends Solid{
protected $id = Block::RED_MUSHROOM_BLOCK;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -30,7 +30,7 @@ class Redstone extends Solid{
protected $id = self::REDSTONE_BLOCK;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getHardness() : float{

View File

@ -28,7 +28,7 @@ class RedstoneLamp extends Solid{
protected $id = self::REDSTONE_LAMP;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

View File

@ -34,7 +34,7 @@ class RedstoneOre extends Solid{
protected $id = self::REDSTONE_ORE;
public function __construct(int $meta = 0){
$this->meta = $meta;
$this->setDamage($meta);
}
public function getName() : string{

Some files were not shown because too many files have changed in this diff Show More