/// <summary> /// Initializes a new instance of the <see cref="FallingBlockData" /> class. /// </summary> /// <param name="state">The state of the falling block (required).</param> /// <param name="canDropAsItem">True if the block can drop as an item, false otherwise (required).</param> /// <param name="canHurtEntities">True if the block can hurt entities, false otherwise (required).</param> /// <param name="canPlaceAsBlock">True if this falling block can be placed as a normal block, false otherwise (required).</param> /// <param name="fallDamagePerBlock">The amount of damage per block this falling block deals (required).</param> /// <param name="fallTime">The amount of time (in ticks) this block has been falling for (required).</param> /// <param name="maxFallDamage">The maximum amount of damage this block can deal (required).</param> public FallingBlockData(BlockState state = default(BlockState), bool?canDropAsItem = default(bool?), bool?canHurtEntities = default(bool?), bool?canPlaceAsBlock = default(bool?), double?fallDamagePerBlock = default(double?), int?fallTime = default(int?), double?maxFallDamage = default(double?)) { // to ensure "state" is required (not null) if (state == null) { throw new InvalidDataException("state is a required property for FallingBlockData and cannot be null"); } else { this.State = state; } // to ensure "canDropAsItem" is required (not null) if (canDropAsItem == null) { throw new InvalidDataException("canDropAsItem is a required property for FallingBlockData and cannot be null"); } else { this.CanDropAsItem = canDropAsItem; } // to ensure "canHurtEntities" is required (not null) if (canHurtEntities == null) { throw new InvalidDataException("canHurtEntities is a required property for FallingBlockData and cannot be null"); } else { this.CanHurtEntities = canHurtEntities; } // to ensure "canPlaceAsBlock" is required (not null) if (canPlaceAsBlock == null) { throw new InvalidDataException("canPlaceAsBlock is a required property for FallingBlockData and cannot be null"); } else { this.CanPlaceAsBlock = canPlaceAsBlock; } // to ensure "fallDamagePerBlock" is required (not null) if (fallDamagePerBlock == null) { throw new InvalidDataException("fallDamagePerBlock is a required property for FallingBlockData and cannot be null"); } else { this.FallDamagePerBlock = fallDamagePerBlock; } // to ensure "fallTime" is required (not null) if (fallTime == null) { throw new InvalidDataException("fallTime is a required property for FallingBlockData and cannot be null"); } else { this.FallTime = fallTime; } // to ensure "maxFallDamage" is required (not null) if (maxFallDamage == null) { throw new InvalidDataException("maxFallDamage is a required property for FallingBlockData and cannot be null"); } else { this.MaxFallDamage = maxFallDamage; } }
/// <summary> /// Initializes a new instance of the <see cref="CreateBlockOperationRequest" /> class. /// </summary> /// <param name="max">The maximum world coordinates spanning the cube where the operation is run (required).</param> /// <param name="min">The minimum world coordinates spanning the cube where the operation is run (required).</param> /// <param name="type">The type of the block operation (required).</param> /// <param name="world">The world that the operation is run in (required).</param> /// <param name="block">The block that we want to change all other blocks into (when using an UPDATE operation.</param> /// <param name="blocks">An array of blocks defining what each block in the spanned cube.</param> public CreateBlockOperationRequest(Vector3i max = default(Vector3i), Vector3i min = default(Vector3i), TypeEnum type = default(TypeEnum), string world = default(string), BlockState block = default(BlockState), List <List <List <BlockState> > > blocks = default(List <List <List <BlockState> > >)) { // to ensure "max" is required (not null) if (max == null) { throw new InvalidDataException("max is a required property for CreateBlockOperationRequest and cannot be null"); } else { this.Max = max; } // to ensure "min" is required (not null) if (min == null) { throw new InvalidDataException("min is a required property for CreateBlockOperationRequest and cannot be null"); } else { this.Min = min; } // to ensure "type" is required (not null) if (type == null) { throw new InvalidDataException("type is a required property for CreateBlockOperationRequest and cannot be null"); } else { this.Type = type; } // to ensure "world" is required (not null) if (world == null) { throw new InvalidDataException("world is a required property for CreateBlockOperationRequest and cannot be null"); } else { this.World = world; } this.Block = block; this.Blocks = blocks; }