class McBlocky::DSL::CommandBlock

Attributes

block_data[R]
block_kind[R]
x[R]
y[R]
z[R]

Public Class Methods

new(context, x, y, z, facing, kind, nbt={}) click to toggle source
Calls superclass method
# File lib/mcblocky/dsl/command_block.rb, line 4
def initialize(context, x, y, z, facing, kind, nbt={})
  super(context, :at)
  @x = x
  @y = y
  @z = z
  @block_data = facing
  @block_kind = kind
  @nbt = nbt
end

Public Instance Methods

command(*args) click to toggle source
Calls superclass method
# File lib/mcblocky/dsl/command_block.rb, line 14
def command(*args)
  raise ArgumentError, "Only one command is allowed per block" unless commands.empty?
  super
end
nbt() click to toggle source
# File lib/mcblocky/dsl/command_block.rb, line 19
def nbt
  return @nbt.merge({'Command'=>commands[0] || ''})
end