Skip to content

Hologram Projector

RSDuck edited this page Aug 29, 2015 · 8 revisions

The Hologram Projector projects an field of blocks into the air. Note: all functions that take coordinates are zerobased while Lua arrays(and in most cases loops) are onebased(to fill an complete row don’t use for 1,8 do instead use for 0,7)

API

table help(string)

Get Help about an function

Arguments

  1. string the name of the function you need help with

Returns

  1. table an help like this

table getMethods()

Lists all function of this peripheral

Arguments

Returns

  1. table An table filled with the names of all function

string getDescription()

Returns an description of the peripheral

Arguments

Returns

  1. string An description what the peripheral does

bool setBlock(number, number, number, string)

Sets the projected block at the specific coordinates

Arguments

  1. number The X-Coordinate of the block, has to be 0 or more and less than 8
  2. number The Y-Coordinate of the block, has be 0 or moreand less than 8
  3. number The Z-Coordinate of the block, has to be more than 0 and less than 8
  4. string The internal name of the block to which it should be set. It’s the same name you use in commands

Returns

  1. bool True if the block was sucsessfull set

bool setBlockMeta(number, number, number, string, number)

Sets the projected block at the specific coordinates and it’s metadata

Arguments

  1. number The X-Coordinate of the block, has to be 0 or more and less than 8
  2. number The Y-Coordinate of the block, has be 0 or moreand less than 8
  3. number The Z-Coordinate of the block, has to be more than 0 and less than 8
  4. string The internal name of the block to which it should be set. It’s the same name you use in commands
  5. number The new metadata of that block

Returns

  1. bool True if the block was sucsessfull set

string getBlock(number, number, number)

Returns the id name of the projected block at the specific coordinates

Arguments

  1. number The X-Coordinate of the block, you want to get, has to be 0 or more and less than 8
  2. number The Y-Coordinate of the block, you want to get, has to be 0 or more and less than 8
  3. number The Z-Coordinate of the block, you want to get, has to be 0 or more and less than 8

Returns

  1. string The id name of the block

setMeta(number, number, number, number)

Sets the meta data of an projected block at the specified coordinates

Arguments

  1. number The X-Coordinate of the block, you want to set, has to be 0 or more and less than 8
  2. number The Y-Coordinate of the block, you want to set, has to be 0 or more and less than 8
  3. number The Z-Coordinate of the block, you want to set, has to be 0 or more and less than 8
  4. number The new meta data of the block

Returns

number getMeta(number, number, number)

Returns the meta data of the projected block at the specific coordinates

Arguments

  1. number The X-Coordinate of the block, you want to get the meta data, has to be 0 or more and less than 8
  2. number The Y-Coordinate of the block, you want to get the meta data, has to be 0 or more and less than 8
  3. number The Z-Coordinate of the block, you want to get the meta data, has to be 0 or more and less than 8

Returns

  1. number The meta data of the block

draw(table)

Uses the given table to set the blocks of the hologram

Arguments

  1. table An table which contains the following content: {{name=The Block ID, [meta=The Block Meta Data], x=The X-Coordinate, y=The Y-Coordinate, z=The Z-Coordinate}, …}

Returns

clear(string, number)

Clears the whole hologram with the given block and metadata

Arguments

  1. string The block to that all blocks should be converted
  2. number The metadata that should be set on all blocks

Returns

setRotation(number)

Sets the rotation in degrees by the given value. Note: The rotation is only available on the Y-Axis(Up-Down)

Arguments

  1. number The new rotation value

Returns

setVelocity(number)

Sets the velocity by the give value. The give value gets added to every tick to the rotation. Note: The rotation is only available on the Y-Axis(Up-Down)

Arguments

  1. number The new velocity value

Returns

number getRotation()

Returns the current rotation

Arguments

Returns

  1. number The current rotation

number getVelocity()

Returns the current velocity

Arguments

Returns

  1. number The current velocity

Events

The hologram projector has one event, which is triggered when a player click the hologram

Signature

  1. number The button which the player used to click the hologram(0 = Left Click, 1 = Right Click)
  2. number The X-Coordinate of the clicked block
  3. number The Y-Coordinate of the clicked block
  4. number The Z-Coordinate of the clicked block
  5. string The side which was clicked(possible values: bottom, top, north, south, west, east). Note: The value is corrigated when rotated
  6. string The way the projector is wrapped to the computer
  7. table The item that the player who clicked the hologram holds.