public override void OnBlockRemoved(global::WorldBase world, global::Chunk _chunk, global::Vector3i _blockPos, global::BlockValue _blockValue) { if (_blockValue.damage > 0) { // Only remove TileEntity and wire when block is removed because it's destroyed, not when picked up by player, or upgraded to Fire version. // Removal of TileEntity and wire when player is picking it up is done in TakeBlock() base.OnBlockRemoved(world, (Chunk)world.GetChunkFromWorldPos(_blockPos), _blockPos, _blockValue); } else { this.shape.OnBlockRemoved(world, _chunk, _blockPos, _blockValue); } }
public override global::TileEntityPowerSource CreateTileEntity(global::Chunk chunk) { if (this.slotItem == null) { this.slotItem = global::ItemClass.GetItemClass(this.SlotItemName, false); } global::TileEntityPowerSource tileEntityPowerSource = new global::TileEntityPowerSource(chunk) { PowerItemType = global::PowerItem.PowerItemTypes.BatteryBank, SlotItem = this.slotItem }; tileEntityPowerSource.WireOffset = new Vector3(0.25f, 0.4f, 0); return(tileEntityPowerSource); }
public override void OnBlockRemoved(global::WorldBase world, global::Chunk _chunk, global::Vector3i _blockPos, global::BlockValue _blockValue) { base.OnBlockRemoved(world, _chunk, _blockPos, _blockValue); Audio.Manager.BroadcastStop(_blockPos.ToVector3(), soundRepeat); }
public override void OnBlockRemoved(global::WorldBase world, global::Chunk _chunk, global::Vector3i _blockPos, global::BlockValue _blockValue) { // Don't remove TileEntity and wire when block is removed because it's destroyed, we keep it for the downgrade version of the block so wires stay connected this.shape.OnBlockRemoved(world, _chunk, _blockPos, _blockValue); }