PocketMine-MP 5.21.2 git-a6534ecbbbcf369264567d27e5ed70f7f5be9816
Loading...
Searching...
No Matches
pocketmine\block\tile\Banner Class Reference
+ Inheritance diagram for pocketmine\block\tile\Banner:
+ Collaboration diagram for pocketmine\block\tile\Banner:

Public Member Functions

 clearSpawnCompoundCache ()
 
 close ()
 
 copyDataFromItem (Item $item)
 
 getBaseColor ()
 
 getBlock ()
 
 getCleanedNBT ()
 
 getDefaultName ()
 
 getPatterns ()
 
 getPosition ()
 
 getRenderUpdateBugWorkaroundStateProperties (Block $block)
 
 getSerializedSpawnCompound ()
 
 getSpawnCompound ()
 
 isClosed ()
 
 isDirty ()
 
 onBlockDestroyed ()
 
 readSaveData (CompoundTag $nbt)
 
 saveNBT ()
 
 setBaseColor (DyeColor $color)
 
 setDirty (bool $dirty=true)
 
 setPatterns (array $patterns)
 

Public Attributes

bool $closed = false
 
const TAG_BASE = "Base"
 
const TAG_ID = "id"
 
const TAG_PATTERN_COLOR = "Color"
 
const TAG_PATTERN_NAME = "Pattern"
 
const TAG_PATTERNS = "Patterns"
 
const TAG_X = "x"
 
const TAG_Y = "y"
 
const TAG_Z = "z"
 

Protected Member Functions

 addAdditionalSpawnData (CompoundTag $nbt)
 
 onBlockDestroyedHook ()
 
 writeSaveData (CompoundTag $nbt)
 

Protected Attributes

Position $position
 
TimingsHandler $timings
 

Detailed Description

Deprecated
See also
\pocketmine\block\BaseBanner

Definition at line 38 of file block/tile/Banner.php.

Member Function Documentation

◆ addAdditionalSpawnData()

pocketmine\block\tile\Banner::addAdditionalSpawnData ( CompoundTag $nbt)
protected

An extension to getSpawnCompound() for further modifying the generic tile NBT.

Reimplemented from pocketmine\block\tile\Spawnable.

Definition at line 94 of file block/tile/Banner.php.

◆ clearSpawnCompoundCache()

pocketmine\block\tile\Spawnable::clearSpawnCompoundCache ( )
inherited

Definition at line 52 of file Spawnable.php.

◆ close()

pocketmine\block\tile\Tile::close ( )
inherited

Definition at line 129 of file Tile.php.

◆ copyDataFromItem()

pocketmine\block\tile\Tile::copyDataFromItem ( Item $item)
inherited

Definition at line 92 of file Tile.php.

◆ getBaseColor()

pocketmine\block\tile\Banner::getBaseColor ( )

Returns the color of the banner base.

Definition at line 111 of file block/tile/Banner.php.

◆ getBlock()

pocketmine\block\tile\Tile::getBlock ( )
inherited

Definition at line 98 of file Tile.php.

◆ getCleanedNBT()

pocketmine\block\tile\Tile::getCleanedNBT ( )
inherited

Definition at line 82 of file Tile.php.

◆ getDefaultName()

pocketmine\block\tile\Banner::getDefaultName ( )

Definition at line 139 of file block/tile/Banner.php.

◆ getPatterns()

pocketmine\block\tile\Banner::getPatterns ( )
Returns
BannerPatternLayer[] @phpstan-return list<BannerPatternLayer>

Definition at line 126 of file block/tile/Banner.php.

◆ getPosition()

pocketmine\block\tile\Tile::getPosition ( )
inherited

Definition at line 102 of file Tile.php.

◆ getRenderUpdateBugWorkaroundStateProperties()

pocketmine\block\tile\Spawnable::getRenderUpdateBugWorkaroundStateProperties ( Block $block)
inherited

The Bedrock client won't re-render a block if the block's state properties didn't change. This is a problem when the tile may affect the block's appearance. For example, a cauldron's liquid changes colour based on the dye inside.

This is worked around in vanilla by modifying one of the block's state properties to a different value, and then changing it back again. Since we don't want to litter core implementation with hacks like this, we brush it under the rug into Tile.

Returns
ByteTag[]|IntTag[]|StringTag[] @phpstan-return array<string, IntTag|StringTag|ByteTag>

Reimplemented in pocketmine\block\tile\Cauldron, and pocketmine\block\tile\FlowerPot.

Definition at line 68 of file Spawnable.php.

◆ getSerializedSpawnCompound()

pocketmine\block\tile\Spawnable::getSerializedSpawnCompound ( )
finalinherited

Returns encoded NBT (varint, little-endian) used to spawn this tile to clients. Uses cache where possible, populates cache if it is null.

@phpstan-return CacheableNbt<\pocketmine\nbt\tag\CompoundTag>

Definition at line 78 of file Spawnable.php.

◆ getSpawnCompound()

pocketmine\block\tile\Spawnable::getSpawnCompound ( )
finalinherited

Definition at line 86 of file Spawnable.php.

◆ isClosed()

pocketmine\block\tile\Tile::isClosed ( )
inherited

Definition at line 106 of file Tile.php.

◆ isDirty()

pocketmine\block\tile\Spawnable::isDirty ( )
inherited
Deprecated

Definition at line 41 of file Spawnable.php.

◆ onBlockDestroyed()

pocketmine\block\tile\Tile::onBlockDestroyed ( )
finalinherited

Called when the tile's block is destroyed.

Definition at line 117 of file Tile.php.

References pocketmine\block\tile\onBlockDestroyedHook().

+ Here is the call graph for this function:

◆ onBlockDestroyedHook()

pocketmine\block\tile\Tile::onBlockDestroyedHook ( )
protectedinherited

Override this method to do actions you need to do when this tile is destroyed due to block being broken.

Reimplemented in pocketmine\block\tile\Chest, pocketmine\block\tile\Jukebox, and pocketmine\block\tile\ShulkerBox.

Definition at line 125 of file Tile.php.

◆ readSaveData()

pocketmine\block\tile\Banner::readSaveData ( CompoundTag $nbt)

Reimplemented from pocketmine\block\tile\Tile.

Definition at line 53 of file block/tile/Banner.php.

◆ saveNBT()

pocketmine\block\tile\Tile::saveNBT ( )
inherited

Definition at line 70 of file Tile.php.

◆ setBaseColor()

pocketmine\block\tile\Banner::setBaseColor ( DyeColor $color)

Sets the color of the banner base.

Definition at line 118 of file block/tile/Banner.php.

◆ setDirty()

pocketmine\block\tile\Spawnable::setDirty ( bool $dirty = true)
inherited
Deprecated

Definition at line 48 of file Spawnable.php.

◆ setPatterns()

pocketmine\block\tile\Banner::setPatterns ( array $patterns)
Parameters
BannerPatternLayer[]$patterns

@phpstan-param list<BannerPatternLayer> $patterns

Definition at line 135 of file block/tile/Banner.php.

◆ writeSaveData()

pocketmine\block\tile\Banner::writeSaveData ( CompoundTag $nbt)
protected

Writes additional save data to a CompoundTag, not including generic things like ID and coordinates.

Reimplemented from pocketmine\block\tile\Tile.

Definition at line 80 of file block/tile/Banner.php.

Member Data Documentation

◆ $closed

bool pocketmine\block\tile\Tile::$closed = false
inherited

Definition at line 50 of file Tile.php.

◆ $position

Position pocketmine\block\tile\Tile::$position
protectedinherited

Definition at line 49 of file Tile.php.

◆ $timings

TimingsHandler pocketmine\block\tile\Tile::$timings
protectedinherited

Definition at line 51 of file Tile.php.

◆ TAG_BASE

const pocketmine\block\tile\Banner::TAG_BASE = "Base"

Definition at line 40 of file block/tile/Banner.php.

◆ TAG_ID

const pocketmine\block\tile\Tile::TAG_ID = "id"
inherited

Definition at line 44 of file Tile.php.

◆ TAG_PATTERN_COLOR

const pocketmine\block\tile\Banner::TAG_PATTERN_COLOR = "Color"

Definition at line 42 of file block/tile/Banner.php.

◆ TAG_PATTERN_NAME

const pocketmine\block\tile\Banner::TAG_PATTERN_NAME = "Pattern"

Definition at line 43 of file block/tile/Banner.php.

◆ TAG_PATTERNS

const pocketmine\block\tile\Banner::TAG_PATTERNS = "Patterns"

Definition at line 41 of file block/tile/Banner.php.

◆ TAG_X

const pocketmine\block\tile\Tile::TAG_X = "x"
inherited

Definition at line 45 of file Tile.php.

◆ TAG_Y

const pocketmine\block\tile\Tile::TAG_Y = "y"
inherited

Definition at line 46 of file Tile.php.

◆ TAG_Z

const pocketmine\block\tile\Tile::TAG_Z = "z"
inherited

Definition at line 47 of file Tile.php.


The documentation for this class was generated from the following file: